notjs-react 0.3.5 → 0.3.8
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 +6 -0
- package/dist/NotJS.d.ts +2 -1
- package/dist/NotJS.d.ts.map +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +857 -854
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react/jsx-runtime"),V=require("react"),vr=require("react-dom");function pr(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const b=Object.getOwnPropertyDescriptor(n,m);Object.defineProperty(h,m,b.get?b:{enumerable:!0,get:()=>n[m]})}}return h.default=n,Object.freeze(h)}const W=pr(V),_r=pr(vr);function Gt(n,h){(h==null||h>n.length)&&(h=n.length);for(var m=0,b=Array(h);m<h;m++)b[m]=n[m];return b}function gi(n){if(Array.isArray(n))return n}function vi(n,h,m){return(h=wi(h))in n?Object.defineProperty(n,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):n[h]=m,n}function pi(n,h){var m=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(m!=null){var b,A,B,E,i=[],o=!0,c=!1;try{if(B=(m=m.call(n)).next,h!==0)for(;!(o=(b=B.call(m)).done)&&(i.push(b.value),i.length!==h);o=!0);}catch(d){c=!0,A=d}finally{try{if(!o&&m.return!=null&&(E=m.return(),Object(E)!==E))return}finally{if(c)throw A}}return i}}function _i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qt(n,h){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);h&&(b=b.filter(function(A){return Object.getOwnPropertyDescriptor(n,A).enumerable})),m.push.apply(m,b)}return m}function Yt(n){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?qt(Object(m),!0).forEach(function(b){vi(n,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(m)):qt(Object(m)).forEach(function(b){Object.defineProperty(n,b,Object.getOwnPropertyDescriptor(m,b))})}return n}function mi(n,h){if(n==null)return{};var m,b,A=Si(n,h);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(n);for(b=0;b<B.length;b++)m=B[b],h.indexOf(m)===-1&&{}.propertyIsEnumerable.call(n,m)&&(A[m]=n[m])}return A}function Si(n,h){if(n==null)return{};var m={};for(var b in n)if({}.hasOwnProperty.call(n,b)){if(h.indexOf(b)!==-1)continue;m[b]=n[b]}return m}function Ci(n,h){return gi(n)||pi(n,h)||yi(n,h)||_i()}function bi(n,h){if(typeof n!="object"||!n)return n;var m=n[Symbol.toPrimitive];if(m!==void 0){var b=m.call(n,h);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(n)}function wi(n){var h=bi(n,"string");return typeof h=="symbol"?h:h+""}function yi(n,h){if(n){if(typeof n=="string")return Gt(n,h);var m={}.toString.call(n).slice(8,-1);return m==="Object"&&n.constructor&&(m=n.constructor.name),m==="Map"||m==="Set"?Array.from(n):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?Gt(n,h):void 0}}function Ai(n,h,m){return h in n?Object.defineProperty(n,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):n[h]=m,n}function Vt(n,h){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);h&&(b=b.filter(function(A){return Object.getOwnPropertyDescriptor(n,A).enumerable})),m.push.apply(m,b)}return m}function Xt(n){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?Vt(Object(m),!0).forEach(function(b){Ai(n,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(m)):Vt(Object(m)).forEach(function(b){Object.defineProperty(n,b,Object.getOwnPropertyDescriptor(m,b))})}return n}function Ei(){for(var n=arguments.length,h=new Array(n),m=0;m<n;m++)h[m]=arguments[m];return function(b){return h.reduceRight(function(A,B){return B(A)},b)}}function je(n){return function h(){for(var m=this,b=arguments.length,A=new Array(b),B=0;B<b;B++)A[B]=arguments[B];return A.length>=n.length?n.apply(this,A):function(){for(var E=arguments.length,i=new Array(E),o=0;o<E;o++)i[o]=arguments[o];return h.apply(m,[].concat(A,i))}}}function rt(n){return{}.toString.call(n).includes("Object")}function xi(n){return!Object.keys(n).length}function Ne(n){return typeof n=="function"}function Bi(n,h){return Object.prototype.hasOwnProperty.call(n,h)}function Ri(n,h){return rt(h)||be("changeType"),Object.keys(h).some(function(m){return!Bi(n,m)})&&be("changeField"),h}function ki(n){Ne(n)||be("selectorType")}function Li(n){Ne(n)||rt(n)||be("handlerType"),rt(n)&&Object.values(n).some(function(h){return!Ne(h)})&&be("handlersType")}function Ii(n){n||be("initialIsRequired"),rt(n)||be("initialType"),xi(n)&&be("initialContent")}function Di(n,h){throw new Error(n[h]||n.default)}var Pi={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},be=je(Di)(Pi),Xe={changes:Ri,selector:ki,handler:Li,initial:Ii};function Oi(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Xe.initial(n),Xe.handler(h);var m={current:n},b=je(Hi)(m,h),A=je(Mi)(m),B=je(Xe.changes)(n),E=je(Ti)(m);function i(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Xe.selector(c),c(m.current)}function o(c){Ei(b,A,B,E)(c)}return[i,o]}function Ti(n,h){return Ne(h)?h(n.current):h}function Mi(n,h){return n.current=Xt(Xt({},n.current),h),h}function Hi(n,h,m){return Ne(h)?h(n.current):Object.keys(m).forEach(function(b){var A;return(A=h[b])===null||A===void 0?void 0:A.call(h,n.current[b])}),m}var Fi={create:Oi},ji={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Wi(n){return function h(){for(var m=this,b=arguments.length,A=new Array(b),B=0;B<b;B++)A[B]=arguments[B];return A.length>=n.length?n.apply(this,A):function(){for(var E=arguments.length,i=new Array(E),o=0;o<E;o++)i[o]=arguments[o];return h.apply(m,[].concat(A,i))}}}function Ni(n){return{}.toString.call(n).includes("Object")}function Ui(n){return n||Zt("configIsRequired"),Ni(n)||Zt("configType"),n.urls?(zi(),{paths:{vs:n.urls.monacoBase}}):n}function zi(){console.warn(mr.deprecation)}function Qi(n,h){throw new Error(n[h]||n.default)}var mr={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
|
@@ -8,15 +8,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8
8
|
monaco.config({ paths: { vs: '...' } })
|
|
9
9
|
|
|
10
10
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
|
-
`},Zt=Wi(Qi)(mr),Ki={config:Ui},Gi=function(){for(var h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return function(A){return m.reduceRight(function(B,E){return E(B)},A)}};function Sr(n,h){return Object.keys(h).forEach(function(m){h[m]instanceof Object&&n[m]&&Object.assign(h[m],Sr(n[m],h[m]))}),Yt(Yt({},n),h)}var qi={type:"cancelation",msg:"operation is manually canceled"};function mt(n){var h=!1,m=new Promise(function(b,A){n.then(function(B){return h?A(qi):b(B)}),n.catch(A)});return m.cancel=function(){return h=!0},m}var Yi=["monaco"],Vi=Fi.create({config:ji,isInitialized:!1,resolve:null,reject:null,monaco:null}),Cr=Ci(Vi,2),Ke=Cr[0],at=Cr[1];function Xi(n){var h=Ki.config(n),m=h.monaco,b=mi(h,Yi);at(function(A){return{config:Sr(A.config,b),monaco:m}})}function Zi(){var n=Ke(function(h){var m=h.monaco,b=h.isInitialized,A=h.resolve;return{monaco:m,isInitialized:b,resolve:A}});if(!n.isInitialized){if(at({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),mt(St);if(window.monaco&&window.monaco.editor)return br(window.monaco),n.resolve(window.monaco),mt(St);Gi(Ji,es)(ts)}return mt(St)}function Ji(n){return document.body.appendChild(n)}function $i(n){var h=document.createElement("script");return n&&(h.src=n),h}function es(n){var h=Ke(function(b){var A=b.config,B=b.reject;return{config:A,reject:B}}),m=$i("".concat(h.config.paths.vs,"/loader.js"));return m.onload=function(){return n()},m.onerror=h.reject,m}function ts(){var n=Ke(function(m){var b=m.config,A=m.resolve,B=m.reject;return{config:b,resolve:A,reject:B}}),h=window.require;h.config(n.config),h(["vs/editor/editor.main"],function(m){var b=m.m||m;br(b),n.resolve(b)},function(m){n.reject(m)})}function br(n){Ke().monaco||at({monaco:n})}function rs(){return Ke(function(n){var h=n.monaco;return h})}var St=new Promise(function(n,h){return at({resolve:n,reject:h})}),wr={config:Xi,init:Zi,__getMonacoInstance:rs},is={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ct=is,ss={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ns=ss;function os({children:n}){return V.createElement("div",{style:ns.container},n)}var as=os,cs=as;function ls({width:n,height:h,isEditorReady:m,loading:b,_ref:A,className:B,wrapperProps:E}){return V.createElement("section",{style:{...Ct.wrapper,width:n,height:h},...E},!m&&V.createElement(cs,null,b),V.createElement("div",{ref:A,style:{...Ct.fullWidth,...!m&&Ct.hide},className:B}))}var hs=ls,yr=V.memo(hs);function us(n){V.useEffect(n,[])}var Ar=us;function ds(n,h,m=!0){let b=V.useRef(!0);V.useEffect(b.current||!m?()=>{b.current=!1}:n,h)}var se=ds;function We(){}function ke(n,h,m,b){return fs(n,b)||gs(n,h,m,b)}function fs(n,h){return n.editor.getModel(Er(n,h))}function gs(n,h,m,b){return n.editor.createModel(h,m,b?Er(n,b):void 0)}function Er(n,h){return n.Uri.parse(h)}function vs({original:n,modified:h,language:m,originalLanguage:b,modifiedLanguage:A,originalModelPath:B,modifiedModelPath:E,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:o=!1,theme:c="light",loading:d="Loading...",options:a={},height:f="100%",width:g="100%",className:S,wrapperProps:u={},beforeMount:r=We,onMount:s=We}){let[e,t]=V.useState(!1),[l,p]=V.useState(!0),_=V.useRef(null),C=V.useRef(null),v=V.useRef(null),w=V.useRef(s),k=V.useRef(r),D=V.useRef(!1);Ar(()=>{let H=wr.init();return H.then(W=>(C.current=W)&&p(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>_.current?F():H.cancel()}),se(()=>{if(_.current&&C.current){let H=_.current.getOriginalEditor(),W=ke(C.current,n||"",b||m||"text",B||"");W!==H.getModel()&&H.setModel(W)}},[B],e),se(()=>{if(_.current&&C.current){let H=_.current.getModifiedEditor(),W=ke(C.current,h||"",A||m||"text",E||"");W!==H.getModel()&&H.setModel(W)}},[E],e),se(()=>{let H=_.current.getModifiedEditor();H.getOption(C.current.editor.EditorOption.readOnly)?H.setValue(h||""):h!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:h||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[h],e),se(()=>{var H,W;(W=(H=_.current)==null?void 0:H.getModel())==null||W.original.setValue(n||"")},[n],e),se(()=>{let{original:H,modified:W}=_.current.getModel();C.current.editor.setModelLanguage(H,b||m||"text"),C.current.editor.setModelLanguage(W,A||m||"text")},[m,b,A],e),se(()=>{var H;(H=C.current)==null||H.editor.setTheme(c)},[c],e),se(()=>{var H;(H=_.current)==null||H.updateOptions(a)},[a],e);let O=V.useCallback(()=>{var G;if(!C.current)return;k.current(C.current);let H=ke(C.current,n||"",b||m||"text",B||""),W=ke(C.current,h||"",A||m||"text",E||"");(G=_.current)==null||G.setModel({original:H,modified:W})},[m,h,A,n,b,B,E]),L=V.useCallback(()=>{var H;!D.current&&v.current&&(_.current=C.current.editor.createDiffEditor(v.current,{automaticLayout:!0,...a}),O(),(H=C.current)==null||H.editor.setTheme(c),t(!0),D.current=!0)},[a,c,O]);V.useEffect(()=>{e&&w.current(_.current,C.current)},[e]),V.useEffect(()=>{!l&&!e&&L()},[l,e,L]);function F(){var W,G,U,y;let H=(W=_.current)==null?void 0:W.getModel();i||((G=H==null?void 0:H.original)==null||G.dispose()),o||((U=H==null?void 0:H.modified)==null||U.dispose()),(y=_.current)==null||y.dispose()}return V.createElement(yr,{width:g,height:f,isEditorReady:e,loading:d,_ref:v,className:S,wrapperProps:u})}var ps=vs;V.memo(ps);function _s(n){let h=V.useRef();return V.useEffect(()=>{h.current=n},[n]),h.current}var ms=_s,Ze=new Map;function Ss({defaultValue:n,defaultLanguage:h,defaultPath:m,value:b,language:A,path:B,theme:E="light",line:i,loading:o="Loading...",options:c={},overrideServices:d={},saveViewState:a=!0,keepCurrentModel:f=!1,width:g="100%",height:S="100%",className:u,wrapperProps:r={},beforeMount:s=We,onMount:e=We,onChange:t,onValidate:l=We}){let[p,_]=V.useState(!1),[C,v]=V.useState(!0),w=V.useRef(null),k=V.useRef(null),D=V.useRef(null),O=V.useRef(e),L=V.useRef(s),F=V.useRef(),H=V.useRef(b),W=ms(B),G=V.useRef(!1),U=V.useRef(!1);Ar(()=>{let I=wr.init();return I.then(P=>(w.current=P)&&v(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>k.current?R():I.cancel()}),se(()=>{var P,z,Y,X;let I=ke(w.current,n||b||"",h||A||"",B||m||"");I!==((P=k.current)==null?void 0:P.getModel())&&(a&&Ze.set(W,(z=k.current)==null?void 0:z.saveViewState()),(Y=k.current)==null||Y.setModel(I),a&&((X=k.current)==null||X.restoreViewState(Ze.get(B))))},[B],p),se(()=>{var I;(I=k.current)==null||I.updateOptions(c)},[c],p),se(()=>{!k.current||b===void 0||(k.current.getOption(w.current.editor.EditorOption.readOnly)?k.current.setValue(b):b!==k.current.getValue()&&(U.current=!0,k.current.executeEdits("",[{range:k.current.getModel().getFullModelRange(),text:b,forceMoveMarkers:!0}]),k.current.pushUndoStop(),U.current=!1))},[b],p),se(()=>{var P,z;let I=(P=k.current)==null?void 0:P.getModel();I&&A&&((z=w.current)==null||z.editor.setModelLanguage(I,A))},[A],p),se(()=>{var I;i!==void 0&&((I=k.current)==null||I.revealLine(i))},[i],p),se(()=>{var I;(I=w.current)==null||I.editor.setTheme(E)},[E],p);let y=V.useCallback(()=>{var I;if(!(!D.current||!w.current)&&!G.current){L.current(w.current);let P=B||m,z=ke(w.current,b||n||"",h||A||"",P||"");k.current=(I=w.current)==null?void 0:I.editor.create(D.current,{model:z,automaticLayout:!0,...c},d),a&&k.current.restoreViewState(Ze.get(P)),w.current.editor.setTheme(E),i!==void 0&&k.current.revealLine(i),_(!0),G.current=!0}},[n,h,m,b,A,B,c,d,a,E,i]);V.useEffect(()=>{p&&O.current(k.current,w.current)},[p]),V.useEffect(()=>{!C&&!p&&y()},[C,p,y]),H.current=b,V.useEffect(()=>{var I,P;p&&t&&((I=F.current)==null||I.dispose(),F.current=(P=k.current)==null?void 0:P.onDidChangeModelContent(z=>{U.current||t(k.current.getValue(),z)}))},[p,t]),V.useEffect(()=>{if(p){let I=w.current.editor.onDidChangeMarkers(P=>{var Y;let z=(Y=k.current.getModel())==null?void 0:Y.uri;if(z&&P.find(X=>X.path===z.path)){let X=w.current.editor.getModelMarkers({resource:z});l==null||l(X)}});return()=>{I==null||I.dispose()}}return()=>{}},[p,l]);function R(){var I,P;(I=F.current)==null||I.dispose(),f?a&&Ze.set(B,k.current.saveViewState()):(P=k.current.getModel())==null||P.dispose(),k.current.dispose()}return V.createElement(yr,{width:g,height:S,isEditorReady:p,loading:o,_ref:D,className:u,wrapperProps:r})}var Cs=Ss,bs=V.memo(Cs),ws=bs,bt={exports:{}},Jt;function ys(){return Jt||(Jt=1,(function(n,h){(function(m,b){n.exports=b()})(globalThis,(()=>(()=>{var m={4567:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const a=o(9042),f=o(9924),g=o(844),S=o(4725),u=o(2585),r=o(3656);let s=i.AccessibilityManager=class extends g.Disposable{constructor(e,t,l,p){super(),this._terminal=e,this._coreBrowserService=l,this._renderService=p,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 _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,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 f.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((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
11
|
+
`},Zt=Wi(Qi)(mr),Ki={config:Ui},Gi=function(){for(var h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return function(A){return m.reduceRight(function(B,E){return E(B)},A)}};function Sr(n,h){return Object.keys(h).forEach(function(m){h[m]instanceof Object&&n[m]&&Object.assign(h[m],Sr(n[m],h[m]))}),Yt(Yt({},n),h)}var qi={type:"cancelation",msg:"operation is manually canceled"};function mt(n){var h=!1,m=new Promise(function(b,A){n.then(function(B){return h?A(qi):b(B)}),n.catch(A)});return m.cancel=function(){return h=!0},m}var Yi=["monaco"],Vi=Fi.create({config:ji,isInitialized:!1,resolve:null,reject:null,monaco:null}),Cr=Ci(Vi,2),Ke=Cr[0],at=Cr[1];function Xi(n){var h=Ki.config(n),m=h.monaco,b=mi(h,Yi);at(function(A){return{config:Sr(A.config,b),monaco:m}})}function Zi(){var n=Ke(function(h){var m=h.monaco,b=h.isInitialized,A=h.resolve;return{monaco:m,isInitialized:b,resolve:A}});if(!n.isInitialized){if(at({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),mt(St);if(window.monaco&&window.monaco.editor)return br(window.monaco),n.resolve(window.monaco),mt(St);Gi(Ji,es)(ts)}return mt(St)}function Ji(n){return document.body.appendChild(n)}function $i(n){var h=document.createElement("script");return n&&(h.src=n),h}function es(n){var h=Ke(function(b){var A=b.config,B=b.reject;return{config:A,reject:B}}),m=$i("".concat(h.config.paths.vs,"/loader.js"));return m.onload=function(){return n()},m.onerror=h.reject,m}function ts(){var n=Ke(function(m){var b=m.config,A=m.resolve,B=m.reject;return{config:b,resolve:A,reject:B}}),h=window.require;h.config(n.config),h(["vs/editor/editor.main"],function(m){var b=m.m||m;br(b),n.resolve(b)},function(m){n.reject(m)})}function br(n){Ke().monaco||at({monaco:n})}function rs(){return Ke(function(n){var h=n.monaco;return h})}var St=new Promise(function(n,h){return at({resolve:n,reject:h})}),wr={config:Xi,init:Zi,__getMonacoInstance:rs},is={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ct=is,ss={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ns=ss;function os({children:n}){return V.createElement("div",{style:ns.container},n)}var as=os,cs=as;function ls({width:n,height:h,isEditorReady:m,loading:b,_ref:A,className:B,wrapperProps:E}){return V.createElement("section",{style:{...Ct.wrapper,width:n,height:h},...E},!m&&V.createElement(cs,null,b),V.createElement("div",{ref:A,style:{...Ct.fullWidth,...!m&&Ct.hide},className:B}))}var hs=ls,yr=V.memo(hs);function us(n){V.useEffect(n,[])}var Ar=us;function ds(n,h,m=!0){let b=V.useRef(!0);V.useEffect(b.current||!m?()=>{b.current=!1}:n,h)}var se=ds;function We(){}function ke(n,h,m,b){return fs(n,b)||gs(n,h,m,b)}function fs(n,h){return n.editor.getModel(Er(n,h))}function gs(n,h,m,b){return n.editor.createModel(h,m,b?Er(n,b):void 0)}function Er(n,h){return n.Uri.parse(h)}function vs({original:n,modified:h,language:m,originalLanguage:b,modifiedLanguage:A,originalModelPath:B,modifiedModelPath:E,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:o=!1,theme:c="light",loading:d="Loading...",options:a={},height:f="100%",width:g="100%",className:S,wrapperProps:u={},beforeMount:r=We,onMount:s=We}){let[e,t]=V.useState(!1),[l,p]=V.useState(!0),_=V.useRef(null),C=V.useRef(null),v=V.useRef(null),w=V.useRef(s),k=V.useRef(r),D=V.useRef(!1);Ar(()=>{let H=wr.init();return H.then(j=>(C.current=j)&&p(!1)).catch(j=>(j==null?void 0:j.type)!=="cancelation"&&console.error("Monaco initialization: error:",j)),()=>_.current?F():H.cancel()}),se(()=>{if(_.current&&C.current){let H=_.current.getOriginalEditor(),j=ke(C.current,n||"",b||m||"text",B||"");j!==H.getModel()&&H.setModel(j)}},[B],e),se(()=>{if(_.current&&C.current){let H=_.current.getModifiedEditor(),j=ke(C.current,h||"",A||m||"text",E||"");j!==H.getModel()&&H.setModel(j)}},[E],e),se(()=>{let H=_.current.getModifiedEditor();H.getOption(C.current.editor.EditorOption.readOnly)?H.setValue(h||""):h!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:h||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[h],e),se(()=>{var H,j;(j=(H=_.current)==null?void 0:H.getModel())==null||j.original.setValue(n||"")},[n],e),se(()=>{let{original:H,modified:j}=_.current.getModel();C.current.editor.setModelLanguage(H,b||m||"text"),C.current.editor.setModelLanguage(j,A||m||"text")},[m,b,A],e),se(()=>{var H;(H=C.current)==null||H.editor.setTheme(c)},[c],e),se(()=>{var H;(H=_.current)==null||H.updateOptions(a)},[a],e);let O=V.useCallback(()=>{var Q;if(!C.current)return;k.current(C.current);let H=ke(C.current,n||"",b||m||"text",B||""),j=ke(C.current,h||"",A||m||"text",E||"");(Q=_.current)==null||Q.setModel({original:H,modified:j})},[m,h,A,n,b,B,E]),L=V.useCallback(()=>{var H;!D.current&&v.current&&(_.current=C.current.editor.createDiffEditor(v.current,{automaticLayout:!0,...a}),O(),(H=C.current)==null||H.editor.setTheme(c),t(!0),D.current=!0)},[a,c,O]);V.useEffect(()=>{e&&w.current(_.current,C.current)},[e]),V.useEffect(()=>{!l&&!e&&L()},[l,e,L]);function F(){var j,Q,U,y;let H=(j=_.current)==null?void 0:j.getModel();i||((Q=H==null?void 0:H.original)==null||Q.dispose()),o||((U=H==null?void 0:H.modified)==null||U.dispose()),(y=_.current)==null||y.dispose()}return V.createElement(yr,{width:g,height:f,isEditorReady:e,loading:d,_ref:v,className:S,wrapperProps:u})}var ps=vs;V.memo(ps);function _s(n){let h=V.useRef();return V.useEffect(()=>{h.current=n},[n]),h.current}var ms=_s,Ze=new Map;function Ss({defaultValue:n,defaultLanguage:h,defaultPath:m,value:b,language:A,path:B,theme:E="light",line:i,loading:o="Loading...",options:c={},overrideServices:d={},saveViewState:a=!0,keepCurrentModel:f=!1,width:g="100%",height:S="100%",className:u,wrapperProps:r={},beforeMount:s=We,onMount:e=We,onChange:t,onValidate:l=We}){let[p,_]=V.useState(!1),[C,v]=V.useState(!0),w=V.useRef(null),k=V.useRef(null),D=V.useRef(null),O=V.useRef(e),L=V.useRef(s),F=V.useRef(),H=V.useRef(b),j=ms(B),Q=V.useRef(!1),U=V.useRef(!1);Ar(()=>{let R=wr.init();return R.then(P=>(w.current=P)&&v(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>k.current?I():R.cancel()}),se(()=>{var P,N,Y,Z;let R=ke(w.current,n||b||"",h||A||"",B||m||"");R!==((P=k.current)==null?void 0:P.getModel())&&(a&&Ze.set(j,(N=k.current)==null?void 0:N.saveViewState()),(Y=k.current)==null||Y.setModel(R),a&&((Z=k.current)==null||Z.restoreViewState(Ze.get(B))))},[B],p),se(()=>{var R;(R=k.current)==null||R.updateOptions(c)},[c],p),se(()=>{!k.current||b===void 0||(k.current.getOption(w.current.editor.EditorOption.readOnly)?k.current.setValue(b):b!==k.current.getValue()&&(U.current=!0,k.current.executeEdits("",[{range:k.current.getModel().getFullModelRange(),text:b,forceMoveMarkers:!0}]),k.current.pushUndoStop(),U.current=!1))},[b],p),se(()=>{var P,N;let R=(P=k.current)==null?void 0:P.getModel();R&&A&&((N=w.current)==null||N.editor.setModelLanguage(R,A))},[A],p),se(()=>{var R;i!==void 0&&((R=k.current)==null||R.revealLine(i))},[i],p),se(()=>{var R;(R=w.current)==null||R.editor.setTheme(E)},[E],p);let y=V.useCallback(()=>{var R;if(!(!D.current||!w.current)&&!Q.current){L.current(w.current);let P=B||m,N=ke(w.current,b||n||"",h||A||"",P||"");k.current=(R=w.current)==null?void 0:R.editor.create(D.current,{model:N,automaticLayout:!0,...c},d),a&&k.current.restoreViewState(Ze.get(P)),w.current.editor.setTheme(E),i!==void 0&&k.current.revealLine(i),_(!0),Q.current=!0}},[n,h,m,b,A,B,c,d,a,E,i]);V.useEffect(()=>{p&&O.current(k.current,w.current)},[p]),V.useEffect(()=>{!C&&!p&&y()},[C,p,y]),H.current=b,V.useEffect(()=>{var R,P;p&&t&&((R=F.current)==null||R.dispose(),F.current=(P=k.current)==null?void 0:P.onDidChangeModelContent(N=>{U.current||t(k.current.getValue(),N)}))},[p,t]),V.useEffect(()=>{if(p){let R=w.current.editor.onDidChangeMarkers(P=>{var Y;let N=(Y=k.current.getModel())==null?void 0:Y.uri;if(N&&P.find(Z=>Z.path===N.path)){let Z=w.current.editor.getModelMarkers({resource:N});l==null||l(Z)}});return()=>{R==null||R.dispose()}}return()=>{}},[p,l]);function I(){var R,P;(R=F.current)==null||R.dispose(),f?a&&Ze.set(B,k.current.saveViewState()):(P=k.current.getModel())==null||P.dispose(),k.current.dispose()}return V.createElement(yr,{width:g,height:S,isEditorReady:p,loading:o,_ref:D,className:u,wrapperProps:r})}var Cs=Ss,bs=V.memo(Cs),ws=bs,bt={exports:{}},Jt;function ys(){return Jt||(Jt=1,(function(n,h){(function(m,b){n.exports=b()})(globalThis,(()=>(()=>{var m={4567:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const a=o(9042),f=o(9924),g=o(844),S=o(4725),u=o(2585),r=o(3656);let s=i.AccessibilityManager=class extends g.Disposable{constructor(e,t,l,p){super(),this._terminal=e,this._coreBrowserService=l,this._renderService=p,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 _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,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 f.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((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
12
12
|
`)))),this.register(this._terminal.onA11yTab((_=>this._handleTab(_)))),this.register(this._terminal.onKey((_=>this._handleKey(_.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
13
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const l=this._terminal.buffer,p=l.lines.length.toString();for(let _=e;_<=t;_++){const C=l.lines.get(l.ydisp+_),v=[],w=(C==null?void 0:C.translateToString(!0,void 0,void 0,v))||"",k=(l.ydisp+_+1).toString(),D=this._rowElements[_];D&&(w.length===0?(D.innerText=" ",this._rowColumns.set(D,[0,1])):(D.textContent=w,this._rowColumns.set(D,v)),D.setAttribute("aria-posinset",k),D.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const l=e.target,p=this._rowElements[t===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==p)return;let _,C;if(t===0?(_=l,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(_=this._rowElements.shift(),C=l,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var w;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},l={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(l.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===l.node&&t.offset>l.offset)&&([t,l]=[l,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const p=this._rowElements.slice(-1)[0];if(l.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(l={node:p,offset:((w=p.textContent)==null?void 0:w.length)??0}),!this._rowContainer.contains(l.node))return;const _=({node:k,offset:D})=>{const O=k instanceof Text?k.parentNode:k;let L=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(O);if(!F)return console.warn("columns is null. Race condition?"),null;let H=D<F.length?F[D]:F.slice(-1)[0]+1;return H>=this._terminal.cols&&(++L,H=0),{row:L,column:H}},C=_(t),v=_(l);if(C&&v){if(C.row>v.row||C.row===v.row&&C.column>=v.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(v.row-C.row)*this._terminal.cols-C.column+v.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=s=c([d(1,u.IInstantiationService),d(2,S.ICoreBrowserService),d(3,S.IRenderService)],s)},3614:(E,i)=>{function o(f){return f.replace(/\r?\n/g,"\r")}function c(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function d(f,g,S,u){f=c(f=o(f),S.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(f,!0),g.value=""}function a(f,g,S){const u=S.getBoundingClientRect(),r=f.clientX-u.left-10,s=f.clientY-u.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${r}px`,g.style.top=`${s}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=o,i.bracketTextForPaste=c,i.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},i.handlePasteEvent=function(f,g,S,u){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),g,S,u)},i.paste=d,i.moveTextAreaUnderMouseCursor=a,i.rightClickHandler=function(f,g,S,u,r){a(f,g,S),r&&u.rightClickSelect(f),g.value=u.selectionText,g.select()}},7239:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const c=o(1505);i.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(d,a,f){this._css.set(d,a,f)}getCss(d,a){return this._css.get(d,a)}setColor(d,a,f){this._color.set(d,a,f)}getColor(d,a){return this._color.get(d,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(o,c,d,a){o.addEventListener(c,d,a);let f=!1;return{dispose:()=>{f||(f=!0,o.removeEventListener(c,d,a))}}}},3551:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const a=o(3656),f=o(8460),g=o(844),S=o(2585),u=o(4725);let r=i.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,l,p){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=l,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{var _;this._lastMouseEvent=void 0,(_=this._activeProviderReplies)==null||_.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let l=0;l<t.length;l++){const p=t[l];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var l,p;this._activeProviderReplies&&e||((l=this._activeProviderReplies)==null||l.forEach((_=>{_==null||_.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[_,C]of this._linkProviderService.linkProviders.entries())e?(p=this._activeProviderReplies)!=null&&p.get(_)&&(t=this._checkLinkProviderResult(_,s,t)):C.provideLinks(s.y,(v=>{var k,D;if(this._isMouseOut)return;const w=v==null?void 0:v.map((O=>({link:O})));(k=this._activeProviderReplies)==null||k.set(_,w),t=this._checkLinkProviderResult(_,s,t),((D=this._activeProviderReplies)==null?void 0:D.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let l=0;l<e.size;l++){const p=e.get(l);if(p)for(let _=0;_<p.length;_++){const C=p[_],v=C.link.range.start.y<s?0:C.link.range.start.x,w=C.link.range.end.y>s?this._bufferService.cols:C.link.range.end.x;for(let k=v;k<=w;k++){if(t.has(k)){p.splice(_--,1);break}t.add(k)}}}}_checkLinkProviderResult(s,e,t){var _;if(!this._activeProviderReplies)return t;const l=this._activeProviderReplies.get(s);let p=!1;for(let C=0;C<s;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(p=!0);if(!p&&l){const C=l.find((v=>this._linkAtPosition(v.link,e)));C&&(t=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let C=0;C<this._activeProviderReplies.size;C++){const v=(_=this._activeProviderReplies.get(C))==null?void 0:_.find((w=>this._linkAtPosition(w.link,e)));if(v){t=!0,this._handleNewLink(v);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.pointerCursor},set:t=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.underline},set:t=>{var l,p,_;(l=this._currentLink)!=null&&l.state&&((_=(p=this._currentLink)==null?void 0:p.state)==null?void 0:_.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const l=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(l,p),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}}))))}_linkHover(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,l=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-l-1,t.end.x,t.end.y-l-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,l=s.range.end.y*this._bufferService.cols+s.range.end.x,p=e.y*this._bufferService.cols+e.x;return t<=p&&p<=l}_positionFromMouseEvent(s,e,t){const l=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,l,p){return{x1:s,y1:e,x2:t,y2:l,cols:this._bufferService.cols,fg:p}}};i.Linkifier=r=c([d(1,u.IMouseService),d(2,u.IRenderService),d(3,S.IBufferService),d(4,u.ILinkProviderService)],r)},9042:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const a=o(511),f=o(2585);let g=i.OscLinkProvider=class{constructor(u,r,s){this._bufferService=u,this._optionsService=r,this._oscLinkService=s}provideLinks(u,r){var w;const s=this._bufferService.buffer.lines.get(u-1);if(!s)return void r(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,l=new a.CellData,p=s.getTrimmedLength();let _=-1,C=-1,v=!1;for(let k=0;k<p;k++)if(C!==-1||s.hasContent(k)){if(s.loadCell(k,l),l.hasExtendedAttrs()&&l.extended.urlId){if(C===-1){C=k,_=l.extended.urlId;continue}v=l.extended.urlId!==_}else C!==-1&&(v=!0);if(v||C!==-1&&k===p-1){const D=(w=this._oscLinkService.getLinkData(_))==null?void 0:w.uri;if(D){const O={start:{x:C+1,y:u},end:{x:k+(v||k!==p-1?0:1),y:u}};let L=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const F=new URL(D);["http:","https:"].includes(F.protocol)||(L=!0)}catch{L=!0}L||e.push({text:D,range:O,activate:(F,H)=>t?t.activate(F,H,O):S(0,H),hover:(F,H)=>{var W;return(W=t==null?void 0:t.hover)==null?void 0:W.call(t,F,H,O)},leave:(F,H)=>{var W;return(W=t==null?void 0:t.leave)==null?void 0:W.call(t,F,H,O)}})}v=!1,l.hasExtendedAttrs()&&l.extended.urlId?(C=k,_=l.extended.urlId):(C=-1,_=-1)}}r(e)}};function S(u,r){if(confirm(`Do you want to navigate to ${r}?
|
|
13
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const l=this._terminal.buffer,p=l.lines.length.toString();for(let _=e;_<=t;_++){const C=l.lines.get(l.ydisp+_),v=[],w=(C==null?void 0:C.translateToString(!0,void 0,void 0,v))||"",k=(l.ydisp+_+1).toString(),D=this._rowElements[_];D&&(w.length===0?(D.innerText=" ",this._rowColumns.set(D,[0,1])):(D.textContent=w,this._rowColumns.set(D,v)),D.setAttribute("aria-posinset",k),D.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const l=e.target,p=this._rowElements[t===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==p)return;let _,C;if(t===0?(_=l,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(_=this._rowElements.shift(),C=l,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var w;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},l={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(l.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===l.node&&t.offset>l.offset)&&([t,l]=[l,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const p=this._rowElements.slice(-1)[0];if(l.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(l={node:p,offset:((w=p.textContent)==null?void 0:w.length)??0}),!this._rowContainer.contains(l.node))return;const _=({node:k,offset:D})=>{const O=k instanceof Text?k.parentNode:k;let L=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(O);if(!F)return console.warn("columns is null. Race condition?"),null;let H=D<F.length?F[D]:F.slice(-1)[0]+1;return H>=this._terminal.cols&&(++L,H=0),{row:L,column:H}},C=_(t),v=_(l);if(C&&v){if(C.row>v.row||C.row===v.row&&C.column>=v.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(v.row-C.row)*this._terminal.cols-C.column+v.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=s=c([d(1,u.IInstantiationService),d(2,S.ICoreBrowserService),d(3,S.IRenderService)],s)},3614:(E,i)=>{function o(f){return f.replace(/\r?\n/g,"\r")}function c(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function d(f,g,S,u){f=c(f=o(f),S.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(f,!0),g.value=""}function a(f,g,S){const u=S.getBoundingClientRect(),r=f.clientX-u.left-10,s=f.clientY-u.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${r}px`,g.style.top=`${s}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=o,i.bracketTextForPaste=c,i.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},i.handlePasteEvent=function(f,g,S,u){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),g,S,u)},i.paste=d,i.moveTextAreaUnderMouseCursor=a,i.rightClickHandler=function(f,g,S,u,r){a(f,g,S),r&&u.rightClickSelect(f),g.value=u.selectionText,g.select()}},7239:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const c=o(1505);i.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(d,a,f){this._css.set(d,a,f)}getCss(d,a){return this._css.get(d,a)}setColor(d,a,f){this._color.set(d,a,f)}getColor(d,a){return this._color.get(d,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(o,c,d,a){o.addEventListener(c,d,a);let f=!1;return{dispose:()=>{f||(f=!0,o.removeEventListener(c,d,a))}}}},3551:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const a=o(3656),f=o(8460),g=o(844),S=o(2585),u=o(4725);let r=i.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,l,p){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=l,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{var _;this._lastMouseEvent=void 0,(_=this._activeProviderReplies)==null||_.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let l=0;l<t.length;l++){const p=t[l];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var l,p;this._activeProviderReplies&&e||((l=this._activeProviderReplies)==null||l.forEach((_=>{_==null||_.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[_,C]of this._linkProviderService.linkProviders.entries())e?(p=this._activeProviderReplies)!=null&&p.get(_)&&(t=this._checkLinkProviderResult(_,s,t)):C.provideLinks(s.y,(v=>{var k,D;if(this._isMouseOut)return;const w=v==null?void 0:v.map((O=>({link:O})));(k=this._activeProviderReplies)==null||k.set(_,w),t=this._checkLinkProviderResult(_,s,t),((D=this._activeProviderReplies)==null?void 0:D.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let l=0;l<e.size;l++){const p=e.get(l);if(p)for(let _=0;_<p.length;_++){const C=p[_],v=C.link.range.start.y<s?0:C.link.range.start.x,w=C.link.range.end.y>s?this._bufferService.cols:C.link.range.end.x;for(let k=v;k<=w;k++){if(t.has(k)){p.splice(_--,1);break}t.add(k)}}}}_checkLinkProviderResult(s,e,t){var _;if(!this._activeProviderReplies)return t;const l=this._activeProviderReplies.get(s);let p=!1;for(let C=0;C<s;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(p=!0);if(!p&&l){const C=l.find((v=>this._linkAtPosition(v.link,e)));C&&(t=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let C=0;C<this._activeProviderReplies.size;C++){const v=(_=this._activeProviderReplies.get(C))==null?void 0:_.find((w=>this._linkAtPosition(w.link,e)));if(v){t=!0,this._handleNewLink(v);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.pointerCursor},set:t=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.underline},set:t=>{var l,p,_;(l=this._currentLink)!=null&&l.state&&((_=(p=this._currentLink)==null?void 0:p.state)==null?void 0:_.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const l=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(l,p),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}}))))}_linkHover(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,l=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-l-1,t.end.x,t.end.y-l-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,l=s.range.end.y*this._bufferService.cols+s.range.end.x,p=e.y*this._bufferService.cols+e.x;return t<=p&&p<=l}_positionFromMouseEvent(s,e,t){const l=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,l,p){return{x1:s,y1:e,x2:t,y2:l,cols:this._bufferService.cols,fg:p}}};i.Linkifier=r=c([d(1,u.IMouseService),d(2,u.IRenderService),d(3,S.IBufferService),d(4,u.ILinkProviderService)],r)},9042:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const a=o(511),f=o(2585);let g=i.OscLinkProvider=class{constructor(u,r,s){this._bufferService=u,this._optionsService=r,this._oscLinkService=s}provideLinks(u,r){var w;const s=this._bufferService.buffer.lines.get(u-1);if(!s)return void r(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,l=new a.CellData,p=s.getTrimmedLength();let _=-1,C=-1,v=!1;for(let k=0;k<p;k++)if(C!==-1||s.hasContent(k)){if(s.loadCell(k,l),l.hasExtendedAttrs()&&l.extended.urlId){if(C===-1){C=k,_=l.extended.urlId;continue}v=l.extended.urlId!==_}else C!==-1&&(v=!0);if(v||C!==-1&&k===p-1){const D=(w=this._oscLinkService.getLinkData(_))==null?void 0:w.uri;if(D){const O={start:{x:C+1,y:u},end:{x:k+(v||k!==p-1?0:1),y:u}};let L=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const F=new URL(D);["http:","https:"].includes(F.protocol)||(L=!0)}catch{L=!0}L||e.push({text:D,range:O,activate:(F,H)=>t?t.activate(F,H,O):S(0,H),hover:(F,H)=>{var j;return(j=t==null?void 0:t.hover)==null?void 0:j.call(t,F,H,O)},leave:(F,H)=>{var j;return(j=t==null?void 0:t.leave)==null?void 0:j.call(t,F,H,O)}})}v=!1,l.hasExtendedAttrs()&&l.extended.urlId?(C=k,_=l.extended.urlId):(C=-1,_=-1)}}r(e)}};function S(u,r){if(confirm(`Do you want to navigate to ${r}?
|
|
14
14
|
|
|
15
|
-
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=g=c([d(0,f.IBufferService),d(1,f.IOptionsService),d(2,f.IOscLinkService)],g)},6193:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const c=o(3614),d=o(3656),a=o(3551),f=o(9042),g=o(3730),S=o(1680),u=o(3107),r=o(5744),s=o(2950),e=o(1296),t=o(428),l=o(4269),p=o(5114),_=o(8934),C=o(3230),v=o(9312),w=o(4725),k=o(6731),D=o(8055),O=o(8969),L=o(8460),F=o(844),H=o(6114),W=o(8437),G=o(2584),U=o(7399),y=o(5941),R=o(9074),I=o(2585),P=o(5435),z=o(4567),Y=o(779);class X extends O.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(T={}){super(T),this.browser=H,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.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(R.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(w.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((x,M)=>this.refresh(x,M)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((x=>this._reportWindowsOptions(x)))),this.register(this._inputHandler.onColor((x=>this._handleColorEvent(x)))),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((x=>this._afterResize(x.cols,x.rows)))),this.register((0,F.toDisposable)((()=>{var x,M;this._customKeyEventHandler=void 0,(M=(x=this.element)==null?void 0:x.parentNode)==null||M.removeChild(this.element)})))}_handleColorEvent(T){if(this._themeService)for(const x of T){let M,j="";switch(x.index){case 256:M="foreground",j="10";break;case 257:M="background",j="11";break;case 258:M="cursor",j="12";break;default:M="ansi",j="4;"+x.index}switch(x.type){case 0:const Q=D.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[x.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${j};${(0,y.toRgbString)(Q)}${G.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors((K=>K.ansi[x.index]=D.channels.toColor(...x.color)));else{const K=M;this._themeService.modifyColors((Z=>Z[K]=D.channels.toColor(...x.color)))}break;case 2:this._themeService.restoreColor(x.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)==null?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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 T=this.buffer.ybase+this.buffer.y,x=this.buffer.lines.get(T);if(!x)return;const M=Math.min(this.buffer.x,this.cols-1),j=this._renderService.dimensions.css.cell.height,Q=x.getWidth(M),K=this._renderService.dimensions.css.cell.width*Q,Z=this.buffer.y*this._renderService.dimensions.css.cell.height,ee=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ee+"px",this.textarea.style.top=Z+"px",this.textarea.style.width=K+"px",this.textarea.style.height=j+"px",this.textarea.style.lineHeight=j+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",(x=>{this.hasSelection()&&(0,c.copyHandler)(x,this._selectionService)})));const T=x=>(0,c.handlePasteEvent)(x,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,d.addDisposableDomListener)(this.element,"paste",T)),H.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(x=>{x.button===2&&(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",(x=>{(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),H.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",(x=>{x.button===1&&(0,c.moveTextAreaUnderMouseCursor)(x,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",(T=>this._keyUp(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",(T=>this._keyDown(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",(T=>this._keyPress(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",(T=>this._compositionHelper.compositionupdate(T)))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,d.addDisposableDomListener)(this.textarea,"input",(T=>this._inputEvent(T)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(T){var M;if(!T)throw new Error("Terminal requires a parent element.");if(T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((M=this.element)==null?void 0:M.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=T.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"),T.appendChild(this.element);const x=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.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,d.addDisposableDomListener)(this.screenElement,"mousemove",(j=>this.updateCursorStyle(j)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),H.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(p.CoreBrowserService,this.textarea,T.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(w.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",(j=>this._handleTextAreaFocus(j)))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(w.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(k.ThemeService),this._instantiationService.setService(w.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(l.CharacterJoinerService),this._instantiationService.setService(w.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(w.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((j=>this._onRender.fire(j)))),this.onResize((j=>this._renderService.resize(j.cols,j.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(_.MouseService),this._instantiationService.setService(w.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(x);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((j=>this.scrollLines(j.amount,j.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(w.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((j=>this.scrollLines(j.amount,j.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((j=>this._renderService.handleSelectionChanged(j.start,j.end,j.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((j=>{this.textarea.value=j,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((j=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(j=>this._selectionService.handleMouseDown(j)))),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(z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(j=>this._handleScreenReaderModeOptionChange(j)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(j=>{!this._overviewRulerRenderer&&j&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const T=this,x=this.element;function M(K){const Z=T._mouseService.getMouseReportCoords(K,T.screenElement);if(!Z)return!1;let ee,te;switch(K.overrideType||K.type){case"mousemove":te=32,K.buttons===void 0?(ee=3,K.button!==void 0&&(ee=K.button<3?K.button:3)):ee=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":te=0,ee=K.button<3?K.button:3;break;case"mousedown":te=1,ee=K.button<3?K.button:3;break;case"wheel":if(T._customWheelEventHandler&&T._customWheelEventHandler(K)===!1||T.viewport.getLinesScrolled(K)===0)return!1;te=K.deltaY<0?0:1,ee=4;break;default:return!1}return!(te===void 0||ee===void 0||ee>4)&&T.coreMouseService.triggerMouseEvent({col:Z.col,row:Z.row,x:Z.x,y:Z.y,button:ee,action:te,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const j={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:K=>(M(K),K.buttons||(this._document.removeEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.removeEventListener("mousemove",j.mousedrag)),this.cancel(K)),wheel:K=>(M(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&M(K)},mousemove:K=>{K.buttons||M(K)}};this.register(this.coreMouseService.onProtocolChange((K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?j.mousemove||(x.addEventListener("mousemove",Q.mousemove),j.mousemove=Q.mousemove):(x.removeEventListener("mousemove",j.mousemove),j.mousemove=null),16&K?j.wheel||(x.addEventListener("wheel",Q.wheel,{passive:!1}),j.wheel=Q.wheel):(x.removeEventListener("wheel",j.wheel),j.wheel=null),2&K?j.mouseup||(j.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",j.mouseup),j.mouseup=null),4&K?j.mousedrag||(j.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",j.mousedrag),j.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(x,"mousedown",(K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return M(K),j.mouseup&&this._document.addEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.addEventListener("mousemove",j.mousedrag),this.cancel(K)}))),this.register((0,d.addDisposableDomListener)(x,"wheel",(K=>{if(!j.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){const Z=this.viewport.getLinesScrolled(K);if(Z===0)return;const ee=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let te="";for(let ie=0;ie<Math.abs(Z);ie++)te+=ee;return this.coreService.triggerDataEvent(te,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}}),{passive:!1})),this.register((0,d.addDisposableDomListener)(x,"touchstart",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)}),{passive:!0})),this.register((0,d.addDisposableDomListener)(x,"touchmove",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)}),{passive:!1}))}refresh(T,x){var M;(M=this._renderService)==null||M.refreshRows(T,x)}updateCursorStyle(T){var x;(x=this._selectionService)!=null&&x.shouldColumnSelect(T)?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(T,x,M=0){var j;M===1?(super.scrollLines(T,x,M),this.refresh(0,this.rows-1)):(j=this.viewport)==null||j.scrollLines(T)}paste(T){(0,c.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}attachCustomWheelEventHandler(T){this._customWheelEventHandler=T}registerLinkProvider(T){return this._linkProviderService.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const x=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),x}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,x,M){this._selectionService.setSelection(T,x,M)}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 T;(T=this._selectionService)==null||T.clearSelection()}selectAll(){var T;(T=this._selectionService)==null||T.selectAll()}selectLines(T,x){var M;(M=this._selectionService)==null||M.selectLines(T,x)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const x=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!x&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;x||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,U.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),M.type===3||M.type===2){const j=this.rows-1;return this.scrollLines(M.type===2?-j:j),this.cancel(T,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(M.cancel&&this.cancel(T,!0),!M.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==G.C0.ETX&&M.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,x){const M=T.isMac&&!this.options.macOptionIsMeta&&x.altKey&&!x.ctrlKey&&!x.metaKey||T.isWindows&&x.altKey&&x.ctrlKey&&!x.metaKey||T.isWindows&&x.getModifierState("AltGraph");return x.type==="keypress"?M:M&&(!x.keyCode||x.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||((function(x){return x.keyCode===16||x.keyCode===17||x.keyCode===18})(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let x;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)x=T.charCode;else if(T.which===null||T.which===void 0)x=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;x=T.which}return!(!x||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(x=String.fromCharCode(x),this._onKey.fire({key:x,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(x,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const x=T.data;return this.coreService.triggerDataEvent(x,!0),this.cancel(T),!0}return!1}resize(T,x){T!==this.cols||x!==this.rows?super.resize(T,x):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,x){var M,j;(M=this._charSizeService)==null||M.measure(),(j=this.viewport)==null||j.syncScrollArea(!0)}clear(){var T;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 x=1;x<this.rows;x++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)==null||T.reset(),this.refresh(0,this.rows-1)}}reset(){var x,M;this.options.rows=this.rows,this.options.cols=this.cols;const T=this._customKeyEventHandler;this._setup(),super.reset(),(x=this._selectionService)==null||x.reset(),this._decorationService.reset(),(M=this.viewport)==null||M.reset(),this._customKeyEventHandler=T,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)==null||T.clearTextureAtlas()}_reportFocus(){var T;(T=this.element)!=null&&T.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const x=this._renderService.dimensions.css.canvas.width.toFixed(0),M=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${M};${x}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const j=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${Q};${j}t`)}}cancel(T,x){if(this.options.cancelEvents||x)return T.preventDefault(),T.stopPropagation(),!1}}i.Terminal=X},9924:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=a-this._lastRefreshMs,g=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const a=o(3656),f=o(4725),g=o(8460),S=o(844),u=o(2585);let r=i.Viewport=class extends S.Disposable{constructor(s,e,t,l,p,_,C,v){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=l,this._charSizeService=p,this._renderService=_,this._coreBrowserService=C,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((w=>this._activeBuffer=w.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((w=>this._renderDimensions=w))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((w=>this._handleThemeChange(w)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.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(s){if(s)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const e=this._getPixelsScrolled(s);return e!==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+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(s,e){var v;let t,l="";const p=[],_=e??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let w=s;w<_;w++){const k=C.get(w);if(!k)continue;const D=(v=C.get(w+1))==null?void 0:v.isWrapped;if(l+=k.translateToString(!D),!D||w===C.length-1){const O=document.createElement("div");O.textContent=l,p.push(O),l.length>0&&(t=O),l=""}}return{bufferElements:p,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};i.Viewport=r=c([d(2,u.IBufferService),d(3,u.IOptionsService),d(4,f.ICharSizeService),d(5,f.IRenderService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],r)},3107:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const a=o(4725),f=o(844),g=o(2585);let S=i.BufferDecorationRenderer=class extends f.Disposable{constructor(u,r,s,e,t){super(),this._screenElement=u,this._bufferService=r,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,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((l=>this._removeDecoration(l)))),this.register((0,f.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 u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var e;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((e=u==null?void 0:u.options)==null?void 0:e.layer)==="top"),r.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=u.options.x??0;return s&&s>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(u,r),r}_refreshStyle(u){const r=u.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let s=this._decorationElements.get(u);s||(s=this._createElement(u),u.element=s,this._decorationElements.set(u,s),this._container.appendChild(s),u.onDispose((()=>{this._decorationElements.delete(u),s.remove()}))),s.style.top=r*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(s)}}_refreshXPosition(u,r=u.element){if(!r)return;const s=u.options.x??0;(u.options.anchor||"left")==="right"?r.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var r;(r=this._decorationElements.get(u))==null||r.remove(),this._decorationElements.delete(u),u.dispose()}};i.BufferDecorationRenderer=S=c([d(1,g.IBufferService),d(2,a.ICoreBrowserService),d(3,g.IDecorationService),d(4,a.IRenderService)],S)},5871:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,d){return c>=o.startBufferLine-this._linePadding[d||"full"]&&c<=o.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(E,i,o){var c=this&&this.__decorate||function(t,l,p,_){var C,v=arguments.length,w=v<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,p):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,l,p,_);else for(var k=t.length-1;k>=0;k--)(C=t[k])&&(w=(v<3?C(w):v>3?C(l,p,w):C(l,p))||w);return v>3&&w&&Object.defineProperty(l,p,w),w},d=this&&this.__param||function(t,l){return function(p,_){l(p,_,t)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const a=o(5871),f=o(4725),g=o(844),S=o(2585),u={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=i.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,l,p,_,C,v,w){var D;super(),this._viewportElement=t,this._screenElement=l,this._bufferService=p,this._decorationService=_,this._renderService=C,this._optionsService=v,this._coreBrowserService=w,this._colorZoneStore=new a.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(),(D=this._viewportElement.parentElement)==null||D.insertBefore(this._canvas,this._viewportElement);const k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var O;(O=this._canvas)==null||O.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 t=Math.floor(this._canvas.width/3),l=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=t,r.center=l,r.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=r.left,s.right=r.left+r.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,l=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);u.left=l,u.center=l,u.right=l}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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 l of this._decorationService.decorations)this._colorZoneStore.addDecoration(l);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const l of t)l.position!=="full"&&this._renderColorZone(l);for(const l of t)l.position==="full"&&this._renderColorZone(l);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-u[t.position||"full"]/2),r[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[t.position||"full"]))}_queueRefresh(t,l){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=l||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=e=c([d(2,S.IBufferService),d(3,S.IDecorationService),d(4,f.IRenderService),d(5,S.IOptionsService),d(6,f.ICoreBrowserService)],e)},2950:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const a=o(4725),f=o(2585),g=o(2584);let S=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,r,s,e,t,l){this._textarea=u,this._compositionView=r,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=l,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,s=r.replace(u,"");this._dataAlreadySent=s,r.length>u.length?this._coreService.triggerDataEvent(s,!0):r.length<u.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):r.length===u.length&&r!==u&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const l=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}u||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=S=c([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,a.IRenderService)],S)},9806:(E,i)=>{function o(c,d,a){const f=a.getBoundingClientRect(),g=c.getComputedStyle(a),S=parseInt(g.getPropertyValue("padding-left")),u=parseInt(g.getPropertyValue("padding-top"));return[d.clientX-f.left-S,d.clientY-f.top-u]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=o,i.getCoords=function(c,d,a,f,g,S,u,r,s){if(!S)return;const e=o(c,d,a);return e?(e[0]=Math.ceil((e[0]+(s?u/2:0))/u),e[1]=Math.ceil(e[1]/r),e[0]=Math.min(Math.max(e[0],1),f+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),g),e):void 0}},9504:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const c=o(2584);function d(r,s,e,t){const l=r-a(r,e),p=s-a(s,e),_=Math.abs(l-p)-(function(C,v,w){let k=0;const D=C-a(C,w),O=v-a(v,w);for(let L=0;L<Math.abs(D-O);L++){const F=f(C,v)==="A"?-1:1,H=w.buffer.lines.get(D+F*L);H!=null&&H.isWrapped&&k++}return k})(r,s,e);return u(_,S(f(r,s),t))}function a(r,s){let e=0,t=s.buffer.lines.get(r),l=t==null?void 0:t.isWrapped;for(;l&&r>=0&&r<s.rows;)e++,t=s.buffer.lines.get(--r),l=t==null?void 0:t.isWrapped;return e}function f(r,s){return r>s?"A":"B"}function g(r,s,e,t,l,p){let _=r,C=s,v="";for(;_!==e||C!==t;)_+=l?1:-1,l&&_>p.cols-1?(v+=p.buffer.translateBufferLineToString(C,!1,r,_),_=0,r=0,C++):!l&&_<0&&(v+=p.buffer.translateBufferLineToString(C,!1,0,r+1),_=p.cols-1,r=_,C--);return v+p.buffer.translateBufferLineToString(C,!1,r,_)}function S(r,s){const e=s?"O":"[";return c.C0.ESC+e+r}function u(r,s){r=Math.floor(r);let e="";for(let t=0;t<r;t++)e+=s;return e}i.moveToCellSequence=function(r,s,e,t){const l=e.buffer.x,p=e.buffer.y;if(!e.buffer.hasScrollback)return(function(v,w,k,D,O,L){return d(w,D,O,L).length===0?"":u(g(v,w,v,w-a(w,O),!1,O).length,S("D",L))})(l,p,0,s,e,t)+d(p,s,e,t)+(function(v,w,k,D,O,L){let F;F=d(w,D,O,L).length>0?D-a(D,O):w;const H=D,W=(function(G,U,y,R,I,P){let z;return z=d(y,R,I,P).length>0?R-a(R,I):U,G<y&&z<=R||G>=y&&z<R?"C":"D"})(v,w,k,D,O,L);return u(g(v,F,k,H,W==="C",O).length,S(W,L))})(l,p,r,s,e,t);let _;if(p===s)return _=l>r?"D":"C",u(Math.abs(l-r),S(_,t));_=p>s?"D":"C";const C=Math.abs(p-s);return u((function(v,w){return w.cols-v})(p>s?r:l,e)+(C-1)*e.cols+1+((p>s?l:r)-1),S(_,t))}},1296:function(E,i,o){var c=this&&this.__decorate||function(L,F,H,W){var G,U=arguments.length,y=U<3?F:W===null?W=Object.getOwnPropertyDescriptor(F,H):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(L,F,H,W);else for(var R=L.length-1;R>=0;R--)(G=L[R])&&(y=(U<3?G(y):U>3?G(F,H,y):G(F,H))||y);return U>3&&y&&Object.defineProperty(F,H,y),y},d=this&&this.__param||function(L,F){return function(H,W){F(H,W,L)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const a=o(3787),f=o(2550),g=o(2223),S=o(6171),u=o(6052),r=o(4725),s=o(8055),e=o(8460),t=o(844),l=o(2585),p="xterm-dom-renderer-owner-",_="xterm-rows",C="xterm-fg-",v="xterm-bg-",w="xterm-focus",k="xterm-selection";let D=1,O=i.DomRenderer=class extends t.Disposable{constructor(L,F,H,W,G,U,y,R,I,P,z,Y,X){super(),this._terminal=L,this._document=F,this._element=H,this._screenElement=W,this._viewportElement=G,this._helperContainer=U,this._linkifier2=y,this._charSizeService=I,this._optionsService=P,this._bufferService=z,this._coreBrowserService=Y,this._themeService=X,this._terminalClass=D++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(_),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(k),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.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=R.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(p+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,t.toDisposable)((()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new f.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 H of this._rowElements)H.style.width=`${this.dimensions.css.canvas.width}px`,H.style.height=`${this.dimensions.css.cell.height}px`,H.style.lineHeight=`${this.dimensions.css.cell.height}px`,H.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${_} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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 F=`${this._terminalSelector} .${_} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${_} .xterm-dim { color: ${s.color.multiplyOpacity(L.foreground,.5).css};}`,F+=`${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 H=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;F+=`@keyframes ${H} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${W} { 50% { box-shadow: none; }}`,F+=`@keyframes ${G} { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,F+=`${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[U,y]of L.ansi.entries())F+=`${this._terminalSelector} .${C}${U} { color: ${y.css}; }${this._terminalSelector} .${C}${U}.xterm-dim { color: ${s.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${v}${U} { background-color: ${y.css}; }`;F+=`${this._terminalSelector} .${C}${g.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(L.background).css}; }${this._terminalSelector} .${C}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${v}${g.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=F}_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,F){for(let H=this._rowElements.length;H<=F;H++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,F){this._refreshRowElements(L,F),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(w),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,F,H){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,F,H),this.renderRows(0,this._bufferService.rows-1),!L||!F)return;this._selectionRenderModel.update(this._terminal,L,F,H);const W=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||y<0)return;const R=this._document.createDocumentFragment();if(H){const I=L[0]>F[0];R.appendChild(this._createSelectionElement(U,I?F[0]:L[0],I?L[0]:F[0],y-U+1))}else{const I=W===U?L[0]:0,P=U===G?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(U,I,P));const z=y-U-1;if(R.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,z)),U!==y){const Y=G===y?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(y,0,Y))}}this._selectionContainer.appendChild(R)}_createSelectionElement(L,F,H,W=1){const G=this._document.createElement("div"),U=F*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(H-F);return U+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-U),G.style.height=W*this.dimensions.css.cell.height+"px",G.style.top=L*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${y}px`,G}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,F){const H=this._bufferService.buffer,W=H.ybase+H.y,G=Math.min(H.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=L;I<=F;I++){const P=I+H.ydisp,z=this._rowElements[I],Y=H.lines.get(P);if(!z||!Y)break;z.replaceChildren(...this._rowFactory.createRow(Y,P,P===W,y,R,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${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,F,H,W,G,U){H<0&&(L=0),W<0&&(F=0);const y=this._bufferService.rows-1;H=Math.max(Math.min(H,y),0),W=Math.max(Math.min(W,y),0),G=Math.min(G,this._bufferService.cols);const R=this._bufferService.buffer,I=R.ybase+R.y,P=Math.min(R.x,G-1),z=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=H;J<=W;++J){const T=J+R.ydisp,x=this._rowElements[J],M=R.lines.get(T);if(!x||!M)break;x.replaceChildren(...this._rowFactory.createRow(M,T,T===I,Y,X,P,z,this.dimensions.css.cell.width,this._widthCache,U?J===H?L:0:-1,U?(J===W?F:G)-1:-1))}}};i.DomRenderer=O=c([d(7,l.IInstantiationService),d(8,r.ICharSizeService),d(9,l.IOptionsService),d(10,l.IBufferService),d(11,r.ICoreBrowserService),d(12,r.IThemeService)],O)},3787:function(E,i,o){var c=this&&this.__decorate||function(_,C,v,w){var k,D=arguments.length,O=D<3?C:w===null?w=Object.getOwnPropertyDescriptor(C,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(_,C,v,w);else for(var L=_.length-1;L>=0;L--)(k=_[L])&&(O=(D<3?k(O):D>3?k(C,v,O):k(C,v))||O);return D>3&&O&&Object.defineProperty(C,v,O),O},d=this&&this.__param||function(_,C){return function(v,w){C(v,w,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const a=o(2223),f=o(643),g=o(511),S=o(2585),u=o(8055),r=o(4725),s=o(4269),e=o(6171),t=o(3734);let l=i.DomRendererRowFactory=class{constructor(_,C,v,w,k,D,O){this._document=_,this._characterJoinerService=C,this._optionsService=v,this._coreBrowserService=w,this._coreService=k,this._decorationService=D,this._themeService=O,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(_,C,v){this._selectionStart=_,this._selectionEnd=C,this._columnSelectMode=v}createRow(_,C,v,w,k,D,O,L,F,H,W){const G=[],U=this._characterJoinerService.getJoinedCharacters(C),y=this._themeService.colors;let R,I=_.getNoBgTrimmedLength();v&&I<D+1&&(I=D+1);let P=0,z="",Y=0,X=0,J=0,T=!1,x=0,M=!1,j=0;const Q=[],K=H!==-1&&W!==-1;for(let Z=0;Z<I;Z++){_.loadCell(Z,this._workCell);let ee=this._workCell.getWidth();if(ee===0)continue;let te=!1,ie=Z,$=this._workCell;if(U.length>0&&Z===U[0][0]){te=!0;const re=U.shift();$=new s.JoinedCellData(this._workCell,_.translateToString(!0,re[0],re[1]),re[1]-re[0]),ie=re[1]-1,ee=$.getWidth()}const xe=this._isCellInSelection(Z,C),me=v&&Z===D,vt=K&&Z>=H&&Z<=W;let pt=!1;this._decorationService.forEachDecorationAtCell(Z,C,void 0,(re=>{pt=!0}));let Ye=$.getChars()||f.WHITESPACE_CELL_CHAR;if(Ye===" "&&($.isUnderline()||$.isOverline())&&(Ye=" "),j=ee*L-F.get(Ye,$.isBold(),$.isItalic()),R){if(P&&(xe&&M||!xe&&!M&&$.bg===Y)&&(xe&&M&&y.selectionForeground||$.fg===X)&&$.extended.ext===J&&vt===T&&j===x&&!me&&!te&&!pt){$.isInvisible()?z+=f.WHITESPACE_CELL_CHAR:z+=Ye,P++;continue}P&&(R.textContent=z),R=this._document.createElement("span"),P=0,z=""}else R=this._document.createElement("span");if(Y=$.bg,X=$.fg,J=$.extended.ext,T=vt,x=j,M=xe,te&&D>=Z&&D<=ie&&(D=Z),!this._coreService.isCursorHidden&&me&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Q.push("xterm-cursor-blink"),Q.push(w==="bar"?"xterm-cursor-bar":w==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(k)switch(k){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($.isBold()&&Q.push("xterm-bold"),$.isItalic()&&Q.push("xterm-italic"),$.isDim()&&Q.push("xterm-dim"),z=$.isInvisible()?f.WHITESPACE_CELL_CHAR:$.getChars()||f.WHITESPACE_CELL_CHAR,$.isUnderline()&&(Q.push(`xterm-underline-${$.extended.underlineStyle}`),z===" "&&(z=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB($.getUnderlineColor()).join(",")})`;else{let re=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&re<8&&(re+=8),R.style.textDecorationColor=y.ansi[re].css}$.isOverline()&&(Q.push("xterm-overline"),z===" "&&(z=" ")),$.isStrikethrough()&&Q.push("xterm-strikethrough"),vt&&(R.style.textDecoration="underline");let ae=$.getFgColor(),Me=$.getFgColorMode(),he=$.getBgColor(),He=$.getBgColorMode();const _t=!!$.isInverse();if(_t){const re=ae;ae=he,he=re;const fi=Me;Me=He,He=fi}let Se,Ve,Ce,Fe=!1;switch(this._decorationService.forEachDecorationAtCell(Z,C,void 0,(re=>{re.options.layer!=="top"&&Fe||(re.backgroundColorRGB&&(He=50331648,he=re.backgroundColorRGB.rgba>>8&16777215,Se=re.backgroundColorRGB),re.foregroundColorRGB&&(Me=50331648,ae=re.foregroundColorRGB.rgba>>8&16777215,Ve=re.foregroundColorRGB),Fe=re.options.layer==="top")})),!Fe&&xe&&(Se=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=Se.rgba>>8&16777215,He=50331648,Fe=!0,y.selectionForeground&&(Me=50331648,ae=y.selectionForeground.rgba>>8&16777215,Ve=y.selectionForeground)),Fe&&Q.push("xterm-decoration-top"),He){case 16777216:case 33554432:Ce=y.ansi[he],Q.push(`xterm-bg-${he}`);break;case 50331648:Ce=u.channels.toColor(he>>16,he>>8&255,255&he),this._addStyle(R,`background-color:#${p((he>>>0).toString(16),"0",6)}`);break;default:_t?(Ce=y.foreground,Q.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ce=y.background}switch(Se||$.isDim()&&(Se=u.color.multiplyOpacity(Ce,.5)),Me){case 16777216:case 33554432:$.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(R,Ce,y.ansi[ae],$,Se,void 0)||Q.push(`xterm-fg-${ae}`);break;case 50331648:const re=u.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(R,Ce,re,$,Se,Ve)||this._addStyle(R,`color:#${p(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,Ce,y.foreground,$,Se,Ve)||_t&&Q.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}Q.length&&(R.className=Q.join(" "),Q.length=0),me||te||pt?R.textContent=z:P++,j!==this.defaultSpacing&&(R.style.letterSpacing=`${j}px`),G.push(R),Z=ie}return R&&P&&(R.textContent=z),G}_applyMinimumContrast(_,C,v,w,k,D){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(w.getCode()))return!1;const O=this._getContrastCache(w);let L;if(k||D||(L=O.getColor(C.rgba,v.rgba)),L===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(w.isDim()?2:1);L=u.color.ensureContrastRatio(k||C,D||v,F),O.setColor((k||C).rgba,(D||v).rgba,L??null)}return!!L&&(this._addStyle(_,`color:${L.css}`),!0)}_getContrastCache(_){return _.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(_,C){_.setAttribute("style",`${_.getAttribute("style")||""}${C};`)}_isCellInSelection(_,C){const v=this._selectionStart,w=this._selectionEnd;return!(!v||!w)&&(this._columnSelectMode?v[0]<=w[0]?_>=v[0]&&C>=v[1]&&_<w[0]&&C<=w[1]:_<v[0]&&C>=v[1]&&_>=w[0]&&C<=w[1]:C>v[1]&&C<w[1]||v[1]===w[1]&&C===v[1]&&_>=v[0]&&_<w[0]||v[1]<w[1]&&C===w[1]&&_<w[0]||v[1]<w[1]&&C===v[1]&&_>=v[0])}};function p(_,C,v){for(;_.length<v;)_=C+_;return _}i.DomRendererRowFactory=l=c([d(1,r.ICharacterJoinerService),d(2,S.IOptionsService),d(3,r.ICoreBrowserService),d(4,S.ICoreService),d(5,S.IDecorationService),d(6,r.IThemeService)],l)},2550:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 d=o.createElement("span");d.classList.add("xterm-char-measure-element");const a=o.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const g=o.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[d,a,f,g],this._container.appendChild(d),this._container.appendChild(a),this._container.appendChild(f),this._container.appendChild(g),c.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(o,c,d,a){o===this._font&&c===this._fontSize&&d===this._weight&&a===this._weightBold||(this._font=o,this._fontSize=c,this._weight=d,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(o,c,d){let a=0;if(!c&&!d&&o.length===1&&(a=o.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const S=this._measure(o,0);return S>0&&(this._flat[a]=S),S}let f=o;c&&(f+="B"),d&&(f+="I");let g=this._holey.get(f);if(g===void 0){let S=0;c&&(S|=1),d&&(S|=2),g=this._measure(o,S),g>0&&this._holey.set(f,g)}return g}_measure(o,c){const d=this._measureElements[c];return d.textContent=o.repeat(32),d.offsetWidth/32}}},2223:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(E,i)=>{function o(d){return 57508<=d&&d<=57558}function c(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},i.isPowerlineGlyph=o,i.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},i.isEmoji=c,i.allowRescaling=function(d,a,f,g){return a===1&&f>Math.ceil(1.5*g)&&d!==void 0&&d>255&&!c(d)&&!o(d)&&!(function(S){return 57344<=S&&S<=63743})(d)},i.treatGlyphAsBackgroundColor=function(d){return o(d)||(function(a){return 9472<=a&&a<=9631})(d)},i.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}}}},i.computeNextVariantOffset=function(d,a,f=0){return(d-(2*Math.round(a)-f))%(2*Math.round(a))}},6052:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class o{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(d,a,f,g=!1){if(this.selectionStart=a,this.selectionEnd=f,!a||!f||a[0]===f[0]&&a[1]===f[1])return void this.clear();const S=d.buffers.active.ydisp,u=a[1]-S,r=f[1]-S,s=Math.max(u,0),e=Math.min(r,d.rows-1);s>=d.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=u,this.viewportEndRow=r,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=a[0],this.endCol=f[0])}isCellSelected(d,a,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&f>=this.viewportCappedStartRow&&a<this.endCol&&f<=this.viewportCappedEndRow:a<this.startCol&&f>=this.viewportCappedStartRow&&a>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol)}}i.createSelectionRenderModel=function(){return new o}},456:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const a=o(2585),f=o(8460),g=o(844);let S=i.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new r(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};i.CharSizeService=S=c([d(2,a.IOptionsService)],S);class u extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,l){t!==void 0&&t>0&&l!==void 0&&l>0&&(this._result.width=t,this._result.height=l)}}class r extends u{constructor(t,l,p){super(),this._document=t,this._parentElement=l,this._optionsService=p,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 s extends u{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const l=this._ctx.measureText("W");if(!("width"in l&&"fontBoundingBoxAscent"in l&&"fontBoundingBoxDescent"in l))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const a=o(3734),f=o(643),g=o(511),S=o(2585);class u extends a.AttributeData{constructor(e,t,l){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=l}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=u;let r=i.CharacterJoinerService=class xr{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];const l=[],p=t.translateToString(!0);let _=0,C=0,v=0,w=t.getFg(0),k=t.getBg(0);for(let D=0;D<t.getTrimmedLength();D++)if(t.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==w||this._workCell.bg!==k){if(D-_>1){const O=this._getJoinedRanges(p,v,C,t,_);for(let L=0;L<O.length;L++)l.push(O[L])}_=D,v=C,w=this._workCell.fg,k=this._workCell.bg}C+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-_>1){const D=this._getJoinedRanges(p,v,C,t,_);for(let O=0;O<D.length;O++)l.push(D[O])}return l}_getJoinedRanges(e,t,l,p,_){const C=e.substring(t,l);let v=[];try{v=this._characterJoiners[0].handler(C)}catch(w){console.error(w)}for(let w=1;w<this._characterJoiners.length;w++)try{const k=this._characterJoiners[w].handler(C);for(let D=0;D<k.length;D++)xr._mergeRanges(v,k[D])}catch(k){console.error(k)}return this._stringRangesToCellRanges(v,p,_),v}_stringRangesToCellRanges(e,t,l){let p=0,_=!1,C=0,v=e[p];if(v){for(let w=l;w<this._bufferService.cols;w++){const k=t.getWidth(w),D=t.getString(w).length||f.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!_&&v[0]<=C&&(v[0]=w,_=!0),v[1]<=C){if(v[1]=w,v=e[++p],!v)break;v[0]<=C?(v[0]=w,_=!0):_=!1}C+=D}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let l=!1;for(let p=0;p<e.length;p++){const _=e[p];if(l){if(t[1]<=_[0])return e[p-1][1]=t[1],e;if(t[1]<=_[1])return e[p-1][1]=Math.max(t[1],_[1]),e.splice(p,1),e;e.splice(p,1),p--}else{if(t[1]<=_[0])return e.splice(p,0,t),e;if(t[1]<=_[1])return _[0]=Math.min(t[0],_[0]),e;t[0]<_[1]&&(_[0]=Math.min(t[0],_[0]),l=!0)}}return l?e[e.length-1][1]=t[1]:e.push(t),e}};i.CharacterJoinerService=r=c([d(0,S.IBufferService)],r)},5114:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const c=o(844),d=o(8460),a=o(3656);class f extends c.Disposable{constructor(u,r,s){super(),this._textarea=u,this._window=r,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,d.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(u){this._window!==u&&(this._window=u,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}}i.CoreBrowserService=f;class g extends c.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)==null||u.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:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const c=o(844);class d extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const g=this.linkProviders.indexOf(f);g!==-1&&this.linkProviders.splice(g,1)}}}}i.LinkProviderService=d},8934:function(E,i,o){var c=this&&this.__decorate||function(S,u,r,s){var e,t=arguments.length,l=t<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,u,r,s);else for(var p=S.length-1;p>=0;p--)(e=S[p])&&(l=(t<3?e(l):t>3?e(u,r,l):e(u,r))||l);return t>3&&l&&Object.defineProperty(u,r,l),l},d=this&&this.__param||function(S,u){return function(r,s){u(r,s,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const a=o(4725),f=o(9806);let g=i.MouseService=class{constructor(S,u){this._renderService=S,this._charSizeService=u}getCoords(S,u,r,s,e){return(0,f.getCoords)(window,S,u,r,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(S,u){const r=(0,f.getCoordsRelativeToElement)(window,S,u);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};i.MouseService=g=c([d(0,a.IRenderService),d(1,a.ICharSizeService)],g)},3230:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const a=o(6193),f=o(4725),g=o(8460),S=o(844),u=o(7226),r=o(2585);let s=i.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,l,p,_,C,v,w){super(),this._rowCount=e,this._charSizeService=p,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((k,D)=>this._renderRows(k,D)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var k;return(k=this._renderer.value)==null?void 0:k.clear()}))),this.register(l.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(_.onDecorationRegistered((()=>this._fullRefresh()))),this.register(_.onDecorationRemoved((()=>this._fullRefresh()))),this.register(l.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(l.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(w.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,t),this.register(v.onWindowChange((k=>this._registerIntersectionObserver(k,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const l=new e.IntersectionObserver((p=>this._handleIntersectionChange(p[p.length-1])),{threshold:0});l.observe(t),this._observerDisposable.value=(0,S.toDisposable)((()=>l.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,l=!1){this._isPaused?this._needsFullRefresh=!0:(l||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((t=>this.refreshRows(t.start,t.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var l;return(l=this._renderer.value)==null?void 0:l.handleResize(e,t)})):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,l){var p;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=l,(p=this._renderer.value)==null||p.handleSelectionChanged(e,t,l)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};i.RenderService=s=c([d(2,r.IOptionsService),d(3,f.ICharSizeService),d(4,r.IDecorationService),d(5,r.IBufferService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],s)},9312:function(E,i,o){var c=this&&this.__decorate||function(v,w,k,D){var O,L=arguments.length,F=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,k):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(v,w,k,D);else for(var H=v.length-1;H>=0;H--)(O=v[H])&&(F=(L<3?O(F):L>3?O(w,k,F):O(w,k))||F);return L>3&&F&&Object.defineProperty(w,k,F),F},d=this&&this.__param||function(v,w){return function(k,D){w(k,D,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const a=o(9806),f=o(9504),g=o(456),S=o(4725),u=o(8460),r=o(844),s=o(6114),e=o(4841),t=o(511),l=o(2585),p=" ",_=new RegExp(p,"g");let C=i.SelectionService=class extends r.Disposable{constructor(v,w,k,D,O,L,F,H,W){super(),this._element=v,this._screenElement=w,this._linkifier=k,this._bufferService=D,this._coreService=O,this._mouseService=L,this._optionsService=F,this._renderService=H,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!v||!w||v[0]===w[0]&&v[1]===w[1])}get selectionText(){const v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!v||!w)return"";const k=this._bufferService.buffer,D=[];if(this._activeSelectionMode===3){if(v[0]===w[0])return"";const O=v[0]<w[0]?v[0]:w[0],L=v[0]<w[0]?w[0]:v[0];for(let F=v[1];F<=w[1];F++){const H=k.translateBufferLineToString(F,!0,O,L);D.push(H)}}else{const O=v[1]===w[1]?w[0]:void 0;D.push(k.translateBufferLineToString(v[1],!0,v[0],O));for(let L=v[1]+1;L<=w[1]-1;L++){const F=k.lines.get(L),H=k.translateBufferLineToString(L,!0);F!=null&&F.isWrapped?D[D.length-1]+=H:D.push(H)}if(v[1]!==w[1]){const L=k.lines.get(w[1]),F=k.translateBufferLineToString(w[1],!0,0,w[0]);L&&L.isWrapped?D[D.length-1]+=F:D.push(F)}}return D.map((O=>O.replace(_," "))).join(s.isWindows?`\r
|
|
15
|
+
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=g=c([d(0,f.IBufferService),d(1,f.IOptionsService),d(2,f.IOscLinkService)],g)},6193:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const c=o(3614),d=o(3656),a=o(3551),f=o(9042),g=o(3730),S=o(1680),u=o(3107),r=o(5744),s=o(2950),e=o(1296),t=o(428),l=o(4269),p=o(5114),_=o(8934),C=o(3230),v=o(9312),w=o(4725),k=o(6731),D=o(8055),O=o(8969),L=o(8460),F=o(844),H=o(6114),j=o(8437),Q=o(2584),U=o(7399),y=o(5941),I=o(9074),R=o(2585),P=o(5435),N=o(4567),Y=o(779);class Z extends O.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(M={}){super(M),this.browser=H,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.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(I.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(w.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((x,K)=>this.refresh(x,K)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((x=>this._reportWindowsOptions(x)))),this.register(this._inputHandler.onColor((x=>this._handleColorEvent(x)))),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((x=>this._afterResize(x.cols,x.rows)))),this.register((0,F.toDisposable)((()=>{var x,K;this._customKeyEventHandler=void 0,(K=(x=this.element)==null?void 0:x.parentNode)==null||K.removeChild(this.element)})))}_handleColorEvent(M){if(this._themeService)for(const x of M){let K,T="";switch(x.index){case 256:K="foreground",T="10";break;case 257:K="background",T="11";break;case 258:K="cursor",T="12";break;default:K="ansi",T="4;"+x.index}switch(x.type){case 0:const q=D.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[x.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${T};${(0,y.toRgbString)(q)}${Q.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors((z=>z.ansi[x.index]=D.channels.toColor(...x.color)));else{const z=K;this._themeService.modifyColors((X=>X[z]=D.channels.toColor(...x.color)))}break;case 2:this._themeService.restoreColor(x.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(M){M?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(M){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var M;return(M=this.textarea)==null?void 0:M.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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 M=this.buffer.ybase+this.buffer.y,x=this.buffer.lines.get(M);if(!x)return;const K=Math.min(this.buffer.x,this.cols-1),T=this._renderService.dimensions.css.cell.height,q=x.getWidth(K),z=this._renderService.dimensions.css.cell.width*q,X=this.buffer.y*this._renderService.dimensions.css.cell.height,ee=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ee+"px",this.textarea.style.top=X+"px",this.textarea.style.width=z+"px",this.textarea.style.height=T+"px",this.textarea.style.lineHeight=T+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",(x=>{this.hasSelection()&&(0,c.copyHandler)(x,this._selectionService)})));const M=x=>(0,c.handlePasteEvent)(x,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",M)),this.register((0,d.addDisposableDomListener)(this.element,"paste",M)),H.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(x=>{x.button===2&&(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",(x=>{(0,c.rightClickHandler)(x,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),H.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",(x=>{x.button===1&&(0,c.moveTextAreaUnderMouseCursor)(x,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",(M=>this._keyUp(M)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",(M=>this._keyDown(M)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",(M=>this._keyPress(M)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",(M=>this._compositionHelper.compositionupdate(M)))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,d.addDisposableDomListener)(this.textarea,"input",(M=>this._inputEvent(M)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(M){var K;if(!M)throw new Error("Terminal requires a parent element.");if(M.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=M.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"),M.appendChild(this.element);const x=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.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,d.addDisposableDomListener)(this.screenElement,"mousemove",(T=>this.updateCursorStyle(T)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),H.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(p.CoreBrowserService,this.textarea,M.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(w.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",(T=>this._handleTextAreaFocus(T)))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(w.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(k.ThemeService),this._instantiationService.setService(w.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(l.CharacterJoinerService),this._instantiationService.setService(w.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(w.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((T=>this._onRender.fire(T)))),this.onResize((T=>this._renderService.resize(T.cols,T.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(_.MouseService),this._instantiationService.setService(w.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(x);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((T=>this.scrollLines(T.amount,T.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(w.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((T=>this.scrollLines(T.amount,T.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((T=>this._renderService.handleSelectionChanged(T.start,T.end,T.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((T=>{this.textarea.value=T,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((T=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(T=>this._selectionService.handleMouseDown(T)))),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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(T=>this._handleScreenReaderModeOptionChange(T)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(T=>{!this._overviewRulerRenderer&&T&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const M=this,x=this.element;function K(z){const X=M._mouseService.getMouseReportCoords(z,M.screenElement);if(!X)return!1;let ee,te;switch(z.overrideType||z.type){case"mousemove":te=32,z.buttons===void 0?(ee=3,z.button!==void 0&&(ee=z.button<3?z.button:3)):ee=1&z.buttons?0:4&z.buttons?1:2&z.buttons?2:3;break;case"mouseup":te=0,ee=z.button<3?z.button:3;break;case"mousedown":te=1,ee=z.button<3?z.button:3;break;case"wheel":if(M._customWheelEventHandler&&M._customWheelEventHandler(z)===!1||M.viewport.getLinesScrolled(z)===0)return!1;te=z.deltaY<0?0:1,ee=4;break;default:return!1}return!(te===void 0||ee===void 0||ee>4)&&M.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:ee,action:te,ctrl:z.ctrlKey,alt:z.altKey,shift:z.shiftKey})}const T={mouseup:null,wheel:null,mousedrag:null,mousemove:null},q={mouseup:z=>(K(z),z.buttons||(this._document.removeEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.removeEventListener("mousemove",T.mousedrag)),this.cancel(z)),wheel:z=>(K(z),this.cancel(z,!0)),mousedrag:z=>{z.buttons&&K(z)},mousemove:z=>{z.buttons||K(z)}};this.register(this.coreMouseService.onProtocolChange((z=>{z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(z)),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&z?T.mousemove||(x.addEventListener("mousemove",q.mousemove),T.mousemove=q.mousemove):(x.removeEventListener("mousemove",T.mousemove),T.mousemove=null),16&z?T.wheel||(x.addEventListener("wheel",q.wheel,{passive:!1}),T.wheel=q.wheel):(x.removeEventListener("wheel",T.wheel),T.wheel=null),2&z?T.mouseup||(T.mouseup=q.mouseup):(this._document.removeEventListener("mouseup",T.mouseup),T.mouseup=null),4&z?T.mousedrag||(T.mousedrag=q.mousedrag):(this._document.removeEventListener("mousemove",T.mousedrag),T.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(x,"mousedown",(z=>{if(z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(z))return K(z),T.mouseup&&this._document.addEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.addEventListener("mousemove",T.mousedrag),this.cancel(z)}))),this.register((0,d.addDisposableDomListener)(x,"wheel",(z=>{if(!T.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(z)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(z);if(X===0)return;const ee=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(z.deltaY<0?"A":"B");let te="";for(let ie=0;ie<Math.abs(X);ie++)te+=ee;return this.coreService.triggerDataEvent(te,!0),this.cancel(z,!0)}return this.viewport.handleWheel(z)?this.cancel(z):void 0}}),{passive:!1})),this.register((0,d.addDisposableDomListener)(x,"touchstart",(z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(z),this.cancel(z)}),{passive:!0})),this.register((0,d.addDisposableDomListener)(x,"touchmove",(z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(z)?void 0:this.cancel(z)}),{passive:!1}))}refresh(M,x){var K;(K=this._renderService)==null||K.refreshRows(M,x)}updateCursorStyle(M){var x;(x=this._selectionService)!=null&&x.shouldColumnSelect(M)?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(M,x,K=0){var T;K===1?(super.scrollLines(M,x,K),this.refresh(0,this.rows-1)):(T=this.viewport)==null||T.scrollLines(M)}paste(M){(0,c.paste)(M,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(M){this._customKeyEventHandler=M}attachCustomWheelEventHandler(M){this._customWheelEventHandler=M}registerLinkProvider(M){return this._linkProviderService.registerLinkProvider(M)}registerCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const x=this._characterJoinerService.register(M);return this.refresh(0,this.rows-1),x}deregisterCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(M)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(M){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+M)}registerDecoration(M){return this._decorationService.registerDecoration(M)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(M,x,K){this._selectionService.setSelection(M,x,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 M;(M=this._selectionService)==null||M.clearSelection()}selectAll(){var M;(M=this._selectionService)==null||M.selectAll()}selectLines(M,x){var K;(K=this._selectionService)==null||K.selectLines(M,x)}_keyDown(M){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;const x=this.browser.isMac&&this.options.macOptionIsMeta&&M.altKey;if(!x&&!this._compositionHelper.keydown(M))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;x||M.key!=="Dead"&&M.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,U.evaluateKeyboardEvent)(M,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(M),K.type===3||K.type===2){const T=this.rows-1;return this.scrollLines(K.type===2?-T:T),this.cancel(M,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,M)||(K.cancel&&this.cancel(M,!0),!K.key||!!(M.key&&!M.ctrlKey&&!M.altKey&&!M.metaKey&&M.key.length===1&&M.key.charCodeAt(0)>=65&&M.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==Q.C0.ETX&&K.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||M.altKey||M.ctrlKey?this.cancel(M,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(M,x){const K=M.isMac&&!this.options.macOptionIsMeta&&x.altKey&&!x.ctrlKey&&!x.metaKey||M.isWindows&&x.altKey&&x.ctrlKey&&!x.metaKey||M.isWindows&&x.getModifierState("AltGraph");return x.type==="keypress"?K:K&&(!x.keyCode||x.keyCode>47)}_keyUp(M){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1||((function(x){return x.keyCode===16||x.keyCode===17||x.keyCode===18})(M)||this.focus(),this.updateCursorStyle(M),this._keyPressHandled=!1)}_keyPress(M){let x;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;if(this.cancel(M),M.charCode)x=M.charCode;else if(M.which===null||M.which===void 0)x=M.keyCode;else{if(M.which===0||M.charCode===0)return!1;x=M.which}return!(!x||(M.altKey||M.ctrlKey||M.metaKey)&&!this._isThirdLevelShift(this.browser,M)||(x=String.fromCharCode(x),this._onKey.fire({key:x,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(x,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(M){if(M.data&&M.inputType==="insertText"&&(!M.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const x=M.data;return this.coreService.triggerDataEvent(x,!0),this.cancel(M),!0}return!1}resize(M,x){M!==this.cols||x!==this.rows?super.resize(M,x):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(M,x){var K,T;(K=this._charSizeService)==null||K.measure(),(T=this.viewport)==null||T.syncScrollArea(!0)}clear(){var M;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 x=1;x<this.rows;x++)this.buffer.lines.push(this.buffer.getBlankLine(j.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(M=this.viewport)==null||M.reset(),this.refresh(0,this.rows-1)}}reset(){var x,K;this.options.rows=this.rows,this.options.cols=this.cols;const M=this._customKeyEventHandler;this._setup(),super.reset(),(x=this._selectionService)==null||x.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){var M;(M=this._renderService)==null||M.clearTextureAtlas()}_reportFocus(){var M;(M=this.element)!=null&&M.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(M){if(this._renderService)switch(M){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const x=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${K};${x}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const T=this._renderService.dimensions.css.cell.width.toFixed(0),q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${q};${T}t`)}}cancel(M,x){if(this.options.cancelEvents||x)return M.preventDefault(),M.stopPropagation(),!1}}i.Terminal=Z},9924:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=a-this._lastRefreshMs,g=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const a=o(3656),f=o(4725),g=o(8460),S=o(844),u=o(2585);let r=i.Viewport=class extends S.Disposable{constructor(s,e,t,l,p,_,C,v){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=l,this._charSizeService=p,this._renderService=_,this._coreBrowserService=C,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((w=>this._activeBuffer=w.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((w=>this._renderDimensions=w))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((w=>this._handleThemeChange(w)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.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(s){if(s)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const e=this._getPixelsScrolled(s);return e!==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+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(s,e){var v;let t,l="";const p=[],_=e??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let w=s;w<_;w++){const k=C.get(w);if(!k)continue;const D=(v=C.get(w+1))==null?void 0:v.isWrapped;if(l+=k.translateToString(!D),!D||w===C.length-1){const O=document.createElement("div");O.textContent=l,p.push(O),l.length>0&&(t=O),l=""}}return{bufferElements:p,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};i.Viewport=r=c([d(2,u.IBufferService),d(3,u.IOptionsService),d(4,f.ICharSizeService),d(5,f.IRenderService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],r)},3107:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const a=o(4725),f=o(844),g=o(2585);let S=i.BufferDecorationRenderer=class extends f.Disposable{constructor(u,r,s,e,t){super(),this._screenElement=u,this._bufferService=r,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,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((l=>this._removeDecoration(l)))),this.register((0,f.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 u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var e;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((e=u==null?void 0:u.options)==null?void 0:e.layer)==="top"),r.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=u.options.x??0;return s&&s>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(u,r),r}_refreshStyle(u){const r=u.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let s=this._decorationElements.get(u);s||(s=this._createElement(u),u.element=s,this._decorationElements.set(u,s),this._container.appendChild(s),u.onDispose((()=>{this._decorationElements.delete(u),s.remove()}))),s.style.top=r*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(s)}}_refreshXPosition(u,r=u.element){if(!r)return;const s=u.options.x??0;(u.options.anchor||"left")==="right"?r.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var r;(r=this._decorationElements.get(u))==null||r.remove(),this._decorationElements.delete(u),u.dispose()}};i.BufferDecorationRenderer=S=c([d(1,g.IBufferService),d(2,a.ICoreBrowserService),d(3,g.IDecorationService),d(4,a.IRenderService)],S)},5871:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,d){return c>=o.startBufferLine-this._linePadding[d||"full"]&&c<=o.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(E,i,o){var c=this&&this.__decorate||function(t,l,p,_){var C,v=arguments.length,w=v<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,p):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,l,p,_);else for(var k=t.length-1;k>=0;k--)(C=t[k])&&(w=(v<3?C(w):v>3?C(l,p,w):C(l,p))||w);return v>3&&w&&Object.defineProperty(l,p,w),w},d=this&&this.__param||function(t,l){return function(p,_){l(p,_,t)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const a=o(5871),f=o(4725),g=o(844),S=o(2585),u={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=i.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,l,p,_,C,v,w){var D;super(),this._viewportElement=t,this._screenElement=l,this._bufferService=p,this._decorationService=_,this._renderService=C,this._optionsService=v,this._coreBrowserService=w,this._colorZoneStore=new a.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(),(D=this._viewportElement.parentElement)==null||D.insertBefore(this._canvas,this._viewportElement);const k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var O;(O=this._canvas)==null||O.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 t=Math.floor(this._canvas.width/3),l=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=t,r.center=l,r.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=r.left,s.right=r.left+r.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,l=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);u.left=l,u.center=l,u.right=l}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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 l of this._decorationService.decorations)this._colorZoneStore.addDecoration(l);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const l of t)l.position!=="full"&&this._renderColorZone(l);for(const l of t)l.position==="full"&&this._renderColorZone(l);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-u[t.position||"full"]/2),r[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[t.position||"full"]))}_queueRefresh(t,l){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=l||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=e=c([d(2,S.IBufferService),d(3,S.IDecorationService),d(4,f.IRenderService),d(5,S.IOptionsService),d(6,f.ICoreBrowserService)],e)},2950:function(E,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,p=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(u,r,s,e);else for(var _=u.length-1;_>=0;_--)(t=u[_])&&(p=(l<3?t(p):l>3?t(r,s,p):t(r,s))||p);return l>3&&p&&Object.defineProperty(r,s,p),p},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const a=o(4725),f=o(2585),g=o(2584);let S=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,r,s,e,t,l){this._textarea=u,this._compositionView=r,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=l,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,s=r.replace(u,"");this._dataAlreadySent=s,r.length>u.length?this._coreService.triggerDataEvent(s,!0):r.length<u.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):r.length===u.length&&r!==u&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const l=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}u||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=S=c([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,a.IRenderService)],S)},9806:(E,i)=>{function o(c,d,a){const f=a.getBoundingClientRect(),g=c.getComputedStyle(a),S=parseInt(g.getPropertyValue("padding-left")),u=parseInt(g.getPropertyValue("padding-top"));return[d.clientX-f.left-S,d.clientY-f.top-u]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=o,i.getCoords=function(c,d,a,f,g,S,u,r,s){if(!S)return;const e=o(c,d,a);return e?(e[0]=Math.ceil((e[0]+(s?u/2:0))/u),e[1]=Math.ceil(e[1]/r),e[0]=Math.min(Math.max(e[0],1),f+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),g),e):void 0}},9504:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const c=o(2584);function d(r,s,e,t){const l=r-a(r,e),p=s-a(s,e),_=Math.abs(l-p)-(function(C,v,w){let k=0;const D=C-a(C,w),O=v-a(v,w);for(let L=0;L<Math.abs(D-O);L++){const F=f(C,v)==="A"?-1:1,H=w.buffer.lines.get(D+F*L);H!=null&&H.isWrapped&&k++}return k})(r,s,e);return u(_,S(f(r,s),t))}function a(r,s){let e=0,t=s.buffer.lines.get(r),l=t==null?void 0:t.isWrapped;for(;l&&r>=0&&r<s.rows;)e++,t=s.buffer.lines.get(--r),l=t==null?void 0:t.isWrapped;return e}function f(r,s){return r>s?"A":"B"}function g(r,s,e,t,l,p){let _=r,C=s,v="";for(;_!==e||C!==t;)_+=l?1:-1,l&&_>p.cols-1?(v+=p.buffer.translateBufferLineToString(C,!1,r,_),_=0,r=0,C++):!l&&_<0&&(v+=p.buffer.translateBufferLineToString(C,!1,0,r+1),_=p.cols-1,r=_,C--);return v+p.buffer.translateBufferLineToString(C,!1,r,_)}function S(r,s){const e=s?"O":"[";return c.C0.ESC+e+r}function u(r,s){r=Math.floor(r);let e="";for(let t=0;t<r;t++)e+=s;return e}i.moveToCellSequence=function(r,s,e,t){const l=e.buffer.x,p=e.buffer.y;if(!e.buffer.hasScrollback)return(function(v,w,k,D,O,L){return d(w,D,O,L).length===0?"":u(g(v,w,v,w-a(w,O),!1,O).length,S("D",L))})(l,p,0,s,e,t)+d(p,s,e,t)+(function(v,w,k,D,O,L){let F;F=d(w,D,O,L).length>0?D-a(D,O):w;const H=D,j=(function(Q,U,y,I,R,P){let N;return N=d(y,I,R,P).length>0?I-a(I,R):U,Q<y&&N<=I||Q>=y&&N<I?"C":"D"})(v,w,k,D,O,L);return u(g(v,F,k,H,j==="C",O).length,S(j,L))})(l,p,r,s,e,t);let _;if(p===s)return _=l>r?"D":"C",u(Math.abs(l-r),S(_,t));_=p>s?"D":"C";const C=Math.abs(p-s);return u((function(v,w){return w.cols-v})(p>s?r:l,e)+(C-1)*e.cols+1+((p>s?l:r)-1),S(_,t))}},1296:function(E,i,o){var c=this&&this.__decorate||function(L,F,H,j){var Q,U=arguments.length,y=U<3?F:j===null?j=Object.getOwnPropertyDescriptor(F,H):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(L,F,H,j);else for(var I=L.length-1;I>=0;I--)(Q=L[I])&&(y=(U<3?Q(y):U>3?Q(F,H,y):Q(F,H))||y);return U>3&&y&&Object.defineProperty(F,H,y),y},d=this&&this.__param||function(L,F){return function(H,j){F(H,j,L)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const a=o(3787),f=o(2550),g=o(2223),S=o(6171),u=o(6052),r=o(4725),s=o(8055),e=o(8460),t=o(844),l=o(2585),p="xterm-dom-renderer-owner-",_="xterm-rows",C="xterm-fg-",v="xterm-bg-",w="xterm-focus",k="xterm-selection";let D=1,O=i.DomRenderer=class extends t.Disposable{constructor(L,F,H,j,Q,U,y,I,R,P,N,Y,Z){super(),this._terminal=L,this._document=F,this._element=H,this._screenElement=j,this._viewportElement=Q,this._helperContainer=U,this._linkifier2=y,this._charSizeService=R,this._optionsService=P,this._bufferService=N,this._coreBrowserService=Y,this._themeService=Z,this._terminalClass=D++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(_),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(k),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.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=I.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(p+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,t.toDisposable)((()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new f.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 H of this._rowElements)H.style.width=`${this.dimensions.css.canvas.width}px`,H.style.height=`${this.dimensions.css.cell.height}px`,H.style.lineHeight=`${this.dimensions.css.cell.height}px`,H.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${_} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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 F=`${this._terminalSelector} .${_} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${_} .xterm-dim { color: ${s.color.multiplyOpacity(L.foreground,.5).css};}`,F+=`${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 H=`blink_underline_${this._terminalClass}`,j=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${H} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${j} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Q} { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,F+=`${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${_}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[U,y]of L.ansi.entries())F+=`${this._terminalSelector} .${C}${U} { color: ${y.css}; }${this._terminalSelector} .${C}${U}.xterm-dim { color: ${s.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${v}${U} { background-color: ${y.css}; }`;F+=`${this._terminalSelector} .${C}${g.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(L.background).css}; }${this._terminalSelector} .${C}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${v}${g.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=F}_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,F){for(let H=this._rowElements.length;H<=F;H++){const j=this._document.createElement("div");this._rowContainer.appendChild(j),this._rowElements.push(j)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,F){this._refreshRowElements(L,F),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(w),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,F,H){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,F,H),this.renderRows(0,this._bufferService.rows-1),!L||!F)return;this._selectionRenderModel.update(this._terminal,L,F,H);const j=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||y<0)return;const I=this._document.createDocumentFragment();if(H){const R=L[0]>F[0];I.appendChild(this._createSelectionElement(U,R?F[0]:L[0],R?L[0]:F[0],y-U+1))}else{const R=j===U?L[0]:0,P=U===Q?F[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(U,R,P));const N=y-U-1;if(I.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,N)),U!==y){const Y=Q===y?F[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(y,0,Y))}}this._selectionContainer.appendChild(I)}_createSelectionElement(L,F,H,j=1){const Q=this._document.createElement("div"),U=F*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(H-F);return U+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-U),Q.style.height=j*this.dimensions.css.cell.height+"px",Q.style.top=L*this.dimensions.css.cell.height+"px",Q.style.left=`${U}px`,Q.style.width=`${y}px`,Q}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,F){const H=this._bufferService.buffer,j=H.ybase+H.y,Q=Math.min(H.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=L;R<=F;R++){const P=R+H.ydisp,N=this._rowElements[R],Y=H.lines.get(P);if(!N||!Y)break;N.replaceChildren(...this._rowFactory.createRow(Y,P,P===j,y,I,Q,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${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,F,H,j,Q,U){H<0&&(L=0),j<0&&(F=0);const y=this._bufferService.rows-1;H=Math.max(Math.min(H,y),0),j=Math.max(Math.min(j,y),0),Q=Math.min(Q,this._bufferService.cols);const I=this._bufferService.buffer,R=I.ybase+I.y,P=Math.min(I.x,Q-1),N=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=H;J<=j;++J){const M=J+I.ydisp,x=this._rowElements[J],K=I.lines.get(M);if(!x||!K)break;x.replaceChildren(...this._rowFactory.createRow(K,M,M===R,Y,Z,P,N,this.dimensions.css.cell.width,this._widthCache,U?J===H?L:0:-1,U?(J===j?F:Q)-1:-1))}}};i.DomRenderer=O=c([d(7,l.IInstantiationService),d(8,r.ICharSizeService),d(9,l.IOptionsService),d(10,l.IBufferService),d(11,r.ICoreBrowserService),d(12,r.IThemeService)],O)},3787:function(E,i,o){var c=this&&this.__decorate||function(_,C,v,w){var k,D=arguments.length,O=D<3?C:w===null?w=Object.getOwnPropertyDescriptor(C,v):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(_,C,v,w);else for(var L=_.length-1;L>=0;L--)(k=_[L])&&(O=(D<3?k(O):D>3?k(C,v,O):k(C,v))||O);return D>3&&O&&Object.defineProperty(C,v,O),O},d=this&&this.__param||function(_,C){return function(v,w){C(v,w,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const a=o(2223),f=o(643),g=o(511),S=o(2585),u=o(8055),r=o(4725),s=o(4269),e=o(6171),t=o(3734);let l=i.DomRendererRowFactory=class{constructor(_,C,v,w,k,D,O){this._document=_,this._characterJoinerService=C,this._optionsService=v,this._coreBrowserService=w,this._coreService=k,this._decorationService=D,this._themeService=O,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(_,C,v){this._selectionStart=_,this._selectionEnd=C,this._columnSelectMode=v}createRow(_,C,v,w,k,D,O,L,F,H,j){const Q=[],U=this._characterJoinerService.getJoinedCharacters(C),y=this._themeService.colors;let I,R=_.getNoBgTrimmedLength();v&&R<D+1&&(R=D+1);let P=0,N="",Y=0,Z=0,J=0,M=!1,x=0,K=!1,T=0;const q=[],z=H!==-1&&j!==-1;for(let X=0;X<R;X++){_.loadCell(X,this._workCell);let ee=this._workCell.getWidth();if(ee===0)continue;let te=!1,ie=X,$=this._workCell;if(U.length>0&&X===U[0][0]){te=!0;const re=U.shift();$=new s.JoinedCellData(this._workCell,_.translateToString(!0,re[0],re[1]),re[1]-re[0]),ie=re[1]-1,ee=$.getWidth()}const xe=this._isCellInSelection(X,C),me=v&&X===D,vt=z&&X>=H&&X<=j;let pt=!1;this._decorationService.forEachDecorationAtCell(X,C,void 0,(re=>{pt=!0}));let Ye=$.getChars()||f.WHITESPACE_CELL_CHAR;if(Ye===" "&&($.isUnderline()||$.isOverline())&&(Ye=" "),T=ee*L-F.get(Ye,$.isBold(),$.isItalic()),I){if(P&&(xe&&K||!xe&&!K&&$.bg===Y)&&(xe&&K&&y.selectionForeground||$.fg===Z)&&$.extended.ext===J&&vt===M&&T===x&&!me&&!te&&!pt){$.isInvisible()?N+=f.WHITESPACE_CELL_CHAR:N+=Ye,P++;continue}P&&(I.textContent=N),I=this._document.createElement("span"),P=0,N=""}else I=this._document.createElement("span");if(Y=$.bg,Z=$.fg,J=$.extended.ext,M=vt,x=T,K=xe,te&&D>=X&&D<=ie&&(D=X),!this._coreService.isCursorHidden&&me&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&q.push("xterm-cursor-blink"),q.push(w==="bar"?"xterm-cursor-bar":w==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(k)switch(k){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($.isBold()&&q.push("xterm-bold"),$.isItalic()&&q.push("xterm-italic"),$.isDim()&&q.push("xterm-dim"),N=$.isInvisible()?f.WHITESPACE_CELL_CHAR:$.getChars()||f.WHITESPACE_CELL_CHAR,$.isUnderline()&&(q.push(`xterm-underline-${$.extended.underlineStyle}`),N===" "&&(N=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB($.getUnderlineColor()).join(",")})`;else{let re=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&re<8&&(re+=8),I.style.textDecorationColor=y.ansi[re].css}$.isOverline()&&(q.push("xterm-overline"),N===" "&&(N=" ")),$.isStrikethrough()&&q.push("xterm-strikethrough"),vt&&(I.style.textDecoration="underline");let ae=$.getFgColor(),Me=$.getFgColorMode(),he=$.getBgColor(),He=$.getBgColorMode();const _t=!!$.isInverse();if(_t){const re=ae;ae=he,he=re;const fi=Me;Me=He,He=fi}let Se,Ve,Ce,Fe=!1;switch(this._decorationService.forEachDecorationAtCell(X,C,void 0,(re=>{re.options.layer!=="top"&&Fe||(re.backgroundColorRGB&&(He=50331648,he=re.backgroundColorRGB.rgba>>8&16777215,Se=re.backgroundColorRGB),re.foregroundColorRGB&&(Me=50331648,ae=re.foregroundColorRGB.rgba>>8&16777215,Ve=re.foregroundColorRGB),Fe=re.options.layer==="top")})),!Fe&&xe&&(Se=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=Se.rgba>>8&16777215,He=50331648,Fe=!0,y.selectionForeground&&(Me=50331648,ae=y.selectionForeground.rgba>>8&16777215,Ve=y.selectionForeground)),Fe&&q.push("xterm-decoration-top"),He){case 16777216:case 33554432:Ce=y.ansi[he],q.push(`xterm-bg-${he}`);break;case 50331648:Ce=u.channels.toColor(he>>16,he>>8&255,255&he),this._addStyle(I,`background-color:#${p((he>>>0).toString(16),"0",6)}`);break;default:_t?(Ce=y.foreground,q.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ce=y.background}switch(Se||$.isDim()&&(Se=u.color.multiplyOpacity(Ce,.5)),Me){case 16777216:case 33554432:$.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(I,Ce,y.ansi[ae],$,Se,void 0)||q.push(`xterm-fg-${ae}`);break;case 50331648:const re=u.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(I,Ce,re,$,Se,Ve)||this._addStyle(I,`color:#${p(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,Ce,y.foreground,$,Se,Ve)||_t&&q.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}q.length&&(I.className=q.join(" "),q.length=0),me||te||pt?I.textContent=N:P++,T!==this.defaultSpacing&&(I.style.letterSpacing=`${T}px`),Q.push(I),X=ie}return I&&P&&(I.textContent=N),Q}_applyMinimumContrast(_,C,v,w,k,D){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(w.getCode()))return!1;const O=this._getContrastCache(w);let L;if(k||D||(L=O.getColor(C.rgba,v.rgba)),L===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(w.isDim()?2:1);L=u.color.ensureContrastRatio(k||C,D||v,F),O.setColor((k||C).rgba,(D||v).rgba,L??null)}return!!L&&(this._addStyle(_,`color:${L.css}`),!0)}_getContrastCache(_){return _.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(_,C){_.setAttribute("style",`${_.getAttribute("style")||""}${C};`)}_isCellInSelection(_,C){const v=this._selectionStart,w=this._selectionEnd;return!(!v||!w)&&(this._columnSelectMode?v[0]<=w[0]?_>=v[0]&&C>=v[1]&&_<w[0]&&C<=w[1]:_<v[0]&&C>=v[1]&&_>=w[0]&&C<=w[1]:C>v[1]&&C<w[1]||v[1]===w[1]&&C===v[1]&&_>=v[0]&&_<w[0]||v[1]<w[1]&&C===w[1]&&_<w[0]||v[1]<w[1]&&C===v[1]&&_>=v[0])}};function p(_,C,v){for(;_.length<v;)_=C+_;return _}i.DomRendererRowFactory=l=c([d(1,r.ICharacterJoinerService),d(2,S.IOptionsService),d(3,r.ICoreBrowserService),d(4,S.ICoreService),d(5,S.IDecorationService),d(6,r.IThemeService)],l)},2550:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 d=o.createElement("span");d.classList.add("xterm-char-measure-element");const a=o.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const g=o.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[d,a,f,g],this._container.appendChild(d),this._container.appendChild(a),this._container.appendChild(f),this._container.appendChild(g),c.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(o,c,d,a){o===this._font&&c===this._fontSize&&d===this._weight&&a===this._weightBold||(this._font=o,this._fontSize=c,this._weight=d,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(o,c,d){let a=0;if(!c&&!d&&o.length===1&&(a=o.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const S=this._measure(o,0);return S>0&&(this._flat[a]=S),S}let f=o;c&&(f+="B"),d&&(f+="I");let g=this._holey.get(f);if(g===void 0){let S=0;c&&(S|=1),d&&(S|=2),g=this._measure(o,S),g>0&&this._holey.set(f,g)}return g}_measure(o,c){const d=this._measureElements[c];return d.textContent=o.repeat(32),d.offsetWidth/32}}},2223:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(E,i)=>{function o(d){return 57508<=d&&d<=57558}function c(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},i.isPowerlineGlyph=o,i.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},i.isEmoji=c,i.allowRescaling=function(d,a,f,g){return a===1&&f>Math.ceil(1.5*g)&&d!==void 0&&d>255&&!c(d)&&!o(d)&&!(function(S){return 57344<=S&&S<=63743})(d)},i.treatGlyphAsBackgroundColor=function(d){return o(d)||(function(a){return 9472<=a&&a<=9631})(d)},i.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}}}},i.computeNextVariantOffset=function(d,a,f=0){return(d-(2*Math.round(a)-f))%(2*Math.round(a))}},6052:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class o{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(d,a,f,g=!1){if(this.selectionStart=a,this.selectionEnd=f,!a||!f||a[0]===f[0]&&a[1]===f[1])return void this.clear();const S=d.buffers.active.ydisp,u=a[1]-S,r=f[1]-S,s=Math.max(u,0),e=Math.min(r,d.rows-1);s>=d.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=u,this.viewportEndRow=r,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=a[0],this.endCol=f[0])}isCellSelected(d,a,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&f>=this.viewportCappedStartRow&&a<this.endCol&&f<=this.viewportCappedEndRow:a<this.startCol&&f>=this.viewportCappedStartRow&&a>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol)}}i.createSelectionRenderModel=function(){return new o}},456:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const a=o(2585),f=o(8460),g=o(844);let S=i.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new r(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};i.CharSizeService=S=c([d(2,a.IOptionsService)],S);class u extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,l){t!==void 0&&t>0&&l!==void 0&&l>0&&(this._result.width=t,this._result.height=l)}}class r extends u{constructor(t,l,p){super(),this._document=t,this._parentElement=l,this._optionsService=p,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 s extends u{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const l=this._ctx.measureText("W");if(!("width"in l&&"fontBoundingBoxAscent"in l&&"fontBoundingBoxDescent"in l))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(E,i,o){var c=this&&this.__decorate||function(s,e,t,l){var p,_=arguments.length,C=_<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(s,e,t,l);else for(var v=s.length-1;v>=0;v--)(p=s[v])&&(C=(_<3?p(C):_>3?p(e,t,C):p(e,t))||C);return _>3&&C&&Object.defineProperty(e,t,C),C},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const a=o(3734),f=o(643),g=o(511),S=o(2585);class u extends a.AttributeData{constructor(e,t,l){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=l}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=u;let r=i.CharacterJoinerService=class xr{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];const l=[],p=t.translateToString(!0);let _=0,C=0,v=0,w=t.getFg(0),k=t.getBg(0);for(let D=0;D<t.getTrimmedLength();D++)if(t.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==w||this._workCell.bg!==k){if(D-_>1){const O=this._getJoinedRanges(p,v,C,t,_);for(let L=0;L<O.length;L++)l.push(O[L])}_=D,v=C,w=this._workCell.fg,k=this._workCell.bg}C+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-_>1){const D=this._getJoinedRanges(p,v,C,t,_);for(let O=0;O<D.length;O++)l.push(D[O])}return l}_getJoinedRanges(e,t,l,p,_){const C=e.substring(t,l);let v=[];try{v=this._characterJoiners[0].handler(C)}catch(w){console.error(w)}for(let w=1;w<this._characterJoiners.length;w++)try{const k=this._characterJoiners[w].handler(C);for(let D=0;D<k.length;D++)xr._mergeRanges(v,k[D])}catch(k){console.error(k)}return this._stringRangesToCellRanges(v,p,_),v}_stringRangesToCellRanges(e,t,l){let p=0,_=!1,C=0,v=e[p];if(v){for(let w=l;w<this._bufferService.cols;w++){const k=t.getWidth(w),D=t.getString(w).length||f.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!_&&v[0]<=C&&(v[0]=w,_=!0),v[1]<=C){if(v[1]=w,v=e[++p],!v)break;v[0]<=C?(v[0]=w,_=!0):_=!1}C+=D}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let l=!1;for(let p=0;p<e.length;p++){const _=e[p];if(l){if(t[1]<=_[0])return e[p-1][1]=t[1],e;if(t[1]<=_[1])return e[p-1][1]=Math.max(t[1],_[1]),e.splice(p,1),e;e.splice(p,1),p--}else{if(t[1]<=_[0])return e.splice(p,0,t),e;if(t[1]<=_[1])return _[0]=Math.min(t[0],_[0]),e;t[0]<_[1]&&(_[0]=Math.min(t[0],_[0]),l=!0)}}return l?e[e.length-1][1]=t[1]:e.push(t),e}};i.CharacterJoinerService=r=c([d(0,S.IBufferService)],r)},5114:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const c=o(844),d=o(8460),a=o(3656);class f extends c.Disposable{constructor(u,r,s){super(),this._textarea=u,this._window=r,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,d.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(u){this._window!==u&&(this._window=u,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}}i.CoreBrowserService=f;class g extends c.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)==null||u.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:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const c=o(844);class d extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const g=this.linkProviders.indexOf(f);g!==-1&&this.linkProviders.splice(g,1)}}}}i.LinkProviderService=d},8934:function(E,i,o){var c=this&&this.__decorate||function(S,u,r,s){var e,t=arguments.length,l=t<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,u,r,s);else for(var p=S.length-1;p>=0;p--)(e=S[p])&&(l=(t<3?e(l):t>3?e(u,r,l):e(u,r))||l);return t>3&&l&&Object.defineProperty(u,r,l),l},d=this&&this.__param||function(S,u){return function(r,s){u(r,s,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const a=o(4725),f=o(9806);let g=i.MouseService=class{constructor(S,u){this._renderService=S,this._charSizeService=u}getCoords(S,u,r,s,e){return(0,f.getCoords)(window,S,u,r,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(S,u){const r=(0,f.getCoordsRelativeToElement)(window,S,u);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};i.MouseService=g=c([d(0,a.IRenderService),d(1,a.ICharSizeService)],g)},3230:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const a=o(6193),f=o(4725),g=o(8460),S=o(844),u=o(7226),r=o(2585);let s=i.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,l,p,_,C,v,w){super(),this._rowCount=e,this._charSizeService=p,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((k,D)=>this._renderRows(k,D)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var k;return(k=this._renderer.value)==null?void 0:k.clear()}))),this.register(l.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(_.onDecorationRegistered((()=>this._fullRefresh()))),this.register(_.onDecorationRemoved((()=>this._fullRefresh()))),this.register(l.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(l.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(w.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,t),this.register(v.onWindowChange((k=>this._registerIntersectionObserver(k,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const l=new e.IntersectionObserver((p=>this._handleIntersectionChange(p[p.length-1])),{threshold:0});l.observe(t),this._observerDisposable.value=(0,S.toDisposable)((()=>l.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,l=!1){this._isPaused?this._needsFullRefresh=!0:(l||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((t=>this.refreshRows(t.start,t.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var l;return(l=this._renderer.value)==null?void 0:l.handleResize(e,t)})):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,l){var p;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=l,(p=this._renderer.value)==null||p.handleSelectionChanged(e,t,l)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};i.RenderService=s=c([d(2,r.IOptionsService),d(3,f.ICharSizeService),d(4,r.IDecorationService),d(5,r.IBufferService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],s)},9312:function(E,i,o){var c=this&&this.__decorate||function(v,w,k,D){var O,L=arguments.length,F=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,k):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(v,w,k,D);else for(var H=v.length-1;H>=0;H--)(O=v[H])&&(F=(L<3?O(F):L>3?O(w,k,F):O(w,k))||F);return L>3&&F&&Object.defineProperty(w,k,F),F},d=this&&this.__param||function(v,w){return function(k,D){w(k,D,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const a=o(9806),f=o(9504),g=o(456),S=o(4725),u=o(8460),r=o(844),s=o(6114),e=o(4841),t=o(511),l=o(2585),p=" ",_=new RegExp(p,"g");let C=i.SelectionService=class extends r.Disposable{constructor(v,w,k,D,O,L,F,H,j){super(),this._element=v,this._screenElement=w,this._linkifier=k,this._bufferService=D,this._coreService=O,this._mouseService=L,this._optionsService=F,this._renderService=H,this._coreBrowserService=j,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!v||!w||v[0]===w[0]&&v[1]===w[1])}get selectionText(){const v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!v||!w)return"";const k=this._bufferService.buffer,D=[];if(this._activeSelectionMode===3){if(v[0]===w[0])return"";const O=v[0]<w[0]?v[0]:w[0],L=v[0]<w[0]?w[0]:v[0];for(let F=v[1];F<=w[1];F++){const H=k.translateBufferLineToString(F,!0,O,L);D.push(H)}}else{const O=v[1]===w[1]?w[0]:void 0;D.push(k.translateBufferLineToString(v[1],!0,v[0],O));for(let L=v[1]+1;L<=w[1]-1;L++){const F=k.lines.get(L),H=k.translateBufferLineToString(L,!0);F!=null&&F.isWrapped?D[D.length-1]+=H:D.push(H)}if(v[1]!==w[1]){const L=k.lines.get(w[1]),F=k.translateBufferLineToString(w[1],!0,0,w[0]);L&&L.isWrapped?D[D.length-1]+=F:D.push(F)}}return D.map((O=>O.replace(_," "))).join(s.isWindows?`\r
|
|
16
16
|
`:`
|
|
17
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&v&&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(v){const w=this._getMouseBufferCoords(v),k=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!!(k&&D&&w)&&this._areCoordsInSelection(w,k,D)}isCellInSelection(v,w){const k=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!k||!D)&&this._areCoordsInSelection([v,w],k,D)}_areCoordsInSelection(v,w,k){return v[1]>w[1]&&v[1]<k[1]||w[1]===k[1]&&v[1]===w[1]&&v[0]>=w[0]&&v[0]<k[0]||w[1]<k[1]&&v[1]===k[1]&&v[0]<k[0]||w[1]<k[1]&&v[1]===w[1]&&v[0]>=w[0]}_selectWordAtCursor(v,w){var O,L;const k=(L=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:L.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(v);return!!D&&(this._selectWordAt(D,w),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,w){this._model.clearSelection(),v=Math.max(v,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const w=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w}_getMouseEventScrollAmount(v){let w=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const k=this._renderService.dimensions.css.canvas.height;return w>=0&&w<=k?0:(w>k&&(w-=k),w=Math.min(Math.max(w,-50),50),w/=50,w/Math.abs(w)+Math.round(14*w))}shouldForceSelection(v){return s.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const w=this._getMouseBufferCoords(v);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))}shouldColumnSelect(v){return v.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const w=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const k=this._bufferService.buffer;if(this._model.selectionEnd[1]<k.lines.length){const D=k.lines.get(this._model.selectionEnd[1]);D&&D.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const w=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const k=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(k&&k[0]!==void 0&&k[1]!==void 0){const D=(0,f.moveToCellSequence)(k[0]-1,k[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(D,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd,k=!(!v||!w||v[0]===w[0]&&v[1]===w[1]);k?v&&w&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&w[0]===this._oldSelectionEnd[0]&&w[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,w,k)):this._oldHasSelection&&this._fireOnSelectionChange(v,w,k)}_fireOnSelectionChange(v,w,k){this._oldSelectionStart=v,this._oldSelectionEnd=w,this._oldHasSelection=k,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((w=>this._handleTrim(w)))}_convertViewportColToCharacterIndex(v,w){let k=w;for(let D=0;w>=D;D++){const O=v.loadCell(D,this._workCell).getChars().length;this._workCell.getWidth()===0?k--:O>1&&w!==D&&(k+=O-1)}return k}setSelection(v,w,k){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,w],this._model.selectionStartLength=k,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,w,k=!0,D=!0){if(v[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,L=O.lines.get(v[1]);if(!L)return;const F=O.translateBufferLineToString(v[1],!1);let H=this._convertViewportColToCharacterIndex(L,v[0]),W=H;const G=v[0]-H;let U=0,y=0,R=0,I=0;if(F.charAt(H)===" "){for(;H>0&&F.charAt(H-1)===" ";)H--;for(;W<F.length&&F.charAt(W+1)===" ";)W++}else{let Y=v[0],X=v[0];L.getWidth(Y)===0&&(U++,Y--),L.getWidth(X)===2&&(y++,X++);const J=L.getString(X).length;for(J>1&&(I+=J-1,W+=J-1);Y>0&&H>0&&!this._isCharWordSeparator(L.loadCell(Y-1,this._workCell));){L.loadCell(Y-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,Y--):T>1&&(R+=T-1,H-=T-1),H--,Y--}for(;X<L.length&&W+1<F.length&&!this._isCharWordSeparator(L.loadCell(X+1,this._workCell));){L.loadCell(X+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,X++):T>1&&(I+=T-1,W+=T-1),W++,X++}}W++;let P=H+G-U+R,z=Math.min(this._bufferService.cols,W-H+U+y-R-I);if(w||F.slice(H,W).trim()!==""){if(k&&P===0&&L.getCodePoint(0)!==32){const Y=O.lines.get(v[1]-1);if(Y&&L.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(X){const J=this._bufferService.cols-X.start;P-=J,z+=J}}}if(D&&P+z===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const Y=O.lines.get(v[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const X=this._getWordAt([0,v[1]+1],!1,!1,!0);X&&(z+=X.length)}}return{start:P,length:z}}}_selectWordAt(v,w){const k=this._getWordAt(v,w);if(k){for(;k.start<0;)k.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[k.start,v[1]],this._model.selectionStartLength=k.length}}_selectToWordAt(v){const w=this._getWordAt(v,!0);if(w){let k=v[1];for(;w.start<0;)w.start+=this._bufferService.cols,k--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,k++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,k]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const w=this._bufferService.buffer.getWrappedRangeForLine(v),k={start:{x:0,y:w.first},end:{x:this._bufferService.cols-1,y:w.last}};this._model.selectionStart=[0,w.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(k,this._bufferService.cols)}};i.SelectionService=C=c([d(3,l.IBufferService),d(4,l.ICoreService),d(5,S.IMouseService),d(6,l.IOptionsService),d(7,S.IRenderService),d(8,S.ICoreBrowserService)],C)},4725:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const c=o(8343);i.ICharSizeService=(0,c.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),i.IMouseService=(0,c.createDecorator)("MouseService"),i.IRenderService=(0,c.createDecorator)("RenderService"),i.ISelectionService=(0,c.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,c.createDecorator)("ThemeService"),i.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(E,i,o){var c=this&&this.__decorate||function(C,v,w,k){var D,O=arguments.length,L=O<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,v,w,k);else for(var F=C.length-1;F>=0;F--)(D=C[F])&&(L=(O<3?D(L):O>3?D(v,w,L):D(v,w))||L);return O>3&&L&&Object.defineProperty(v,w,L),L},d=this&&this.__param||function(C,v){return function(w,k){v(w,k,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const a=o(7239),f=o(8055),g=o(8460),S=o(844),u=o(2585),r=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),e=f.css.toColor("#ffffff"),t=f.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let w=0;w<216;w++){const k=v[w/36%6|0],D=v[w/6%6|0],O=v[w%6];C.push({css:f.channels.toCss(k,D,O),rgba:f.channels.toRgba(k,D,O)})}for(let w=0;w<24;w++){const k=8+10*w;C.push({css:f.channels.toCss(k,k,k),rgba:f.channels.toRgba(k,k,k)})}return C})());let p=i.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:f.color.blend(s,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:f.color.blend(s,l),ansi:i.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(C={}){const v=this._colors;if(v.foreground=_(C.foreground,r),v.background=_(C.background,s),v.cursor=_(C.cursor,e),v.cursorAccent=_(C.cursorAccent,t),v.selectionBackgroundTransparent=_(C.selectionBackground,l),v.selectionBackgroundOpaque=f.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=_(C.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=f.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=C.selectionForeground?_(C.selectionForeground,f.NULL_COLOR):void 0,v.selectionForeground===f.NULL_COLOR&&(v.selectionForeground=void 0),f.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=f.color.opacity(v.selectionBackgroundTransparent,.3)),f.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=f.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=i.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=_(C.black,i.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=_(C.red,i.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=_(C.green,i.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=_(C.yellow,i.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=_(C.blue,i.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=_(C.magenta,i.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=_(C.cyan,i.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=_(C.white,i.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=_(C.brightBlack,i.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=_(C.brightRed,i.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=_(C.brightGreen,i.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=_(C.brightYellow,i.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=_(C.brightBlue,i.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=_(C.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=_(C.brightCyan,i.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=_(C.brightWhite,i.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const w=Math.min(v.ansi.length-16,C.extendedAnsi.length);for(let k=0;k<w;k++)v.ansi[k+16]=_(C.extendedAnsi[k],i.DEFAULT_ANSI_COLORS[k+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(C){C(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,v){if(C!==void 0)try{return f.css.toColor(C)}catch{}return v}i.ThemeService=p=c([d(0,u.IOptionsService)],p)},6349:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const c=o(8460),d=o(844);class a extends d.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(g){if(this._maxLength===g)return;const S=new Array(g);for(let u=0;u<Math.min(g,this.length);u++)S[u]=this._array[this._getCyclicIndex(u)];this._array=S,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let S=this._length;S<g;S++)this._array[S]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,S){this._array[this._getCyclicIndex(g)]=S}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,S,...u){if(S){for(let r=g;r<this._length-S;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+S)];this._length-=S,this.onDeleteEmitter.fire({index:g,amount:S})}for(let r=this._length-1;r>=g;r--)this._array[this._getCyclicIndex(r+u.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<u.length;r++)this._array[this._getCyclicIndex(g+r)]=u[r];if(u.length&&this.onInsertEmitter.fire({index:g,amount:u.length}),this._length+u.length>this._maxLength){const r=this._length+u.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=u.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,u){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let s=S-1;s>=0;s--)this.set(g+s+u,this.get(g+s));const r=g+S+u-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<S;r++)this.set(g+r+u,this.get(g+r))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}i.CircularList=a},1439:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function o(c,d=5){if(typeof c!="object")return c;const a=Array.isArray(c)?[]:{};for(const f in c)a[f]=d<=1?c[f]:c[f]&&o(c[f],d-1);return a}},8055:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let o=0,c=0,d=0,a=0;var f,g,S,u,r;function s(t){const l=t.toString(16);return l.length<2?"0"+l:l}function e(t,l){return t<l?(l+.05)/(t+.05):(t+.05)/(l+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(l,p,_,C){return C!==void 0?`#${s(l)}${s(p)}${s(_)}${s(C)}`:`#${s(l)}${s(p)}${s(_)}`},t.toRgba=function(l,p,_,C=255){return(l<<24|p<<16|_<<8|C)>>>0},t.toColor=function(l,p,_,C){return{css:t.toCss(l,p,_,C),rgba:t.toRgba(l,p,_,C)}}})(f||(i.channels=f={})),(function(t){function l(p,_){return a=Math.round(255*_),[o,c,d]=r.toChannels(p.rgba),{css:f.toCss(o,c,d,a),rgba:f.toRgba(o,c,d,a)}}t.blend=function(p,_){if(a=(255&_.rgba)/255,a===1)return{css:_.css,rgba:_.rgba};const C=_.rgba>>24&255,v=_.rgba>>16&255,w=_.rgba>>8&255,k=p.rgba>>24&255,D=p.rgba>>16&255,O=p.rgba>>8&255;return o=k+Math.round((C-k)*a),c=D+Math.round((v-D)*a),d=O+Math.round((w-O)*a),{css:f.toCss(o,c,d),rgba:f.toRgba(o,c,d)}},t.isOpaque=function(p){return(255&p.rgba)==255},t.ensureContrastRatio=function(p,_,C){const v=r.ensureContrastRatio(p.rgba,_.rgba,C);if(v)return f.toColor(v>>24&255,v>>16&255,v>>8&255)},t.opaque=function(p){const _=(255|p.rgba)>>>0;return[o,c,d]=r.toChannels(_),{css:f.toCss(o,c,d),rgba:_}},t.opacity=l,t.multiplyOpacity=function(p,_){return a=255&p.rgba,l(p,a*_/255)},t.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}})(g||(i.color=g={})),(function(t){let l,p;try{const _=document.createElement("canvas");_.width=1,_.height=1;const C=_.getContext("2d",{willReadFrequently:!0});C&&(l=C,l.globalCompositeOperation="copy",p=l.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return o=parseInt(_.slice(1,2).repeat(2),16),c=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),f.toColor(o,c,d);case 5:return o=parseInt(_.slice(1,2).repeat(2),16),c=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),a=parseInt(_.slice(4,5).repeat(2),16),f.toColor(o,c,d,a);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}const 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(C)return o=parseInt(C[1]),c=parseInt(C[2]),d=parseInt(C[3]),a=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),f.toColor(o,c,d,a);if(!l||!p)throw new Error("css.toColor: Unsupported css format");if(l.fillStyle=p,l.fillStyle=_,typeof l.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(l.fillRect(0,0,1,1),[o,c,d,a]=l.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(o,c,d,a),css:_}}})(S||(i.css=S={})),(function(t){function l(p,_,C){const v=p/255,w=_/255,k=C/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}t.relativeLuminance=function(p){return l(p>>16&255,p>>8&255,255&p)},t.relativeLuminance2=l})(u||(i.rgb=u={})),(function(t){function l(_,C,v){const w=_>>24&255,k=_>>16&255,D=_>>8&255;let O=C>>24&255,L=C>>16&255,F=C>>8&255,H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));for(;H<v&&(O>0||L>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),L-=Math.max(0,Math.ceil(.1*L)),F-=Math.max(0,Math.ceil(.1*F)),H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));return(O<<24|L<<16|F<<8|255)>>>0}function p(_,C,v){const w=_>>24&255,k=_>>16&255,D=_>>8&255;let O=C>>24&255,L=C>>16&255,F=C>>8&255,H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));for(;H<v&&(O<255||L<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),L=Math.min(255,L+Math.ceil(.1*(255-L))),F=Math.min(255,F+Math.ceil(.1*(255-F))),H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));return(O<<24|L<<16|F<<8|255)>>>0}t.blend=function(_,C){if(a=(255&C)/255,a===1)return C;const v=C>>24&255,w=C>>16&255,k=C>>8&255,D=_>>24&255,O=_>>16&255,L=_>>8&255;return o=D+Math.round((v-D)*a),c=O+Math.round((w-O)*a),d=L+Math.round((k-L)*a),f.toRgba(o,c,d)},t.ensureContrastRatio=function(_,C,v){const w=u.relativeLuminance(_>>8),k=u.relativeLuminance(C>>8);if(e(w,k)<v){if(k<w){const L=l(_,C,v),F=e(w,u.relativeLuminance(L>>8));if(F<v){const H=p(_,C,v);return F>e(w,u.relativeLuminance(H>>8))?L:H}return L}const D=p(_,C,v),O=e(w,u.relativeLuminance(D>>8));if(O<v){const L=l(_,C,v);return O>e(w,u.relativeLuminance(L>>8))?D:L}return D}},t.reduceLuminance=l,t.increaseLuminance=p,t.toChannels=function(_){return[_>>24&255,_>>16&255,_>>8&255,255&_]}})(r||(i.rgba=r={})),i.toPaddedHex=s,i.contrastRatio=e},8969:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const c=o(844),d=o(2585),a=o(4348),f=o(7866),g=o(744),S=o(7302),u=o(6975),r=o(8460),s=o(1753),e=o(1480),t=o(7994),l=o(9282),p=o(5435),_=o(5981),C=o(2660);let v=!1;class w extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((D=>{var O;(O=this._onScrollApi)==null||O.fire(D.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(D){for(const O in D)this.optionsService.options[O]=D[O]}constructor(D){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new S.OptionsService(D)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((O=>{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((O=>{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 _.WriteBuffer(((O,L)=>this._inputHandler.parse(O,L)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(D,O){this._writeBuffer.write(D,O)}writeSync(D,O){this._logService.logLevel<=d.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(D,O)}input(D,O=!0){this.coreService.triggerDataEvent(D,O)}resize(D,O){isNaN(D)||isNaN(O)||(D=Math.max(D,g.MINIMUM_COLS),O=Math.max(O,g.MINIMUM_ROWS),this._bufferService.resize(D,O))}scroll(D,O=!1){this._bufferService.scroll(D,O)}scrollLines(D,O,L){this._bufferService.scrollLines(D,O,L)}scrollPages(D){this.scrollLines(D*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(D){const O=D-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(D,O){return this._inputHandler.registerEscHandler(D,O)}registerDcsHandler(D,O){return this._inputHandler.registerDcsHandler(D,O)}registerCsiHandler(D,O){return this._inputHandler.registerCsiHandler(D,O)}registerOscHandler(D,O){return this._inputHandler.registerOscHandler(D,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let D=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?D=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(D=!0),D?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const D=[];D.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),D.push(this.registerCsiHandler({final:"H"},(()=>((0,l.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const O of D)O.dispose()}))}}}i.CoreTerminal=w},8460:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const d=[];for(let a=0;a<this._listeners.length;a++)d.push(this._listeners[a]);for(let a=0;a<d.length;a++)d[a].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o((d=>c.fire(d)))},i.runAndSubscribe=function(o,c){return c(void 0),o((d=>c(d)))}},5435:function(E,i,o){var c=this&&this.__decorate||function(U,y,R,I){var P,z=arguments.length,Y=z<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,R):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(U,y,R,I);else for(var X=U.length-1;X>=0;X--)(P=U[X])&&(Y=(z<3?P(Y):z>3?P(y,R,Y):P(y,R))||Y);return z>3&&Y&&Object.defineProperty(y,R,Y),Y},d=this&&this.__param||function(U,y){return function(R,I){y(R,I,U)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const a=o(2584),f=o(7116),g=o(2015),S=o(844),u=o(482),r=o(8437),s=o(8460),e=o(643),t=o(511),l=o(3734),p=o(2585),_=o(1480),C=o(6242),v=o(6351),w=o(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function O(U,y){if(U>24)return y.setWinLines||!1;switch(U){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var L;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(i.WindowsOptionsReportType=L={}));let F=0;class H extends S.Disposable{getAttrData(){return this._curAttrData}constructor(y,R,I,P,z,Y,X,J,T=new g.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=R,this._coreService=I,this._logService=P,this._optionsService=z,this._oscLinkService=Y,this._coreMouseService=X,this._unicodeService=J,this._parser=T,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._parser.setCsiHandlerFallback(((x,M)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(x),params:M.toArray()})})),this._parser.setEscHandlerFallback((x=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(x)})})),this._parser.setExecuteHandlerFallback((x=>{this._logService.debug("Unknown EXECUTE code: ",{code:x})})),this._parser.setOscHandlerFallback(((x,M,j)=>{this._logService.debug("Unknown OSC code: ",{identifier:x,action:M,data:j})})),this._parser.setDcsHandlerFallback(((x,M,j)=>{M==="HOOK"&&(j=j.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(x),action:M,payload:j})})),this._parser.setPrintHandler(((x,M,j)=>this.print(x,M,j))),this._parser.registerCsiHandler({final:"@"},(x=>this.insertChars(x))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(x=>this.scrollLeft(x))),this._parser.registerCsiHandler({final:"A"},(x=>this.cursorUp(x))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(x=>this.scrollRight(x))),this._parser.registerCsiHandler({final:"B"},(x=>this.cursorDown(x))),this._parser.registerCsiHandler({final:"C"},(x=>this.cursorForward(x))),this._parser.registerCsiHandler({final:"D"},(x=>this.cursorBackward(x))),this._parser.registerCsiHandler({final:"E"},(x=>this.cursorNextLine(x))),this._parser.registerCsiHandler({final:"F"},(x=>this.cursorPrecedingLine(x))),this._parser.registerCsiHandler({final:"G"},(x=>this.cursorCharAbsolute(x))),this._parser.registerCsiHandler({final:"H"},(x=>this.cursorPosition(x))),this._parser.registerCsiHandler({final:"I"},(x=>this.cursorForwardTab(x))),this._parser.registerCsiHandler({final:"J"},(x=>this.eraseInDisplay(x,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(x=>this.eraseInDisplay(x,!0))),this._parser.registerCsiHandler({final:"K"},(x=>this.eraseInLine(x,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(x=>this.eraseInLine(x,!0))),this._parser.registerCsiHandler({final:"L"},(x=>this.insertLines(x))),this._parser.registerCsiHandler({final:"M"},(x=>this.deleteLines(x))),this._parser.registerCsiHandler({final:"P"},(x=>this.deleteChars(x))),this._parser.registerCsiHandler({final:"S"},(x=>this.scrollUp(x))),this._parser.registerCsiHandler({final:"T"},(x=>this.scrollDown(x))),this._parser.registerCsiHandler({final:"X"},(x=>this.eraseChars(x))),this._parser.registerCsiHandler({final:"Z"},(x=>this.cursorBackwardTab(x))),this._parser.registerCsiHandler({final:"`"},(x=>this.charPosAbsolute(x))),this._parser.registerCsiHandler({final:"a"},(x=>this.hPositionRelative(x))),this._parser.registerCsiHandler({final:"b"},(x=>this.repeatPrecedingCharacter(x))),this._parser.registerCsiHandler({final:"c"},(x=>this.sendDeviceAttributesPrimary(x))),this._parser.registerCsiHandler({prefix:">",final:"c"},(x=>this.sendDeviceAttributesSecondary(x))),this._parser.registerCsiHandler({final:"d"},(x=>this.linePosAbsolute(x))),this._parser.registerCsiHandler({final:"e"},(x=>this.vPositionRelative(x))),this._parser.registerCsiHandler({final:"f"},(x=>this.hVPosition(x))),this._parser.registerCsiHandler({final:"g"},(x=>this.tabClear(x))),this._parser.registerCsiHandler({final:"h"},(x=>this.setMode(x))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(x=>this.setModePrivate(x))),this._parser.registerCsiHandler({final:"l"},(x=>this.resetMode(x))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(x=>this.resetModePrivate(x))),this._parser.registerCsiHandler({final:"m"},(x=>this.charAttributes(x))),this._parser.registerCsiHandler({final:"n"},(x=>this.deviceStatus(x))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(x=>this.deviceStatusPrivate(x))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(x=>this.softReset(x))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(x=>this.setCursorStyle(x))),this._parser.registerCsiHandler({final:"r"},(x=>this.setScrollRegion(x))),this._parser.registerCsiHandler({final:"s"},(x=>this.saveCursor(x))),this._parser.registerCsiHandler({final:"t"},(x=>this.windowOptions(x))),this._parser.registerCsiHandler({final:"u"},(x=>this.restoreCursor(x))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(x=>this.insertColumns(x))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(x=>this.deleteColumns(x))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(x=>this.selectProtected(x))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(x=>this.requestMode(x,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(x=>this.requestMode(x,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((x=>(this.setTitle(x),this.setIconName(x),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((x=>this.setIconName(x)))),this._parser.registerOscHandler(2,new C.OscHandler((x=>this.setTitle(x)))),this._parser.registerOscHandler(4,new C.OscHandler((x=>this.setOrReportIndexedColor(x)))),this._parser.registerOscHandler(8,new C.OscHandler((x=>this.setHyperlink(x)))),this._parser.registerOscHandler(10,new C.OscHandler((x=>this.setOrReportFgColor(x)))),this._parser.registerOscHandler(11,new C.OscHandler((x=>this.setOrReportBgColor(x)))),this._parser.registerOscHandler(12,new C.OscHandler((x=>this.setOrReportCursorColor(x)))),this._parser.registerOscHandler(104,new C.OscHandler((x=>this.restoreIndexedColor(x)))),this._parser.registerOscHandler(110,new C.OscHandler((x=>this.restoreFgColor(x)))),this._parser.registerOscHandler(111,new C.OscHandler((x=>this.restoreBgColor(x)))),this._parser.registerOscHandler(112,new C.OscHandler((x=>this.restoreCursorColor(x)))),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 x in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:x},(()=>this.selectCharset("("+x))),this._parser.registerEscHandler({intermediates:")",final:x},(()=>this.selectCharset(")"+x))),this._parser.registerEscHandler({intermediates:"*",final:x},(()=>this.selectCharset("*"+x))),this._parser.registerEscHandler({intermediates:"+",final:x},(()=>this.selectCharset("+"+x))),this._parser.registerEscHandler({intermediates:"-",final:x},(()=>this.selectCharset("-"+x))),this._parser.registerEscHandler({intermediates:".",final:x},(()=>this.selectCharset("."+x))),this._parser.registerEscHandler({intermediates:"/",final:x},(()=>this.selectCharset("/"+x)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((x=>(this._logService.error("Parsing error: ",x),x))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((x,M)=>this.requestStatusString(x,M))))}_preserveStack(y,R,I,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=I,this._parseStack.position=P}_logSlowResolvingAsync(y){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([y,new Promise(((R,I)=>setTimeout((()=>I("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,R){let I,P=this._activeBuffer.x,z=this._activeBuffer.y,Y=0;const X=this._parseStack.paused;if(X){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(I),I;P=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>D&&(Y=this._parseStack.position+D)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(x=>String.fromCharCode(x))).join("")}"`),typeof y=="string"?y.split("").map((x=>x.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(y.length,D))),X||this._dirtyRowTracker.clearRange(),y.length>D)for(let x=Y;x<y.length;x+=D){const M=x+D<y.length?x+D:y.length,j=typeof y=="string"?this._stringDecoder.decode(y.substring(x,M),this._parseBuffer):this._utf8Decoder.decode(y.subarray(x,M),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,j))return this._preserveStack(P,z,j,x),this._logSlowResolvingAsync(I),I}else if(!X){const x=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,x))return this._preserveStack(P,z,x,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===P&&this._activeBuffer.y===z||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),T=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);T<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(T,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(y,R,I){let P,z;const Y=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,T=this._coreService.decPrivateModes.wraparound,x=this._coreService.modes.insertMode,M=this._curAttrData;let j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-R>0&&j.getWidth(this._activeBuffer.x-1)===2&&j.setCellFromCodepoint(this._activeBuffer.x-1,0,1,M);let Q=this._parser.precedingJoinState;for(let K=R;K<I;++K){if(P=y[K],P<127&&Y){const ie=Y[String.fromCharCode(P)];ie&&(P=ie.charCodeAt(0))}const Z=this._unicodeService.charProperties(P,Q);z=_.UnicodeService.extractWidth(Z);const ee=_.UnicodeService.extractShouldJoin(Z),te=ee?_.UnicodeService.extractWidth(Q):0;if(Q=Z,X&&this._onA11yChar.fire((0,u.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+z-te>J){if(T){const ie=j;let $=this._activeBuffer.x-te;for(this._activeBuffer.x=te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&j instanceof r.BufferLine&&j.copyCellsFrom(ie,$,0,te,!1);$<J;)ie.setCellFromCodepoint($++,0,1,M)}else if(this._activeBuffer.x=J-1,z===2)continue}if(ee&&this._activeBuffer.x){const ie=j.getWidth(this._activeBuffer.x-1)?1:2;j.addCodepointToCell(this._activeBuffer.x-ie,P,z);for(let $=z-te;--$>=0;)j.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}else if(x&&(j.insertCells(this._activeBuffer.x,z-te,this._activeBuffer.getNullCell(M)),j.getWidth(J-1)===2&&j.setCellFromCodepoint(J-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,M)),j.setCellFromCodepoint(this._activeBuffer.x++,P,z,M),z>0)for(;--z;)j.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}this._parser.precedingJoinState=Q,this._activeBuffer.x<J&&I-R>0&&j.getWidth(this._activeBuffer.x)===0&&!j.hasContent(this._activeBuffer.x)&&j.setCellFromCodepoint(this._activeBuffer.x,0,1,M),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,R){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,R):this._parser.registerCsiHandler(y,(I=>!O(I.params[0],this._optionsService.rawOptions.windowOptions)||R(I)))}registerDcsHandler(y,R){return this._parser.registerDcsHandler(y,new v.DcsHandler(R))}registerEscHandler(y,R){return this._parser.registerEscHandler(y,R)}registerOscHandler(y,R){return this._parser.registerOscHandler(y,new C.OscHandler(R))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=y,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+R)}cursorUp(y){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const R=y.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const R=y.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,R,I,P=!1,z=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);Y.replaceCells(R,I,this._activeBuffer.getNullCell(this._eraseAttrData()),z),P&&(Y.isWrapped=!1)}_resetBufferLine(y,R=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),I.isWrapped=!1)}eraseInDisplay(y,R=!1){let I;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);I<this._bufferService.rows;I++)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,R);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(y,R=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;R--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;R--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let R=y.params[0]||1;for(;R--;)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(y){let R=y.params[0]||1;for(;R--;)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(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const R=this._parser.precedingJoinState;if(!R)return!0;const I=y.params[0]||1,P=_.UnicodeService.extractWidth(R),z=this._activeBuffer.x-P,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(z),X=new Uint32Array(Y.length*I);let J=0;for(let x=0;x<Y.length;){const M=Y.codePointAt(x)||0;X[J++]=M,x+=M>65535?2:1}let T=J;for(let x=1;x<I;++x)X.copyWithin(T,0,J),T+=J;return this.print(X,0,T),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){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(),y.params[R]===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(y,R){const I=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:z}=this._coreMouseService,Y=this._coreService,{buffers:X,cols:J}=this._bufferService,{active:T,alt:x}=X,M=this._optionsService.rawOptions,j=ee=>ee?1:2,Q=y.params[0];return K=Q,Z=R?Q===2?4:Q===4?j(Y.modes.insertMode):Q===12?3:Q===20?j(M.convertEol):0:Q===1?j(I.applicationCursorKeys):Q===3?M.windowOptions.setWinLines?J===80?2:J===132?1:0:0:Q===6?j(I.origin):Q===7?j(I.wraparound):Q===8?3:Q===9?j(P==="X10"):Q===12?j(M.cursorBlink):Q===25?j(!Y.isCursorHidden):Q===45?j(I.reverseWraparound):Q===66?j(I.applicationKeypad):Q===67?4:Q===1e3?j(P==="VT200"):Q===1002?j(P==="DRAG"):Q===1003?j(P==="ANY"):Q===1004?j(I.sendFocus):Q===1005?4:Q===1006?j(z==="SGR"):Q===1015?4:Q===1016?j(z==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?j(T===x):Q===2004?j(I.bracketedPasteMode):0,Y.triggerDataEvent(`${a.C0.ESC}[${R?"":"?"}${K};${Z}$y`),!0;var K,Z}_updateAttrColor(y,R,I,P,z){return R===2?(y|=50331648,y&=-16777216,y|=l.AttributeData.fromColorRGB([I,P,z])):R===5&&(y&=-50331904,y|=33554432|255&I),y}_extractColor(y,R,I){const P=[0,0,-1,0,0,0];let z=0,Y=0;do{if(P[Y+z]=y.params[R+Y],y.hasSubParams(R+Y)){const X=y.getSubParams(R+Y);let J=0;do P[1]===5&&(z=1),P[Y+J+1+z]=X[J];while(++J<X.length&&J+Y+1+z<P.length);break}if(P[1]===5&&Y+z>=2||P[1]===2&&Y+z>=5)break;P[1]&&(z=1)}while(++Y+R<y.length&&Y+z<P.length);for(let X=2;X<P.length;++X)P[X]===-1&&(P[X]=0);switch(P[0]){case 38:I.fg=this._updateAttrColor(I.fg,P[1],P[3],P[4],P[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,P[1],P[3],P[4],P[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,P[1],P[3],P[4],P[5])}return Y}_processUnderline(y,R){R.extended=R.extended.clone(),(!~y||y>5)&&(y=1),R.extended.underlineStyle=y,R.fg|=268435456,y===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(y){y.fg=r.DEFAULT_ATTR_DATA.fg,y.bg=r.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=y.length;let I;const P=this._curAttrData;for(let z=0;z<R;z++)I=y.params[z],I>=30&&I<=37?(P.fg&=-50331904,P.fg|=16777216|I-30):I>=40&&I<=47?(P.bg&=-50331904,P.bg|=16777216|I-40):I>=90&&I<=97?(P.fg&=-50331904,P.fg|=16777224|I-90):I>=100&&I<=107?(P.bg&=-50331904,P.bg|=16777224|I-100):I===0?this._processSGR0(P):I===1?P.fg|=134217728:I===3?P.bg|=67108864:I===4?(P.fg|=268435456,this._processUnderline(y.hasSubParams(z)?y.getSubParams(z)[0]:1,P)):I===5?P.fg|=536870912:I===7?P.fg|=67108864:I===8?P.fg|=1073741824:I===9?P.fg|=2147483648:I===2?P.bg|=134217728:I===21?this._processUnderline(2,P):I===22?(P.fg&=-134217729,P.bg&=-134217729):I===23?P.bg&=-67108865:I===24?(P.fg&=-268435457,this._processUnderline(0,P)):I===25?P.fg&=-536870913:I===27?P.fg&=-67108865:I===28?P.fg&=-1073741825:I===29?P.fg&=2147483647:I===39?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):I===49?(P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?z+=this._extractColor(y,z,P):I===53?P.bg|=1073741824:I===55?P.bg&=-1073741825:I===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):I===100?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${R};${I}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const R=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${R};${I}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(y){const R=y.params[0]||1;switch(R){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 I=R%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(y){const R=y.params[0]||1;let I;return(y.length<2||(I=y.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(y){if(!O(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:R!==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(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const R=[],I=y.split(";");for(;I.length>1;){const P=I.shift(),z=I.shift();if(/^\d+$/.exec(P)){const Y=parseInt(P);if(G(Y))if(z==="?")R.push({type:0,index:Y});else{const X=(0,w.parseColor)(z);X&&R.push({type:1,index:Y,color:X})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(y){const R=y.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(y,R){this._getCurrentLinkId()&&this._finishHyperlink();const I=y.split(":");let P;const z=I.findIndex((Y=>Y.startsWith("id=")));return z!==-1&&(P=I[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,R){const I=y.split(";");for(let P=0;P<I.length&&!(R>=this._specialColors.length);++P,++R)if(I[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const z=(0,w.parseColor)(I[P]);z&&this._onColor.fire([{type:1,index:this._specialColors[R],color:z}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const R=[],I=y.split(";");for(let P=0;P<I.length;++P)if(/^\d+$/.exec(I[P])){const z=parseInt(I[P]);G(z)&&R.push({type:2,index:z})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){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,f.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(k[y[0]],f.CHARSETS[y[1]]||f.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 y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new t.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const I=this._activeBuffer.ybase+this._activeBuffer.y+R,P=this._activeBuffer.lines.get(I);P&&(P.fill(y),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,R){const I=this._bufferService.buffer,P=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${z}${a.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,R){this._dirtyRowTracker.markRangeDirty(y,R)}}i.InputHandler=H;let W=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,y){U>y&&(F=U,U=y,y=F),U<this.start&&(this.start=U),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}W=c([d(0,p.IBufferService)],W)},844:(E,i)=>{function o(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,a,f){this._data[d]||(this._data[d]={}),this._data[d][a]=f}get(d,a){return this._data[d]?this._data[d][a]:void 0}clear(){this._data={}}}i.TwoKeyMap=o,i.FourKeyMap=class{constructor(){this._data=new o}set(c,d,a,f,g){this._data.get(c,d)||this._data.set(c,d,new o),this._data.get(c,d).set(a,f,g)}get(c,d,a,f){var g;return(g=this._data.get(c,d))==null?void 0:g.get(a,f)}clear(){this._data.clear()}}},6114:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const o=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=o.includes("Firefox"),i.isLegacyEdge=o.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(o),i.getSafariVersion=function(){if(!i.isSafari)return 0;const d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(o)},6106:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let o=0;i.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const d=this._getKey(c);if(d===void 0||(o=this._search(d),o===-1)||this._getKey(this._array[o])!==d)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===d);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,d){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do d(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let d=0,a=this._array.length-1;for(;a>=d;){let f=d+a>>1;const g=this._getKey(this._array[f]);if(g>c)a=f-1;else{if(!(g<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}d=f+1}}return d}}},7226:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=o(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let S=0,u=0,r=g.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),u=Math.max(S,u),s=g.timeRemaining(),1.5*u>s)return r-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-S))}ms`),void this._start();r=s}this.clear()}}class a extends d{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}i.PriorityTaskQueue=a,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:a,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const c=o(643);i.updateWindowsModeWrappedState=function(d){const a=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=a==null?void 0:a.get(d.cols-1),g=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);g&&f&&(g.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new o;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}i.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,f=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},9092:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const c=o(6349),d=o(7226),a=o(3734),f=o(8437),g=o(4634),S=o(511),u=o(643),r=o(4863),s=o(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,l){this._hasScrollback=e,this._optionsService=t,this._bufferService=l,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new f.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const t=e+this._optionsService.rawOptions.scrollback;return t>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=f.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA);let p=0;const _=this._getCorrectBufferLength(t);if(_>this.lines.maxLength&&(this.lines.maxLength=_),this.lines.length>0){if(this._cols<e)for(let v=0;v<this.lines.length;v++)p+=+this.lines.get(v).resize(e,l);let C=0;if(this._rows<t)for(let v=this._rows;v<t;v++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(e,l)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(e,l)));else for(let v=this._rows;v>t;v--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(_<this.lines.maxLength){const v=this.lines.length-_;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=_}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let C=0;C<this.lines.length;C++)p+=+this.lines.get(C).resize(e,l);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const l=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(l.length>0){const p=(0,g.reflowLargerCreateNewLayout)(this.lines,l);(0,g.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(e,t,p.countRemoved)}}_reflowLargerAdjustViewport(e,t,l){const p=this.getNullCell(f.DEFAULT_ATTR_DATA);let _=l;for(;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new f.BufferLine(e,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-l,0)}_reflowSmaller(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA),p=[];let _=0;for(let C=this.lines.length-1;C>=0;C--){let v=this.lines.get(C);if(!v||!v.isWrapped&&v.getTrimmedLength()<=e)continue;const w=[v];for(;v.isWrapped&&C>0;)v=this.lines.get(--C),w.unshift(v);const k=this.ybase+this.y;if(k>=C&&k<C+w.length)continue;const D=w[w.length-1].getTrimmedLength(),O=(0,g.reflowSmallerGetNewLineLengths)(w,this._cols,e),L=O.length-w.length;let F;F=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 H=[];for(let I=0;I<L;I++){const P=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);H.push(P)}H.length>0&&(p.push({start:C+w.length+_,newLines:H}),_+=H.length),w.push(...H);let W=O.length-1,G=O[W];G===0&&(W--,G=O[W]);let U=w.length-L-1,y=D;for(;U>=0;){const I=Math.min(y,G);if(w[W]===void 0)break;if(w[W].copyCellsFrom(w[U],y-I,G-I,I,!0),G-=I,G===0&&(W--,G=O[W]),y-=I,y===0){U--;const P=Math.max(U,0);y=(0,g.getWrappedLineTrimmedLength)(w,P,this._cols)}}for(let I=0;I<w.length;I++)O[I]<e&&w[I].setCell(O[I],l);let R=L-F;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+_)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+t-1)}if(p.length>0){const C=[],v=[];for(let W=0;W<this.lines.length;W++)v.push(this.lines.get(W));const w=this.lines.length;let k=w-1,D=0,O=p[D];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);let L=0;for(let W=Math.min(this.lines.maxLength-1,w+_-1);W>=0;W--)if(O&&O.start>k+L){for(let G=O.newLines.length-1;G>=0;G--)this.lines.set(W--,O.newLines[G]);W++,C.push({index:k+1,amount:O.newLines.length}),L+=O.newLines.length,O=p[++D]}else this.lines.set(W,v[k--]);let F=0;for(let W=C.length-1;W>=0;W--)C[W].index+=F,this.lines.onInsertEmitter.fire(C[W]),F+=C[W].amount;const H=Math.max(0,w+_-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(e,t,l=0,p){const _=this.lines.get(e);return _?_.translateToString(t,l,p):""}getWrappedRangeForLine(e){let t=e,l=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;l+1<this.lines.length&&this.lines.get(l+1).isWrapped;)l++;return{first:t,last:l}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new r.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((l=>{t.line-=l,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((l=>{t.line>=l.index&&(t.line+=l.amount)}))),t.register(this.lines.onDelete((l=>{t.line>=l.index&&t.line<l.index+l.amount&&t.dispose(),t.line>l.index&&(t.line-=l.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const c=o(3734),d=o(511),a=o(643),f=o(482);i.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class S{constructor(r,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const t=s||d.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let l=0;l<r;++l)this.setCell(l,t);this.length=r}get(r){const s=this._data[3*r+0],e=2097151&s;return[this._data[3*r+1],2097152&s?this._combined[r]:e?(0,f.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):e]}set(r,s){this._data[3*r+1]=s[a.CHAR_DATA_ATTR_INDEX],s[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=s[1],this._data[3*r+0]=2097152|r|s[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=s[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&s}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r]:2097151&s?(0,f.stringFromCodePoint)(2097151&s):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,s){return g=3*r,s.content=this._data[g+0],s.fg=this._data[g+1],s.bg=this._data[g+2],2097152&s.content&&(s.combinedData=this._combined[r]),268435456&s.bg&&(s.extended=this._extendedAttrs[r]),s}setCell(r,s){2097152&s.content&&(this._combined[r]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[r]=s.extended),this._data[3*r+0]=s.content,this._data[3*r+1]=s.fg,this._data[3*r+2]=s.bg}setCellFromCodepoint(r,s,e,t){268435456&t.bg&&(this._extendedAttrs[r]=t.extended),this._data[3*r+0]=s|e<<22,this._data[3*r+1]=t.fg,this._data[3*r+2]=t.bg}addCodepointToCell(r,s,e){let t=this._data[3*r+0];2097152&t?this._combined[r]+=(0,f.stringFromCodePoint)(s):2097151&t?(this._combined[r]=(0,f.stringFromCodePoint)(2097151&t)+(0,f.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*r+0]=t}insertCells(r,s,e){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length-r){const t=new d.CellData;for(let l=this.length-r-s-1;l>=0;--l)this.setCell(r+s+l,this.loadCell(r+l,t));for(let l=0;l<s;++l)this.setCell(r+l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(r,s,e){if(r%=this.length,s<this.length-r){const t=new d.CellData;for(let l=0;l<this.length-r-s;++l)this.setCell(r+l,this.loadCell(r+s+l,t));for(let l=this.length-s;l<this.length;++l)this.setCell(l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,e)}replaceCells(r,s,e,t=!1){if(t)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.isProtected(r)||this.setCell(r,e),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.setCell(r++,e)}resize(r,s){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t<r;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,e);const t=Object.keys(this._combined);for(let p=0;p<t.length;p++){const _=parseInt(t[p],10);_>=r&&delete this._combined[_]}const l=Object.keys(this._extendedAttrs);for(let p=0;p<l.length;p++){const _=parseInt(l[p],10);_>=r&&delete this._extendedAttrs[_]}}return this.length=r,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,r);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const s in r._combined)this._combined[s]=r._combined[s];this._extendedAttrs={};for(const s in r._extendedAttrs)this._extendedAttrs[s]=r._extendedAttrs[s];this.isWrapped=r.isWrapped}clone(){const r=new S(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const s in this._combined)r._combined[s]=this._combined[s];for(const s in this._extendedAttrs)r._extendedAttrs[s]=this._extendedAttrs[s];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,s,e,t,l){const p=r._data;if(l)for(let C=t-1;C>=0;C--){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=p[3*(s+C)+v];268435456&p[3*(s+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[s+C])}else for(let C=0;C<t;C++){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=p[3*(s+C)+v];268435456&p[3*(s+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[s+C])}const _=Object.keys(r._combined);for(let C=0;C<_.length;C++){const v=parseInt(_[C],10);v>=s&&(this._combined[v-s+e]=r._combined[v])}}translateToString(r,s,e,t){s=s??0,e=e??this.length,r&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let l="";for(;s<e;){const p=this._data[3*s+0],_=2097151&p,C=2097152&p?this._combined[s]:_?(0,f.stringFromCodePoint)(_):a.WHITESPACE_CELL_CHAR;if(l+=C,t)for(let v=0;v<C.length;++v)t.push(s);s+=p>>22||1}return t&&t.push(s),l}}i.BufferLine=S},4841:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(E,i)=>{function o(c,d,a){if(d===c.length-1)return c[d].getTrimmedLength();const f=!c[d].hasContent(a-1)&&c[d].getWidth(a-1)===1,g=c[d+1].getWidth(0)===2;return f&&g?a-1:a}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(c,d,a,f,g){const S=[];for(let u=0;u<c.length-1;u++){let r=u,s=c.get(++r);if(!s.isWrapped)continue;const e=[c.get(u)];for(;r<c.length&&s.isWrapped;)e.push(s),s=c.get(++r);if(f>=u&&f<r){u+=e.length-1;continue}let t=0,l=o(e,t,d),p=1,_=0;for(;p<e.length;){const v=o(e,p,d),w=v-_,k=a-l,D=Math.min(w,k);e[t].copyCellsFrom(e[p],_,l,D,!1),l+=D,l===a&&(t++,l=0),_+=D,_===v&&(p++,_=0),l===0&&t!==0&&e[t-1].getWidth(a-1)===2&&(e[t].copyCellsFrom(e[t-1],a-1,l++,1,!1),e[t-1].setCell(a-1,g))}e[t].replaceCells(l,a,g);let C=0;for(let v=e.length-1;v>0&&(v>t||e[v].getTrimmedLength()===0);v--)C++;C>0&&(S.push(u+e.length-C),S.push(C)),u+=e.length-1}return S},i.reflowLargerCreateNewLayout=function(c,d){const a=[];let f=0,g=d[f],S=0;for(let u=0;u<c.length;u++)if(g===u){const r=d[++f];c.onDeleteEmitter.fire({index:u-S,amount:r}),u+=r-1,S+=r,g=d[++f]}else a.push(u);return{layout:a,countRemoved:S}},i.reflowLargerApplyNewLayout=function(c,d){const a=[];for(let f=0;f<d.length;f++)a.push(c.get(d[f]));for(let f=0;f<a.length;f++)c.set(f,a[f]);c.length=d.length},i.reflowSmallerGetNewLineLengths=function(c,d,a){const f=[],g=c.map(((s,e)=>o(c,e,d))).reduce(((s,e)=>s+e));let S=0,u=0,r=0;for(;r<g;){if(g-r<a){f.push(g-r);break}S+=a;const s=o(c,u,d);S>s&&(S-=s,u++);const e=c[u].getWidth(S-1)===2;e&&S--;const t=e?a-1:a;f.push(t),r+=t}return f},i.getWrappedLineTrimmedLength=o},5295:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const c=o(8460),d=o(844),a=o(9092);class f extends d.Disposable{constructor(S,u){super(),this._optionsService=S,this._bufferService=u,this._onBufferActivate=this.register(new c.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,u){this._normal.resize(S,u),this._alt.resize(S,u),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}i.BufferSet=f},511:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=o(482),d=o(643),a=o(3734);class f extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const u=new f;return u.setFromCharData(S),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(S[d.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(S[d.CHAR_DATA_CHAR_INDEX].length===2){const r=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const s=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(r-55296)+s-56320+65536|S[d.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=S[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=f},643:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const c=o(8460),d=o(844);class a{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}i.Marker=a,a._nextId=1},7116:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(E,i)=>{var o,c,d;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
|
|
17
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&v&&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(v){const w=this._getMouseBufferCoords(v),k=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!!(k&&D&&w)&&this._areCoordsInSelection(w,k,D)}isCellInSelection(v,w){const k=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!k||!D)&&this._areCoordsInSelection([v,w],k,D)}_areCoordsInSelection(v,w,k){return v[1]>w[1]&&v[1]<k[1]||w[1]===k[1]&&v[1]===w[1]&&v[0]>=w[0]&&v[0]<k[0]||w[1]<k[1]&&v[1]===k[1]&&v[0]<k[0]||w[1]<k[1]&&v[1]===w[1]&&v[0]>=w[0]}_selectWordAtCursor(v,w){var O,L;const k=(L=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:L.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(v);return!!D&&(this._selectWordAt(D,w),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,w){this._model.clearSelection(),v=Math.max(v,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const w=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w}_getMouseEventScrollAmount(v){let w=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const k=this._renderService.dimensions.css.canvas.height;return w>=0&&w<=k?0:(w>k&&(w-=k),w=Math.min(Math.max(w,-50),50),w/=50,w/Math.abs(w)+Math.round(14*w))}shouldForceSelection(v){return s.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const w=this._getMouseBufferCoords(v);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))}shouldColumnSelect(v){return v.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const w=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const k=this._bufferService.buffer;if(this._model.selectionEnd[1]<k.lines.length){const D=k.lines.get(this._model.selectionEnd[1]);D&&D.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const w=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const k=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(k&&k[0]!==void 0&&k[1]!==void 0){const D=(0,f.moveToCellSequence)(k[0]-1,k[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(D,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,w=this._model.finalSelectionEnd,k=!(!v||!w||v[0]===w[0]&&v[1]===w[1]);k?v&&w&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&w[0]===this._oldSelectionEnd[0]&&w[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,w,k)):this._oldHasSelection&&this._fireOnSelectionChange(v,w,k)}_fireOnSelectionChange(v,w,k){this._oldSelectionStart=v,this._oldSelectionEnd=w,this._oldHasSelection=k,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((w=>this._handleTrim(w)))}_convertViewportColToCharacterIndex(v,w){let k=w;for(let D=0;w>=D;D++){const O=v.loadCell(D,this._workCell).getChars().length;this._workCell.getWidth()===0?k--:O>1&&w!==D&&(k+=O-1)}return k}setSelection(v,w,k){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,w],this._model.selectionStartLength=k,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,w,k=!0,D=!0){if(v[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,L=O.lines.get(v[1]);if(!L)return;const F=O.translateBufferLineToString(v[1],!1);let H=this._convertViewportColToCharacterIndex(L,v[0]),j=H;const Q=v[0]-H;let U=0,y=0,I=0,R=0;if(F.charAt(H)===" "){for(;H>0&&F.charAt(H-1)===" ";)H--;for(;j<F.length&&F.charAt(j+1)===" ";)j++}else{let Y=v[0],Z=v[0];L.getWidth(Y)===0&&(U++,Y--),L.getWidth(Z)===2&&(y++,Z++);const J=L.getString(Z).length;for(J>1&&(R+=J-1,j+=J-1);Y>0&&H>0&&!this._isCharWordSeparator(L.loadCell(Y-1,this._workCell));){L.loadCell(Y-1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,Y--):M>1&&(I+=M-1,H-=M-1),H--,Y--}for(;Z<L.length&&j+1<F.length&&!this._isCharWordSeparator(L.loadCell(Z+1,this._workCell));){L.loadCell(Z+1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,Z++):M>1&&(R+=M-1,j+=M-1),j++,Z++}}j++;let P=H+Q-U+I,N=Math.min(this._bufferService.cols,j-H+U+y-I-R);if(w||F.slice(H,j).trim()!==""){if(k&&P===0&&L.getCodePoint(0)!==32){const Y=O.lines.get(v[1]-1);if(Y&&L.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(Z){const J=this._bufferService.cols-Z.start;P-=J,N+=J}}}if(D&&P+N===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const Y=O.lines.get(v[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const Z=this._getWordAt([0,v[1]+1],!1,!1,!0);Z&&(N+=Z.length)}}return{start:P,length:N}}}_selectWordAt(v,w){const k=this._getWordAt(v,w);if(k){for(;k.start<0;)k.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[k.start,v[1]],this._model.selectionStartLength=k.length}}_selectToWordAt(v){const w=this._getWordAt(v,!0);if(w){let k=v[1];for(;w.start<0;)w.start+=this._bufferService.cols,k--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,k++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,k]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const w=this._bufferService.buffer.getWrappedRangeForLine(v),k={start:{x:0,y:w.first},end:{x:this._bufferService.cols-1,y:w.last}};this._model.selectionStart=[0,w.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(k,this._bufferService.cols)}};i.SelectionService=C=c([d(3,l.IBufferService),d(4,l.ICoreService),d(5,S.IMouseService),d(6,l.IOptionsService),d(7,S.IRenderService),d(8,S.ICoreBrowserService)],C)},4725:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const c=o(8343);i.ICharSizeService=(0,c.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),i.IMouseService=(0,c.createDecorator)("MouseService"),i.IRenderService=(0,c.createDecorator)("RenderService"),i.ISelectionService=(0,c.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,c.createDecorator)("ThemeService"),i.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(E,i,o){var c=this&&this.__decorate||function(C,v,w,k){var D,O=arguments.length,L=O<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,v,w,k);else for(var F=C.length-1;F>=0;F--)(D=C[F])&&(L=(O<3?D(L):O>3?D(v,w,L):D(v,w))||L);return O>3&&L&&Object.defineProperty(v,w,L),L},d=this&&this.__param||function(C,v){return function(w,k){v(w,k,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const a=o(7239),f=o(8055),g=o(8460),S=o(844),u=o(2585),r=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),e=f.css.toColor("#ffffff"),t=f.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let w=0;w<216;w++){const k=v[w/36%6|0],D=v[w/6%6|0],O=v[w%6];C.push({css:f.channels.toCss(k,D,O),rgba:f.channels.toRgba(k,D,O)})}for(let w=0;w<24;w++){const k=8+10*w;C.push({css:f.channels.toCss(k,k,k),rgba:f.channels.toRgba(k,k,k)})}return C})());let p=i.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:f.color.blend(s,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:f.color.blend(s,l),ansi:i.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(C={}){const v=this._colors;if(v.foreground=_(C.foreground,r),v.background=_(C.background,s),v.cursor=_(C.cursor,e),v.cursorAccent=_(C.cursorAccent,t),v.selectionBackgroundTransparent=_(C.selectionBackground,l),v.selectionBackgroundOpaque=f.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=_(C.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=f.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=C.selectionForeground?_(C.selectionForeground,f.NULL_COLOR):void 0,v.selectionForeground===f.NULL_COLOR&&(v.selectionForeground=void 0),f.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=f.color.opacity(v.selectionBackgroundTransparent,.3)),f.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=f.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=i.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=_(C.black,i.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=_(C.red,i.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=_(C.green,i.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=_(C.yellow,i.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=_(C.blue,i.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=_(C.magenta,i.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=_(C.cyan,i.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=_(C.white,i.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=_(C.brightBlack,i.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=_(C.brightRed,i.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=_(C.brightGreen,i.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=_(C.brightYellow,i.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=_(C.brightBlue,i.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=_(C.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=_(C.brightCyan,i.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=_(C.brightWhite,i.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const w=Math.min(v.ansi.length-16,C.extendedAnsi.length);for(let k=0;k<w;k++)v.ansi[k+16]=_(C.extendedAnsi[k],i.DEFAULT_ANSI_COLORS[k+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(C){C(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,v){if(C!==void 0)try{return f.css.toColor(C)}catch{}return v}i.ThemeService=p=c([d(0,u.IOptionsService)],p)},6349:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const c=o(8460),d=o(844);class a extends d.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(g){if(this._maxLength===g)return;const S=new Array(g);for(let u=0;u<Math.min(g,this.length);u++)S[u]=this._array[this._getCyclicIndex(u)];this._array=S,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let S=this._length;S<g;S++)this._array[S]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,S){this._array[this._getCyclicIndex(g)]=S}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,S,...u){if(S){for(let r=g;r<this._length-S;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+S)];this._length-=S,this.onDeleteEmitter.fire({index:g,amount:S})}for(let r=this._length-1;r>=g;r--)this._array[this._getCyclicIndex(r+u.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<u.length;r++)this._array[this._getCyclicIndex(g+r)]=u[r];if(u.length&&this.onInsertEmitter.fire({index:g,amount:u.length}),this._length+u.length>this._maxLength){const r=this._length+u.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=u.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,u){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let s=S-1;s>=0;s--)this.set(g+s+u,this.get(g+s));const r=g+S+u-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<S;r++)this.set(g+r+u,this.get(g+r))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}i.CircularList=a},1439:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function o(c,d=5){if(typeof c!="object")return c;const a=Array.isArray(c)?[]:{};for(const f in c)a[f]=d<=1?c[f]:c[f]&&o(c[f],d-1);return a}},8055:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let o=0,c=0,d=0,a=0;var f,g,S,u,r;function s(t){const l=t.toString(16);return l.length<2?"0"+l:l}function e(t,l){return t<l?(l+.05)/(t+.05):(t+.05)/(l+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(l,p,_,C){return C!==void 0?`#${s(l)}${s(p)}${s(_)}${s(C)}`:`#${s(l)}${s(p)}${s(_)}`},t.toRgba=function(l,p,_,C=255){return(l<<24|p<<16|_<<8|C)>>>0},t.toColor=function(l,p,_,C){return{css:t.toCss(l,p,_,C),rgba:t.toRgba(l,p,_,C)}}})(f||(i.channels=f={})),(function(t){function l(p,_){return a=Math.round(255*_),[o,c,d]=r.toChannels(p.rgba),{css:f.toCss(o,c,d,a),rgba:f.toRgba(o,c,d,a)}}t.blend=function(p,_){if(a=(255&_.rgba)/255,a===1)return{css:_.css,rgba:_.rgba};const C=_.rgba>>24&255,v=_.rgba>>16&255,w=_.rgba>>8&255,k=p.rgba>>24&255,D=p.rgba>>16&255,O=p.rgba>>8&255;return o=k+Math.round((C-k)*a),c=D+Math.round((v-D)*a),d=O+Math.round((w-O)*a),{css:f.toCss(o,c,d),rgba:f.toRgba(o,c,d)}},t.isOpaque=function(p){return(255&p.rgba)==255},t.ensureContrastRatio=function(p,_,C){const v=r.ensureContrastRatio(p.rgba,_.rgba,C);if(v)return f.toColor(v>>24&255,v>>16&255,v>>8&255)},t.opaque=function(p){const _=(255|p.rgba)>>>0;return[o,c,d]=r.toChannels(_),{css:f.toCss(o,c,d),rgba:_}},t.opacity=l,t.multiplyOpacity=function(p,_){return a=255&p.rgba,l(p,a*_/255)},t.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}})(g||(i.color=g={})),(function(t){let l,p;try{const _=document.createElement("canvas");_.width=1,_.height=1;const C=_.getContext("2d",{willReadFrequently:!0});C&&(l=C,l.globalCompositeOperation="copy",p=l.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return o=parseInt(_.slice(1,2).repeat(2),16),c=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),f.toColor(o,c,d);case 5:return o=parseInt(_.slice(1,2).repeat(2),16),c=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),a=parseInt(_.slice(4,5).repeat(2),16),f.toColor(o,c,d,a);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}const 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(C)return o=parseInt(C[1]),c=parseInt(C[2]),d=parseInt(C[3]),a=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),f.toColor(o,c,d,a);if(!l||!p)throw new Error("css.toColor: Unsupported css format");if(l.fillStyle=p,l.fillStyle=_,typeof l.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(l.fillRect(0,0,1,1),[o,c,d,a]=l.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(o,c,d,a),css:_}}})(S||(i.css=S={})),(function(t){function l(p,_,C){const v=p/255,w=_/255,k=C/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}t.relativeLuminance=function(p){return l(p>>16&255,p>>8&255,255&p)},t.relativeLuminance2=l})(u||(i.rgb=u={})),(function(t){function l(_,C,v){const w=_>>24&255,k=_>>16&255,D=_>>8&255;let O=C>>24&255,L=C>>16&255,F=C>>8&255,H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));for(;H<v&&(O>0||L>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),L-=Math.max(0,Math.ceil(.1*L)),F-=Math.max(0,Math.ceil(.1*F)),H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));return(O<<24|L<<16|F<<8|255)>>>0}function p(_,C,v){const w=_>>24&255,k=_>>16&255,D=_>>8&255;let O=C>>24&255,L=C>>16&255,F=C>>8&255,H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));for(;H<v&&(O<255||L<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),L=Math.min(255,L+Math.ceil(.1*(255-L))),F=Math.min(255,F+Math.ceil(.1*(255-F))),H=e(u.relativeLuminance2(O,L,F),u.relativeLuminance2(w,k,D));return(O<<24|L<<16|F<<8|255)>>>0}t.blend=function(_,C){if(a=(255&C)/255,a===1)return C;const v=C>>24&255,w=C>>16&255,k=C>>8&255,D=_>>24&255,O=_>>16&255,L=_>>8&255;return o=D+Math.round((v-D)*a),c=O+Math.round((w-O)*a),d=L+Math.round((k-L)*a),f.toRgba(o,c,d)},t.ensureContrastRatio=function(_,C,v){const w=u.relativeLuminance(_>>8),k=u.relativeLuminance(C>>8);if(e(w,k)<v){if(k<w){const L=l(_,C,v),F=e(w,u.relativeLuminance(L>>8));if(F<v){const H=p(_,C,v);return F>e(w,u.relativeLuminance(H>>8))?L:H}return L}const D=p(_,C,v),O=e(w,u.relativeLuminance(D>>8));if(O<v){const L=l(_,C,v);return O>e(w,u.relativeLuminance(L>>8))?D:L}return D}},t.reduceLuminance=l,t.increaseLuminance=p,t.toChannels=function(_){return[_>>24&255,_>>16&255,_>>8&255,255&_]}})(r||(i.rgba=r={})),i.toPaddedHex=s,i.contrastRatio=e},8969:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const c=o(844),d=o(2585),a=o(4348),f=o(7866),g=o(744),S=o(7302),u=o(6975),r=o(8460),s=o(1753),e=o(1480),t=o(7994),l=o(9282),p=o(5435),_=o(5981),C=o(2660);let v=!1;class w extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((D=>{var O;(O=this._onScrollApi)==null||O.fire(D.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(D){for(const O in D)this.optionsService.options[O]=D[O]}constructor(D){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new S.OptionsService(D)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((O=>{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((O=>{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 _.WriteBuffer(((O,L)=>this._inputHandler.parse(O,L)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(D,O){this._writeBuffer.write(D,O)}writeSync(D,O){this._logService.logLevel<=d.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(D,O)}input(D,O=!0){this.coreService.triggerDataEvent(D,O)}resize(D,O){isNaN(D)||isNaN(O)||(D=Math.max(D,g.MINIMUM_COLS),O=Math.max(O,g.MINIMUM_ROWS),this._bufferService.resize(D,O))}scroll(D,O=!1){this._bufferService.scroll(D,O)}scrollLines(D,O,L){this._bufferService.scrollLines(D,O,L)}scrollPages(D){this.scrollLines(D*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(D){const O=D-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(D,O){return this._inputHandler.registerEscHandler(D,O)}registerDcsHandler(D,O){return this._inputHandler.registerDcsHandler(D,O)}registerCsiHandler(D,O){return this._inputHandler.registerCsiHandler(D,O)}registerOscHandler(D,O){return this._inputHandler.registerOscHandler(D,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let D=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?D=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(D=!0),D?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const D=[];D.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),D.push(this.registerCsiHandler({final:"H"},(()=>((0,l.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const O of D)O.dispose()}))}}}i.CoreTerminal=w},8460:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const d=[];for(let a=0;a<this._listeners.length;a++)d.push(this._listeners[a]);for(let a=0;a<d.length;a++)d[a].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o((d=>c.fire(d)))},i.runAndSubscribe=function(o,c){return c(void 0),o((d=>c(d)))}},5435:function(E,i,o){var c=this&&this.__decorate||function(U,y,I,R){var P,N=arguments.length,Y=N<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,I):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(U,y,I,R);else for(var Z=U.length-1;Z>=0;Z--)(P=U[Z])&&(Y=(N<3?P(Y):N>3?P(y,I,Y):P(y,I))||Y);return N>3&&Y&&Object.defineProperty(y,I,Y),Y},d=this&&this.__param||function(U,y){return function(I,R){y(I,R,U)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const a=o(2584),f=o(7116),g=o(2015),S=o(844),u=o(482),r=o(8437),s=o(8460),e=o(643),t=o(511),l=o(3734),p=o(2585),_=o(1480),C=o(6242),v=o(6351),w=o(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function O(U,y){if(U>24)return y.setWinLines||!1;switch(U){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var L;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(i.WindowsOptionsReportType=L={}));let F=0;class H extends S.Disposable{getAttrData(){return this._curAttrData}constructor(y,I,R,P,N,Y,Z,J,M=new g.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=I,this._coreService=R,this._logService=P,this._optionsService=N,this._oscLinkService=Y,this._coreMouseService=Z,this._unicodeService=J,this._parser=M,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 j(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._parser.setCsiHandlerFallback(((x,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(x),params:K.toArray()})})),this._parser.setEscHandlerFallback((x=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(x)})})),this._parser.setExecuteHandlerFallback((x=>{this._logService.debug("Unknown EXECUTE code: ",{code:x})})),this._parser.setOscHandlerFallback(((x,K,T)=>{this._logService.debug("Unknown OSC code: ",{identifier:x,action:K,data:T})})),this._parser.setDcsHandlerFallback(((x,K,T)=>{K==="HOOK"&&(T=T.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(x),action:K,payload:T})})),this._parser.setPrintHandler(((x,K,T)=>this.print(x,K,T))),this._parser.registerCsiHandler({final:"@"},(x=>this.insertChars(x))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(x=>this.scrollLeft(x))),this._parser.registerCsiHandler({final:"A"},(x=>this.cursorUp(x))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(x=>this.scrollRight(x))),this._parser.registerCsiHandler({final:"B"},(x=>this.cursorDown(x))),this._parser.registerCsiHandler({final:"C"},(x=>this.cursorForward(x))),this._parser.registerCsiHandler({final:"D"},(x=>this.cursorBackward(x))),this._parser.registerCsiHandler({final:"E"},(x=>this.cursorNextLine(x))),this._parser.registerCsiHandler({final:"F"},(x=>this.cursorPrecedingLine(x))),this._parser.registerCsiHandler({final:"G"},(x=>this.cursorCharAbsolute(x))),this._parser.registerCsiHandler({final:"H"},(x=>this.cursorPosition(x))),this._parser.registerCsiHandler({final:"I"},(x=>this.cursorForwardTab(x))),this._parser.registerCsiHandler({final:"J"},(x=>this.eraseInDisplay(x,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(x=>this.eraseInDisplay(x,!0))),this._parser.registerCsiHandler({final:"K"},(x=>this.eraseInLine(x,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(x=>this.eraseInLine(x,!0))),this._parser.registerCsiHandler({final:"L"},(x=>this.insertLines(x))),this._parser.registerCsiHandler({final:"M"},(x=>this.deleteLines(x))),this._parser.registerCsiHandler({final:"P"},(x=>this.deleteChars(x))),this._parser.registerCsiHandler({final:"S"},(x=>this.scrollUp(x))),this._parser.registerCsiHandler({final:"T"},(x=>this.scrollDown(x))),this._parser.registerCsiHandler({final:"X"},(x=>this.eraseChars(x))),this._parser.registerCsiHandler({final:"Z"},(x=>this.cursorBackwardTab(x))),this._parser.registerCsiHandler({final:"`"},(x=>this.charPosAbsolute(x))),this._parser.registerCsiHandler({final:"a"},(x=>this.hPositionRelative(x))),this._parser.registerCsiHandler({final:"b"},(x=>this.repeatPrecedingCharacter(x))),this._parser.registerCsiHandler({final:"c"},(x=>this.sendDeviceAttributesPrimary(x))),this._parser.registerCsiHandler({prefix:">",final:"c"},(x=>this.sendDeviceAttributesSecondary(x))),this._parser.registerCsiHandler({final:"d"},(x=>this.linePosAbsolute(x))),this._parser.registerCsiHandler({final:"e"},(x=>this.vPositionRelative(x))),this._parser.registerCsiHandler({final:"f"},(x=>this.hVPosition(x))),this._parser.registerCsiHandler({final:"g"},(x=>this.tabClear(x))),this._parser.registerCsiHandler({final:"h"},(x=>this.setMode(x))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(x=>this.setModePrivate(x))),this._parser.registerCsiHandler({final:"l"},(x=>this.resetMode(x))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(x=>this.resetModePrivate(x))),this._parser.registerCsiHandler({final:"m"},(x=>this.charAttributes(x))),this._parser.registerCsiHandler({final:"n"},(x=>this.deviceStatus(x))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(x=>this.deviceStatusPrivate(x))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(x=>this.softReset(x))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(x=>this.setCursorStyle(x))),this._parser.registerCsiHandler({final:"r"},(x=>this.setScrollRegion(x))),this._parser.registerCsiHandler({final:"s"},(x=>this.saveCursor(x))),this._parser.registerCsiHandler({final:"t"},(x=>this.windowOptions(x))),this._parser.registerCsiHandler({final:"u"},(x=>this.restoreCursor(x))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(x=>this.insertColumns(x))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(x=>this.deleteColumns(x))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(x=>this.selectProtected(x))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(x=>this.requestMode(x,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(x=>this.requestMode(x,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((x=>(this.setTitle(x),this.setIconName(x),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((x=>this.setIconName(x)))),this._parser.registerOscHandler(2,new C.OscHandler((x=>this.setTitle(x)))),this._parser.registerOscHandler(4,new C.OscHandler((x=>this.setOrReportIndexedColor(x)))),this._parser.registerOscHandler(8,new C.OscHandler((x=>this.setHyperlink(x)))),this._parser.registerOscHandler(10,new C.OscHandler((x=>this.setOrReportFgColor(x)))),this._parser.registerOscHandler(11,new C.OscHandler((x=>this.setOrReportBgColor(x)))),this._parser.registerOscHandler(12,new C.OscHandler((x=>this.setOrReportCursorColor(x)))),this._parser.registerOscHandler(104,new C.OscHandler((x=>this.restoreIndexedColor(x)))),this._parser.registerOscHandler(110,new C.OscHandler((x=>this.restoreFgColor(x)))),this._parser.registerOscHandler(111,new C.OscHandler((x=>this.restoreBgColor(x)))),this._parser.registerOscHandler(112,new C.OscHandler((x=>this.restoreCursorColor(x)))),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 x in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:x},(()=>this.selectCharset("("+x))),this._parser.registerEscHandler({intermediates:")",final:x},(()=>this.selectCharset(")"+x))),this._parser.registerEscHandler({intermediates:"*",final:x},(()=>this.selectCharset("*"+x))),this._parser.registerEscHandler({intermediates:"+",final:x},(()=>this.selectCharset("+"+x))),this._parser.registerEscHandler({intermediates:"-",final:x},(()=>this.selectCharset("-"+x))),this._parser.registerEscHandler({intermediates:".",final:x},(()=>this.selectCharset("."+x))),this._parser.registerEscHandler({intermediates:"/",final:x},(()=>this.selectCharset("/"+x)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((x=>(this._logService.error("Parsing error: ",x),x))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((x,K)=>this.requestStatusString(x,K))))}_preserveStack(y,I,R,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=R,this._parseStack.position=P}_logSlowResolvingAsync(y){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([y,new Promise(((I,R)=>setTimeout((()=>R("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,I){let R,P=this._activeBuffer.x,N=this._activeBuffer.y,Y=0;const Z=this._parseStack.paused;if(Z){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(R),R;P=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>D&&(Y=this._parseStack.position+D)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(x=>String.fromCharCode(x))).join("")}"`),typeof y=="string"?y.split("").map((x=>x.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(y.length,D))),Z||this._dirtyRowTracker.clearRange(),y.length>D)for(let x=Y;x<y.length;x+=D){const K=x+D<y.length?x+D:y.length,T=typeof y=="string"?this._stringDecoder.decode(y.substring(x,K),this._parseBuffer):this._utf8Decoder.decode(y.subarray(x,K),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,T))return this._preserveStack(P,N,T,x),this._logSlowResolvingAsync(R),R}else if(!Z){const x=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,x))return this._preserveStack(P,N,x,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===P&&this._activeBuffer.y===N||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),M=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);M<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(M,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(y,I,R){let P,N;const Y=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,M=this._coreService.decPrivateModes.wraparound,x=this._coreService.modes.insertMode,K=this._curAttrData;let T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-I>0&&T.getWidth(this._activeBuffer.x-1)===2&&T.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let q=this._parser.precedingJoinState;for(let z=I;z<R;++z){if(P=y[z],P<127&&Y){const ie=Y[String.fromCharCode(P)];ie&&(P=ie.charCodeAt(0))}const X=this._unicodeService.charProperties(P,q);N=_.UnicodeService.extractWidth(X);const ee=_.UnicodeService.extractShouldJoin(X),te=ee?_.UnicodeService.extractWidth(q):0;if(q=X,Z&&this._onA11yChar.fire((0,u.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-te>J){if(M){const ie=T;let $=this._activeBuffer.x-te;for(this._activeBuffer.x=te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&T instanceof r.BufferLine&&T.copyCellsFrom(ie,$,0,te,!1);$<J;)ie.setCellFromCodepoint($++,0,1,K)}else if(this._activeBuffer.x=J-1,N===2)continue}if(ee&&this._activeBuffer.x){const ie=T.getWidth(this._activeBuffer.x-1)?1:2;T.addCodepointToCell(this._activeBuffer.x-ie,P,N);for(let $=N-te;--$>=0;)T.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(x&&(T.insertCells(this._activeBuffer.x,N-te,this._activeBuffer.getNullCell(K)),T.getWidth(J-1)===2&&T.setCellFromCodepoint(J-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,K)),T.setCellFromCodepoint(this._activeBuffer.x++,P,N,K),N>0)for(;--N;)T.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=q,this._activeBuffer.x<J&&R-I>0&&T.getWidth(this._activeBuffer.x)===0&&!T.hasContent(this._activeBuffer.x)&&T.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,I){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,I):this._parser.registerCsiHandler(y,(R=>!O(R.params[0],this._optionsService.rawOptions.windowOptions)||I(R)))}registerDcsHandler(y,I){return this._parser.registerDcsHandler(y,new v.DcsHandler(I))}registerEscHandler(y,I){return this._parser.registerEscHandler(y,I)}registerOscHandler(y,I){return this._parser.registerOscHandler(y,new C.OscHandler(I))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=y,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+I)}cursorUp(y){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const I=y.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=y.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=y.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const I=y.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,I,R,P=!1,N=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);Y.replaceCells(I,R,this._activeBuffer.getNullCell(this._eraseAttrData()),N),P&&(Y.isWrapped=!1)}_resetBufferLine(y,I=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),R.isWrapped=!1)}eraseInDisplay(y,I=!1){let R;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);R<this._bufferService.rows;R++)this._resetBufferLine(R,I);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,I);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(y,I=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let I=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;I--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let I=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;I--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let I=y.params[0]||1;for(;I--;)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(y){let I=y.params[0]||1;for(;I--;)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(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const I=this._parser.precedingJoinState;if(!I)return!0;const R=y.params[0]||1,P=_.UnicodeService.extractWidth(I),N=this._activeBuffer.x-P,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),Z=new Uint32Array(Y.length*R);let J=0;for(let x=0;x<Y.length;){const K=Y.codePointAt(x)||0;Z[J++]=K,x+=K>65535?2:1}let M=J;for(let x=1;x<R;++x)Z.copyWithin(M,0,J),M+=J;return this.print(Z,0,M),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let I=0;I<y.length;I++)switch(y.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let I=0;I<y.length;I++)switch(y.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(y){for(let I=0;I<y.length;I++)switch(y.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let I=0;I<y.length;I++)switch(y.params[I]){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(),y.params[I]===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(y,I){const R=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:N}=this._coreMouseService,Y=this._coreService,{buffers:Z,cols:J}=this._bufferService,{active:M,alt:x}=Z,K=this._optionsService.rawOptions,T=ee=>ee?1:2,q=y.params[0];return z=q,X=I?q===2?4:q===4?T(Y.modes.insertMode):q===12?3:q===20?T(K.convertEol):0:q===1?T(R.applicationCursorKeys):q===3?K.windowOptions.setWinLines?J===80?2:J===132?1:0:0:q===6?T(R.origin):q===7?T(R.wraparound):q===8?3:q===9?T(P==="X10"):q===12?T(K.cursorBlink):q===25?T(!Y.isCursorHidden):q===45?T(R.reverseWraparound):q===66?T(R.applicationKeypad):q===67?4:q===1e3?T(P==="VT200"):q===1002?T(P==="DRAG"):q===1003?T(P==="ANY"):q===1004?T(R.sendFocus):q===1005?4:q===1006?T(N==="SGR"):q===1015?4:q===1016?T(N==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?T(M===x):q===2004?T(R.bracketedPasteMode):0,Y.triggerDataEvent(`${a.C0.ESC}[${I?"":"?"}${z};${X}$y`),!0;var z,X}_updateAttrColor(y,I,R,P,N){return I===2?(y|=50331648,y&=-16777216,y|=l.AttributeData.fromColorRGB([R,P,N])):I===5&&(y&=-50331904,y|=33554432|255&R),y}_extractColor(y,I,R){const P=[0,0,-1,0,0,0];let N=0,Y=0;do{if(P[Y+N]=y.params[I+Y],y.hasSubParams(I+Y)){const Z=y.getSubParams(I+Y);let J=0;do P[1]===5&&(N=1),P[Y+J+1+N]=Z[J];while(++J<Z.length&&J+Y+1+N<P.length);break}if(P[1]===5&&Y+N>=2||P[1]===2&&Y+N>=5)break;P[1]&&(N=1)}while(++Y+I<y.length&&Y+N<P.length);for(let Z=2;Z<P.length;++Z)P[Z]===-1&&(P[Z]=0);switch(P[0]){case 38:R.fg=this._updateAttrColor(R.fg,P[1],P[3],P[4],P[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,P[1],P[3],P[4],P[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,P[1],P[3],P[4],P[5])}return Y}_processUnderline(y,I){I.extended=I.extended.clone(),(!~y||y>5)&&(y=1),I.extended.underlineStyle=y,I.fg|=268435456,y===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(y){y.fg=r.DEFAULT_ATTR_DATA.fg,y.bg=r.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=y.length;let R;const P=this._curAttrData;for(let N=0;N<I;N++)R=y.params[N],R>=30&&R<=37?(P.fg&=-50331904,P.fg|=16777216|R-30):R>=40&&R<=47?(P.bg&=-50331904,P.bg|=16777216|R-40):R>=90&&R<=97?(P.fg&=-50331904,P.fg|=16777224|R-90):R>=100&&R<=107?(P.bg&=-50331904,P.bg|=16777224|R-100):R===0?this._processSGR0(P):R===1?P.fg|=134217728:R===3?P.bg|=67108864:R===4?(P.fg|=268435456,this._processUnderline(y.hasSubParams(N)?y.getSubParams(N)[0]:1,P)):R===5?P.fg|=536870912:R===7?P.fg|=67108864:R===8?P.fg|=1073741824:R===9?P.fg|=2147483648:R===2?P.bg|=134217728:R===21?this._processUnderline(2,P):R===22?(P.fg&=-134217729,P.bg&=-134217729):R===23?P.bg&=-67108865:R===24?(P.fg&=-268435457,this._processUnderline(0,P)):R===25?P.fg&=-536870913:R===27?P.fg&=-67108865:R===28?P.fg&=-1073741825:R===29?P.fg&=2147483647:R===39?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):R===49?(P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?N+=this._extractColor(y,N,P):R===53?P.bg|=1073741824:R===55?P.bg&=-1073741825:R===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):R===100?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${I};${R}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const I=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${I};${R}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(y){const I=y.params[0]||1;switch(I){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 R=I%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(y){const I=y.params[0]||1;let R;return(y.length<2||(R=y.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(y){if(!O(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:I!==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(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const I=[],R=y.split(";");for(;R.length>1;){const P=R.shift(),N=R.shift();if(/^\d+$/.exec(P)){const Y=parseInt(P);if(Q(Y))if(N==="?")I.push({type:0,index:Y});else{const Z=(0,w.parseColor)(N);Z&&I.push({type:1,index:Y,color:Z})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(y){const I=y.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(y,I){this._getCurrentLinkId()&&this._finishHyperlink();const R=y.split(":");let P;const N=R.findIndex((Y=>Y.startsWith("id=")));return N!==-1&&(P=R[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,I){const R=y.split(";");for(let P=0;P<R.length&&!(I>=this._specialColors.length);++P,++I)if(R[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const N=(0,w.parseColor)(R[P]);N&&this._onColor.fire([{type:1,index:this._specialColors[I],color:N}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const I=[],R=y.split(";");for(let P=0;P<R.length;++P)if(/^\d+$/.exec(R[P])){const N=parseInt(R[P]);Q(N)&&I.push({type:2,index:N})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){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,f.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(k[y[0]],f.CHARSETS[y[1]]||f.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 y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new t.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const R=this._activeBuffer.ybase+this._activeBuffer.y+I,P=this._activeBuffer.lines.get(R);P&&(P.fill(y),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,I){const R=this._bufferService.buffer,P=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${N}${a.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,I){this._dirtyRowTracker.markRangeDirty(y,I)}}i.InputHandler=H;let j=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,y){U>y&&(F=U,U=y,y=F),U<this.start&&(this.start=U),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(U){return 0<=U&&U<256}j=c([d(0,p.IBufferService)],j)},844:(E,i)=>{function o(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,a,f){this._data[d]||(this._data[d]={}),this._data[d][a]=f}get(d,a){return this._data[d]?this._data[d][a]:void 0}clear(){this._data={}}}i.TwoKeyMap=o,i.FourKeyMap=class{constructor(){this._data=new o}set(c,d,a,f,g){this._data.get(c,d)||this._data.set(c,d,new o),this._data.get(c,d).set(a,f,g)}get(c,d,a,f){var g;return(g=this._data.get(c,d))==null?void 0:g.get(a,f)}clear(){this._data.clear()}}},6114:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const o=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=o.includes("Firefox"),i.isLegacyEdge=o.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(o),i.getSafariVersion=function(){if(!i.isSafari)return 0;const d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(o)},6106:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let o=0;i.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const d=this._getKey(c);if(d===void 0||(o=this._search(d),o===-1)||this._getKey(this._array[o])!==d)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===d);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,d){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do d(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let d=0,a=this._array.length-1;for(;a>=d;){let f=d+a>>1;const g=this._getKey(this._array[f]);if(g>c)a=f-1;else{if(!(g<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}d=f+1}}return d}}},7226:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=o(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let S=0,u=0,r=g.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),u=Math.max(S,u),s=g.timeRemaining(),1.5*u>s)return r-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-S))}ms`),void this._start();r=s}this.clear()}}class a extends d{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}i.PriorityTaskQueue=a,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:a,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const c=o(643);i.updateWindowsModeWrappedState=function(d){const a=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=a==null?void 0:a.get(d.cols-1),g=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);g&&f&&(g.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new o;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}i.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,f=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},9092:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const c=o(6349),d=o(7226),a=o(3734),f=o(8437),g=o(4634),S=o(511),u=o(643),r=o(4863),s=o(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,l){this._hasScrollback=e,this._optionsService=t,this._bufferService=l,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new f.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const t=e+this._optionsService.rawOptions.scrollback;return t>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=f.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA);let p=0;const _=this._getCorrectBufferLength(t);if(_>this.lines.maxLength&&(this.lines.maxLength=_),this.lines.length>0){if(this._cols<e)for(let v=0;v<this.lines.length;v++)p+=+this.lines.get(v).resize(e,l);let C=0;if(this._rows<t)for(let v=this._rows;v<t;v++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(e,l)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(e,l)));else for(let v=this._rows;v>t;v--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(_<this.lines.maxLength){const v=this.lines.length-_;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=_}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let C=0;C<this.lines.length;C++)p+=+this.lines.get(C).resize(e,l);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const l=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(l.length>0){const p=(0,g.reflowLargerCreateNewLayout)(this.lines,l);(0,g.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(e,t,p.countRemoved)}}_reflowLargerAdjustViewport(e,t,l){const p=this.getNullCell(f.DEFAULT_ATTR_DATA);let _=l;for(;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new f.BufferLine(e,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-l,0)}_reflowSmaller(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA),p=[];let _=0;for(let C=this.lines.length-1;C>=0;C--){let v=this.lines.get(C);if(!v||!v.isWrapped&&v.getTrimmedLength()<=e)continue;const w=[v];for(;v.isWrapped&&C>0;)v=this.lines.get(--C),w.unshift(v);const k=this.ybase+this.y;if(k>=C&&k<C+w.length)continue;const D=w[w.length-1].getTrimmedLength(),O=(0,g.reflowSmallerGetNewLineLengths)(w,this._cols,e),L=O.length-w.length;let F;F=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 H=[];for(let R=0;R<L;R++){const P=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);H.push(P)}H.length>0&&(p.push({start:C+w.length+_,newLines:H}),_+=H.length),w.push(...H);let j=O.length-1,Q=O[j];Q===0&&(j--,Q=O[j]);let U=w.length-L-1,y=D;for(;U>=0;){const R=Math.min(y,Q);if(w[j]===void 0)break;if(w[j].copyCellsFrom(w[U],y-R,Q-R,R,!0),Q-=R,Q===0&&(j--,Q=O[j]),y-=R,y===0){U--;const P=Math.max(U,0);y=(0,g.getWrappedLineTrimmedLength)(w,P,this._cols)}}for(let R=0;R<w.length;R++)O[R]<e&&w[R].setCell(O[R],l);let I=L-F;for(;I-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+_)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+t-1)}if(p.length>0){const C=[],v=[];for(let j=0;j<this.lines.length;j++)v.push(this.lines.get(j));const w=this.lines.length;let k=w-1,D=0,O=p[D];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);let L=0;for(let j=Math.min(this.lines.maxLength-1,w+_-1);j>=0;j--)if(O&&O.start>k+L){for(let Q=O.newLines.length-1;Q>=0;Q--)this.lines.set(j--,O.newLines[Q]);j++,C.push({index:k+1,amount:O.newLines.length}),L+=O.newLines.length,O=p[++D]}else this.lines.set(j,v[k--]);let F=0;for(let j=C.length-1;j>=0;j--)C[j].index+=F,this.lines.onInsertEmitter.fire(C[j]),F+=C[j].amount;const H=Math.max(0,w+_-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(e,t,l=0,p){const _=this.lines.get(e);return _?_.translateToString(t,l,p):""}getWrappedRangeForLine(e){let t=e,l=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;l+1<this.lines.length&&this.lines.get(l+1).isWrapped;)l++;return{first:t,last:l}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new r.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((l=>{t.line-=l,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((l=>{t.line>=l.index&&(t.line+=l.amount)}))),t.register(this.lines.onDelete((l=>{t.line>=l.index&&t.line<l.index+l.amount&&t.dispose(),t.line>l.index&&(t.line-=l.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const c=o(3734),d=o(511),a=o(643),f=o(482);i.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class S{constructor(r,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const t=s||d.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let l=0;l<r;++l)this.setCell(l,t);this.length=r}get(r){const s=this._data[3*r+0],e=2097151&s;return[this._data[3*r+1],2097152&s?this._combined[r]:e?(0,f.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):e]}set(r,s){this._data[3*r+1]=s[a.CHAR_DATA_ATTR_INDEX],s[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=s[1],this._data[3*r+0]=2097152|r|s[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=s[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&s}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r]:2097151&s?(0,f.stringFromCodePoint)(2097151&s):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,s){return g=3*r,s.content=this._data[g+0],s.fg=this._data[g+1],s.bg=this._data[g+2],2097152&s.content&&(s.combinedData=this._combined[r]),268435456&s.bg&&(s.extended=this._extendedAttrs[r]),s}setCell(r,s){2097152&s.content&&(this._combined[r]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[r]=s.extended),this._data[3*r+0]=s.content,this._data[3*r+1]=s.fg,this._data[3*r+2]=s.bg}setCellFromCodepoint(r,s,e,t){268435456&t.bg&&(this._extendedAttrs[r]=t.extended),this._data[3*r+0]=s|e<<22,this._data[3*r+1]=t.fg,this._data[3*r+2]=t.bg}addCodepointToCell(r,s,e){let t=this._data[3*r+0];2097152&t?this._combined[r]+=(0,f.stringFromCodePoint)(s):2097151&t?(this._combined[r]=(0,f.stringFromCodePoint)(2097151&t)+(0,f.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*r+0]=t}insertCells(r,s,e){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length-r){const t=new d.CellData;for(let l=this.length-r-s-1;l>=0;--l)this.setCell(r+s+l,this.loadCell(r+l,t));for(let l=0;l<s;++l)this.setCell(r+l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(r,s,e){if(r%=this.length,s<this.length-r){const t=new d.CellData;for(let l=0;l<this.length-r-s;++l)this.setCell(r+l,this.loadCell(r+s+l,t));for(let l=this.length-s;l<this.length;++l)this.setCell(l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,e)}replaceCells(r,s,e,t=!1){if(t)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.isProtected(r)||this.setCell(r,e),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.setCell(r++,e)}resize(r,s){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t<r;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,e);const t=Object.keys(this._combined);for(let p=0;p<t.length;p++){const _=parseInt(t[p],10);_>=r&&delete this._combined[_]}const l=Object.keys(this._extendedAttrs);for(let p=0;p<l.length;p++){const _=parseInt(l[p],10);_>=r&&delete this._extendedAttrs[_]}}return this.length=r,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,r);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const s in r._combined)this._combined[s]=r._combined[s];this._extendedAttrs={};for(const s in r._extendedAttrs)this._extendedAttrs[s]=r._extendedAttrs[s];this.isWrapped=r.isWrapped}clone(){const r=new S(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const s in this._combined)r._combined[s]=this._combined[s];for(const s in this._extendedAttrs)r._extendedAttrs[s]=this._extendedAttrs[s];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,s,e,t,l){const p=r._data;if(l)for(let C=t-1;C>=0;C--){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=p[3*(s+C)+v];268435456&p[3*(s+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[s+C])}else for(let C=0;C<t;C++){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=p[3*(s+C)+v];268435456&p[3*(s+C)+2]&&(this._extendedAttrs[e+C]=r._extendedAttrs[s+C])}const _=Object.keys(r._combined);for(let C=0;C<_.length;C++){const v=parseInt(_[C],10);v>=s&&(this._combined[v-s+e]=r._combined[v])}}translateToString(r,s,e,t){s=s??0,e=e??this.length,r&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let l="";for(;s<e;){const p=this._data[3*s+0],_=2097151&p,C=2097152&p?this._combined[s]:_?(0,f.stringFromCodePoint)(_):a.WHITESPACE_CELL_CHAR;if(l+=C,t)for(let v=0;v<C.length;++v)t.push(s);s+=p>>22||1}return t&&t.push(s),l}}i.BufferLine=S},4841:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(E,i)=>{function o(c,d,a){if(d===c.length-1)return c[d].getTrimmedLength();const f=!c[d].hasContent(a-1)&&c[d].getWidth(a-1)===1,g=c[d+1].getWidth(0)===2;return f&&g?a-1:a}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(c,d,a,f,g){const S=[];for(let u=0;u<c.length-1;u++){let r=u,s=c.get(++r);if(!s.isWrapped)continue;const e=[c.get(u)];for(;r<c.length&&s.isWrapped;)e.push(s),s=c.get(++r);if(f>=u&&f<r){u+=e.length-1;continue}let t=0,l=o(e,t,d),p=1,_=0;for(;p<e.length;){const v=o(e,p,d),w=v-_,k=a-l,D=Math.min(w,k);e[t].copyCellsFrom(e[p],_,l,D,!1),l+=D,l===a&&(t++,l=0),_+=D,_===v&&(p++,_=0),l===0&&t!==0&&e[t-1].getWidth(a-1)===2&&(e[t].copyCellsFrom(e[t-1],a-1,l++,1,!1),e[t-1].setCell(a-1,g))}e[t].replaceCells(l,a,g);let C=0;for(let v=e.length-1;v>0&&(v>t||e[v].getTrimmedLength()===0);v--)C++;C>0&&(S.push(u+e.length-C),S.push(C)),u+=e.length-1}return S},i.reflowLargerCreateNewLayout=function(c,d){const a=[];let f=0,g=d[f],S=0;for(let u=0;u<c.length;u++)if(g===u){const r=d[++f];c.onDeleteEmitter.fire({index:u-S,amount:r}),u+=r-1,S+=r,g=d[++f]}else a.push(u);return{layout:a,countRemoved:S}},i.reflowLargerApplyNewLayout=function(c,d){const a=[];for(let f=0;f<d.length;f++)a.push(c.get(d[f]));for(let f=0;f<a.length;f++)c.set(f,a[f]);c.length=d.length},i.reflowSmallerGetNewLineLengths=function(c,d,a){const f=[],g=c.map(((s,e)=>o(c,e,d))).reduce(((s,e)=>s+e));let S=0,u=0,r=0;for(;r<g;){if(g-r<a){f.push(g-r);break}S+=a;const s=o(c,u,d);S>s&&(S-=s,u++);const e=c[u].getWidth(S-1)===2;e&&S--;const t=e?a-1:a;f.push(t),r+=t}return f},i.getWrappedLineTrimmedLength=o},5295:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const c=o(8460),d=o(844),a=o(9092);class f extends d.Disposable{constructor(S,u){super(),this._optionsService=S,this._bufferService=u,this._onBufferActivate=this.register(new c.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,u){this._normal.resize(S,u),this._alt.resize(S,u),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}i.BufferSet=f},511:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=o(482),d=o(643),a=o(3734);class f extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const u=new f;return u.setFromCharData(S),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(S[d.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(S[d.CHAR_DATA_CHAR_INDEX].length===2){const r=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const s=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(r-55296)+s-56320+65536|S[d.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=S[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=f},643:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const c=o(8460),d=o(844);class a{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}i.Marker=a,a._nextId=1},7116:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(E,i)=>{var o,c,d;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
|
|
18
18
|
`,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(o||(i.C0=o={})),(function(a){a.PAD="",a.HOP="",a.BPH="",a.NBH="",a.IND="",a.NEL="
",a.SSA="",a.ESA="",a.HTS="",a.HTJ="",a.VTS="",a.PLD="",a.PLU="",a.RI="",a.SS2="",a.SS3="",a.DCS="",a.PU1="",a.PU2="",a.STS="",a.CCH="",a.MW="",a.SPA="",a.EPA="",a.SOS="",a.SGCI="",a.SCI="",a.CSI="",a.ST="",a.OSC="",a.PM="",a.APC=""})(c||(i.C1=c={})),(function(a){a.ST=`${o.ESC}\\`})(d||(i.C1_ESCAPED=d={}))},7399:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const c=o(2584),d={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:["'",'"']};i.evaluateKeyboardEvent=function(a,f,g,S){const u={type:0,cancel:!1,key:void 0},r=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?u.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?u.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?u.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(u.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:u.key=a.ctrlKey?"\b":c.C0.DEL,a.altKey&&(u.key=c.C0.ESC+u.key);break;case 9:if(a.shiftKey){u.key=c.C0.ESC+"[Z";break}u.key=c.C0.HT,u.cancel=!0;break;case 13:u.key=a.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,u.cancel=!0;break;case 27:u.key=c.C0.ESC,a.altKey&&(u.key=c.C0.ESC+c.C0.ESC),u.cancel=!0;break;case 37:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"D",u.key===c.C0.ESC+"[1;3D"&&(u.key=c.C0.ESC+(g?"b":"[1;5D"))):u.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"C",u.key===c.C0.ESC+"[1;3C"&&(u.key=c.C0.ESC+(g?"f":"[1;5C"))):u.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"A",g||u.key!==c.C0.ESC+"[1;3A"||(u.key=c.C0.ESC+"[1;5A")):u.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"B",g||u.key!==c.C0.ESC+"[1;3B"||(u.key=c.C0.ESC+"[1;5B")):u.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(u.key=c.C0.ESC+"[2~");break;case 46:u.key=r?c.C0.ESC+"[3;"+(r+1)+"~":c.C0.ESC+"[3~";break;case 36:u.key=r?c.C0.ESC+"[1;"+(r+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:u.key=r?c.C0.ESC+"[1;"+(r+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:a.shiftKey?u.type=2:a.ctrlKey?u.key=c.C0.ESC+"[5;"+(r+1)+"~":u.key=c.C0.ESC+"[5~";break;case 34:a.shiftKey?u.type=3:a.ctrlKey?u.key=c.C0.ESC+"[6;"+(r+1)+"~":u.key=c.C0.ESC+"[6~";break;case 112:u.key=r?c.C0.ESC+"[1;"+(r+1)+"P":c.C0.ESC+"OP";break;case 113:u.key=r?c.C0.ESC+"[1;"+(r+1)+"Q":c.C0.ESC+"OQ";break;case 114:u.key=r?c.C0.ESC+"[1;"+(r+1)+"R":c.C0.ESC+"OR";break;case 115:u.key=r?c.C0.ESC+"[1;"+(r+1)+"S":c.C0.ESC+"OS";break;case 116:u.key=r?c.C0.ESC+"[15;"+(r+1)+"~":c.C0.ESC+"[15~";break;case 117:u.key=r?c.C0.ESC+"[17;"+(r+1)+"~":c.C0.ESC+"[17~";break;case 118:u.key=r?c.C0.ESC+"[18;"+(r+1)+"~":c.C0.ESC+"[18~";break;case 119:u.key=r?c.C0.ESC+"[19;"+(r+1)+"~":c.C0.ESC+"[19~";break;case 120:u.key=r?c.C0.ESC+"[20;"+(r+1)+"~":c.C0.ESC+"[20~";break;case 121:u.key=r?c.C0.ESC+"[21;"+(r+1)+"~":c.C0.ESC+"[21~";break;case 122:u.key=r?c.C0.ESC+"[23;"+(r+1)+"~":c.C0.ESC+"[23~";break;case 123:u.key=r?c.C0.ESC+"[24;"+(r+1)+"~":c.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(g&&!S||!a.altKey||a.metaKey)!g||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?u.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(u.key=c.C0.US),a.key==="@"&&(u.key=c.C0.NUL)):a.keyCode===65&&(u.type=1);else{const s=d[a.keyCode],e=s==null?void 0:s[a.shiftKey?1:0];if(e)u.key=c.C0.ESC+e;else if(a.keyCode>=65&&a.keyCode<=90){const t=a.ctrlKey?a.keyCode-64:a.keyCode+32;let l=String.fromCharCode(t);a.shiftKey&&(l=l.toUpperCase()),u.key=c.C0.ESC+l}else if(a.keyCode===32)u.key=c.C0.ESC+(a.ctrlKey?c.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let t=a.code.slice(3,4);a.shiftKey||(t=t.toLowerCase()),u.key=c.C0.ESC+t,u.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?u.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?u.key=c.C0.NUL:a.keyCode>=51&&a.keyCode<=55?u.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?u.key=c.C0.DEL:a.keyCode===219?u.key=c.C0.ESC:a.keyCode===220?u.key=c.C0.FS:a.keyCode===221&&(u.key=c.C0.GS)}return u}},482:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},i.utf32ToString=function(o,c=0,d=o.length){let a="";for(let f=c;f<d;++f){let g=o[f];g>65535?(g-=65536,a+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):a+=String.fromCharCode(g)}return a},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const d=o.length;if(!d)return 0;let a=0,f=0;if(this._interim){const g=o.charCodeAt(f++);56320<=g&&g<=57343?c[a++]=1024*(this._interim-55296)+g-56320+65536:(c[a++]=this._interim,c[a++]=g),this._interim=0}for(let g=f;g<d;++g){const S=o.charCodeAt(g);if(55296<=S&&S<=56319){if(++g>=d)return this._interim=S,a;const u=o.charCodeAt(g);56320<=u&&u<=57343?c[a++]=1024*(S-55296)+u-56320+65536:(c[a++]=S,c[a++]=u)}else S!==65279&&(c[a++]=S)}return a}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const d=o.length;if(!d)return 0;let a,f,g,S,u=0,r=0,s=0;if(this.interim[0]){let l=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let _,C=0;for(;(_=63&this.interim[++C])&&C<4;)p<<=6,p|=_;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,w=v-C;for(;s<w;){if(s>=d)return 0;if(_=o[s++],(192&_)!=128){s--,l=!0;break}this.interim[C++]=_,p<<=6,p|=63&_}l||(v===2?p<128?s--:c[u++]=p:v===3?p<2048||p>=55296&&p<=57343||p===65279||(c[u++]=p):p<65536||p>1114111||(c[u++]=p)),this.interim.fill(0)}const e=d-4;let t=s;for(;t<d;){for(;!(!(t<e)||128&(a=o[t])||128&(f=o[t+1])||128&(g=o[t+2])||128&(S=o[t+3]));)c[u++]=a,c[u++]=f,c[u++]=g,c[u++]=S,t+=4;if(a=o[t++],a<128)c[u++]=a;else if((224&a)==192){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(r=(31&a)<<6|63&f,r<128){t--;continue}c[u++]=r}else if((240&a)==224){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,u;if(g=o[t++],(192&g)!=128){t--;continue}if(r=(15&a)<<12|(63&f)<<6|63&g,r<2048||r>=55296&&r<=57343||r===65279)continue;c[u++]=r}else if((248&a)==240){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,u;if(g=o[t++],(192&g)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,this.interim[2]=g,u;if(S=o[t++],(192&S)!=128){t--;continue}if(r=(7&a)<<18|(63&f)<<12|(63&g)<<6|63&S,r<65536||r>1114111)continue;c[u++]=r}}return u}}},225:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const c=o(1480),d=[[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]],a=[[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 f;i.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let g=0;g<d.length;++g)f.fill(0,d[g][0],d[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?f[g]:(function(S,u){let r,s=0,e=u.length-1;if(S<u[0][0]||S>u[e][1])return!1;for(;e>=s;)if(r=s+e>>1,S>u[r][1])s=r+1;else{if(!(S<u[r][0]))return!0;e=r-1}return!1})(g,a)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,S){let u=this.wcwidth(g),r=u===0&&S!==0;if(r){const s=c.UnicodeService.extractWidth(S);s===0?r=!1:s>u&&(u=s)}return c.UnicodeService.createPropertyValue(0,u,r)}}},5981:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const c=o(8460),d=o(844);class a extends d.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,S){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S)}_innerWrite(g=0,S=!0){const u=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],s=this._action(r,S);if(s){const t=l=>Date.now()-u>=12?setTimeout((()=>this._innerWrite(0,l))):this._innerWrite(u,l);return void s.catch((l=>(queueMicrotask((()=>{throw l})),Promise.resolve(!1)))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-u>=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()}}i.WriteBuffer=a},5941:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const o=/^([\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})$/,c=/^[\da-f]+$/;function d(a,f){const g=a.toString(16),S=g.length<2?"0"+g:g;switch(f){case 4:return g[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}i.parseColor=function(a){if(!a)return;let f=a.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const g=o.exec(f);if(g){const S=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/S*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/S*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/S*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const g=f.length/3,S=[0,0,0];for(let u=0;u<3;++u){const r=parseInt(f.slice(g*u,g*u+g),16);S[u]=g===1?r<<4:g===2?r:g===3?r>>4:r>>8}return S}},i.toRgbString=function(a,f=16){const[g,S,u]=a;return`rgb:${d(g,f)}/${d(S,f)}/${d(u,f)}`}},5770:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const c=o(482),d=o(8742),a=o(5770),f=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(S,u){this._handlers[S]===void 0&&(this._handlers[S]=[]);const r=this._handlers[S];return r.push(u),{dispose:()=>{const s=r.indexOf(u);s!==-1&&r.splice(s,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(S,u){if(this.reset(),this._ident=S,this._active=this._handlers[S]||f,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(S,u,r){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(S,u,r);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(S,u,r))}unhook(S,u=!0){if(this._active.length){let r=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,r=u,e=this._stack.fallThrough,this._stack.paused=!1),!e&&r===!1){for(;s>=0&&(r=this._active[s].unhook(S),r!==!0);s--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,r;s--}for(;s>=0;s--)if(r=this._active[s].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",S);this._active=f,this._ident=0}};const g=new d.Params;g.addParam(0),i.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=g,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():g,this._data="",this._hitLimit=!1}put(S,u,r){this._hitLimit||(this._data+=(0,c.utf32ToString)(S,u,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let u=!1;if(this._hitLimit)u=!1;else if(S&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then((r=>(this._params=g,this._data="",this._hitLimit=!1,r)));return this._params=g,this._data="",this._hitLimit=!1,u}}},2015:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const c=o(844),d=o(8742),a=o(6242),f=o(6351);class g{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,t,l){this.table[e<<8|s]=t<<4|l}addMany(s,e,t,l){for(let p=0;p<s.length;p++)this.table[e<<8|s[p]]=t<<4|l}}i.TransitionTable=g;const S=160;i.VT500_TRANSITION_TABLE=(function(){const r=new g(4095),s=Array.apply(null,Array(256)).map(((C,v)=>v)),e=(C,v)=>s.slice(C,v),t=e(32,127),l=e(0,24);l.push(25),l.push.apply(l,e(28,32));const p=e(0,14);let _;for(_ in r.setDefault(1,0),r.addMany(t,0,2,0),p)r.addMany([24,26,153,154],_,3,0),r.addMany(e(128,144),_,3,0),r.addMany(e(144,152),_,3,0),r.add(156,_,0,0),r.add(27,_,11,1),r.add(157,_,4,8),r.addMany([152,158,159],_,0,7),r.add(155,_,11,3),r.add(144,_,11,9);return r.addMany(l,0,3,0),r.addMany(l,1,3,1),r.add(127,1,0,1),r.addMany(l,8,0,8),r.addMany(l,3,3,3),r.add(127,3,0,3),r.addMany(l,4,3,4),r.add(127,4,0,4),r.addMany(l,6,3,6),r.addMany(l,5,3,5),r.add(127,5,0,5),r.addMany(l,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(t,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(e(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(t,7,0,7),r.addMany(l,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(e(64,127),3,7,0),r.addMany(e(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(e(48,60),4,8,4),r.addMany(e(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(e(32,64),6,0,6),r.add(127,6,0,6),r.addMany(e(64,127),6,0,0),r.addMany(e(32,48),3,9,5),r.addMany(e(32,48),5,9,5),r.addMany(e(48,64),5,0,6),r.addMany(e(64,127),5,7,0),r.addMany(e(32,48),4,9,5),r.addMany(e(32,48),1,9,2),r.addMany(e(32,48),2,9,2),r.addMany(e(48,127),2,10,0),r.addMany(e(48,80),1,10,0),r.addMany(e(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(e(96,127),1,10,0),r.add(80,1,11,9),r.addMany(l,9,0,9),r.add(127,9,0,9),r.addMany(e(28,32),9,0,9),r.addMany(e(32,48),9,9,12),r.addMany(e(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(l,11,0,11),r.addMany(e(32,128),11,0,11),r.addMany(e(28,32),11,0,11),r.addMany(l,10,0,10),r.add(127,10,0,10),r.addMany(e(28,32),10,0,10),r.addMany(e(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(e(32,48),10,9,12),r.addMany(l,12,0,12),r.add(127,12,0,12),r.addMany(e(28,32),12,0,12),r.addMany(e(32,48),12,9,12),r.addMany(e(48,64),12,0,11),r.addMany(e(64,127),12,12,13),r.addMany(e(64,127),10,12,13),r.addMany(e(64,127),9,12,13),r.addMany(l,13,13,13),r.addMany(t,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(S,0,2,0),r.add(S,8,5,8),r.add(S,6,0,6),r.add(S,11,0,11),r.add(S,13,13,13),r})();class u extends c.Disposable{constructor(s=i.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,l)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,e=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<s.intermediates.length;++p){const _=s.intermediates.charCodeAt(p);if(32>_||_>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=_}}if(s.final.length!==1)throw new Error("final must be a single byte");const l=s.final.charCodeAt(0);if(e[0]>l||l>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return t<<=8,t|=l,t}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const l=this._escHandlers[t];return l.push(e),{dispose:()=>{const p=l.indexOf(e);p!==-1&&l.splice(p,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const l=this._csiHandlers[t];return l.push(e),{dispose:()=>{const p=l.indexOf(e);p!==-1&&l.splice(p,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}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(s,e,t,l,p){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=t,this._parseStack.transition=l,this._parseStack.chunkPos=p}parse(s,e,t){let l,p=0,_=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let w=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&w>-1){for(;w>=0&&(l=v[w](this._params),l!==!0);w--)if(l instanceof Promise)return this._parseStack.handlerPos=w,l}this._parseStack.handlers=[];break;case 4:if(t===!1&&w>-1){for(;w>=0&&(l=v[w](),l!==!0);w--)if(l instanceof Promise)return this._parseStack.handlerPos=w,l}this._parseStack.handlers=[];break;case 6:if(p=s[this._parseStack.chunkPos],l=this._dcsParser.unhook(p!==24&&p!==26,t),l)return l;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=s[this._parseStack.chunkPos],l=this._oscParser.end(p!==24&&p!==26,t),l)return l;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=C;v<e;++v){switch(p=s[v],_=this._transitions.table[this.currentState<<8|(p<160?p:S)],_>>4){case 2:for(let L=v+1;;++L){if(L>=e||(p=s[L])<32||p>126&&p<S){this._printHandler(s,v,L),v=L-1;break}if(++L>=e||(p=s[L])<32||p>126&&p<S){this._printHandler(s,v,L),v=L-1;break}if(++L>=e||(p=s[L])<32||p>126&&p<S){this._printHandler(s,v,L),v=L-1;break}if(++L>=e||(p=s[L])<32||p>126&&p<S){this._printHandler(s,v,L),v=L-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const w=this._csiHandlers[this._collect<<8|p];let k=w?w.length-1:-1;for(;k>=0&&(l=w[k](this._params),l!==!0);k--)if(l instanceof Promise)return this._preserveStack(3,w,k,_,v),l;k<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingJoinState=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++v<e&&(p=s[v])>47&&p<60);v--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:const D=this._escHandlers[this._collect<<8|p];let O=D?D.length-1:-1;for(;O>=0&&(l=D[O](),l!==!0);O--)if(l instanceof Promise)return this._preserveStack(4,D,O,_,v),l;O<0&&this._escHandlerFb(this._collect<<8|p),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|p,this._params);break;case 13:for(let L=v+1;;++L)if(L>=e||(p=s[L])===24||p===26||p===27||p>127&&p<S){this._dcsParser.put(s,v,L),v=L-1;break}break;case 14:if(l=this._dcsParser.unhook(p!==24&&p!==26),l)return this._preserveStack(6,[],0,_,v),l;p===27&&(_|=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=v+1;;L++)if(L>=e||(p=s[L])<32||p>127&&p<S){this._oscParser.put(s,v,L),v=L-1;break}break;case 6:if(l=this._oscParser.end(p!==24&&p!==26),l)return this._preserveStack(5,[],0,_,v),l;p===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&_}}}i.EscapeSequenceParser=u},6242:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const c=o(5770),d=o(482),a=[];i.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,g){this._handlers[f]===void 0&&(this._handlers[f]=[]);const S=this._handlers[f];return S.push(g),{dispose:()=>{const u=S.indexOf(g);u!==-1&&S.splice(u,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,g,S){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(f,g,S);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(f,g,S))}start(){this.reset(),this._state=1}put(f,g,S){if(this._state!==3){if(this._state===1)for(;g<S;){const u=f[g++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&S-g>0&&this._put(f,g,S)}}end(f,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,u=this._active.length-1,r=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,S=g,r=this._stack.fallThrough,this._stack.paused=!1),!r&&S===!1){for(;u>=0&&(S=this._active[u].end(f),S!==!0);u--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,S;u--}for(;u>=0;u--)if(S=this._active[u].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",f);this._active=a,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,g,S){this._hitLimit||(this._data+=(0,d.utf32ToString)(f,g,S),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let g=!1;if(this._hitLimit)g=!1;else if(f&&(g=this._handler(this._data),g instanceof Promise))return g.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,g}}},8742:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const o=2147483647;class c{static fromArray(a){const f=new c;if(!a.length)return f;for(let g=Array.isArray(a[0])?1:0;g<a.length;++g){const S=a[g];if(Array.isArray(S))for(let u=0;u<S.length;++u)f.addSubParam(S[u]);else f.addParam(S)}return f}constructor(a=32,f=32){if(this.maxLength=a,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new c(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let f=0;f<this.length;++f){a.push(this.params[f]);const g=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-g>0&&a.push(Array.prototype.slice.call(this._subParams,g,S))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>o?o:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>o?o:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const f=this._subParamsIdx[a]>>8,g=255&this._subParamsIdx[a];return g-f>0?this._subParams.subarray(f,g):null}getSubParamsAll(){const a={};for(let f=0;f<this.length;++f){const g=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-g>0&&(a[f]=this._subParams.slice(g,S))}return a}addDigit(a){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,S=g[f-1];g[f-1]=~S?Math.min(10*S+a,o):a}}i.Params=c},5741:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const d={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(d),c.dispose=()=>this._wrappedAddonDispose(d),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===o){c=d;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const c=o(3785),d=o(511);i.BufferApiView=class{constructor(a,f){this._buffer=a,this.type=f}init(a){return this._buffer=a,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(a){const f=this._buffer.lines.get(a);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new d.CellData}}},3785:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const c=o(511);i.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,a){if(!(d<0||d>=this._line.length))return a?(this._line.loadCell(d,a),a):this._line.loadCell(d,new c.CellData)}translateToString(d,a,f){return this._line.translateToString(d,a,f)}}},8285:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const c=o(8771),d=o(8460),a=o(844);class f extends a.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}i.BufferNamespaceApi=f},7975:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,(d=>c(d.toArray())))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,((d,a)=>c(d,a.toArray())))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(E,i,o){var c=this&&this.__decorate||function(r,s,e,t){var l,p=arguments.length,_=p<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(r,s,e,t);else for(var C=r.length-1;C>=0;C--)(l=r[C])&&(_=(p<3?l(_):p>3?l(s,e,_):l(s,e))||_);return p>3&&_&&Object.defineProperty(s,e,_),_},d=this&&this.__param||function(r,s){return function(e,t){s(e,t,r)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const a=o(8460),f=o(844),g=o(5295),S=o(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let u=i.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(r,this))}resize(r,s){this.cols=r,this.rows=s,this.buffers.resize(r,s),this._onResize.fire({cols:r,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,s=!1){const e=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===r.fg&&t.getBg(0)===r.bg||(t=e.getBlankLine(r,s),this._cachedBlankLine=t),t.isWrapped=s;const l=e.ybase+e.scrollTop,p=e.ybase+e.scrollBottom;if(e.scrollTop===0){const _=e.lines.isFull;p===e.lines.length-1?_?e.lines.recycle().copyFrom(t):e.lines.push(t.clone()):e.lines.splice(p+1,0,t.clone()),_?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const _=p-l+1;e.lines.shiftElements(l+1,_-1,-1),e.lines.set(p,t.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(r,s,e){const t=this.buffer;if(r<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else r+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const l=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+r,t.ybase),0),l!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}};i.BufferService=u=c([d(0,S.IOptionsService)],u)},7994:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(E,i,o){var c=this&&this.__decorate||function(t,l,p,_){var C,v=arguments.length,w=v<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,p):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,l,p,_);else for(var k=t.length-1;k>=0;k--)(C=t[k])&&(w=(v<3?C(w):v>3?C(l,p,w):C(l,p))||w);return v>3&&w&&Object.defineProperty(l,p,w),w},d=this&&this.__param||function(t,l){return function(p,_){l(p,_,t)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const a=o(2585),f=o(8460),g=o(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function u(t,l){let p=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(p|=64,p|=t.action):(p|=3&t.button,4&t.button&&(p|=64),8&t.button&&(p|=128),t.action===32?p|=32:t.action!==0||l||(p|=3)),p}const r=String.fromCharCode,s={DEFAULT:t=>{const l=[u(t,!1)+32,t.col+32,t.row+32];return l[0]>255||l[1]>255||l[2]>255?"":`\x1B[M${r(l[0])}${r(l[1])}${r(l[2])}`},SGR:t=>{const l=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.col};${t.row}${l}`},SGR_PIXELS:t=>{const l=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.x};${t.y}${l}`}};let e=i.CoreMouseService=class extends g.Disposable{constructor(t,l){super(),this._bufferService=t,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const p of Object.keys(S))this.addProtocol(p,S[p]);for(const p of Object.keys(s))this.addEncoding(p,s[p]);this.reset()}addProtocol(t,l){this._protocols[t]=l}addEncoding(t,l){this._encodings[t]=l}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const l=this._encodings[this._activeEncoding](t);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,l,p){if(p){if(t.x!==l.x||t.y!==l.y)return!1}else if(t.col!==l.col||t.row!==l.row)return!1;return t.button===l.button&&t.action===l.action&&t.ctrl===l.ctrl&&t.alt===l.alt&&t.shift===l.shift}};i.CoreMouseService=e=c([d(0,a.IBufferService),d(1,a.ICoreService)],e)},6975:function(E,i,o){var c=this&&this.__decorate||function(e,t,l,p){var _,C=arguments.length,v=C<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,t,l,p);else for(var w=e.length-1;w>=0;w--)(_=e[w])&&(v=(C<3?_(v):C>3?_(t,l,v):_(t,l))||v);return C>3&&v&&Object.defineProperty(t,l,v),v},d=this&&this.__param||function(e,t){return function(l,p){t(l,p,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const a=o(1439),f=o(8460),g=o(844),S=o(2585),u=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=i.CoreService=class extends g.Disposable{constructor(e,t,l){super(),this._bufferService=e,this._logService=t,this._optionsService=l,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(u),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(u),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const l=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&l.ybase!==l.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((p=>p.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(e))}};i.CoreService=s=c([d(0,S.IBufferService),d(1,S.ILogService),d(2,S.IOptionsService)],s)},9074:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const c=o(8055),d=o(8460),a=o(844),f=o(6106);let g=0,S=0;class u extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList((e=>e==null?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new r(e);if(t){const l=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),l.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,l){let p=0,_=0;for(const C of this._decorations.getKeyIterator(t))p=C.options.x??0,_=p+(C.options.width??1),e>=p&&e<_&&(!l||(C.options.layer??"bottom")===l)&&(yield C)}forEachDecorationAtCell(e,t,l,p){this._decorations.forEachByKey(t,(_=>{g=_.options.x??0,S=g+(_.options.width??1),e>=g&&e<S&&(!l||(_.options.layer??"bottom")===l)&&p(_)}))}}i.DecorationService=u;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const c=o(2585),d=o(8343);class a{constructor(...g){this._entries=new Map;for(const[S,u]of g)this.set(S,u)}set(g,S){const u=this._entries.get(g);return this._entries.set(g,S),u}forEach(g){for(const[S,u]of this._entries.entries())g(S,u)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}i.ServiceCollection=a,i.InstantiationService=class{constructor(){this._services=new a,this._services.set(c.IInstantiationService,this)}setService(f,g){this._services.set(f,g)}getService(f){return this._services.get(f)}createInstance(f,...g){const S=(0,d.getServiceDependencies)(f).sort(((s,e)=>s.index-e.index)),u=[];for(const s of S){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${s.id}.`);u.push(e)}const r=S.length>0?S[0].index:g.length;if(g.length!==r)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${r+1} conflicts with ${g.length} static arguments`);return new f(...g,...u)}}},7866:function(E,i,o){var c=this&&this.__decorate||function(r,s,e,t){var l,p=arguments.length,_=p<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(r,s,e,t);else for(var C=r.length-1;C>=0;C--)(l=r[C])&&(_=(p<3?l(_):p>3?l(s,e,_):l(s,e))||_);return p>3&&_&&Object.defineProperty(s,e,_),_},d=this&&this.__param||function(r,s){return function(e,t){s(e,t,r)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const a=o(844),f=o(2585),g={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let S,u=i.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let s=0;s<r.length;s++)typeof r[s]=="function"&&(r[s]=r[s]())}_log(r,s,e){this._evalLazyOptionalParams(e),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...e)}trace(r,...s){var e;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,r,s)}debug(r,...s){var e;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,r,s)}info(r,...s){var e;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,r,s)}warn(r,...s){var e;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,r,s)}error(r,...s){var e;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,r,s)}};i.LogService=u=c([d(0,f.IOptionsService)],u),i.setTraceLogger=function(r){S=r},i.traceCall=function(r,s,e){if(typeof e.value!="function")throw new Error("not supported");const t=e.value;e.value=function(...l){if(S.logLevel!==f.LogLevelEnum.TRACE)return t.apply(this,l);S.trace(`GlyphRenderer#${t.name}(${l.map((_=>JSON.stringify(_))).join(", ")})`);const p=t.apply(this,l);return S.trace(`GlyphRenderer#${t.name} return`,p),p}}},7302:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const c=o(8460),d=o(844),a=o(6114);i.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:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends d.Disposable{constructor(u){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...i.DEFAULT_OPTIONS};for(const s in u)if(s in r)try{const e=u[s];r[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,d.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(u,r){return this.onOptionChange((s=>{s===u&&r(this.rawOptions[u])}))}onMultipleOptionChange(u,r){return this.onOptionChange((s=>{u.indexOf(s)!==-1&&r()}))}_setupOptions(){const u=s=>{if(!(s in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},r=(s,e)=>{if(!(s in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:u.bind(this,s),set:r.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(u,r){switch(u){case"cursorStyle":if(r||(r=i.DEFAULT_OPTIONS[u]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${u}`);break;case"wordSeparator":r||(r=i.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=f.includes(r)?r:i.DEFAULT_OPTIONS[u];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${u} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${u} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}i.OptionsService=g},2660:function(E,i,o){var c=this&&this.__decorate||function(g,S,u,r){var s,e=arguments.length,t=e<3?S:r===null?r=Object.getOwnPropertyDescriptor(S,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(g,S,u,r);else for(var l=g.length-1;l>=0;l--)(s=g[l])&&(t=(e<3?s(t):e>3?s(S,u,t):s(S,u))||t);return e>3&&t&&Object.defineProperty(S,u,t),t},d=this&&this.__param||function(g,S){return function(u,r){S(u,r,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const a=o(2585);let f=i.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const S=this._bufferService.buffer;if(g.id===void 0){const l=S.addMarker(S.ybase+S.y),p={data:g,id:this._nextId++,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(p,l))),this._dataByLinkId.set(p.id,p),p.id}const u=g,r=this._getEntryIdKey(u),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,S.ybase+S.y),s.id;const e=S.addMarker(S.ybase+S.y),t={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(t,e))),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(g,S){const u=this._dataByLinkId.get(g);if(u&&u.lines.every((r=>r.line!==S))){const r=this._bufferService.buffer.addMarker(S);u.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(u,r)))}}getLinkData(g){var S;return(S=this._dataByLinkId.get(g))==null?void 0:S.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,S){const u=g.lines.indexOf(S);u!==-1&&(g.lines.splice(u,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};i.OscLinkService=f=c([d(0,a.IBufferService)],f)},8343:(E,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const o="di$target",c="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(d){return d[c]||[]},i.createDecorator=function(d){if(i.serviceRegistry.has(d))return i.serviceRegistry.get(d);const a=function(f,g,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,r,s){r[o]===r?r[c].push({id:u,index:s}):(r[c]=[{id:u,index:s}],r[o]=r)})(a,f,S)};return a.toString=()=>d,i.serviceRegistry.set(d,a),a}},2585:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const c=o(8343);var d;i.IBufferService=(0,c.createDecorator)("BufferService"),i.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),i.ICoreService=(0,c.createDecorator)("CoreService"),i.ICharsetService=(0,c.createDecorator)("CharsetService"),i.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(d||(i.LogLevelEnum=d={})),i.ILogService=(0,c.createDecorator)("LogService"),i.IOptionsService=(0,c.createDecorator)("OptionsService"),i.IOscLinkService=(0,c.createDecorator)("OscLinkService"),i.IUnicodeService=(0,c.createDecorator)("UnicodeService"),i.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(E,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const c=o(8460),d=o(225);class a{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,S,u=!1){return(16777215&g)<<3|(3&S)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const g=new d.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let S=0,u=0;const r=g.length;for(let s=0;s<r;++s){let e=g.charCodeAt(s);if(55296<=e&&e<=56319){if(++s>=r)return S+this.wcwidth(e);const p=g.charCodeAt(s);56320<=p&&p<=57343?e=1024*(e-55296)+p-56320+65536:S+=this.wcwidth(p)}const t=this.charProperties(e,u);let l=a.extractWidth(t);a.extractShouldJoin(t)&&(l-=a.extractWidth(u)),S+=l,u=t}return S}charProperties(g,S){return this._activeProvider.charProperties(g,S)}}i.UnicodeService=a}},b={};function A(E){var i=b[E];if(i!==void 0)return i.exports;var o=b[E]={exports:{}};return m[E].call(o.exports,o,o.exports,A),o.exports}var B={};return(()=>{var E=B;Object.defineProperty(E,"__esModule",{value:!0}),E.Terminal=void 0;const i=A(9042),o=A(3236),c=A(844),d=A(5741),a=A(8285),f=A(7975),g=A(7090),S=["cols","rows"];class u extends c.Disposable{constructor(s){super(),this._core=this.register(new o.Terminal(s)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const e=l=>this._core.options[l],t=(l,p)=>{this._checkReadonlyOptions(l),this._core.options[l]=p};for(const l in this._core.options){const p={get:e.bind(this,l),set:t.bind(this,l)};Object.defineProperty(this._publicOptions,l,p)}}_checkReadonlyOptions(s){if(S.includes(s))throw new Error(`Option "${s}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.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 a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,t){this._verifyIntegers(s,e,t),this._core.select(s,e,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
|
|
19
|
-
`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return i}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}E.Terminal=u})(),B})()))})(bt)),bt.exports}var As=ys();function ve(n,h,{checkForDefaultPrevented:m=!0}={}){return function(A){if(n==null||n(A),m===!1||!A.defaultPrevented)return h==null?void 0:h(A)}}function $t(n,h){if(typeof n=="function")return n(h);n!=null&&(n.current=h)}function Br(...n){return h=>{let m=!1;const b=n.map(A=>{const B=$t(A,h);return!m&&typeof B=="function"&&(m=!0),B});if(m)return()=>{for(let A=0;A<b.length;A++){const B=b[A];typeof B=="function"?B():$t(n[A],null)}}}}function Re(...n){return N.useCallback(Br(...n),n)}function Rr(n,h=[]){let m=[];function b(B,E){const i=N.createContext(E),o=m.length;m=[...m,E];const c=a=>{var s;const{scope:f,children:g,...S}=a,u=((s=f==null?void 0:f[n])==null?void 0:s[o])||i,r=N.useMemo(()=>S,Object.values(S));return q.jsx(u.Provider,{value:r,children:g})};c.displayName=B+"Provider";function d(a,f){var u;const g=((u=f==null?void 0:f[n])==null?void 0:u[o])||i,S=N.useContext(g);if(S)return S;if(E!==void 0)return E;throw new Error(`\`${a}\` must be used within \`${B}\``)}return[c,d]}const A=()=>{const B=m.map(E=>N.createContext(E));return function(i){const o=(i==null?void 0:i[n])||B;return N.useMemo(()=>({[`__scope${n}`]:{...i,[n]:o}}),[i,o])}};return A.scopeName=n,[b,Es(A,...h)]}function Es(...n){const h=n[0];if(n.length===1)return h;const m=()=>{const b=n.map(A=>({useScope:A(),scopeName:A.scopeName}));return function(B){const E=b.reduce((i,{useScope:o,scopeName:c})=>{const a=o(B)[`__scope${c}`];return{...i,...a}},{});return N.useMemo(()=>({[`__scope${h.scopeName}`]:E}),[E])}};return m.scopeName=h.scopeName,m}function xs(n){const h=Bs(n),m=N.forwardRef((b,A)=>{const{children:B,...E}=b,i=N.Children.toArray(B),o=i.find(ks);if(o){const c=o.props.children,d=i.map(a=>a===o?N.Children.count(c)>1?N.Children.only(null):N.isValidElement(c)?c.props.children:null:a);return q.jsx(h,{...E,ref:A,children:N.isValidElement(c)?N.cloneElement(c,void 0,d):null})}return q.jsx(h,{...E,ref:A,children:B})});return m.displayName=`${n}.Slot`,m}function Bs(n){const h=N.forwardRef((m,b)=>{const{children:A,...B}=m;if(N.isValidElement(A)){const E=Is(A),i=Ls(B,A.props);return A.type!==N.Fragment&&(i.ref=b?Br(b,E):E),N.cloneElement(A,i)}return N.Children.count(A)>1?N.Children.only(null):null});return h.displayName=`${n}.SlotClone`,h}var kr=Symbol("radix.slottable");function Rs(n){const h=({children:m})=>q.jsx(q.Fragment,{children:m});return h.displayName=`${n}.Slottable`,h.__radixId=kr,h}function ks(n){return N.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===kr}function Ls(n,h){const m={...h};for(const b in h){const A=n[b],B=h[b];/^on[A-Z]/.test(b)?A&&B?m[b]=(...i)=>{const o=B(...i);return A(...i),o}:A&&(m[b]=A):b==="style"?m[b]={...A,...B}:b==="className"&&(m[b]=[A,B].filter(Boolean).join(" "))}return{...n,...m}}function Is(n){var b,A;let h=(b=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:b.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(A=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:A.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var Ds=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ds.reduce((n,h)=>{const m=xs(`Primitive.${h}`),b=N.forwardRef((A,B)=>{const{asChild:E,...i}=A,o=E?m:h;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),q.jsx(o,{...i,ref:B})});return b.displayName=`Primitive.${h}`,{...n,[h]:b}},{});function Ps(n,h){n&&_r.flushSync(()=>n.dispatchEvent(h))}function ct(n){const h=N.useRef(n);return N.useEffect(()=>{h.current=n}),N.useMemo(()=>(...m)=>{var b;return(b=h.current)==null?void 0:b.call(h,...m)},[])}function Os(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n);N.useEffect(()=>{const b=A=>{A.key==="Escape"&&m(A)};return h.addEventListener("keydown",b,{capture:!0}),()=>h.removeEventListener("keydown",b,{capture:!0})},[m,h])}var Ts="DismissableLayer",kt="dismissableLayer.update",Ms="dismissableLayer.pointerDownOutside",Hs="dismissableLayer.focusOutside",er,Lr=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ir=N.forwardRef((n,h)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:b,onPointerDownOutside:A,onFocusOutside:B,onInteractOutside:E,onDismiss:i,...o}=n,c=N.useContext(Lr),[d,a]=N.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=N.useState({}),S=Re(h,C=>a(C)),u=Array.from(c.layers),[r]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),s=u.indexOf(r),e=d?u.indexOf(d):-1,t=c.layersWithOutsidePointerEventsDisabled.size>0,l=e>=s,p=Ws(C=>{const v=C.target,w=[...c.branches].some(k=>k.contains(v));!l||w||(A==null||A(C),E==null||E(C),C.defaultPrevented||i==null||i())},f),_=Ns(C=>{const v=C.target;[...c.branches].some(k=>k.contains(v))||(B==null||B(C),E==null||E(C),C.defaultPrevented||i==null||i())},f);return Os(C=>{e===c.layers.size-1&&(b==null||b(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},f),N.useEffect(()=>{if(d)return m&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(er=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),tr(),()=>{m&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=er)}},[d,f,m,c]),N.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,c]),N.useEffect(()=>{const C=()=>g({});return document.addEventListener(kt,C),()=>document.removeEventListener(kt,C)},[]),q.jsx(Ee.div,{...o,ref:S,style:{pointerEvents:t?l?"auto":"none":void 0,...n.style},onFocusCapture:ve(n.onFocusCapture,_.onFocusCapture),onBlurCapture:ve(n.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ve(n.onPointerDownCapture,p.onPointerDownCapture)})});Ir.displayName=Ts;var Fs="DismissableLayerBranch",js=N.forwardRef((n,h)=>{const m=N.useContext(Lr),b=N.useRef(null),A=Re(h,b);return N.useEffect(()=>{const B=b.current;if(B)return m.branches.add(B),()=>{m.branches.delete(B)}},[m.branches]),q.jsx(Ee.div,{...n,ref:A})});js.displayName=Fs;function Ws(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),b=N.useRef(!1),A=N.useRef(()=>{});return N.useEffect(()=>{const B=i=>{if(i.target&&!b.current){let o=function(){Dr(Ms,m,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(h.removeEventListener("click",A.current),A.current=o,h.addEventListener("click",A.current,{once:!0})):o()}else h.removeEventListener("click",A.current);b.current=!1},E=window.setTimeout(()=>{h.addEventListener("pointerdown",B)},0);return()=>{window.clearTimeout(E),h.removeEventListener("pointerdown",B),h.removeEventListener("click",A.current)}},[h,m]),{onPointerDownCapture:()=>b.current=!0}}function Ns(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),b=N.useRef(!1);return N.useEffect(()=>{const A=B=>{B.target&&!b.current&&Dr(Hs,m,{originalEvent:B},{discrete:!1})};return h.addEventListener("focusin",A),()=>h.removeEventListener("focusin",A)},[h,m]),{onFocusCapture:()=>b.current=!0,onBlurCapture:()=>b.current=!1}}function tr(){const n=new CustomEvent(kt);document.dispatchEvent(n)}function Dr(n,h,m,{discrete:b}){const A=m.originalEvent.target,B=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:m});h&&A.addEventListener(n,h,{once:!0}),b?Ps(A,B):A.dispatchEvent(B)}var we=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},Us=N[" useId ".trim().toString()]||(()=>{}),zs=0;function Qs(n){const[h,m]=N.useState(Us());return we(()=>{m(b=>b??String(zs++))},[n]),h?`radix-${h}`:""}const Ks=["top","right","bottom","left"],ye=Math.min,ne=Math.max,it=Math.round,Je=Math.floor,de=n=>({x:n,y:n}),Gs={left:"right",right:"left",bottom:"top",top:"bottom"},qs={start:"end",end:"start"};function Lt(n,h,m){return ne(n,ye(h,m))}function pe(n,h){return typeof n=="function"?n(h):n}function _e(n){return n.split("-")[0]}function Pe(n){return n.split("-")[1]}function Tt(n){return n==="x"?"y":"x"}function Mt(n){return n==="y"?"height":"width"}const Ys=new Set(["top","bottom"]);function ue(n){return Ys.has(_e(n))?"y":"x"}function Ht(n){return Tt(ue(n))}function Vs(n,h,m){m===void 0&&(m=!1);const b=Pe(n),A=Ht(n),B=Mt(A);let E=A==="x"?b===(m?"end":"start")?"right":"left":b==="start"?"bottom":"top";return h.reference[B]>h.floating[B]&&(E=st(E)),[E,st(E)]}function Xs(n){const h=st(n);return[It(n),h,It(h)]}function It(n){return n.replace(/start|end/g,h=>qs[h])}const rr=["left","right"],ir=["right","left"],Zs=["top","bottom"],Js=["bottom","top"];function $s(n,h,m){switch(n){case"top":case"bottom":return m?h?ir:rr:h?rr:ir;case"left":case"right":return h?Zs:Js;default:return[]}}function en(n,h,m,b){const A=Pe(n);let B=$s(_e(n),m==="start",b);return A&&(B=B.map(E=>E+"-"+A),h&&(B=B.concat(B.map(It)))),B}function st(n){return n.replace(/left|right|bottom|top/g,h=>Gs[h])}function tn(n){return{top:0,right:0,bottom:0,left:0,...n}}function Pr(n){return typeof n!="number"?tn(n):{top:n,right:n,bottom:n,left:n}}function nt(n){const{x:h,y:m,width:b,height:A}=n;return{width:b,height:A,top:m,left:h,right:h+b,bottom:m+A,x:h,y:m}}function sr(n,h,m){let{reference:b,floating:A}=n;const B=ue(h),E=Ht(h),i=Mt(E),o=_e(h),c=B==="y",d=b.x+b.width/2-A.width/2,a=b.y+b.height/2-A.height/2,f=b[i]/2-A[i]/2;let g;switch(o){case"top":g={x:d,y:b.y-A.height};break;case"bottom":g={x:d,y:b.y+b.height};break;case"right":g={x:b.x+b.width,y:a};break;case"left":g={x:b.x-A.width,y:a};break;default:g={x:b.x,y:b.y}}switch(Pe(h)){case"start":g[E]-=f*(m&&c?-1:1);break;case"end":g[E]+=f*(m&&c?-1:1);break}return g}const rn=async(n,h,m)=>{const{placement:b="bottom",strategy:A="absolute",middleware:B=[],platform:E}=m,i=B.filter(Boolean),o=await(E.isRTL==null?void 0:E.isRTL(h));let c=await E.getElementRects({reference:n,floating:h,strategy:A}),{x:d,y:a}=sr(c,b,o),f=b,g={},S=0;for(let u=0;u<i.length;u++){const{name:r,fn:s}=i[u],{x:e,y:t,data:l,reset:p}=await s({x:d,y:a,initialPlacement:b,placement:f,strategy:A,middlewareData:g,rects:c,platform:E,elements:{reference:n,floating:h}});d=e??d,a=t??a,g={...g,[r]:{...g[r],...l}},p&&S<=50&&(S++,typeof p=="object"&&(p.placement&&(f=p.placement),p.rects&&(c=p.rects===!0?await E.getElementRects({reference:n,floating:h,strategy:A}):p.rects),{x:d,y:a}=sr(c,f,o)),u=-1)}return{x:d,y:a,placement:f,strategy:A,middlewareData:g}};async function Ue(n,h){var m;h===void 0&&(h={});const{x:b,y:A,platform:B,rects:E,elements:i,strategy:o}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:a="floating",altBoundary:f=!1,padding:g=0}=pe(h,n),S=Pr(g),r=i[f?a==="floating"?"reference":"floating":a],s=nt(await B.getClippingRect({element:(m=await(B.isElement==null?void 0:B.isElement(r)))==null||m?r:r.contextElement||await(B.getDocumentElement==null?void 0:B.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:o})),e=a==="floating"?{x:b,y:A,width:E.floating.width,height:E.floating.height}:E.reference,t=await(B.getOffsetParent==null?void 0:B.getOffsetParent(i.floating)),l=await(B.isElement==null?void 0:B.isElement(t))?await(B.getScale==null?void 0:B.getScale(t))||{x:1,y:1}:{x:1,y:1},p=nt(B.convertOffsetParentRelativeRectToViewportRelativeRect?await B.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:e,offsetParent:t,strategy:o}):e);return{top:(s.top-p.top+S.top)/l.y,bottom:(p.bottom-s.bottom+S.bottom)/l.y,left:(s.left-p.left+S.left)/l.x,right:(p.right-s.right+S.right)/l.x}}const sn=n=>({name:"arrow",options:n,async fn(h){const{x:m,y:b,placement:A,rects:B,platform:E,elements:i,middlewareData:o}=h,{element:c,padding:d=0}=pe(n,h)||{};if(c==null)return{};const a=Pr(d),f={x:m,y:b},g=Ht(A),S=Mt(g),u=await E.getDimensions(c),r=g==="y",s=r?"top":"left",e=r?"bottom":"right",t=r?"clientHeight":"clientWidth",l=B.reference[S]+B.reference[g]-f[g]-B.floating[S],p=f[g]-B.reference[g],_=await(E.getOffsetParent==null?void 0:E.getOffsetParent(c));let C=_?_[t]:0;(!C||!await(E.isElement==null?void 0:E.isElement(_)))&&(C=i.floating[t]||B.floating[S]);const v=l/2-p/2,w=C/2-u[S]/2-1,k=ye(a[s],w),D=ye(a[e],w),O=k,L=C-u[S]-D,F=C/2-u[S]/2+v,H=Lt(O,F,L),W=!o.arrow&&Pe(A)!=null&&F!==H&&B.reference[S]/2-(F<O?k:D)-u[S]/2<0,G=W?F<O?F-O:F-L:0;return{[g]:f[g]+G,data:{[g]:H,centerOffset:F-H-G,...W&&{alignmentOffset:G}},reset:W}}}),nn=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(h){var m,b;const{placement:A,middlewareData:B,rects:E,initialPlacement:i,platform:o,elements:c}=h,{mainAxis:d=!0,crossAxis:a=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:u=!0,...r}=pe(n,h);if((m=B.arrow)!=null&&m.alignmentOffset)return{};const s=_e(A),e=ue(i),t=_e(i)===i,l=await(o.isRTL==null?void 0:o.isRTL(c.floating)),p=f||(t||!u?[st(i)]:Xs(i)),_=S!=="none";!f&&_&&p.push(...en(i,u,S,l));const C=[i,...p],v=await Ue(h,r),w=[];let k=((b=B.flip)==null?void 0:b.overflows)||[];if(d&&w.push(v[s]),a){const F=Vs(A,E,l);w.push(v[F[0]],v[F[1]])}if(k=[...k,{placement:A,overflows:w}],!w.every(F=>F<=0)){var D,O;const F=(((D=B.flip)==null?void 0:D.index)||0)+1,H=C[F];if(H&&(!(a==="alignment"?e!==ue(H):!1)||k.every(U=>ue(U.placement)===e?U.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:H}};let W=(O=k.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(g){case"bestFit":{var L;const G=(L=k.filter(U=>{if(_){const y=ue(U.placement);return y===e||y==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(y=>y>0).reduce((y,R)=>y+R,0)]).sort((U,y)=>U[1]-y[1])[0])==null?void 0:L[0];G&&(W=G);break}case"initialPlacement":W=i;break}if(A!==W)return{reset:{placement:W}}}return{}}}};function nr(n,h){return{top:n.top-h.height,right:n.right-h.width,bottom:n.bottom-h.height,left:n.left-h.width}}function or(n){return Ks.some(h=>n[h]>=0)}const on=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(h){const{rects:m}=h,{strategy:b="referenceHidden",...A}=pe(n,h);switch(b){case"referenceHidden":{const B=await Ue(h,{...A,elementContext:"reference"}),E=nr(B,m.reference);return{data:{referenceHiddenOffsets:E,referenceHidden:or(E)}}}case"escaped":{const B=await Ue(h,{...A,altBoundary:!0}),E=nr(B,m.floating);return{data:{escapedOffsets:E,escaped:or(E)}}}default:return{}}}}},Or=new Set(["left","top"]);async function an(n,h){const{placement:m,platform:b,elements:A}=n,B=await(b.isRTL==null?void 0:b.isRTL(A.floating)),E=_e(m),i=Pe(m),o=ue(m)==="y",c=Or.has(E)?-1:1,d=B&&o?-1:1,a=pe(h,n);let{mainAxis:f,crossAxis:g,alignmentAxis:S}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return i&&typeof S=="number"&&(g=i==="end"?S*-1:S),o?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const cn=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(h){var m,b;const{x:A,y:B,placement:E,middlewareData:i}=h,o=await an(h,n);return E===((m=i.offset)==null?void 0:m.placement)&&(b=i.arrow)!=null&&b.alignmentOffset?{}:{x:A+o.x,y:B+o.y,data:{...o,placement:E}}}}},ln=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(h){const{x:m,y:b,placement:A}=h,{mainAxis:B=!0,crossAxis:E=!1,limiter:i={fn:r=>{let{x:s,y:e}=r;return{x:s,y:e}}},...o}=pe(n,h),c={x:m,y:b},d=await Ue(h,o),a=ue(_e(A)),f=Tt(a);let g=c[f],S=c[a];if(B){const r=f==="y"?"top":"left",s=f==="y"?"bottom":"right",e=g+d[r],t=g-d[s];g=Lt(e,g,t)}if(E){const r=a==="y"?"top":"left",s=a==="y"?"bottom":"right",e=S+d[r],t=S-d[s];S=Lt(e,S,t)}const u=i.fn({...h,[f]:g,[a]:S});return{...u,data:{x:u.x-m,y:u.y-b,enabled:{[f]:B,[a]:E}}}}}},hn=function(n){return n===void 0&&(n={}),{options:n,fn(h){const{x:m,y:b,placement:A,rects:B,middlewareData:E}=h,{offset:i=0,mainAxis:o=!0,crossAxis:c=!0}=pe(n,h),d={x:m,y:b},a=ue(A),f=Tt(a);let g=d[f],S=d[a];const u=pe(i,h),r=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(o){const t=f==="y"?"height":"width",l=B.reference[f]-B.floating[t]+r.mainAxis,p=B.reference[f]+B.reference[t]-r.mainAxis;g<l?g=l:g>p&&(g=p)}if(c){var s,e;const t=f==="y"?"width":"height",l=Or.has(_e(A)),p=B.reference[a]-B.floating[t]+(l&&((s=E.offset)==null?void 0:s[a])||0)+(l?0:r.crossAxis),_=B.reference[a]+B.reference[t]+(l?0:((e=E.offset)==null?void 0:e[a])||0)-(l?r.crossAxis:0);S<p?S=p:S>_&&(S=_)}return{[f]:g,[a]:S}}}},un=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(h){var m,b;const{placement:A,rects:B,platform:E,elements:i}=h,{apply:o=()=>{},...c}=pe(n,h),d=await Ue(h,c),a=_e(A),f=Pe(A),g=ue(A)==="y",{width:S,height:u}=B.floating;let r,s;a==="top"||a==="bottom"?(r=a,s=f===(await(E.isRTL==null?void 0:E.isRTL(i.floating))?"start":"end")?"left":"right"):(s=a,r=f==="end"?"top":"bottom");const e=u-d.top-d.bottom,t=S-d.left-d.right,l=ye(u-d[r],e),p=ye(S-d[s],t),_=!h.middlewareData.shift;let C=l,v=p;if((m=h.middlewareData.shift)!=null&&m.enabled.x&&(v=t),(b=h.middlewareData.shift)!=null&&b.enabled.y&&(C=e),_&&!f){const k=ne(d.left,0),D=ne(d.right,0),O=ne(d.top,0),L=ne(d.bottom,0);g?v=S-2*(k!==0||D!==0?k+D:ne(d.left,d.right)):C=u-2*(O!==0||L!==0?O+L:ne(d.top,d.bottom))}await o({...h,availableWidth:v,availableHeight:C});const w=await E.getDimensions(i.floating);return S!==w.width||u!==w.height?{reset:{rects:!0}}:{}}}};function lt(){return typeof window<"u"}function Oe(n){return Tr(n)?(n.nodeName||"").toLowerCase():"#document"}function oe(n){var h;return(n==null||(h=n.ownerDocument)==null?void 0:h.defaultView)||window}function ge(n){var h;return(h=(Tr(n)?n.ownerDocument:n.document)||window.document)==null?void 0:h.documentElement}function Tr(n){return lt()?n instanceof Node||n instanceof oe(n).Node:!1}function ce(n){return lt()?n instanceof Element||n instanceof oe(n).Element:!1}function fe(n){return lt()?n instanceof HTMLElement||n instanceof oe(n).HTMLElement:!1}function ar(n){return!lt()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof oe(n).ShadowRoot}const dn=new Set(["inline","contents"]);function Ge(n){const{overflow:h,overflowX:m,overflowY:b,display:A}=le(n);return/auto|scroll|overlay|hidden|clip/.test(h+b+m)&&!dn.has(A)}const fn=new Set(["table","td","th"]);function gn(n){return fn.has(Oe(n))}const vn=[":popover-open",":modal"];function ht(n){return vn.some(h=>{try{return n.matches(h)}catch{return!1}})}const pn=["transform","translate","scale","rotate","perspective"],_n=["transform","translate","scale","rotate","perspective","filter"],mn=["paint","layout","strict","content"];function Ft(n){const h=jt(),m=ce(n)?le(n):n;return pn.some(b=>m[b]?m[b]!=="none":!1)||(m.containerType?m.containerType!=="normal":!1)||!h&&(m.backdropFilter?m.backdropFilter!=="none":!1)||!h&&(m.filter?m.filter!=="none":!1)||_n.some(b=>(m.willChange||"").includes(b))||mn.some(b=>(m.contain||"").includes(b))}function Sn(n){let h=Ae(n);for(;fe(h)&&!Ie(h);){if(Ft(h))return h;if(ht(h))return null;h=Ae(h)}return null}function jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Cn=new Set(["html","body","#document"]);function Ie(n){return Cn.has(Oe(n))}function le(n){return oe(n).getComputedStyle(n)}function ut(n){return ce(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ae(n){if(Oe(n)==="html")return n;const h=n.assignedSlot||n.parentNode||ar(n)&&n.host||ge(n);return ar(h)?h.host:h}function Mr(n){const h=Ae(n);return Ie(h)?n.ownerDocument?n.ownerDocument.body:n.body:fe(h)&&Ge(h)?h:Mr(h)}function ze(n,h,m){var b;h===void 0&&(h=[]),m===void 0&&(m=!0);const A=Mr(n),B=A===((b=n.ownerDocument)==null?void 0:b.body),E=oe(A);if(B){const i=Dt(E);return h.concat(E,E.visualViewport||[],Ge(A)?A:[],i&&m?ze(i):[])}return h.concat(A,ze(A,[],m))}function Dt(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Hr(n){const h=le(n);let m=parseFloat(h.width)||0,b=parseFloat(h.height)||0;const A=fe(n),B=A?n.offsetWidth:m,E=A?n.offsetHeight:b,i=it(m)!==B||it(b)!==E;return i&&(m=B,b=E),{width:m,height:b,$:i}}function Wt(n){return ce(n)?n:n.contextElement}function Le(n){const h=Wt(n);if(!fe(h))return de(1);const m=h.getBoundingClientRect(),{width:b,height:A,$:B}=Hr(h);let E=(B?it(m.width):m.width)/b,i=(B?it(m.height):m.height)/A;return(!E||!Number.isFinite(E))&&(E=1),(!i||!Number.isFinite(i))&&(i=1),{x:E,y:i}}const bn=de(0);function Fr(n){const h=oe(n);return!jt()||!h.visualViewport?bn:{x:h.visualViewport.offsetLeft,y:h.visualViewport.offsetTop}}function wn(n,h,m){return h===void 0&&(h=!1),!m||h&&m!==oe(n)?!1:h}function Be(n,h,m,b){h===void 0&&(h=!1),m===void 0&&(m=!1);const A=n.getBoundingClientRect(),B=Wt(n);let E=de(1);h&&(b?ce(b)&&(E=Le(b)):E=Le(n));const i=wn(B,m,b)?Fr(B):de(0);let o=(A.left+i.x)/E.x,c=(A.top+i.y)/E.y,d=A.width/E.x,a=A.height/E.y;if(B){const f=oe(B),g=b&&ce(b)?oe(b):b;let S=f,u=Dt(S);for(;u&&b&&g!==S;){const r=Le(u),s=u.getBoundingClientRect(),e=le(u),t=s.left+(u.clientLeft+parseFloat(e.paddingLeft))*r.x,l=s.top+(u.clientTop+parseFloat(e.paddingTop))*r.y;o*=r.x,c*=r.y,d*=r.x,a*=r.y,o+=t,c+=l,S=oe(u),u=Dt(S)}}return nt({width:d,height:a,x:o,y:c})}function dt(n,h){const m=ut(n).scrollLeft;return h?h.left+m:Be(ge(n)).left+m}function jr(n,h){const m=n.getBoundingClientRect(),b=m.left+h.scrollLeft-dt(n,m),A=m.top+h.scrollTop;return{x:b,y:A}}function yn(n){let{elements:h,rect:m,offsetParent:b,strategy:A}=n;const B=A==="fixed",E=ge(b),i=h?ht(h.floating):!1;if(b===E||i&&B)return m;let o={scrollLeft:0,scrollTop:0},c=de(1);const d=de(0),a=fe(b);if((a||!a&&!B)&&((Oe(b)!=="body"||Ge(E))&&(o=ut(b)),fe(b))){const g=Be(b);c=Le(b),d.x=g.x+b.clientLeft,d.y=g.y+b.clientTop}const f=E&&!a&&!B?jr(E,o):de(0);return{width:m.width*c.x,height:m.height*c.y,x:m.x*c.x-o.scrollLeft*c.x+d.x+f.x,y:m.y*c.y-o.scrollTop*c.y+d.y+f.y}}function An(n){return Array.from(n.getClientRects())}function En(n){const h=ge(n),m=ut(n),b=n.ownerDocument.body,A=ne(h.scrollWidth,h.clientWidth,b.scrollWidth,b.clientWidth),B=ne(h.scrollHeight,h.clientHeight,b.scrollHeight,b.clientHeight);let E=-m.scrollLeft+dt(n);const i=-m.scrollTop;return le(b).direction==="rtl"&&(E+=ne(h.clientWidth,b.clientWidth)-A),{width:A,height:B,x:E,y:i}}const cr=25;function xn(n,h){const m=oe(n),b=ge(n),A=m.visualViewport;let B=b.clientWidth,E=b.clientHeight,i=0,o=0;if(A){B=A.width,E=A.height;const d=jt();(!d||d&&h==="fixed")&&(i=A.offsetLeft,o=A.offsetTop)}const c=dt(b);if(c<=0){const d=b.ownerDocument,a=d.body,f=getComputedStyle(a),g=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(b.clientWidth-a.clientWidth-g);S<=cr&&(B-=S)}else c<=cr&&(B+=c);return{width:B,height:E,x:i,y:o}}const Bn=new Set(["absolute","fixed"]);function Rn(n,h){const m=Be(n,!0,h==="fixed"),b=m.top+n.clientTop,A=m.left+n.clientLeft,B=fe(n)?Le(n):de(1),E=n.clientWidth*B.x,i=n.clientHeight*B.y,o=A*B.x,c=b*B.y;return{width:E,height:i,x:o,y:c}}function lr(n,h,m){let b;if(h==="viewport")b=xn(n,m);else if(h==="document")b=En(ge(n));else if(ce(h))b=Rn(h,m);else{const A=Fr(n);b={x:h.x-A.x,y:h.y-A.y,width:h.width,height:h.height}}return nt(b)}function Wr(n,h){const m=Ae(n);return m===h||!ce(m)||Ie(m)?!1:le(m).position==="fixed"||Wr(m,h)}function kn(n,h){const m=h.get(n);if(m)return m;let b=ze(n,[],!1).filter(i=>ce(i)&&Oe(i)!=="body"),A=null;const B=le(n).position==="fixed";let E=B?Ae(n):n;for(;ce(E)&&!Ie(E);){const i=le(E),o=Ft(E);!o&&i.position==="fixed"&&(A=null),(B?!o&&!A:!o&&i.position==="static"&&!!A&&Bn.has(A.position)||Ge(E)&&!o&&Wr(n,E))?b=b.filter(d=>d!==E):A=i,E=Ae(E)}return h.set(n,b),b}function Ln(n){let{element:h,boundary:m,rootBoundary:b,strategy:A}=n;const E=[...m==="clippingAncestors"?ht(h)?[]:kn(h,this._c):[].concat(m),b],i=E[0],o=E.reduce((c,d)=>{const a=lr(h,d,A);return c.top=ne(a.top,c.top),c.right=ye(a.right,c.right),c.bottom=ye(a.bottom,c.bottom),c.left=ne(a.left,c.left),c},lr(h,i,A));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function In(n){const{width:h,height:m}=Hr(n);return{width:h,height:m}}function Dn(n,h,m){const b=fe(h),A=ge(h),B=m==="fixed",E=Be(n,!0,B,h);let i={scrollLeft:0,scrollTop:0};const o=de(0);function c(){o.x=dt(A)}if(b||!b&&!B)if((Oe(h)!=="body"||Ge(A))&&(i=ut(h)),b){const g=Be(h,!0,B,h);o.x=g.x+h.clientLeft,o.y=g.y+h.clientTop}else A&&c();B&&!b&&A&&c();const d=A&&!b&&!B?jr(A,i):de(0),a=E.left+i.scrollLeft-o.x-d.x,f=E.top+i.scrollTop-o.y-d.y;return{x:a,y:f,width:E.width,height:E.height}}function wt(n){return le(n).position==="static"}function hr(n,h){if(!fe(n)||le(n).position==="fixed")return null;if(h)return h(n);let m=n.offsetParent;return ge(n)===m&&(m=m.ownerDocument.body),m}function Nr(n,h){const m=oe(n);if(ht(n))return m;if(!fe(n)){let A=Ae(n);for(;A&&!Ie(A);){if(ce(A)&&!wt(A))return A;A=Ae(A)}return m}let b=hr(n,h);for(;b&&gn(b)&&wt(b);)b=hr(b,h);return b&&Ie(b)&&wt(b)&&!Ft(b)?m:b||Sn(n)||m}const Pn=async function(n){const h=this.getOffsetParent||Nr,m=this.getDimensions,b=await m(n.floating);return{reference:Dn(n.reference,await h(n.floating),n.strategy),floating:{x:0,y:0,width:b.width,height:b.height}}};function On(n){return le(n).direction==="rtl"}const Tn={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:ge,getClippingRect:Ln,getOffsetParent:Nr,getElementRects:Pn,getClientRects:An,getDimensions:In,getScale:Le,isElement:ce,isRTL:On};function Ur(n,h){return n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height}function Mn(n,h){let m=null,b;const A=ge(n);function B(){var i;clearTimeout(b),(i=m)==null||i.disconnect(),m=null}function E(i,o){i===void 0&&(i=!1),o===void 0&&(o=1),B();const c=n.getBoundingClientRect(),{left:d,top:a,width:f,height:g}=c;if(i||h(),!f||!g)return;const S=Je(a),u=Je(A.clientWidth-(d+f)),r=Je(A.clientHeight-(a+g)),s=Je(d),t={rootMargin:-S+"px "+-u+"px "+-r+"px "+-s+"px",threshold:ne(0,ye(1,o))||1};let l=!0;function p(_){const C=_[0].intersectionRatio;if(C!==o){if(!l)return E();C?E(!1,C):b=setTimeout(()=>{E(!1,1e-7)},1e3)}C===1&&!Ur(c,n.getBoundingClientRect())&&E(),l=!1}try{m=new IntersectionObserver(p,{...t,root:A.ownerDocument})}catch{m=new IntersectionObserver(p,t)}m.observe(n)}return E(!0),B}function Hn(n,h,m,b){b===void 0&&(b={});const{ancestorScroll:A=!0,ancestorResize:B=!0,elementResize:E=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:o=!1}=b,c=Wt(n),d=A||B?[...c?ze(c):[],...ze(h)]:[];d.forEach(s=>{A&&s.addEventListener("scroll",m,{passive:!0}),B&&s.addEventListener("resize",m)});const a=c&&i?Mn(c,m):null;let f=-1,g=null;E&&(g=new ResizeObserver(s=>{let[e]=s;e&&e.target===c&&g&&(g.unobserve(h),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;(t=g)==null||t.observe(h)})),m()}),c&&!o&&g.observe(c),g.observe(h));let S,u=o?Be(n):null;o&&r();function r(){const s=Be(n);u&&!Ur(u,s)&&m(),u=s,S=requestAnimationFrame(r)}return m(),()=>{var s;d.forEach(e=>{A&&e.removeEventListener("scroll",m),B&&e.removeEventListener("resize",m)}),a==null||a(),(s=g)==null||s.disconnect(),g=null,o&&cancelAnimationFrame(S)}}const Fn=cn,jn=ln,Wn=nn,Nn=un,Un=on,ur=sn,zn=hn,Qn=(n,h,m)=>{const b=new Map,A={platform:Tn,...m},B={...A.platform,_c:b};return rn(n,h,{...A,platform:B})};var Kn=typeof document<"u",Gn=function(){},tt=Kn?V.useLayoutEffect:Gn;function ot(n,h){if(n===h)return!0;if(typeof n!=typeof h)return!1;if(typeof n=="function"&&n.toString()===h.toString())return!0;let m,b,A;if(n&&h&&typeof n=="object"){if(Array.isArray(n)){if(m=n.length,m!==h.length)return!1;for(b=m;b--!==0;)if(!ot(n[b],h[b]))return!1;return!0}if(A=Object.keys(n),m=A.length,m!==Object.keys(h).length)return!1;for(b=m;b--!==0;)if(!{}.hasOwnProperty.call(h,A[b]))return!1;for(b=m;b--!==0;){const B=A[b];if(!(B==="_owner"&&n.$$typeof)&&!ot(n[B],h[B]))return!1}return!0}return n!==n&&h!==h}function zr(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(n,h){const m=zr(n);return Math.round(h*m)/m}function yt(n){const h=N.useRef(n);return tt(()=>{h.current=n}),h}function qn(n){n===void 0&&(n={});const{placement:h="bottom",strategy:m="absolute",middleware:b=[],platform:A,elements:{reference:B,floating:E}={},transform:i=!0,whileElementsMounted:o,open:c}=n,[d,a]=N.useState({x:0,y:0,strategy:m,placement:h,middlewareData:{},isPositioned:!1}),[f,g]=N.useState(b);ot(f,b)||g(b);const[S,u]=N.useState(null),[r,s]=N.useState(null),e=N.useCallback(U=>{U!==_.current&&(_.current=U,u(U))},[]),t=N.useCallback(U=>{U!==C.current&&(C.current=U,s(U))},[]),l=B||S,p=E||r,_=N.useRef(null),C=N.useRef(null),v=N.useRef(d),w=o!=null,k=yt(o),D=yt(A),O=yt(c),L=N.useCallback(()=>{if(!_.current||!C.current)return;const U={placement:h,strategy:m,middleware:f};D.current&&(U.platform=D.current),Qn(_.current,C.current,U).then(y=>{const R={...y,isPositioned:O.current!==!1};F.current&&!ot(v.current,R)&&(v.current=R,_r.flushSync(()=>{a(R)}))})},[f,h,m,D,O]);tt(()=>{c===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,a(U=>({...U,isPositioned:!1})))},[c]);const F=N.useRef(!1);tt(()=>(F.current=!0,()=>{F.current=!1}),[]),tt(()=>{if(l&&(_.current=l),p&&(C.current=p),l&&p){if(k.current)return k.current(l,p,L);L()}},[l,p,L,k,w]);const H=N.useMemo(()=>({reference:_,floating:C,setReference:e,setFloating:t}),[e,t]),W=N.useMemo(()=>({reference:l,floating:p}),[l,p]),G=N.useMemo(()=>{const U={position:m,left:0,top:0};if(!W.floating)return U;const y=dr(W.floating,d.x),R=dr(W.floating,d.y);return i?{...U,transform:"translate("+y+"px, "+R+"px)",...zr(W.floating)>=1.5&&{willChange:"transform"}}:{position:m,left:y,top:R}},[m,i,W.floating,d.x,d.y]);return N.useMemo(()=>({...d,update:L,refs:H,elements:W,floatingStyles:G}),[d,L,H,W,G])}const Yn=n=>{function h(m){return{}.hasOwnProperty.call(m,"current")}return{name:"arrow",options:n,fn(m){const{element:b,padding:A}=typeof n=="function"?n(m):n;return b&&h(b)?b.current!=null?ur({element:b.current,padding:A}).fn(m):{}:b?ur({element:b,padding:A}).fn(m):{}}}},Vn=(n,h)=>({...Fn(n),options:[n,h]}),Xn=(n,h)=>({...jn(n),options:[n,h]}),Zn=(n,h)=>({...zn(n),options:[n,h]}),Jn=(n,h)=>({...Wn(n),options:[n,h]}),$n=(n,h)=>({...Nn(n),options:[n,h]}),eo=(n,h)=>({...Un(n),options:[n,h]}),to=(n,h)=>({...Yn(n),options:[n,h]});var ro="Arrow",Qr=N.forwardRef((n,h)=>{const{children:m,width:b=10,height:A=5,...B}=n;return q.jsx(Ee.svg,{...B,ref:h,width:b,height:A,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?m:q.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qr.displayName=ro;var io=Qr;function so(n){const[h,m]=N.useState(void 0);return we(()=>{if(n){m({width:n.offsetWidth,height:n.offsetHeight});const b=new ResizeObserver(A=>{if(!Array.isArray(A)||!A.length)return;const B=A[0];let E,i;if("borderBoxSize"in B){const o=B.borderBoxSize,c=Array.isArray(o)?o[0]:o;E=c.inlineSize,i=c.blockSize}else E=n.offsetWidth,i=n.offsetHeight;m({width:E,height:i})});return b.observe(n,{box:"border-box"}),()=>b.unobserve(n)}else m(void 0)},[n]),h}var Nt="Popper",[Kr,Gr]=Rr(Nt),[no,qr]=Kr(Nt),Yr=n=>{const{__scopePopper:h,children:m}=n,[b,A]=N.useState(null);return q.jsx(no,{scope:h,anchor:b,onAnchorChange:A,children:m})};Yr.displayName=Nt;var Vr="PopperAnchor",Xr=N.forwardRef((n,h)=>{const{__scopePopper:m,virtualRef:b,...A}=n,B=qr(Vr,m),E=N.useRef(null),i=Re(h,E),o=N.useRef(null);return N.useEffect(()=>{const c=o.current;o.current=(b==null?void 0:b.current)||E.current,c!==o.current&&B.onAnchorChange(o.current)}),b?null:q.jsx(Ee.div,{...A,ref:i})});Xr.displayName=Vr;var Ut="PopperContent",[oo,ao]=Kr(Ut),Zr=N.forwardRef((n,h)=>{var T,x,M,j,Q,K;const{__scopePopper:m,side:b="bottom",sideOffset:A=0,align:B="center",alignOffset:E=0,arrowPadding:i=0,avoidCollisions:o=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:a="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:S,...u}=n,r=qr(Ut,m),[s,e]=N.useState(null),t=Re(h,Z=>e(Z)),[l,p]=N.useState(null),_=so(l),C=(_==null?void 0:_.width)??0,v=(_==null?void 0:_.height)??0,w=b+(B!=="center"?"-"+B:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(c)?c:[c],O=D.length>0,L={padding:k,boundary:D.filter(lo),altBoundary:O},{refs:F,floatingStyles:H,placement:W,isPositioned:G,middlewareData:U}=qn({strategy:"fixed",placement:w,whileElementsMounted:(...Z)=>Hn(...Z,{animationFrame:g==="always"}),elements:{reference:r.anchor},middleware:[Vn({mainAxis:A+v,alignmentAxis:E}),o&&Xn({mainAxis:!0,crossAxis:!1,limiter:a==="partial"?Zn():void 0,...L}),o&&Jn({...L}),$n({...L,apply:({elements:Z,rects:ee,availableWidth:te,availableHeight:ie})=>{const{width:$,height:xe}=ee.reference,me=Z.floating.style;me.setProperty("--radix-popper-available-width",`${te}px`),me.setProperty("--radix-popper-available-height",`${ie}px`),me.setProperty("--radix-popper-anchor-width",`${$}px`),me.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),l&&to({element:l,padding:i}),ho({arrowWidth:C,arrowHeight:v}),f&&eo({strategy:"referenceHidden",...L})]}),[y,R]=ei(W),I=ct(S);we(()=>{G&&(I==null||I())},[G,I]);const P=(T=U.arrow)==null?void 0:T.x,z=(x=U.arrow)==null?void 0:x.y,Y=((M=U.arrow)==null?void 0:M.centerOffset)!==0,[X,J]=N.useState();return we(()=>{s&&J(window.getComputedStyle(s).zIndex)},[s]),q.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:G?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(j=U.transformOrigin)==null?void 0:j.x,(Q=U.transformOrigin)==null?void 0:Q.y].join(" "),...((K=U.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:q.jsx(oo,{scope:m,placedSide:y,onArrowChange:p,arrowX:P,arrowY:z,shouldHideArrow:Y,children:q.jsx(Ee.div,{"data-side":y,"data-align":R,...u,ref:t,style:{...u.style,animation:G?void 0:"none"}})})})});Zr.displayName=Ut;var Jr="PopperArrow",co={top:"bottom",right:"left",bottom:"top",left:"right"},$r=N.forwardRef(function(h,m){const{__scopePopper:b,...A}=h,B=ao(Jr,b),E=co[B.placedSide];return q.jsx("span",{ref:B.onArrowChange,style:{position:"absolute",left:B.arrowX,top:B.arrowY,[E]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[B.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[B.placedSide],visibility:B.shouldHideArrow?"hidden":void 0},children:q.jsx(io,{...A,ref:m,style:{...A.style,display:"block"}})})});$r.displayName=Jr;function lo(n){return n!==null}var ho=n=>({name:"transformOrigin",options:n,fn(h){var r,s,e;const{placement:m,rects:b,middlewareData:A}=h,E=((r=A.arrow)==null?void 0:r.centerOffset)!==0,i=E?0:n.arrowWidth,o=E?0:n.arrowHeight,[c,d]=ei(m),a={start:"0%",center:"50%",end:"100%"}[d],f=(((s=A.arrow)==null?void 0:s.x)??0)+i/2,g=(((e=A.arrow)==null?void 0:e.y)??0)+o/2;let S="",u="";return c==="bottom"?(S=E?a:`${f}px`,u=`${-o}px`):c==="top"?(S=E?a:`${f}px`,u=`${b.floating.height+o}px`):c==="right"?(S=`${-o}px`,u=E?a:`${g}px`):c==="left"&&(S=`${b.floating.width+o}px`,u=E?a:`${g}px`),{data:{x:S,y:u}}}});function ei(n){const[h,m="center"]=n.split("-");return[h,m]}var uo=Yr,fo=Xr,go=Zr,vo=$r,po="Portal",ti=N.forwardRef((n,h)=>{var i;const{container:m,...b}=n,[A,B]=N.useState(!1);we(()=>B(!0),[]);const E=m||A&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return E?vr.createPortal(q.jsx(Ee.div,{...b,ref:h}),E):null});ti.displayName=po;function _o(n,h){return N.useReducer((m,b)=>h[m][b]??m,n)}var zt=n=>{const{present:h,children:m}=n,b=mo(h),A=typeof m=="function"?m({present:b.isPresent}):N.Children.only(m),B=Re(b.ref,So(A));return typeof m=="function"||b.isPresent?N.cloneElement(A,{ref:B}):null};zt.displayName="Presence";function mo(n){const[h,m]=N.useState(),b=N.useRef(null),A=N.useRef(n),B=N.useRef("none"),E=n?"mounted":"unmounted",[i,o]=_o(E,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const c=$e(b.current);B.current=i==="mounted"?c:"none"},[i]),we(()=>{const c=b.current,d=A.current;if(d!==n){const f=B.current,g=$e(c);n?o("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?o("UNMOUNT"):o(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),A.current=n}},[n,o]),we(()=>{if(h){let c;const d=h.ownerDocument.defaultView??window,a=g=>{const u=$e(b.current).includes(CSS.escape(g.animationName));if(g.target===h&&u&&(o("ANIMATION_END"),!A.current)){const r=h.style.animationFillMode;h.style.animationFillMode="forwards",c=d.setTimeout(()=>{h.style.animationFillMode==="forwards"&&(h.style.animationFillMode=r)})}},f=g=>{g.target===h&&(B.current=$e(b.current))};return h.addEventListener("animationstart",f),h.addEventListener("animationcancel",a),h.addEventListener("animationend",a),()=>{d.clearTimeout(c),h.removeEventListener("animationstart",f),h.removeEventListener("animationcancel",a),h.removeEventListener("animationend",a)}}else o("ANIMATION_END")},[h,o]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:N.useCallback(c=>{b.current=c?getComputedStyle(c):null,m(c)},[])}}function $e(n){return(n==null?void 0:n.animationName)||"none"}function So(n){var b,A;let h=(b=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:b.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(A=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:A.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var Co=N[" useInsertionEffect ".trim().toString()]||we;function bo({prop:n,defaultProp:h,onChange:m=()=>{},caller:b}){const[A,B,E]=wo({defaultProp:h,onChange:m}),i=n!==void 0,o=i?n:A;{const d=N.useRef(n!==void 0);N.useEffect(()=>{const a=d.current;a!==i&&console.warn(`${b} is changing from ${a?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,b])}const c=N.useCallback(d=>{var a;if(i){const f=yo(d)?d(n):d;f!==n&&((a=E.current)==null||a.call(E,f))}else B(d)},[i,n,B,E]);return[o,c]}function wo({defaultProp:n,onChange:h}){const[m,b]=N.useState(n),A=N.useRef(m),B=N.useRef(h);return Co(()=>{B.current=h},[h]),N.useEffect(()=>{var E;A.current!==m&&((E=B.current)==null||E.call(B,m),A.current=m)},[m,A]),[m,b,B]}function yo(n){return typeof n=="function"}var Ao=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Eo="VisuallyHidden",ri=N.forwardRef((n,h)=>q.jsx(Ee.span,{...n,ref:h,style:{...Ao,...n.style}}));ri.displayName=Eo;var xo=ri,[ft]=Rr("Tooltip",[Gr]),gt=Gr(),ii="TooltipProvider",Bo=700,Pt="tooltip.open",[Ro,Qt]=ft(ii),si=n=>{const{__scopeTooltip:h,delayDuration:m=Bo,skipDelayDuration:b=300,disableHoverableContent:A=!1,children:B}=n,E=N.useRef(!0),i=N.useRef(!1),o=N.useRef(0);return N.useEffect(()=>{const c=o.current;return()=>window.clearTimeout(c)},[]),q.jsx(Ro,{scope:h,isOpenDelayedRef:E,delayDuration:m,onOpen:N.useCallback(()=>{window.clearTimeout(o.current),E.current=!1},[]),onClose:N.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>E.current=!0,b)},[b]),isPointerInTransitRef:i,onPointerInTransitChange:N.useCallback(c=>{i.current=c},[]),disableHoverableContent:A,children:B})};si.displayName=ii;var Qe="Tooltip",[ko,qe]=ft(Qe),ni=n=>{const{__scopeTooltip:h,children:m,open:b,defaultOpen:A,onOpenChange:B,disableHoverableContent:E,delayDuration:i}=n,o=Qt(Qe,n.__scopeTooltip),c=gt(h),[d,a]=N.useState(null),f=Qs(),g=N.useRef(0),S=E??o.disableHoverableContent,u=i??o.delayDuration,r=N.useRef(!1),[s,e]=bo({prop:b,defaultProp:A??!1,onChange:C=>{C?(o.onOpen(),document.dispatchEvent(new CustomEvent(Pt))):o.onClose(),B==null||B(C)},caller:Qe}),t=N.useMemo(()=>s?r.current?"delayed-open":"instant-open":"closed",[s]),l=N.useCallback(()=>{window.clearTimeout(g.current),g.current=0,r.current=!1,e(!0)},[e]),p=N.useCallback(()=>{window.clearTimeout(g.current),g.current=0,e(!1)},[e]),_=N.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{r.current=!0,e(!0),g.current=0},u)},[u,e]);return N.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),q.jsx(uo,{...c,children:q.jsx(ko,{scope:h,contentId:f,open:s,stateAttribute:t,trigger:d,onTriggerChange:a,onTriggerEnter:N.useCallback(()=>{o.isOpenDelayedRef.current?_():l()},[o.isOpenDelayedRef,_,l]),onTriggerLeave:N.useCallback(()=>{S?p():(window.clearTimeout(g.current),g.current=0)},[p,S]),onOpen:l,onClose:p,disableHoverableContent:S,children:m})})};ni.displayName=Qe;var Ot="TooltipTrigger",oi=N.forwardRef((n,h)=>{const{__scopeTooltip:m,...b}=n,A=qe(Ot,m),B=Qt(Ot,m),E=gt(m),i=N.useRef(null),o=Re(h,i,A.onTriggerChange),c=N.useRef(!1),d=N.useRef(!1),a=N.useCallback(()=>c.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",a),[a]),q.jsx(fo,{asChild:!0,...E,children:q.jsx(Ee.button,{"aria-describedby":A.open?A.contentId:void 0,"data-state":A.stateAttribute,...b,ref:o,onPointerMove:ve(n.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!B.isPointerInTransitRef.current&&(A.onTriggerEnter(),d.current=!0)}),onPointerLeave:ve(n.onPointerLeave,()=>{A.onTriggerLeave(),d.current=!1}),onPointerDown:ve(n.onPointerDown,()=>{A.open&&A.onClose(),c.current=!0,document.addEventListener("pointerup",a,{once:!0})}),onFocus:ve(n.onFocus,()=>{c.current||A.onOpen()}),onBlur:ve(n.onBlur,A.onClose),onClick:ve(n.onClick,A.onClose)})})});oi.displayName=Ot;var Kt="TooltipPortal",[Lo,Io]=ft(Kt,{forceMount:void 0}),ai=n=>{const{__scopeTooltip:h,forceMount:m,children:b,container:A}=n,B=qe(Kt,h);return q.jsx(Lo,{scope:h,forceMount:m,children:q.jsx(zt,{present:m||B.open,children:q.jsx(ti,{asChild:!0,container:A,children:b})})})};ai.displayName=Kt;var De="TooltipContent",ci=N.forwardRef((n,h)=>{const m=Io(De,n.__scopeTooltip),{forceMount:b=m.forceMount,side:A="top",...B}=n,E=qe(De,n.__scopeTooltip);return q.jsx(zt,{present:b||E.open,children:E.disableHoverableContent?q.jsx(li,{side:A,...B,ref:h}):q.jsx(Do,{side:A,...B,ref:h})})}),Do=N.forwardRef((n,h)=>{const m=qe(De,n.__scopeTooltip),b=Qt(De,n.__scopeTooltip),A=N.useRef(null),B=Re(h,A),[E,i]=N.useState(null),{trigger:o,onClose:c}=m,d=A.current,{onPointerInTransitChange:a}=b,f=N.useCallback(()=>{i(null),a(!1)},[a]),g=N.useCallback((S,u)=>{const r=S.currentTarget,s={x:S.clientX,y:S.clientY},e=Mo(s,r.getBoundingClientRect()),t=Ho(s,e),l=Fo(u.getBoundingClientRect()),p=Wo([...t,...l]);i(p),a(!0)},[a]);return N.useEffect(()=>()=>f(),[f]),N.useEffect(()=>{if(o&&d){const S=r=>g(r,d),u=r=>g(r,o);return o.addEventListener("pointerleave",S),d.addEventListener("pointerleave",u),()=>{o.removeEventListener("pointerleave",S),d.removeEventListener("pointerleave",u)}}},[o,d,g,f]),N.useEffect(()=>{if(E){const S=u=>{const r=u.target,s={x:u.clientX,y:u.clientY},e=(o==null?void 0:o.contains(r))||(d==null?void 0:d.contains(r)),t=!jo(s,E);e?f():t&&(f(),c())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[o,d,E,c,f]),q.jsx(li,{...n,ref:B})}),[Po,Oo]=ft(Qe,{isInside:!1}),To=Rs("TooltipContent"),li=N.forwardRef((n,h)=>{const{__scopeTooltip:m,children:b,"aria-label":A,onEscapeKeyDown:B,onPointerDownOutside:E,...i}=n,o=qe(De,m),c=gt(m),{onClose:d}=o;return N.useEffect(()=>(document.addEventListener(Pt,d),()=>document.removeEventListener(Pt,d)),[d]),N.useEffect(()=>{if(o.trigger){const a=f=>{const g=f.target;g!=null&&g.contains(o.trigger)&&d()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[o.trigger,d]),q.jsx(Ir,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:B,onPointerDownOutside:E,onFocusOutside:a=>a.preventDefault(),onDismiss:d,children:q.jsxs(go,{"data-state":o.stateAttribute,...c,...i,ref:h,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[q.jsx(To,{children:b}),q.jsx(Po,{scope:m,isInside:!0,children:q.jsx(xo,{id:o.contentId,role:"tooltip",children:A||b})})]})})});ci.displayName=De;var hi="TooltipArrow",ui=N.forwardRef((n,h)=>{const{__scopeTooltip:m,...b}=n,A=gt(m);return Oo(hi,m).isInside?null:q.jsx(vo,{...A,...b,ref:h})});ui.displayName=hi;function Mo(n,h){const m=Math.abs(h.top-n.y),b=Math.abs(h.bottom-n.y),A=Math.abs(h.right-n.x),B=Math.abs(h.left-n.x);switch(Math.min(m,b,A,B)){case B:return"left";case A:return"right";case m:return"top";case b:return"bottom";default:throw new Error("unreachable")}}function Ho(n,h,m=5){const b=[];switch(h){case"top":b.push({x:n.x-m,y:n.y+m},{x:n.x+m,y:n.y+m});break;case"bottom":b.push({x:n.x-m,y:n.y-m},{x:n.x+m,y:n.y-m});break;case"left":b.push({x:n.x+m,y:n.y-m},{x:n.x+m,y:n.y+m});break;case"right":b.push({x:n.x-m,y:n.y-m},{x:n.x-m,y:n.y+m});break}return b}function Fo(n){const{top:h,right:m,bottom:b,left:A}=n;return[{x:A,y:h},{x:m,y:h},{x:m,y:b},{x:A,y:b}]}function jo(n,h){const{x:m,y:b}=n;let A=!1;for(let B=0,E=h.length-1;B<h.length;E=B++){const i=h[B],o=h[E],c=i.x,d=i.y,a=o.x,f=o.y;d>b!=f>b&&m<(a-c)*(b-d)/(f-d)+c&&(A=!A)}return A}function Wo(n){const h=n.slice();return h.sort((m,b)=>m.x<b.x?-1:m.x>b.x?1:m.y<b.y?-1:m.y>b.y?1:0),No(h)}function No(n){if(n.length<=1)return n.slice();const h=[];for(let b=0;b<n.length;b++){const A=n[b];for(;h.length>=2;){const B=h[h.length-1],E=h[h.length-2];if((B.x-E.x)*(A.y-E.y)>=(B.y-E.y)*(A.x-E.x))h.pop();else break}h.push(A)}h.pop();const m=[];for(let b=n.length-1;b>=0;b--){const A=n[b];for(;m.length>=2;){const B=m[m.length-1],E=m[m.length-2];if((B.x-E.x)*(A.y-E.y)>=(B.y-E.y)*(A.x-E.x))m.pop();else break}m.push(A)}return m.pop(),h.length===1&&m.length===1&&h[0].x===m[0].x&&h[0].y===m[0].y?h:h.concat(m)}var Uo=si,At=ni,Et=oi,xt=ai,Bt=ci,Rt=ui;/**
|
|
19
|
+
`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return i}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}E.Terminal=u})(),B})()))})(bt)),bt.exports}var As=ys();function ve(n,h,{checkForDefaultPrevented:m=!0}={}){return function(A){if(n==null||n(A),m===!1||!A.defaultPrevented)return h==null?void 0:h(A)}}function $t(n,h){if(typeof n=="function")return n(h);n!=null&&(n.current=h)}function Br(...n){return h=>{let m=!1;const b=n.map(A=>{const B=$t(A,h);return!m&&typeof B=="function"&&(m=!0),B});if(m)return()=>{for(let A=0;A<b.length;A++){const B=b[A];typeof B=="function"?B():$t(n[A],null)}}}}function Re(...n){return W.useCallback(Br(...n),n)}function Rr(n,h=[]){let m=[];function b(B,E){const i=W.createContext(E),o=m.length;m=[...m,E];const c=a=>{var s;const{scope:f,children:g,...S}=a,u=((s=f==null?void 0:f[n])==null?void 0:s[o])||i,r=W.useMemo(()=>S,Object.values(S));return G.jsx(u.Provider,{value:r,children:g})};c.displayName=B+"Provider";function d(a,f){var u;const g=((u=f==null?void 0:f[n])==null?void 0:u[o])||i,S=W.useContext(g);if(S)return S;if(E!==void 0)return E;throw new Error(`\`${a}\` must be used within \`${B}\``)}return[c,d]}const A=()=>{const B=m.map(E=>W.createContext(E));return function(i){const o=(i==null?void 0:i[n])||B;return W.useMemo(()=>({[`__scope${n}`]:{...i,[n]:o}}),[i,o])}};return A.scopeName=n,[b,Es(A,...h)]}function Es(...n){const h=n[0];if(n.length===1)return h;const m=()=>{const b=n.map(A=>({useScope:A(),scopeName:A.scopeName}));return function(B){const E=b.reduce((i,{useScope:o,scopeName:c})=>{const a=o(B)[`__scope${c}`];return{...i,...a}},{});return W.useMemo(()=>({[`__scope${h.scopeName}`]:E}),[E])}};return m.scopeName=h.scopeName,m}function xs(n){const h=Bs(n),m=W.forwardRef((b,A)=>{const{children:B,...E}=b,i=W.Children.toArray(B),o=i.find(ks);if(o){const c=o.props.children,d=i.map(a=>a===o?W.Children.count(c)>1?W.Children.only(null):W.isValidElement(c)?c.props.children:null:a);return G.jsx(h,{...E,ref:A,children:W.isValidElement(c)?W.cloneElement(c,void 0,d):null})}return G.jsx(h,{...E,ref:A,children:B})});return m.displayName=`${n}.Slot`,m}function Bs(n){const h=W.forwardRef((m,b)=>{const{children:A,...B}=m;if(W.isValidElement(A)){const E=Is(A),i=Ls(B,A.props);return A.type!==W.Fragment&&(i.ref=b?Br(b,E):E),W.cloneElement(A,i)}return W.Children.count(A)>1?W.Children.only(null):null});return h.displayName=`${n}.SlotClone`,h}var kr=Symbol("radix.slottable");function Rs(n){const h=({children:m})=>G.jsx(G.Fragment,{children:m});return h.displayName=`${n}.Slottable`,h.__radixId=kr,h}function ks(n){return W.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===kr}function Ls(n,h){const m={...h};for(const b in h){const A=n[b],B=h[b];/^on[A-Z]/.test(b)?A&&B?m[b]=(...i)=>{const o=B(...i);return A(...i),o}:A&&(m[b]=A):b==="style"?m[b]={...A,...B}:b==="className"&&(m[b]=[A,B].filter(Boolean).join(" "))}return{...n,...m}}function Is(n){var b,A;let h=(b=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:b.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(A=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:A.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var Ds=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ds.reduce((n,h)=>{const m=xs(`Primitive.${h}`),b=W.forwardRef((A,B)=>{const{asChild:E,...i}=A,o=E?m:h;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),G.jsx(o,{...i,ref:B})});return b.displayName=`Primitive.${h}`,{...n,[h]:b}},{});function Ps(n,h){n&&_r.flushSync(()=>n.dispatchEvent(h))}function ct(n){const h=W.useRef(n);return W.useEffect(()=>{h.current=n}),W.useMemo(()=>(...m)=>{var b;return(b=h.current)==null?void 0:b.call(h,...m)},[])}function Os(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n);W.useEffect(()=>{const b=A=>{A.key==="Escape"&&m(A)};return h.addEventListener("keydown",b,{capture:!0}),()=>h.removeEventListener("keydown",b,{capture:!0})},[m,h])}var Ts="DismissableLayer",kt="dismissableLayer.update",Ms="dismissableLayer.pointerDownOutside",Hs="dismissableLayer.focusOutside",er,Lr=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ir=W.forwardRef((n,h)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:b,onPointerDownOutside:A,onFocusOutside:B,onInteractOutside:E,onDismiss:i,...o}=n,c=W.useContext(Lr),[d,a]=W.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=W.useState({}),S=Re(h,C=>a(C)),u=Array.from(c.layers),[r]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),s=u.indexOf(r),e=d?u.indexOf(d):-1,t=c.layersWithOutsidePointerEventsDisabled.size>0,l=e>=s,p=Ws(C=>{const v=C.target,w=[...c.branches].some(k=>k.contains(v));!l||w||(A==null||A(C),E==null||E(C),C.defaultPrevented||i==null||i())},f),_=Ns(C=>{const v=C.target;[...c.branches].some(k=>k.contains(v))||(B==null||B(C),E==null||E(C),C.defaultPrevented||i==null||i())},f);return Os(C=>{e===c.layers.size-1&&(b==null||b(C),!C.defaultPrevented&&i&&(C.preventDefault(),i()))},f),W.useEffect(()=>{if(d)return m&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(er=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),tr(),()=>{m&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=er)}},[d,f,m,c]),W.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,c]),W.useEffect(()=>{const C=()=>g({});return document.addEventListener(kt,C),()=>document.removeEventListener(kt,C)},[]),G.jsx(Ee.div,{...o,ref:S,style:{pointerEvents:t?l?"auto":"none":void 0,...n.style},onFocusCapture:ve(n.onFocusCapture,_.onFocusCapture),onBlurCapture:ve(n.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ve(n.onPointerDownCapture,p.onPointerDownCapture)})});Ir.displayName=Ts;var Fs="DismissableLayerBranch",js=W.forwardRef((n,h)=>{const m=W.useContext(Lr),b=W.useRef(null),A=Re(h,b);return W.useEffect(()=>{const B=b.current;if(B)return m.branches.add(B),()=>{m.branches.delete(B)}},[m.branches]),G.jsx(Ee.div,{...n,ref:A})});js.displayName=Fs;function Ws(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),b=W.useRef(!1),A=W.useRef(()=>{});return W.useEffect(()=>{const B=i=>{if(i.target&&!b.current){let o=function(){Dr(Ms,m,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(h.removeEventListener("click",A.current),A.current=o,h.addEventListener("click",A.current,{once:!0})):o()}else h.removeEventListener("click",A.current);b.current=!1},E=window.setTimeout(()=>{h.addEventListener("pointerdown",B)},0);return()=>{window.clearTimeout(E),h.removeEventListener("pointerdown",B),h.removeEventListener("click",A.current)}},[h,m]),{onPointerDownCapture:()=>b.current=!0}}function Ns(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),b=W.useRef(!1);return W.useEffect(()=>{const A=B=>{B.target&&!b.current&&Dr(Hs,m,{originalEvent:B},{discrete:!1})};return h.addEventListener("focusin",A),()=>h.removeEventListener("focusin",A)},[h,m]),{onFocusCapture:()=>b.current=!0,onBlurCapture:()=>b.current=!1}}function tr(){const n=new CustomEvent(kt);document.dispatchEvent(n)}function Dr(n,h,m,{discrete:b}){const A=m.originalEvent.target,B=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:m});h&&A.addEventListener(n,h,{once:!0}),b?Ps(A,B):A.dispatchEvent(B)}var we=globalThis!=null&&globalThis.document?W.useLayoutEffect:()=>{},Us=W[" useId ".trim().toString()]||(()=>{}),zs=0;function Qs(n){const[h,m]=W.useState(Us());return we(()=>{m(b=>b??String(zs++))},[n]),h?`radix-${h}`:""}const Ks=["top","right","bottom","left"],ye=Math.min,ne=Math.max,it=Math.round,Je=Math.floor,de=n=>({x:n,y:n}),Gs={left:"right",right:"left",bottom:"top",top:"bottom"},qs={start:"end",end:"start"};function Lt(n,h,m){return ne(n,ye(h,m))}function pe(n,h){return typeof n=="function"?n(h):n}function _e(n){return n.split("-")[0]}function Pe(n){return n.split("-")[1]}function Tt(n){return n==="x"?"y":"x"}function Mt(n){return n==="y"?"height":"width"}const Ys=new Set(["top","bottom"]);function ue(n){return Ys.has(_e(n))?"y":"x"}function Ht(n){return Tt(ue(n))}function Vs(n,h,m){m===void 0&&(m=!1);const b=Pe(n),A=Ht(n),B=Mt(A);let E=A==="x"?b===(m?"end":"start")?"right":"left":b==="start"?"bottom":"top";return h.reference[B]>h.floating[B]&&(E=st(E)),[E,st(E)]}function Xs(n){const h=st(n);return[It(n),h,It(h)]}function It(n){return n.replace(/start|end/g,h=>qs[h])}const rr=["left","right"],ir=["right","left"],Zs=["top","bottom"],Js=["bottom","top"];function $s(n,h,m){switch(n){case"top":case"bottom":return m?h?ir:rr:h?rr:ir;case"left":case"right":return h?Zs:Js;default:return[]}}function en(n,h,m,b){const A=Pe(n);let B=$s(_e(n),m==="start",b);return A&&(B=B.map(E=>E+"-"+A),h&&(B=B.concat(B.map(It)))),B}function st(n){return n.replace(/left|right|bottom|top/g,h=>Gs[h])}function tn(n){return{top:0,right:0,bottom:0,left:0,...n}}function Pr(n){return typeof n!="number"?tn(n):{top:n,right:n,bottom:n,left:n}}function nt(n){const{x:h,y:m,width:b,height:A}=n;return{width:b,height:A,top:m,left:h,right:h+b,bottom:m+A,x:h,y:m}}function sr(n,h,m){let{reference:b,floating:A}=n;const B=ue(h),E=Ht(h),i=Mt(E),o=_e(h),c=B==="y",d=b.x+b.width/2-A.width/2,a=b.y+b.height/2-A.height/2,f=b[i]/2-A[i]/2;let g;switch(o){case"top":g={x:d,y:b.y-A.height};break;case"bottom":g={x:d,y:b.y+b.height};break;case"right":g={x:b.x+b.width,y:a};break;case"left":g={x:b.x-A.width,y:a};break;default:g={x:b.x,y:b.y}}switch(Pe(h)){case"start":g[E]-=f*(m&&c?-1:1);break;case"end":g[E]+=f*(m&&c?-1:1);break}return g}const rn=async(n,h,m)=>{const{placement:b="bottom",strategy:A="absolute",middleware:B=[],platform:E}=m,i=B.filter(Boolean),o=await(E.isRTL==null?void 0:E.isRTL(h));let c=await E.getElementRects({reference:n,floating:h,strategy:A}),{x:d,y:a}=sr(c,b,o),f=b,g={},S=0;for(let u=0;u<i.length;u++){const{name:r,fn:s}=i[u],{x:e,y:t,data:l,reset:p}=await s({x:d,y:a,initialPlacement:b,placement:f,strategy:A,middlewareData:g,rects:c,platform:E,elements:{reference:n,floating:h}});d=e??d,a=t??a,g={...g,[r]:{...g[r],...l}},p&&S<=50&&(S++,typeof p=="object"&&(p.placement&&(f=p.placement),p.rects&&(c=p.rects===!0?await E.getElementRects({reference:n,floating:h,strategy:A}):p.rects),{x:d,y:a}=sr(c,f,o)),u=-1)}return{x:d,y:a,placement:f,strategy:A,middlewareData:g}};async function Ue(n,h){var m;h===void 0&&(h={});const{x:b,y:A,platform:B,rects:E,elements:i,strategy:o}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:a="floating",altBoundary:f=!1,padding:g=0}=pe(h,n),S=Pr(g),r=i[f?a==="floating"?"reference":"floating":a],s=nt(await B.getClippingRect({element:(m=await(B.isElement==null?void 0:B.isElement(r)))==null||m?r:r.contextElement||await(B.getDocumentElement==null?void 0:B.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:o})),e=a==="floating"?{x:b,y:A,width:E.floating.width,height:E.floating.height}:E.reference,t=await(B.getOffsetParent==null?void 0:B.getOffsetParent(i.floating)),l=await(B.isElement==null?void 0:B.isElement(t))?await(B.getScale==null?void 0:B.getScale(t))||{x:1,y:1}:{x:1,y:1},p=nt(B.convertOffsetParentRelativeRectToViewportRelativeRect?await B.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:e,offsetParent:t,strategy:o}):e);return{top:(s.top-p.top+S.top)/l.y,bottom:(p.bottom-s.bottom+S.bottom)/l.y,left:(s.left-p.left+S.left)/l.x,right:(p.right-s.right+S.right)/l.x}}const sn=n=>({name:"arrow",options:n,async fn(h){const{x:m,y:b,placement:A,rects:B,platform:E,elements:i,middlewareData:o}=h,{element:c,padding:d=0}=pe(n,h)||{};if(c==null)return{};const a=Pr(d),f={x:m,y:b},g=Ht(A),S=Mt(g),u=await E.getDimensions(c),r=g==="y",s=r?"top":"left",e=r?"bottom":"right",t=r?"clientHeight":"clientWidth",l=B.reference[S]+B.reference[g]-f[g]-B.floating[S],p=f[g]-B.reference[g],_=await(E.getOffsetParent==null?void 0:E.getOffsetParent(c));let C=_?_[t]:0;(!C||!await(E.isElement==null?void 0:E.isElement(_)))&&(C=i.floating[t]||B.floating[S]);const v=l/2-p/2,w=C/2-u[S]/2-1,k=ye(a[s],w),D=ye(a[e],w),O=k,L=C-u[S]-D,F=C/2-u[S]/2+v,H=Lt(O,F,L),j=!o.arrow&&Pe(A)!=null&&F!==H&&B.reference[S]/2-(F<O?k:D)-u[S]/2<0,Q=j?F<O?F-O:F-L:0;return{[g]:f[g]+Q,data:{[g]:H,centerOffset:F-H-Q,...j&&{alignmentOffset:Q}},reset:j}}}),nn=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(h){var m,b;const{placement:A,middlewareData:B,rects:E,initialPlacement:i,platform:o,elements:c}=h,{mainAxis:d=!0,crossAxis:a=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:u=!0,...r}=pe(n,h);if((m=B.arrow)!=null&&m.alignmentOffset)return{};const s=_e(A),e=ue(i),t=_e(i)===i,l=await(o.isRTL==null?void 0:o.isRTL(c.floating)),p=f||(t||!u?[st(i)]:Xs(i)),_=S!=="none";!f&&_&&p.push(...en(i,u,S,l));const C=[i,...p],v=await Ue(h,r),w=[];let k=((b=B.flip)==null?void 0:b.overflows)||[];if(d&&w.push(v[s]),a){const F=Vs(A,E,l);w.push(v[F[0]],v[F[1]])}if(k=[...k,{placement:A,overflows:w}],!w.every(F=>F<=0)){var D,O;const F=(((D=B.flip)==null?void 0:D.index)||0)+1,H=C[F];if(H&&(!(a==="alignment"?e!==ue(H):!1)||k.every(U=>ue(U.placement)===e?U.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:H}};let j=(O=k.filter(Q=>Q.overflows[0]<=0).sort((Q,U)=>Q.overflows[1]-U.overflows[1])[0])==null?void 0:O.placement;if(!j)switch(g){case"bestFit":{var L;const Q=(L=k.filter(U=>{if(_){const y=ue(U.placement);return y===e||y==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(y=>y>0).reduce((y,I)=>y+I,0)]).sort((U,y)=>U[1]-y[1])[0])==null?void 0:L[0];Q&&(j=Q);break}case"initialPlacement":j=i;break}if(A!==j)return{reset:{placement:j}}}return{}}}};function nr(n,h){return{top:n.top-h.height,right:n.right-h.width,bottom:n.bottom-h.height,left:n.left-h.width}}function or(n){return Ks.some(h=>n[h]>=0)}const on=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(h){const{rects:m}=h,{strategy:b="referenceHidden",...A}=pe(n,h);switch(b){case"referenceHidden":{const B=await Ue(h,{...A,elementContext:"reference"}),E=nr(B,m.reference);return{data:{referenceHiddenOffsets:E,referenceHidden:or(E)}}}case"escaped":{const B=await Ue(h,{...A,altBoundary:!0}),E=nr(B,m.floating);return{data:{escapedOffsets:E,escaped:or(E)}}}default:return{}}}}},Or=new Set(["left","top"]);async function an(n,h){const{placement:m,platform:b,elements:A}=n,B=await(b.isRTL==null?void 0:b.isRTL(A.floating)),E=_e(m),i=Pe(m),o=ue(m)==="y",c=Or.has(E)?-1:1,d=B&&o?-1:1,a=pe(h,n);let{mainAxis:f,crossAxis:g,alignmentAxis:S}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return i&&typeof S=="number"&&(g=i==="end"?S*-1:S),o?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const cn=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(h){var m,b;const{x:A,y:B,placement:E,middlewareData:i}=h,o=await an(h,n);return E===((m=i.offset)==null?void 0:m.placement)&&(b=i.arrow)!=null&&b.alignmentOffset?{}:{x:A+o.x,y:B+o.y,data:{...o,placement:E}}}}},ln=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(h){const{x:m,y:b,placement:A}=h,{mainAxis:B=!0,crossAxis:E=!1,limiter:i={fn:r=>{let{x:s,y:e}=r;return{x:s,y:e}}},...o}=pe(n,h),c={x:m,y:b},d=await Ue(h,o),a=ue(_e(A)),f=Tt(a);let g=c[f],S=c[a];if(B){const r=f==="y"?"top":"left",s=f==="y"?"bottom":"right",e=g+d[r],t=g-d[s];g=Lt(e,g,t)}if(E){const r=a==="y"?"top":"left",s=a==="y"?"bottom":"right",e=S+d[r],t=S-d[s];S=Lt(e,S,t)}const u=i.fn({...h,[f]:g,[a]:S});return{...u,data:{x:u.x-m,y:u.y-b,enabled:{[f]:B,[a]:E}}}}}},hn=function(n){return n===void 0&&(n={}),{options:n,fn(h){const{x:m,y:b,placement:A,rects:B,middlewareData:E}=h,{offset:i=0,mainAxis:o=!0,crossAxis:c=!0}=pe(n,h),d={x:m,y:b},a=ue(A),f=Tt(a);let g=d[f],S=d[a];const u=pe(i,h),r=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(o){const t=f==="y"?"height":"width",l=B.reference[f]-B.floating[t]+r.mainAxis,p=B.reference[f]+B.reference[t]-r.mainAxis;g<l?g=l:g>p&&(g=p)}if(c){var s,e;const t=f==="y"?"width":"height",l=Or.has(_e(A)),p=B.reference[a]-B.floating[t]+(l&&((s=E.offset)==null?void 0:s[a])||0)+(l?0:r.crossAxis),_=B.reference[a]+B.reference[t]+(l?0:((e=E.offset)==null?void 0:e[a])||0)-(l?r.crossAxis:0);S<p?S=p:S>_&&(S=_)}return{[f]:g,[a]:S}}}},un=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(h){var m,b;const{placement:A,rects:B,platform:E,elements:i}=h,{apply:o=()=>{},...c}=pe(n,h),d=await Ue(h,c),a=_e(A),f=Pe(A),g=ue(A)==="y",{width:S,height:u}=B.floating;let r,s;a==="top"||a==="bottom"?(r=a,s=f===(await(E.isRTL==null?void 0:E.isRTL(i.floating))?"start":"end")?"left":"right"):(s=a,r=f==="end"?"top":"bottom");const e=u-d.top-d.bottom,t=S-d.left-d.right,l=ye(u-d[r],e),p=ye(S-d[s],t),_=!h.middlewareData.shift;let C=l,v=p;if((m=h.middlewareData.shift)!=null&&m.enabled.x&&(v=t),(b=h.middlewareData.shift)!=null&&b.enabled.y&&(C=e),_&&!f){const k=ne(d.left,0),D=ne(d.right,0),O=ne(d.top,0),L=ne(d.bottom,0);g?v=S-2*(k!==0||D!==0?k+D:ne(d.left,d.right)):C=u-2*(O!==0||L!==0?O+L:ne(d.top,d.bottom))}await o({...h,availableWidth:v,availableHeight:C});const w=await E.getDimensions(i.floating);return S!==w.width||u!==w.height?{reset:{rects:!0}}:{}}}};function lt(){return typeof window<"u"}function Oe(n){return Tr(n)?(n.nodeName||"").toLowerCase():"#document"}function oe(n){var h;return(n==null||(h=n.ownerDocument)==null?void 0:h.defaultView)||window}function ge(n){var h;return(h=(Tr(n)?n.ownerDocument:n.document)||window.document)==null?void 0:h.documentElement}function Tr(n){return lt()?n instanceof Node||n instanceof oe(n).Node:!1}function ce(n){return lt()?n instanceof Element||n instanceof oe(n).Element:!1}function fe(n){return lt()?n instanceof HTMLElement||n instanceof oe(n).HTMLElement:!1}function ar(n){return!lt()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof oe(n).ShadowRoot}const dn=new Set(["inline","contents"]);function Ge(n){const{overflow:h,overflowX:m,overflowY:b,display:A}=le(n);return/auto|scroll|overlay|hidden|clip/.test(h+b+m)&&!dn.has(A)}const fn=new Set(["table","td","th"]);function gn(n){return fn.has(Oe(n))}const vn=[":popover-open",":modal"];function ht(n){return vn.some(h=>{try{return n.matches(h)}catch{return!1}})}const pn=["transform","translate","scale","rotate","perspective"],_n=["transform","translate","scale","rotate","perspective","filter"],mn=["paint","layout","strict","content"];function Ft(n){const h=jt(),m=ce(n)?le(n):n;return pn.some(b=>m[b]?m[b]!=="none":!1)||(m.containerType?m.containerType!=="normal":!1)||!h&&(m.backdropFilter?m.backdropFilter!=="none":!1)||!h&&(m.filter?m.filter!=="none":!1)||_n.some(b=>(m.willChange||"").includes(b))||mn.some(b=>(m.contain||"").includes(b))}function Sn(n){let h=Ae(n);for(;fe(h)&&!Ie(h);){if(Ft(h))return h;if(ht(h))return null;h=Ae(h)}return null}function jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Cn=new Set(["html","body","#document"]);function Ie(n){return Cn.has(Oe(n))}function le(n){return oe(n).getComputedStyle(n)}function ut(n){return ce(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ae(n){if(Oe(n)==="html")return n;const h=n.assignedSlot||n.parentNode||ar(n)&&n.host||ge(n);return ar(h)?h.host:h}function Mr(n){const h=Ae(n);return Ie(h)?n.ownerDocument?n.ownerDocument.body:n.body:fe(h)&&Ge(h)?h:Mr(h)}function ze(n,h,m){var b;h===void 0&&(h=[]),m===void 0&&(m=!0);const A=Mr(n),B=A===((b=n.ownerDocument)==null?void 0:b.body),E=oe(A);if(B){const i=Dt(E);return h.concat(E,E.visualViewport||[],Ge(A)?A:[],i&&m?ze(i):[])}return h.concat(A,ze(A,[],m))}function Dt(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Hr(n){const h=le(n);let m=parseFloat(h.width)||0,b=parseFloat(h.height)||0;const A=fe(n),B=A?n.offsetWidth:m,E=A?n.offsetHeight:b,i=it(m)!==B||it(b)!==E;return i&&(m=B,b=E),{width:m,height:b,$:i}}function Wt(n){return ce(n)?n:n.contextElement}function Le(n){const h=Wt(n);if(!fe(h))return de(1);const m=h.getBoundingClientRect(),{width:b,height:A,$:B}=Hr(h);let E=(B?it(m.width):m.width)/b,i=(B?it(m.height):m.height)/A;return(!E||!Number.isFinite(E))&&(E=1),(!i||!Number.isFinite(i))&&(i=1),{x:E,y:i}}const bn=de(0);function Fr(n){const h=oe(n);return!jt()||!h.visualViewport?bn:{x:h.visualViewport.offsetLeft,y:h.visualViewport.offsetTop}}function wn(n,h,m){return h===void 0&&(h=!1),!m||h&&m!==oe(n)?!1:h}function Be(n,h,m,b){h===void 0&&(h=!1),m===void 0&&(m=!1);const A=n.getBoundingClientRect(),B=Wt(n);let E=de(1);h&&(b?ce(b)&&(E=Le(b)):E=Le(n));const i=wn(B,m,b)?Fr(B):de(0);let o=(A.left+i.x)/E.x,c=(A.top+i.y)/E.y,d=A.width/E.x,a=A.height/E.y;if(B){const f=oe(B),g=b&&ce(b)?oe(b):b;let S=f,u=Dt(S);for(;u&&b&&g!==S;){const r=Le(u),s=u.getBoundingClientRect(),e=le(u),t=s.left+(u.clientLeft+parseFloat(e.paddingLeft))*r.x,l=s.top+(u.clientTop+parseFloat(e.paddingTop))*r.y;o*=r.x,c*=r.y,d*=r.x,a*=r.y,o+=t,c+=l,S=oe(u),u=Dt(S)}}return nt({width:d,height:a,x:o,y:c})}function dt(n,h){const m=ut(n).scrollLeft;return h?h.left+m:Be(ge(n)).left+m}function jr(n,h){const m=n.getBoundingClientRect(),b=m.left+h.scrollLeft-dt(n,m),A=m.top+h.scrollTop;return{x:b,y:A}}function yn(n){let{elements:h,rect:m,offsetParent:b,strategy:A}=n;const B=A==="fixed",E=ge(b),i=h?ht(h.floating):!1;if(b===E||i&&B)return m;let o={scrollLeft:0,scrollTop:0},c=de(1);const d=de(0),a=fe(b);if((a||!a&&!B)&&((Oe(b)!=="body"||Ge(E))&&(o=ut(b)),fe(b))){const g=Be(b);c=Le(b),d.x=g.x+b.clientLeft,d.y=g.y+b.clientTop}const f=E&&!a&&!B?jr(E,o):de(0);return{width:m.width*c.x,height:m.height*c.y,x:m.x*c.x-o.scrollLeft*c.x+d.x+f.x,y:m.y*c.y-o.scrollTop*c.y+d.y+f.y}}function An(n){return Array.from(n.getClientRects())}function En(n){const h=ge(n),m=ut(n),b=n.ownerDocument.body,A=ne(h.scrollWidth,h.clientWidth,b.scrollWidth,b.clientWidth),B=ne(h.scrollHeight,h.clientHeight,b.scrollHeight,b.clientHeight);let E=-m.scrollLeft+dt(n);const i=-m.scrollTop;return le(b).direction==="rtl"&&(E+=ne(h.clientWidth,b.clientWidth)-A),{width:A,height:B,x:E,y:i}}const cr=25;function xn(n,h){const m=oe(n),b=ge(n),A=m.visualViewport;let B=b.clientWidth,E=b.clientHeight,i=0,o=0;if(A){B=A.width,E=A.height;const d=jt();(!d||d&&h==="fixed")&&(i=A.offsetLeft,o=A.offsetTop)}const c=dt(b);if(c<=0){const d=b.ownerDocument,a=d.body,f=getComputedStyle(a),g=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(b.clientWidth-a.clientWidth-g);S<=cr&&(B-=S)}else c<=cr&&(B+=c);return{width:B,height:E,x:i,y:o}}const Bn=new Set(["absolute","fixed"]);function Rn(n,h){const m=Be(n,!0,h==="fixed"),b=m.top+n.clientTop,A=m.left+n.clientLeft,B=fe(n)?Le(n):de(1),E=n.clientWidth*B.x,i=n.clientHeight*B.y,o=A*B.x,c=b*B.y;return{width:E,height:i,x:o,y:c}}function lr(n,h,m){let b;if(h==="viewport")b=xn(n,m);else if(h==="document")b=En(ge(n));else if(ce(h))b=Rn(h,m);else{const A=Fr(n);b={x:h.x-A.x,y:h.y-A.y,width:h.width,height:h.height}}return nt(b)}function Wr(n,h){const m=Ae(n);return m===h||!ce(m)||Ie(m)?!1:le(m).position==="fixed"||Wr(m,h)}function kn(n,h){const m=h.get(n);if(m)return m;let b=ze(n,[],!1).filter(i=>ce(i)&&Oe(i)!=="body"),A=null;const B=le(n).position==="fixed";let E=B?Ae(n):n;for(;ce(E)&&!Ie(E);){const i=le(E),o=Ft(E);!o&&i.position==="fixed"&&(A=null),(B?!o&&!A:!o&&i.position==="static"&&!!A&&Bn.has(A.position)||Ge(E)&&!o&&Wr(n,E))?b=b.filter(d=>d!==E):A=i,E=Ae(E)}return h.set(n,b),b}function Ln(n){let{element:h,boundary:m,rootBoundary:b,strategy:A}=n;const E=[...m==="clippingAncestors"?ht(h)?[]:kn(h,this._c):[].concat(m),b],i=E[0],o=E.reduce((c,d)=>{const a=lr(h,d,A);return c.top=ne(a.top,c.top),c.right=ye(a.right,c.right),c.bottom=ye(a.bottom,c.bottom),c.left=ne(a.left,c.left),c},lr(h,i,A));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function In(n){const{width:h,height:m}=Hr(n);return{width:h,height:m}}function Dn(n,h,m){const b=fe(h),A=ge(h),B=m==="fixed",E=Be(n,!0,B,h);let i={scrollLeft:0,scrollTop:0};const o=de(0);function c(){o.x=dt(A)}if(b||!b&&!B)if((Oe(h)!=="body"||Ge(A))&&(i=ut(h)),b){const g=Be(h,!0,B,h);o.x=g.x+h.clientLeft,o.y=g.y+h.clientTop}else A&&c();B&&!b&&A&&c();const d=A&&!b&&!B?jr(A,i):de(0),a=E.left+i.scrollLeft-o.x-d.x,f=E.top+i.scrollTop-o.y-d.y;return{x:a,y:f,width:E.width,height:E.height}}function wt(n){return le(n).position==="static"}function hr(n,h){if(!fe(n)||le(n).position==="fixed")return null;if(h)return h(n);let m=n.offsetParent;return ge(n)===m&&(m=m.ownerDocument.body),m}function Nr(n,h){const m=oe(n);if(ht(n))return m;if(!fe(n)){let A=Ae(n);for(;A&&!Ie(A);){if(ce(A)&&!wt(A))return A;A=Ae(A)}return m}let b=hr(n,h);for(;b&&gn(b)&&wt(b);)b=hr(b,h);return b&&Ie(b)&&wt(b)&&!Ft(b)?m:b||Sn(n)||m}const Pn=async function(n){const h=this.getOffsetParent||Nr,m=this.getDimensions,b=await m(n.floating);return{reference:Dn(n.reference,await h(n.floating),n.strategy),floating:{x:0,y:0,width:b.width,height:b.height}}};function On(n){return le(n).direction==="rtl"}const Tn={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:ge,getClippingRect:Ln,getOffsetParent:Nr,getElementRects:Pn,getClientRects:An,getDimensions:In,getScale:Le,isElement:ce,isRTL:On};function Ur(n,h){return n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height}function Mn(n,h){let m=null,b;const A=ge(n);function B(){var i;clearTimeout(b),(i=m)==null||i.disconnect(),m=null}function E(i,o){i===void 0&&(i=!1),o===void 0&&(o=1),B();const c=n.getBoundingClientRect(),{left:d,top:a,width:f,height:g}=c;if(i||h(),!f||!g)return;const S=Je(a),u=Je(A.clientWidth-(d+f)),r=Je(A.clientHeight-(a+g)),s=Je(d),t={rootMargin:-S+"px "+-u+"px "+-r+"px "+-s+"px",threshold:ne(0,ye(1,o))||1};let l=!0;function p(_){const C=_[0].intersectionRatio;if(C!==o){if(!l)return E();C?E(!1,C):b=setTimeout(()=>{E(!1,1e-7)},1e3)}C===1&&!Ur(c,n.getBoundingClientRect())&&E(),l=!1}try{m=new IntersectionObserver(p,{...t,root:A.ownerDocument})}catch{m=new IntersectionObserver(p,t)}m.observe(n)}return E(!0),B}function Hn(n,h,m,b){b===void 0&&(b={});const{ancestorScroll:A=!0,ancestorResize:B=!0,elementResize:E=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:o=!1}=b,c=Wt(n),d=A||B?[...c?ze(c):[],...ze(h)]:[];d.forEach(s=>{A&&s.addEventListener("scroll",m,{passive:!0}),B&&s.addEventListener("resize",m)});const a=c&&i?Mn(c,m):null;let f=-1,g=null;E&&(g=new ResizeObserver(s=>{let[e]=s;e&&e.target===c&&g&&(g.unobserve(h),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;(t=g)==null||t.observe(h)})),m()}),c&&!o&&g.observe(c),g.observe(h));let S,u=o?Be(n):null;o&&r();function r(){const s=Be(n);u&&!Ur(u,s)&&m(),u=s,S=requestAnimationFrame(r)}return m(),()=>{var s;d.forEach(e=>{A&&e.removeEventListener("scroll",m),B&&e.removeEventListener("resize",m)}),a==null||a(),(s=g)==null||s.disconnect(),g=null,o&&cancelAnimationFrame(S)}}const Fn=cn,jn=ln,Wn=nn,Nn=un,Un=on,ur=sn,zn=hn,Qn=(n,h,m)=>{const b=new Map,A={platform:Tn,...m},B={...A.platform,_c:b};return rn(n,h,{...A,platform:B})};var Kn=typeof document<"u",Gn=function(){},tt=Kn?V.useLayoutEffect:Gn;function ot(n,h){if(n===h)return!0;if(typeof n!=typeof h)return!1;if(typeof n=="function"&&n.toString()===h.toString())return!0;let m,b,A;if(n&&h&&typeof n=="object"){if(Array.isArray(n)){if(m=n.length,m!==h.length)return!1;for(b=m;b--!==0;)if(!ot(n[b],h[b]))return!1;return!0}if(A=Object.keys(n),m=A.length,m!==Object.keys(h).length)return!1;for(b=m;b--!==0;)if(!{}.hasOwnProperty.call(h,A[b]))return!1;for(b=m;b--!==0;){const B=A[b];if(!(B==="_owner"&&n.$$typeof)&&!ot(n[B],h[B]))return!1}return!0}return n!==n&&h!==h}function zr(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(n,h){const m=zr(n);return Math.round(h*m)/m}function yt(n){const h=W.useRef(n);return tt(()=>{h.current=n}),h}function qn(n){n===void 0&&(n={});const{placement:h="bottom",strategy:m="absolute",middleware:b=[],platform:A,elements:{reference:B,floating:E}={},transform:i=!0,whileElementsMounted:o,open:c}=n,[d,a]=W.useState({x:0,y:0,strategy:m,placement:h,middlewareData:{},isPositioned:!1}),[f,g]=W.useState(b);ot(f,b)||g(b);const[S,u]=W.useState(null),[r,s]=W.useState(null),e=W.useCallback(U=>{U!==_.current&&(_.current=U,u(U))},[]),t=W.useCallback(U=>{U!==C.current&&(C.current=U,s(U))},[]),l=B||S,p=E||r,_=W.useRef(null),C=W.useRef(null),v=W.useRef(d),w=o!=null,k=yt(o),D=yt(A),O=yt(c),L=W.useCallback(()=>{if(!_.current||!C.current)return;const U={placement:h,strategy:m,middleware:f};D.current&&(U.platform=D.current),Qn(_.current,C.current,U).then(y=>{const I={...y,isPositioned:O.current!==!1};F.current&&!ot(v.current,I)&&(v.current=I,_r.flushSync(()=>{a(I)}))})},[f,h,m,D,O]);tt(()=>{c===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,a(U=>({...U,isPositioned:!1})))},[c]);const F=W.useRef(!1);tt(()=>(F.current=!0,()=>{F.current=!1}),[]),tt(()=>{if(l&&(_.current=l),p&&(C.current=p),l&&p){if(k.current)return k.current(l,p,L);L()}},[l,p,L,k,w]);const H=W.useMemo(()=>({reference:_,floating:C,setReference:e,setFloating:t}),[e,t]),j=W.useMemo(()=>({reference:l,floating:p}),[l,p]),Q=W.useMemo(()=>{const U={position:m,left:0,top:0};if(!j.floating)return U;const y=dr(j.floating,d.x),I=dr(j.floating,d.y);return i?{...U,transform:"translate("+y+"px, "+I+"px)",...zr(j.floating)>=1.5&&{willChange:"transform"}}:{position:m,left:y,top:I}},[m,i,j.floating,d.x,d.y]);return W.useMemo(()=>({...d,update:L,refs:H,elements:j,floatingStyles:Q}),[d,L,H,j,Q])}const Yn=n=>{function h(m){return{}.hasOwnProperty.call(m,"current")}return{name:"arrow",options:n,fn(m){const{element:b,padding:A}=typeof n=="function"?n(m):n;return b&&h(b)?b.current!=null?ur({element:b.current,padding:A}).fn(m):{}:b?ur({element:b,padding:A}).fn(m):{}}}},Vn=(n,h)=>({...Fn(n),options:[n,h]}),Xn=(n,h)=>({...jn(n),options:[n,h]}),Zn=(n,h)=>({...zn(n),options:[n,h]}),Jn=(n,h)=>({...Wn(n),options:[n,h]}),$n=(n,h)=>({...Nn(n),options:[n,h]}),eo=(n,h)=>({...Un(n),options:[n,h]}),to=(n,h)=>({...Yn(n),options:[n,h]});var ro="Arrow",Qr=W.forwardRef((n,h)=>{const{children:m,width:b=10,height:A=5,...B}=n;return G.jsx(Ee.svg,{...B,ref:h,width:b,height:A,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?m:G.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qr.displayName=ro;var io=Qr;function so(n){const[h,m]=W.useState(void 0);return we(()=>{if(n){m({width:n.offsetWidth,height:n.offsetHeight});const b=new ResizeObserver(A=>{if(!Array.isArray(A)||!A.length)return;const B=A[0];let E,i;if("borderBoxSize"in B){const o=B.borderBoxSize,c=Array.isArray(o)?o[0]:o;E=c.inlineSize,i=c.blockSize}else E=n.offsetWidth,i=n.offsetHeight;m({width:E,height:i})});return b.observe(n,{box:"border-box"}),()=>b.unobserve(n)}else m(void 0)},[n]),h}var Nt="Popper",[Kr,Gr]=Rr(Nt),[no,qr]=Kr(Nt),Yr=n=>{const{__scopePopper:h,children:m}=n,[b,A]=W.useState(null);return G.jsx(no,{scope:h,anchor:b,onAnchorChange:A,children:m})};Yr.displayName=Nt;var Vr="PopperAnchor",Xr=W.forwardRef((n,h)=>{const{__scopePopper:m,virtualRef:b,...A}=n,B=qr(Vr,m),E=W.useRef(null),i=Re(h,E),o=W.useRef(null);return W.useEffect(()=>{const c=o.current;o.current=(b==null?void 0:b.current)||E.current,c!==o.current&&B.onAnchorChange(o.current)}),b?null:G.jsx(Ee.div,{...A,ref:i})});Xr.displayName=Vr;var Ut="PopperContent",[oo,ao]=Kr(Ut),Zr=W.forwardRef((n,h)=>{var M,x,K,T,q,z;const{__scopePopper:m,side:b="bottom",sideOffset:A=0,align:B="center",alignOffset:E=0,arrowPadding:i=0,avoidCollisions:o=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:a="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:S,...u}=n,r=qr(Ut,m),[s,e]=W.useState(null),t=Re(h,X=>e(X)),[l,p]=W.useState(null),_=so(l),C=(_==null?void 0:_.width)??0,v=(_==null?void 0:_.height)??0,w=b+(B!=="center"?"-"+B:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(c)?c:[c],O=D.length>0,L={padding:k,boundary:D.filter(lo),altBoundary:O},{refs:F,floatingStyles:H,placement:j,isPositioned:Q,middlewareData:U}=qn({strategy:"fixed",placement:w,whileElementsMounted:(...X)=>Hn(...X,{animationFrame:g==="always"}),elements:{reference:r.anchor},middleware:[Vn({mainAxis:A+v,alignmentAxis:E}),o&&Xn({mainAxis:!0,crossAxis:!1,limiter:a==="partial"?Zn():void 0,...L}),o&&Jn({...L}),$n({...L,apply:({elements:X,rects:ee,availableWidth:te,availableHeight:ie})=>{const{width:$,height:xe}=ee.reference,me=X.floating.style;me.setProperty("--radix-popper-available-width",`${te}px`),me.setProperty("--radix-popper-available-height",`${ie}px`),me.setProperty("--radix-popper-anchor-width",`${$}px`),me.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),l&&to({element:l,padding:i}),ho({arrowWidth:C,arrowHeight:v}),f&&eo({strategy:"referenceHidden",...L})]}),[y,I]=ei(j),R=ct(S);we(()=>{Q&&(R==null||R())},[Q,R]);const P=(M=U.arrow)==null?void 0:M.x,N=(x=U.arrow)==null?void 0:x.y,Y=((K=U.arrow)==null?void 0:K.centerOffset)!==0,[Z,J]=W.useState();return we(()=>{s&&J(window.getComputedStyle(s).zIndex)},[s]),G.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(T=U.transformOrigin)==null?void 0:T.x,(q=U.transformOrigin)==null?void 0:q.y].join(" "),...((z=U.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:G.jsx(oo,{scope:m,placedSide:y,onArrowChange:p,arrowX:P,arrowY:N,shouldHideArrow:Y,children:G.jsx(Ee.div,{"data-side":y,"data-align":I,...u,ref:t,style:{...u.style,animation:Q?void 0:"none"}})})})});Zr.displayName=Ut;var Jr="PopperArrow",co={top:"bottom",right:"left",bottom:"top",left:"right"},$r=W.forwardRef(function(h,m){const{__scopePopper:b,...A}=h,B=ao(Jr,b),E=co[B.placedSide];return G.jsx("span",{ref:B.onArrowChange,style:{position:"absolute",left:B.arrowX,top:B.arrowY,[E]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[B.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[B.placedSide],visibility:B.shouldHideArrow?"hidden":void 0},children:G.jsx(io,{...A,ref:m,style:{...A.style,display:"block"}})})});$r.displayName=Jr;function lo(n){return n!==null}var ho=n=>({name:"transformOrigin",options:n,fn(h){var r,s,e;const{placement:m,rects:b,middlewareData:A}=h,E=((r=A.arrow)==null?void 0:r.centerOffset)!==0,i=E?0:n.arrowWidth,o=E?0:n.arrowHeight,[c,d]=ei(m),a={start:"0%",center:"50%",end:"100%"}[d],f=(((s=A.arrow)==null?void 0:s.x)??0)+i/2,g=(((e=A.arrow)==null?void 0:e.y)??0)+o/2;let S="",u="";return c==="bottom"?(S=E?a:`${f}px`,u=`${-o}px`):c==="top"?(S=E?a:`${f}px`,u=`${b.floating.height+o}px`):c==="right"?(S=`${-o}px`,u=E?a:`${g}px`):c==="left"&&(S=`${b.floating.width+o}px`,u=E?a:`${g}px`),{data:{x:S,y:u}}}});function ei(n){const[h,m="center"]=n.split("-");return[h,m]}var uo=Yr,fo=Xr,go=Zr,vo=$r,po="Portal",ti=W.forwardRef((n,h)=>{var i;const{container:m,...b}=n,[A,B]=W.useState(!1);we(()=>B(!0),[]);const E=m||A&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return E?vr.createPortal(G.jsx(Ee.div,{...b,ref:h}),E):null});ti.displayName=po;function _o(n,h){return W.useReducer((m,b)=>h[m][b]??m,n)}var zt=n=>{const{present:h,children:m}=n,b=mo(h),A=typeof m=="function"?m({present:b.isPresent}):W.Children.only(m),B=Re(b.ref,So(A));return typeof m=="function"||b.isPresent?W.cloneElement(A,{ref:B}):null};zt.displayName="Presence";function mo(n){const[h,m]=W.useState(),b=W.useRef(null),A=W.useRef(n),B=W.useRef("none"),E=n?"mounted":"unmounted",[i,o]=_o(E,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return W.useEffect(()=>{const c=$e(b.current);B.current=i==="mounted"?c:"none"},[i]),we(()=>{const c=b.current,d=A.current;if(d!==n){const f=B.current,g=$e(c);n?o("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?o("UNMOUNT"):o(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),A.current=n}},[n,o]),we(()=>{if(h){let c;const d=h.ownerDocument.defaultView??window,a=g=>{const u=$e(b.current).includes(CSS.escape(g.animationName));if(g.target===h&&u&&(o("ANIMATION_END"),!A.current)){const r=h.style.animationFillMode;h.style.animationFillMode="forwards",c=d.setTimeout(()=>{h.style.animationFillMode==="forwards"&&(h.style.animationFillMode=r)})}},f=g=>{g.target===h&&(B.current=$e(b.current))};return h.addEventListener("animationstart",f),h.addEventListener("animationcancel",a),h.addEventListener("animationend",a),()=>{d.clearTimeout(c),h.removeEventListener("animationstart",f),h.removeEventListener("animationcancel",a),h.removeEventListener("animationend",a)}}else o("ANIMATION_END")},[h,o]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:W.useCallback(c=>{b.current=c?getComputedStyle(c):null,m(c)},[])}}function $e(n){return(n==null?void 0:n.animationName)||"none"}function So(n){var b,A;let h=(b=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:b.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(A=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:A.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var Co=W[" useInsertionEffect ".trim().toString()]||we;function bo({prop:n,defaultProp:h,onChange:m=()=>{},caller:b}){const[A,B,E]=wo({defaultProp:h,onChange:m}),i=n!==void 0,o=i?n:A;{const d=W.useRef(n!==void 0);W.useEffect(()=>{const a=d.current;a!==i&&console.warn(`${b} is changing from ${a?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,b])}const c=W.useCallback(d=>{var a;if(i){const f=yo(d)?d(n):d;f!==n&&((a=E.current)==null||a.call(E,f))}else B(d)},[i,n,B,E]);return[o,c]}function wo({defaultProp:n,onChange:h}){const[m,b]=W.useState(n),A=W.useRef(m),B=W.useRef(h);return Co(()=>{B.current=h},[h]),W.useEffect(()=>{var E;A.current!==m&&((E=B.current)==null||E.call(B,m),A.current=m)},[m,A]),[m,b,B]}function yo(n){return typeof n=="function"}var Ao=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Eo="VisuallyHidden",ri=W.forwardRef((n,h)=>G.jsx(Ee.span,{...n,ref:h,style:{...Ao,...n.style}}));ri.displayName=Eo;var xo=ri,[ft]=Rr("Tooltip",[Gr]),gt=Gr(),ii="TooltipProvider",Bo=700,Pt="tooltip.open",[Ro,Qt]=ft(ii),si=n=>{const{__scopeTooltip:h,delayDuration:m=Bo,skipDelayDuration:b=300,disableHoverableContent:A=!1,children:B}=n,E=W.useRef(!0),i=W.useRef(!1),o=W.useRef(0);return W.useEffect(()=>{const c=o.current;return()=>window.clearTimeout(c)},[]),G.jsx(Ro,{scope:h,isOpenDelayedRef:E,delayDuration:m,onOpen:W.useCallback(()=>{window.clearTimeout(o.current),E.current=!1},[]),onClose:W.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>E.current=!0,b)},[b]),isPointerInTransitRef:i,onPointerInTransitChange:W.useCallback(c=>{i.current=c},[]),disableHoverableContent:A,children:B})};si.displayName=ii;var Qe="Tooltip",[ko,qe]=ft(Qe),ni=n=>{const{__scopeTooltip:h,children:m,open:b,defaultOpen:A,onOpenChange:B,disableHoverableContent:E,delayDuration:i}=n,o=Qt(Qe,n.__scopeTooltip),c=gt(h),[d,a]=W.useState(null),f=Qs(),g=W.useRef(0),S=E??o.disableHoverableContent,u=i??o.delayDuration,r=W.useRef(!1),[s,e]=bo({prop:b,defaultProp:A??!1,onChange:C=>{C?(o.onOpen(),document.dispatchEvent(new CustomEvent(Pt))):o.onClose(),B==null||B(C)},caller:Qe}),t=W.useMemo(()=>s?r.current?"delayed-open":"instant-open":"closed",[s]),l=W.useCallback(()=>{window.clearTimeout(g.current),g.current=0,r.current=!1,e(!0)},[e]),p=W.useCallback(()=>{window.clearTimeout(g.current),g.current=0,e(!1)},[e]),_=W.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{r.current=!0,e(!0),g.current=0},u)},[u,e]);return W.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),G.jsx(uo,{...c,children:G.jsx(ko,{scope:h,contentId:f,open:s,stateAttribute:t,trigger:d,onTriggerChange:a,onTriggerEnter:W.useCallback(()=>{o.isOpenDelayedRef.current?_():l()},[o.isOpenDelayedRef,_,l]),onTriggerLeave:W.useCallback(()=>{S?p():(window.clearTimeout(g.current),g.current=0)},[p,S]),onOpen:l,onClose:p,disableHoverableContent:S,children:m})})};ni.displayName=Qe;var Ot="TooltipTrigger",oi=W.forwardRef((n,h)=>{const{__scopeTooltip:m,...b}=n,A=qe(Ot,m),B=Qt(Ot,m),E=gt(m),i=W.useRef(null),o=Re(h,i,A.onTriggerChange),c=W.useRef(!1),d=W.useRef(!1),a=W.useCallback(()=>c.current=!1,[]);return W.useEffect(()=>()=>document.removeEventListener("pointerup",a),[a]),G.jsx(fo,{asChild:!0,...E,children:G.jsx(Ee.button,{"aria-describedby":A.open?A.contentId:void 0,"data-state":A.stateAttribute,...b,ref:o,onPointerMove:ve(n.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!B.isPointerInTransitRef.current&&(A.onTriggerEnter(),d.current=!0)}),onPointerLeave:ve(n.onPointerLeave,()=>{A.onTriggerLeave(),d.current=!1}),onPointerDown:ve(n.onPointerDown,()=>{A.open&&A.onClose(),c.current=!0,document.addEventListener("pointerup",a,{once:!0})}),onFocus:ve(n.onFocus,()=>{c.current||A.onOpen()}),onBlur:ve(n.onBlur,A.onClose),onClick:ve(n.onClick,A.onClose)})})});oi.displayName=Ot;var Kt="TooltipPortal",[Lo,Io]=ft(Kt,{forceMount:void 0}),ai=n=>{const{__scopeTooltip:h,forceMount:m,children:b,container:A}=n,B=qe(Kt,h);return G.jsx(Lo,{scope:h,forceMount:m,children:G.jsx(zt,{present:m||B.open,children:G.jsx(ti,{asChild:!0,container:A,children:b})})})};ai.displayName=Kt;var De="TooltipContent",ci=W.forwardRef((n,h)=>{const m=Io(De,n.__scopeTooltip),{forceMount:b=m.forceMount,side:A="top",...B}=n,E=qe(De,n.__scopeTooltip);return G.jsx(zt,{present:b||E.open,children:E.disableHoverableContent?G.jsx(li,{side:A,...B,ref:h}):G.jsx(Do,{side:A,...B,ref:h})})}),Do=W.forwardRef((n,h)=>{const m=qe(De,n.__scopeTooltip),b=Qt(De,n.__scopeTooltip),A=W.useRef(null),B=Re(h,A),[E,i]=W.useState(null),{trigger:o,onClose:c}=m,d=A.current,{onPointerInTransitChange:a}=b,f=W.useCallback(()=>{i(null),a(!1)},[a]),g=W.useCallback((S,u)=>{const r=S.currentTarget,s={x:S.clientX,y:S.clientY},e=Mo(s,r.getBoundingClientRect()),t=Ho(s,e),l=Fo(u.getBoundingClientRect()),p=Wo([...t,...l]);i(p),a(!0)},[a]);return W.useEffect(()=>()=>f(),[f]),W.useEffect(()=>{if(o&&d){const S=r=>g(r,d),u=r=>g(r,o);return o.addEventListener("pointerleave",S),d.addEventListener("pointerleave",u),()=>{o.removeEventListener("pointerleave",S),d.removeEventListener("pointerleave",u)}}},[o,d,g,f]),W.useEffect(()=>{if(E){const S=u=>{const r=u.target,s={x:u.clientX,y:u.clientY},e=(o==null?void 0:o.contains(r))||(d==null?void 0:d.contains(r)),t=!jo(s,E);e?f():t&&(f(),c())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[o,d,E,c,f]),G.jsx(li,{...n,ref:B})}),[Po,Oo]=ft(Qe,{isInside:!1}),To=Rs("TooltipContent"),li=W.forwardRef((n,h)=>{const{__scopeTooltip:m,children:b,"aria-label":A,onEscapeKeyDown:B,onPointerDownOutside:E,...i}=n,o=qe(De,m),c=gt(m),{onClose:d}=o;return W.useEffect(()=>(document.addEventListener(Pt,d),()=>document.removeEventListener(Pt,d)),[d]),W.useEffect(()=>{if(o.trigger){const a=f=>{const g=f.target;g!=null&&g.contains(o.trigger)&&d()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[o.trigger,d]),G.jsx(Ir,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:B,onPointerDownOutside:E,onFocusOutside:a=>a.preventDefault(),onDismiss:d,children:G.jsxs(go,{"data-state":o.stateAttribute,...c,...i,ref:h,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[G.jsx(To,{children:b}),G.jsx(Po,{scope:m,isInside:!0,children:G.jsx(xo,{id:o.contentId,role:"tooltip",children:A||b})})]})})});ci.displayName=De;var hi="TooltipArrow",ui=W.forwardRef((n,h)=>{const{__scopeTooltip:m,...b}=n,A=gt(m);return Oo(hi,m).isInside?null:G.jsx(vo,{...A,...b,ref:h})});ui.displayName=hi;function Mo(n,h){const m=Math.abs(h.top-n.y),b=Math.abs(h.bottom-n.y),A=Math.abs(h.right-n.x),B=Math.abs(h.left-n.x);switch(Math.min(m,b,A,B)){case B:return"left";case A:return"right";case m:return"top";case b:return"bottom";default:throw new Error("unreachable")}}function Ho(n,h,m=5){const b=[];switch(h){case"top":b.push({x:n.x-m,y:n.y+m},{x:n.x+m,y:n.y+m});break;case"bottom":b.push({x:n.x-m,y:n.y-m},{x:n.x+m,y:n.y-m});break;case"left":b.push({x:n.x+m,y:n.y-m},{x:n.x+m,y:n.y+m});break;case"right":b.push({x:n.x-m,y:n.y-m},{x:n.x-m,y:n.y+m});break}return b}function Fo(n){const{top:h,right:m,bottom:b,left:A}=n;return[{x:A,y:h},{x:m,y:h},{x:m,y:b},{x:A,y:b}]}function jo(n,h){const{x:m,y:b}=n;let A=!1;for(let B=0,E=h.length-1;B<h.length;E=B++){const i=h[B],o=h[E],c=i.x,d=i.y,a=o.x,f=o.y;d>b!=f>b&&m<(a-c)*(b-d)/(f-d)+c&&(A=!A)}return A}function Wo(n){const h=n.slice();return h.sort((m,b)=>m.x<b.x?-1:m.x>b.x?1:m.y<b.y?-1:m.y>b.y?1:0),No(h)}function No(n){if(n.length<=1)return n.slice();const h=[];for(let b=0;b<n.length;b++){const A=n[b];for(;h.length>=2;){const B=h[h.length-1],E=h[h.length-2];if((B.x-E.x)*(A.y-E.y)>=(B.y-E.y)*(A.x-E.x))h.pop();else break}h.push(A)}h.pop();const m=[];for(let b=n.length-1;b>=0;b--){const A=n[b];for(;m.length>=2;){const B=m[m.length-1],E=m[m.length-2];if((B.x-E.x)*(A.y-E.y)>=(B.y-E.y)*(A.x-E.x))m.pop();else break}m.push(A)}return m.pop(),h.length===1&&m.length===1&&h[0].x===m[0].x&&h[0].y===m[0].y?h:h.concat(m)}var Uo=si,At=ni,Et=oi,xt=ai,Bt=ci,Rt=ui;/**
|
|
20
20
|
* @license lucide-react v0.469.0 - ISC
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
@@ -141,28 +141,28 @@ func main() {
|
|
|
141
141
|
|
|
142
142
|
fmt.Printf("Hello, %s!\\n", name)
|
|
143
143
|
}
|
|
144
|
-
`};function Zo({websocketUrl:n="ws://localhost:8080/terminal",apiBaseUrl:h="http://localhost:8080/api",initialCode:m,initialLanguage:b="java",initialVersion:A="25",initialDarkMode:B=!0,hideHeader:E=!1}){const[
|
|
145
|
-
`);const
|
|
146
|
-
`)},
|
|
147
|
-
`);
|
|
144
|
+
`};function Zo({websocketUrl:n="ws://localhost:8080/terminal",apiBaseUrl:h="http://localhost:8080/api",initialCode:m,initialLanguage:b="java",initialVersion:A="25",initialDarkMode:B=!0,hideHeader:E=!1,editorWidthPercent:i=50}){const[o,c]=V.useState(m||et[b]||et.java),[d,a]=V.useState([]),[f,g]=V.useState(b),[S,u]=V.useState({default:null,code:"",versions:[]}),[r,s]=V.useState([]),[e,t]=V.useState(A),[l,p]=V.useState(null),[_,C]=V.useState(B),[v,w]=V.useState(!1),[k,D]=V.useState(!1),[O,L]=V.useState(i),[F,H]=V.useState(!1),[j,Q]=V.useState(null),[U,y]=V.useState(""),I=V.useRef(null),R=V.useRef(null),P=V.useRef(null),N=V.useRef(""),Y=V.useRef(null);V.useEffect(()=>{(async()=>{try{const q=await fetch(`${h}/language/info/${b}`);if(!q.ok)throw new Error("Language not supported");const z=await q.json();z.availableVersions.includes(A)?Q(!0):(Q(!1),y(`${b.toUpperCase()} version ${A} is not available. Available versions: ${z.availableVersions.join(", ")}`))}catch{Q(!1),y(`Failed to connect to NotJS API at ${h}. Please ensure the Spring Boot backend is running.`)}})()},[h,b,A]),V.useEffect(()=>{fetch(`${h}/language/supported`).then(T=>T.json()).then(T=>{a(T)}).catch(T=>{console.error("Failed to fetch languages:",T)})},[h]),V.useEffect(()=>{f&&fetch(`${h}/language/info/${f}`).then(T=>T.json()).then(T=>{s(T.availableVersions),p(T.defaultVersion),t(T.defaultVersion),u({default:T.defaultVersion,versions:T.availableVersions,code:et[f]}),c(et[f])}).catch(T=>{console.error("Failed to fetch language info:",T)})},[f,h]),V.useEffect(()=>{if(!I.current||j!==!0||l===null&&r.length===0)return;const T=new As.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:_?{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#ffffff"}:{background:"#ffffff",foreground:"#000000",cursor:"#000000"},scrollback:1e3,convertEol:!0});R.current=T,T.open(I.current);const q=()=>{if(I.current&&R.current){const X=I.current.getBoundingClientRect(),ee=Math.floor((X.width-20)/9),te=Math.floor((X.height-20)/17);R.current.resize(ee,te)}};setTimeout(q,100),window.addEventListener("resize",q);const z=new WebSocket(n);return P.current=z,z.onopen=()=>{console.log("WebSocket connected"),T.write(`\x1B[1;32m> Connected\x1B[0m\r
|
|
145
|
+
`);const X={language:f,code:S.code,version:S.default||e||null,arguments:[]};z.send(JSON.stringify(X)),T.write(`\x1B[1;36m> Running ${f} ${S.default||l||""}...\x1B[0m\r
|
|
146
|
+
`)},z.onmessage=X=>{const ee=X.data.replace(/\n/g,`\r
|
|
147
|
+
`);T.write(ee)},z.onerror=X=>{console.error("WebSocket error:",X),T.write(`\x1B[1;31m\r
|
|
148
148
|
[ERROR] WebSocket connection error\x1B[0m\r
|
|
149
|
-
`)},
|
|
149
|
+
`)},z.onclose=()=>{console.log("WebSocket closed"),T.write(`\x1B[1;33m\r
|
|
150
150
|
[DISCONNECTED]\x1B[0m\r
|
|
151
|
-
`)},
|
|
152
|
-
`),
|
|
153
|
-
`),
|
|
154
|
-
`),
|
|
155
|
-
`);const
|
|
156
|
-
`)},
|
|
157
|
-
`);(
|
|
151
|
+
`)},T.onData(X=>{z.readyState===WebSocket.OPEN&&(X===""||X==="\b"?N.current.length>0&&(N.current=N.current.slice(0,-1),T.write("\b \b")):X==="\r"?(T.write(`\r
|
|
152
|
+
`),z.send(N.current+`
|
|
153
|
+
`),N.current=""):X===""?(T.write(`^C\r
|
|
154
|
+
`),N.current=""):(N.current+=X,T.write(X)))}),()=>{window.removeEventListener("resize",q),T.dispose(),z.readyState===WebSocket.OPEN&&z.close()}},[j,n,S,_]),V.useEffect(()=>{R.current&&(R.current.options.theme=_?{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#ffffff"}:{background:"#ffffff",foreground:"#000000",cursor:"#000000"})},[_]);const Z=()=>{var q;if(!R.current||!I.current)return;if(P.current){const z=P.current;z.onopen=null,z.onmessage=null,z.onerror=null,z.onclose=null,z.close()}R.current.reset(),R.current.clear(),N.current="";const T=new WebSocket(n);P.current=T,T.onopen=()=>{var X,ee;console.log("WebSocket reconnected"),(X=R.current)==null||X.write(`\x1B[1;32m> Connected\x1B[0m\r
|
|
155
|
+
`);const z={language:f,code:o,version:e||S.default||null,arguments:[]};T.send(JSON.stringify(z)),(ee=R.current)==null||ee.write(`\x1B[1;36m> Running ${f} ${e||S.default||l||""}...\x1B[0m\r
|
|
156
|
+
`)},T.onmessage=z=>{var ee;const X=z.data.replace(/\n/g,`\r
|
|
157
|
+
`);(ee=R.current)==null||ee.write(X)},T.onerror=z=>{var X;console.error("WebSocket error:",z),(X=R.current)==null||X.write(`\x1B[1;31m\r
|
|
158
158
|
[ERROR] WebSocket connection error\x1B[0m\r
|
|
159
|
-
`)},
|
|
159
|
+
`)},T.onclose=()=>{var z;console.log("WebSocket closed"),(z=R.current)==null||z.write(`\x1B[1;33m\r
|
|
160
160
|
[DISCONNECTED]\x1B[0m\r
|
|
161
|
-
`)},(
|
|
162
|
-
`),
|
|
163
|
-
`),
|
|
164
|
-
`),
|
|
165
|
-
`)}
|
|
161
|
+
`)},(q=R.current)==null||q.onData(z=>{var X,ee,te,ie;T.readyState===WebSocket.OPEN&&(z===""||z==="\b"?N.current.length>0&&(N.current=N.current.slice(0,-1),(X=R.current)==null||X.write("\b \b")):z==="\r"?((ee=R.current)==null||ee.write(`\r
|
|
162
|
+
`),T.send(N.current+`
|
|
163
|
+
`),N.current=""):z===""?((te=R.current)==null||te.write(`^C\r
|
|
164
|
+
`),N.current=""):(N.current+=z,(ie=R.current)==null||ie.write(z)))})},J=(T,q)=>{navigator.clipboard.writeText(T).then(()=>{q==="code"?(w(!0),setTimeout(()=>w(!1),2e3)):(D(!0),setTimeout(()=>D(!1),2e3))})},M=()=>{if(R.current){const T=R.current.buffer.active;let q="";for(let z=0;z<T.length;z++){const X=T.getLine(z);X&&(q+=X.translateToString(!0)+`
|
|
165
|
+
`)}J(q,"console")}},x=()=>{C(T=>!T),_?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark")};V.useEffect(()=>{_&&document.documentElement.classList.add("dark")},[]),V.useEffect(()=>{L(i)},[]);const K=T=>{T.preventDefault(),H(!0)};return V.useEffect(()=>{const T=z=>{if(!F||!Y.current)return;const ee=Y.current.getBoundingClientRect(),te=(z.clientX-ee.left)/ee.width*100;te>=20&&te<=80&&L(te)},q=()=>{H(!1)};return F&&(document.addEventListener("mousemove",T),document.addEventListener("mouseup",q),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",q),document.body.style.cursor="",document.body.style.userSelect=""}},[F]),V.useEffect(()=>{R.current&&I.current&&setTimeout(()=>{if(I.current&&R.current){const T=I.current.getBoundingClientRect(),q=Math.floor((T.width-20)/9),z=Math.floor((T.height-20)/17);R.current.resize(q,z)}},10)},[O]),j===!1?G.jsx("div",{className:"flex flex-col items-center justify-center h-screen w-screen bg-neutral-50 dark:bg-neutral-950 p-8",children:G.jsx("div",{className:"max-w-2xl w-full border-2 border-red-500 rounded-2xl p-8 bg-white dark:bg-neutral-900",children:G.jsxs("div",{className:"flex items-start gap-4",children:[G.jsx(Go,{className:"w-8 h-8 text-red-500 flex-shrink-0 mt-1"}),G.jsxs("div",{children:[G.jsx("h2",{className:"text-2xl font-bold text-red-600 dark:text-red-500 mb-3",children:"NotJS Configuration Error"}),G.jsx("p",{className:"text-red-700 dark:text-red-400 text-lg leading-relaxed",children:U})]})]})})}):j===null?G.jsx("div",{className:"flex flex-col items-center justify-center h-screen w-screen bg-neutral-50 dark:bg-neutral-950",children:G.jsx("div",{className:"text-neutral-600 dark:text-neutral-400 text-lg",children:"Loading NotJS..."})}):G.jsxs(Uo,{delayDuration:200,children:[G.jsx("style",{children:`
|
|
166
166
|
/* Custom scrollbar for xterm terminal */
|
|
167
167
|
.xterm-viewport::-webkit-scrollbar {
|
|
168
168
|
width: 12px;
|
|
@@ -208,5 +208,5 @@ func main() {
|
|
|
208
208
|
.dark .xterm-viewport {
|
|
209
209
|
scrollbar-color: #525252 transparent;
|
|
210
210
|
}
|
|
211
|
-
`}),
|
|
211
|
+
`}),G.jsxs("div",{className:"flex flex-col h-screen w-screen bg-neutral-50 dark:bg-neutral-950",children:[!E&&G.jsxs("div",{className:"flex items-center justify-between px-8 py-3 bg-white/80 dark:bg-neutral-900/80 backdrop-blur border-b border-black/5 dark:border-white/5",children:[G.jsxs("div",{className:"flex items-center gap-6",children:[G.jsxs("div",{className:"flex items-center gap-4",children:[G.jsx("h1",{className:"text-2xl font-semibold text-neutral-900 dark:text-white",children:"NotJS"}),G.jsx("img",{src:Xo,alt:"NotJS Logo",className:"h-10 object-contain rounded-xl"})]}),G.jsx("select",{value:f,onChange:T=>g(T.target.value),className:"px-4 py-2 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500/40 transition",children:d.map(T=>G.jsx("option",{value:T,children:T.toUpperCase()},T))}),r.length>0&&G.jsx("select",{value:e||l||"",onChange:T=>t(T.target.value||null),className:"px-4 py-2 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/40 transition",children:r.map(T=>G.jsxs("option",{value:T,children:["v",T," ",T===l?"(default)":""]},T))})]}),G.jsx("button",{onClick:x,className:"p-3 rounded-xl bg-neutral-100 dark:bg-neutral-800 hover:bg-neutral-200 dark:hover:bg-neutral-700 transition",children:_?G.jsx(Vo,{className:"w-5 h-5 text-yellow-500"}):G.jsx(qo,{className:"w-5 h-5 text-neutral-700"})})]}),G.jsxs("div",{ref:Y,className:"flex flex-1 overflow-hidden relative",children:[G.jsxs("div",{className:"flex flex-col bg-white dark:bg-neutral-900",style:{width:`${O}%`},children:[G.jsxs("div",{className:"flex items-center justify-between px-8 py-2 bg-neutral-100/70 dark:bg-neutral-900 border-b border-black/5 dark:border-white/5",children:[G.jsx("h2",{className:"text-sm font-semibold tracking-wide text-neutral-600 dark:text-neutral-400",children:"CODE"}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsxs(At,{children:[G.jsx(Et,{asChild:!0,children:G.jsx("button",{onClick:Z,className:"p-1.5 rounded-lg transition bg-orange-500/90 hover:bg-orange-500 text-white",children:G.jsx(Yo,{className:"w-3.5 h-3.5"})})}),G.jsx(xt,{children:G.jsxs(Bt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Restart program",G.jsx(Rt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]}),G.jsxs(At,{children:[G.jsx(Et,{asChild:!0,children:G.jsx("button",{onClick:()=>J(o,"code"),className:"p-1.5 rounded-lg bg-neutral-200 dark:bg-neutral-800 hover:bg-neutral-300 dark:hover:bg-neutral-700 transition",children:v?G.jsx(fr,{className:"w-3.5 h-3.5 text-emerald-600"}):G.jsx(gr,{className:"w-3.5 h-3.5 text-neutral-700 dark:text-neutral-300"})})}),G.jsx(xt,{children:G.jsxs(Bt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Copy code",G.jsx(Rt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]})]})]}),G.jsx("div",{className:"flex-1 overflow-hidden rounded-b-2xl",children:G.jsx(ws,{height:"100%",language:f,value:o,onChange:T=>c(T||""),theme:_?"vs-dark":"light",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})})]}),G.jsx("div",{className:`w-1 bg-black/5 dark:bg-white/5 hover:bg-blue-500 cursor-col-resize transition ${F?"bg-blue-500":""}`,onMouseDown:K}),G.jsxs("div",{className:"flex-1 flex flex-col bg-white dark:bg-neutral-950",children:[G.jsxs("div",{className:"flex items-center justify-between px-8 py-2 bg-neutral-100/70 dark:bg-neutral-900 border-b border-black/5 dark:border-white/5",children:[G.jsx("h2",{className:"text-sm font-semibold tracking-wide text-neutral-600 dark:text-neutral-400",children:"CONSOLE"}),G.jsxs(At,{children:[G.jsx(Et,{asChild:!0,children:G.jsx("button",{onClick:M,className:"p-1.5 rounded-lg bg-neutral-200 dark:bg-neutral-800 hover:bg-neutral-300 dark:hover:bg-neutral-700 transition",children:k?G.jsx(fr,{className:"w-3.5 h-3.5 text-emerald-600"}):G.jsx(gr,{className:"w-3.5 h-3.5 text-neutral-700 dark:text-neutral-300"})})}),G.jsx(xt,{children:G.jsxs(Bt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Copy output",G.jsx(Rt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]})]}),G.jsx("div",{ref:I,className:"flex-1 overflow-hidden rounded-b-2xl bg-white dark:bg-neutral-950 p-3"})]})]})]})]})}exports.NotJS=Zo;
|
|
212
212
|
//# sourceMappingURL=index.cjs.map
|