From 7f6a7f1a817c5bfc876c5e645340779db80f99e2 Mon Sep 17 00:00:00 2001 From: Raunak Raj Date: Sat, 16 Dec 2023 05:26:40 +0530 Subject: [PATCH] Fixed panel issue when changing the file tab position #41 --- dist/main.js | 2 +- src/main.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/main.js b/dist/main.js index b476aff..6b95dbf 100644 --- a/dist/main.js +++ b/dist/main.js @@ -63,4 +63,4 @@ out vec4 outColor; void main() { outColor = v_color; -}`)),this.register((0,d.toDisposable)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,l.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let x=new Float32Array([0,0,1,0,0,1,1,1]),A=S.createBuffer();this.register((0,d.toDisposable)(()=>S.deleteBuffer(A))),S.bindBuffer(S.ARRAY_BUFFER,A),S.bufferData(S.ARRAY_BUFFER,x,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let k=new Uint8Array([0,1,2,3]),D=S.createBuffer();this.register((0,d.toDisposable)(()=>S.deleteBuffer(D))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,D),S.bufferData(S.ELEMENT_ARRAY_BUFFER,k,S.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(S.createBuffer()),this.register((0,d.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,v,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,v,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,v,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(m.colors),this.register(this._themeService.onChangeColors(T=>{this._updateCachedColors(T),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(a){let g=this._gl;g.useProgram(this._program),g.bindVertexArray(this._vertexArrayObject),g.uniformMatrix4fv(this._projectionLocation,!1,c.PROJECTION_MATRIX),g.bindBuffer(g.ARRAY_BUFFER,this._attributesBuffer),g.bufferData(g.ARRAY_BUFFER,a.attributes,g.DYNAMIC_DRAW),g.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,g.UNSIGNED_BYTE,0,a.count)}handleResize(){this._updateViewportRectangle()}setDimensions(a){this._dimensions=a}_updateCachedColors(a){this._bgFloat=this._colorToFloat32Array(a.background),this._cursorFloat=this._colorToFloat32Array(a.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(a){let g=this._terminal,y=this._vertices,m,S,x,A,k,D,T,b,E,L,R,P=1;for(m=0;m>24&255)/255,r=(h>>16&255)/255,u=(h>>8&255)/255,_=1,this._addRectangle(a.attributes,g,e,s,(x-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,i,r,u,_)}_addRectangle(a,g,y,m,S,x,A,k,D,T){a[g]=y/this._dimensions.device.canvas.width,a[g+1]=m/this._dimensions.device.canvas.height,a[g+2]=S/this._dimensions.device.canvas.width,a[g+3]=x/this._dimensions.device.canvas.height,a[g+4]=A,a[g+5]=k,a[g+6]=D,a[g+7]=T}_addRectangleFloat(a,g,y,m,S,x,A){a[g]=y/this._dimensions.device.canvas.width,a[g+1]=m/this._dimensions.device.canvas.height,a[g+2]=S/this._dimensions.device.canvas.width,a[g+3]=x/this._dimensions.device.canvas.height,a[g+4]=A[0],a[g+5]=A[1],a[g+6]=A[2],a[g+7]=A[3]}_colorToFloat32Array(a){return new Float32Array([(a.rgba>>24&255)/255,(a.rgba>>16&255)/255,(a.rgba>>8&255)/255,(255&a.rgba)/255])}}t.RectangleRenderer=p},310:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;let l=o(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,l.createSelectionRenderModel)()}resize(d,n){let c=d*n*t.RENDER_MODEL_INDICIES_PER_CELL;c!==this.cells.length&&(this.cells=new Uint32Array(c),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(M,t,o){var l=this&&this.__decorate||function(x,A,k,D){var T,b=arguments.length,E=b<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,k):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,A,k,D);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(E=(b<3?T(E):b>3?T(A,k,E):T(A,k))||E);return b>3&&E&&Object.defineProperty(A,k,E),E};Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;let d=o(820),n=o(274),c=o(627),v=o(457),f=o(56),h=o(374),e=o(345),s=o(859),i=o(147),r=o(782),u=o(855),_=o(776),p=o(965),C=o(742),a=o(310),g=o(733);class y extends s.Disposable{constructor(A,k,D,T,b,E,L,R,P){super(),this._terminal=A,this._characterJoinerService=k,this._charSizeService=D,this._coreBrowserService=T,this._coreService=b,this._decorationService=E,this._optionsService=L,this._themeService=R,this._cursorBlinkStateManager=new s.MutableDisposable,this._charAtlasDisposable=this.register(new s.MutableDisposable),this._model=new a.RenderModel,this._workCell=new r.CellData,this._rectangleRenderer=this.register(new s.MutableDisposable),this._glyphRenderer=this.register(new s.MutableDisposable),this._onChangeTextureAtlas=this.register(new e.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new e.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new e.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new e.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new e.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new n.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new g.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,L,this._themeService)],this.dimensions=(0,h.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(L.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");let W={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",W),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",N=>{console.log("webglcontextlost event received"),N.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(N)},3e3)})),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",N=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(N,U)=>this._setCanvasDevicePixelDimensions(N,U))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,s.toDisposable)(()=>{var N;for(let U of this._renderLayers)U.dispose();(N=this._canvas.parentElement)===null||N===void 0||N.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var A;return(A=this._charAtlas)===null||A===void 0?void 0:A.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(A,k){var D,T,b,E;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let L of this._renderLayers)L.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(D=this._rectangleRenderer.value)===null||D===void 0||D.setDimensions(this.dimensions),(T=this._rectangleRenderer.value)===null||T===void 0||T.handleResize(),(b=this._glyphRenderer.value)===null||b===void 0||b.setDimensions(this.dimensions),(E=this._glyphRenderer.value)===null||E===void 0||E.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var A;for(let k of this._renderLayers)k.handleBlur(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.pause(),this._requestRedrawViewport()}handleFocus(){var A;for(let k of this._renderLayers)k.handleFocus(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.resume(),this._requestRedrawViewport()}handleSelectionChanged(A,k,D){for(let T of this._renderLayers)T.handleSelectionChanged(this._terminal,A,k,D);this._model.selection.update(this._terminal,A,k,D),this._requestRedrawViewport()}handleCursorMove(){var A;for(let k of this._renderLayers)k.handleCursorMove(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new C.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new p.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var A;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);let k=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==k&&(this._onChangeTextureAtlas.fire(k.pages[0].canvas),this._charAtlasDisposable.value=(0,s.getDisposeArrayDisposable)([(0,e.forwardEvent)(k.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,e.forwardEvent)(k.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=k,this._charAtlas.warmUp(),(A=this._glyphRenderer.value)===null||A===void 0||A.setAtlas(this._charAtlas)}_clearModel(A){var k;this._model.clear(),A&&((k=this._glyphRenderer.value)===null||k===void 0||k.clear())}clearTextureAtlas(){var A;(A=this._charAtlas)===null||A===void 0||A.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var A;this._clearModel(!0);for(let k of this._renderLayers)k.reset(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(A){return-1}deregisterCharacterJoiner(A){return!1}renderRows(A,k){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(let D of this._renderLayers)D.handleGridChanged(this._terminal,A,k);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(A,k),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new v.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(A,k){let D=this._core,T,b,E,L,R,P,W,N,U,q,w,O,H,F=this._workCell;A=S(A,D.rows-1,0),k=S(k,D.rows-1,0);let G=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=Math.min(this._terminal.buffer.active.cursorX,D.cols-1),Z=-1,re=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ne=!1;for(b=A;b<=k;b++)for(E=b+D.buffer.ydisp,L=D.buffer.lines.get(E),this._model.lineLengths[b]=0,R=this._characterJoinerService.getJoinedCharacters(E),O=0;O0&&O===R[0][0]&&(P=!0,N=R.shift(),F=new m(F,L.translateToString(!0,N[0],N[1]),N[1]-N[0]),W=N[1]-1),U=F.getChars(),q=F.getCode(),w=(b*D.cols+O)*a.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(F,O,E),re&&E===G&&(O===z&&(this._model.cursor={x:z,y:this._terminal.buffer.active.cursorY,width:F.getWidth(),style:this._coreBrowserService.isFocused?D.options.cursorStyle||"block":D.options.cursorInactiveStyle,cursorWidth:D.options.cursorWidth,dpr:this._devicePixelRatio},Z=z+F.getWidth()-1),O>=z&&O<=Z&&(this._coreBrowserService.isFocused&&(D.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&D.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),q!==u.NULL_CELL_CODE&&(this._model.lineLengths[b]=O+1),(this._model.cells[w]!==q||this._model.cells[w+a.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[w+a.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[w+a.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ne=!0,U.length>1&&(q|=a.COMBINED_CHAR_BIT_MASK),this._model.cells[w]=q,this._model.cells[w+a.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[w+a.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[w+a.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(O,b,q,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,U,T),P))for(F=this._workCell,O++;O{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;let l=o(374);function d(n,c,v){let f=(0,l.throwIfFalsy)(n.createShader(c));if(n.shaderSource(f,v),n.compileShader(f),n.getShaderParameter(f,n.COMPILE_STATUS))return f;console.error(n.getShaderInfoLog(f)),n.deleteShader(f)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,c,v){let f=(0,l.throwIfFalsy)(n.createProgram());if(n.attachShader(f,(0,l.throwIfFalsy)(d(n,n.VERTEX_SHADER,c))),n.attachShader(f,(0,l.throwIfFalsy)(d(n,n.FRAGMENT_SHADER,v))),n.linkProgram(f),n.getProgramParameter(f,n.LINK_STATUS))return f;console.error(n.getProgramInfoLog(f)),n.deleteProgram(f)},t.createShader=d,t.expandFloat32Array=function(n,c){let v=Math.min(2*n.length,c),f=new Float32Array(v);for(let h=0;h{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let l=o(627),d=o(237),n=o(374),c=o(859);class v extends c.Disposable{constructor(h,e,s,i,r,u,_,p){super(),this._container=e,this._alpha=r,this._coreBrowserService=u,this._optionsService=_,this._themeService=p,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${s}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(C=>{this._refreshCharAtlas(h,C),this.reset(h)})),this.register((0,c.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(h){}handleFocus(h){}handleCursorMove(h){}handleGridChanged(h,e,s){}handleSelectionChanged(h,e,s,i=!1){}_setTransparency(h,e){if(e===this._alpha)return;let s=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,s),this._refreshCharAtlas(h,this._themeService.colors),this.handleGridChanged(h,0,h.rows-1)}_refreshCharAtlas(h,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,l.acquireTextureAtlas)(h,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(h,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(h,this._themeService.colors)}_fillBottomLineAtCells(h,e,s=1){this._ctx.fillRect(h*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,s*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(h,e,s,i){this._alpha?this._ctx.clearRect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight))}_fillCharTrueColor(h,e,s,i){this._ctx.font=this._getFont(h,!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipCell(s,i,e.getWidth()),this._ctx.fillText(e.getChars(),s*this._deviceCellWidth+this._deviceCharLeft,i*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(h,e,s){this._ctx.beginPath(),this._ctx.rect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(h,e,s){return`${s?"italic":""} ${e?h.options.fontWeightBold:h.options.fontWeight} ${h.options.fontSize*this._coreBrowserService.dpr}px ${h.options.fontFamily}`}}t.BaseRenderLayer=v},733:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let l=o(197),d=o(237),n=o(592);class c extends n.BaseRenderLayer{constructor(f,h,e,s,i,r,u){super(e,f,"link",h,!0,i,r,u),this.register(s.onShowLinkUnderline(_=>this._handleShowLinkUnderline(_))),this.register(s.onHideLinkUnderline(_=>this._handleHideLinkUnderline(_)))}resize(f,h){super.resize(f,h),this._state=void 0}reset(f){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let f=this._state.y2-this._state.y1-1;f>0&&this._clearCells(0,this._state.y1+1,this._state.cols,f),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(f){if(f.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:f.fg!==void 0&&(0,l.is256Color)(f.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[f.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,f.y1===f.y2)this._fillBottomLineAtCells(f.x1,f.y1,f.x2-f.x1);else{this._fillBottomLineAtCells(f.x1,f.y1,f.cols-f.x1);for(let h=f.y1+1;h{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(o,l,d,n){o.addEventListener(l,d,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(l,d,n))}}}},274:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let o,l=0,d=0,n=!1,c=!1,v=!1;t.CellColorResolver=class{constructor(f,h,e,s,i){this._terminal=f,this._selectionRenderModel=h,this._decorationService=e,this._coreBrowserService=s,this._themeService=i,this.result={fg:0,bg:0,ext:0}}resolve(f,h,e){this.result.bg=f.bg,this.result.fg=f.fg,this.result.ext=268435456&f.bg?f.extended.ext:0,d=0,l=0,c=!1,n=!1,v=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(h,e,"bottom",s=>{s.backgroundColorRGB&&(d=s.backgroundColorRGB.rgba>>8&16777215,c=!0),s.foregroundColorRGB&&(l=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),v=this._selectionRenderModel.isCellSelected(this._terminal,h,e),v&&(d=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,c=!0,o.selectionForeground&&(l=o.selectionForeground.rgba>>8&16777215,n=!0)),this._decorationService.forEachDecorationAtCell(h,e,"top",s=>{s.backgroundColorRGB&&(d=s.backgroundColorRGB.rgba>>8&16777215,c=!0),s.foregroundColorRGB&&(l=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),c&&(d=v?-16777216&f.bg&-134217729|d|50331648:-16777216&f.bg|d|50331648),n&&(l=-16777216&f.fg&-67108865|l|50331648),67108864&this.result.fg&&(c&&!n&&(l=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,n=!0),!c&&n&&(d=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,c=!0)),o=void 0,this.result.bg=c?d:this.result.bg,this.result.fg=n?l:this.result.fg}}},627:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let l=o(509),d=o(197),n=[];t.acquireTextureAtlas=function(c,v,f,h,e,s,i,r){let u=(0,d.generateConfig)(h,e,s,i,v,f,r);for(let C=0;C=0){if((0,d.configEquals)(a.config,u))return a.atlas;a.ownedBy.length===1?(a.atlas.dispose(),n.splice(C,1)):a.ownedBy.splice(g,1);break}}for(let C=0;C{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let l=o(160);t.generateConfig=function(d,n,c,v,f,h,e){let s={foreground:h.foreground,background:h.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:h.ansi.slice(),contrastCache:h.contrastCache,halfContrastCache:h.halfContrastCache};return{customGlyphs:f.customGlyphs,devicePixelRatio:e,letterSpacing:f.letterSpacing,lineHeight:f.lineHeight,deviceCellWidth:d,deviceCellHeight:n,deviceCharWidth:c,deviceCharHeight:v,fontFamily:f.fontFamily,fontSize:f.fontSize,fontWeight:f.fontWeight,fontWeightBold:f.fontWeightBold,allowTransparency:f.allowTransparency,drawBoldTextInBrightColors:f.drawBoldTextInBrightColors,minimumContrastRatio:f.minimumContrastRatio,colors:s}},t.configEquals=function(d,n){for(let c=0;c{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let l=o(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(o,l){this._renderCallback=o,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let l=o(374);t.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:8,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};let d={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2551":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u2552":{1:(h,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u2553":{1:(h,e)=>`M${.5-h},1 L${.5-h},.5 L1,.5 M${.5+h},.5 L${.5+h},1`},"\u2554":{1:(h,e)=>`M1,${.5-e} L${.5-h},${.5-e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1`},"\u2555":{1:(h,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"\u2556":{1:(h,e)=>`M${.5+h},1 L${.5+h},.5 L0,.5 M${.5-h},.5 L${.5-h},1`},"\u2557":{1:(h,e)=>`M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M0,${.5-e} L${.5+h},${.5-e} L${.5+h},1`},"\u2558":{1:(h,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"\u2559":{1:(h,e)=>`M1,.5 L${.5-h},.5 L${.5-h},0 M${.5+h},.5 L${.5+h},0`},"\u255A":{1:(h,e)=>`M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0 M1,${.5+e} L${.5-h},${.5+e} L${.5-h},0`},"\u255B":{1:(h,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"\u255C":{1:(h,e)=>`M0,.5 L${.5+h},.5 L${.5+h},0 M${.5-h},.5 L${.5-h},0`},"\u255D":{1:(h,e)=>`M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M0,${.5+e} L${.5+h},${.5+e} L${.5+h},0`},"\u255E":{1:(h,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u255F":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1 M${.5+h},.5 L1,.5`},"\u2560":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u2561":{1:(h,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"\u2562":{1:(h,e)=>`M0,.5 L${.5-h},.5 M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u2563":{1:(h,e)=>`M${.5+h},0 L${.5+h},1 M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0`},"\u2564":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"\u2565":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},.5 L${.5-h},1 M${.5+h},.5 L${.5+h},1`},"\u2566":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1`},"\u2567":{1:(h,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2568":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},.5 L${.5-h},0 M${.5+h},.5 L${.5+h},0`},"\u2569":{1:(h,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u256A":{1:(h,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u256B":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u256C":{1:(h,e)=>`M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1 M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u2509":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(h,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"\u256E":{1:(h,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"\u256F":{1:(h,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"\u2570":{1:(h,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"\uE0B5":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"\uE0B6":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"\uE0B7":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"\uE0B8":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"\uE0B9":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BA":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"\uE0BC":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"\uE0BD":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BE":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions["\uE0BB"]=t.powerlineDefinitions["\uE0BD"],t.powerlineDefinitions["\uE0BF"]=t.powerlineDefinitions["\uE0B9"],t.tryDrawCustomChar=function(h,e,s,i,r,u,_,p){let C=t.blockElementDefinitions[e];if(C)return function(m,S,x,A,k,D){for(let T=0;T7&&parseInt(b.slice(7,9),16)||1;else{if(!b.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${b}" when drawing pattern glyph`);[U,q,w,O]=b.substring(5,b.length-1).split(",").map(H=>parseFloat(H))}for(let H=0;Hh.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(h,e)=>h.lineTo(e[0],e[1]),M:(h,e)=>h.moveTo(e[0],e[1])};function f(h,e,s,i,r,u,_,p=0,C=0){let a=h.map(g=>parseFloat(g)||parseInt(g));if(a.length<2)throw new Error("Too few arguments for instruction");for(let g=0;g{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let l=o(859);t.observeDevicePixelDimensions=function(d,n,c){let v=new n.ResizeObserver(f=>{let h=f.find(i=>i.target===d);if(!h)return;if(!("devicePixelContentBoxSize"in h))return v?.disconnect(),void(v=void 0);let e=h.devicePixelContentBoxSize[0].inlineSize,s=h.devicePixelContentBoxSize[0].blockSize;e>0&&s>0&&c(e,s)});try{v.observe(d,{box:["device-pixel-content-box"]})}catch{v.disconnect(),v=void 0}return(0,l.toDisposable)(()=>v?.disconnect())}},374:(M,t)=>{function o(l){return 57508<=l&&l<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(l){if(!l)throw new Error("value must not be falsy");return l},t.isPowerlineGlyph=o,t.isRestrictedPowerlineGlyph=function(l){return 57520<=l&&l<=57527},t.excludeFromContrastRatioDemands=function(l){return o(l)||function(d){return 9472<=d&&d<=9631}(l)},t.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}}}}},296:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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,n,c,v=!1){if(this.selectionStart=n,this.selectionEnd=c,!n||!c||n[0]===c[0]&&n[1]===c[1])return void this.clear();let f=n[1]-d.buffer.active.viewportY,h=c[1]-d.buffer.active.viewportY,e=Math.max(f,0),s=Math.min(h,d.rows-1);e>=d.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=f,this.viewportEndRow=h,this.viewportCappedStartRow=e,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=c[0])}isCellSelected(d,n,c){return!!this.hasSelection&&(c-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&c>=this.viewportCappedStartRow&&n=this.viewportCappedStartRow&&n>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c=this.startCol&&n=this.startCol)}}t.createSelectionRenderModel=function(){return new o}},509:function(M,t,o){var l=this&&this.__decorate||function(y,m,S,x){var A,k=arguments.length,D=k<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,S,x);else for(var T=y.length-1;T>=0;T--)(A=y[T])&&(D=(k<3?A(D):k>3?A(m,S,D):A(m,S))||D);return k>3&&D&&Object.defineProperty(m,S,D),D};Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let d=o(237),n=o(860),c=o(374),v=o(160),f=o(345),h=o(485),e=o(385),s=o(147),i=o(855),r=o(776),u={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},_;class p{get pages(){return this._pages}constructor(m,S,x){this._document=m,this._config=S,this._unicodeService=x,this._didWarmUp=!1,this._cacheMap=new h.FourKeyMap,this._cacheMapCombined=new h.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new s.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=g(m,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let m of this.pages)m.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let m=new e.IdleTaskQueue;for(let S=33;S<126;S++)m.enqueue(()=>{if(!this._cacheMap.get(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT)){let x=this._drawToCache(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT);this._cacheMap.set(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT,x)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let m of this._pages)m.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(p.maxAtlasPages&&this._pages.length>=Math.max(4,p.maxAtlasPages)){let S=this._pages.filter(E=>2*E.canvas.width<=(p.maxTextureSize||4096)).sort((E,L)=>L.canvas.width!==E.canvas.width?L.canvas.width-E.canvas.width:L.percentageUsed-E.percentageUsed),x=-1,A=0;for(let E=0;EE.glyphs[0].texturePage).sort((E,L)=>E>L?1:-1),T=this.pages.length-k.length,b=this._mergePages(k,T);b.version++;for(let E=D.length-1;E>=0;E--)this._deletePage(D[E]);this.pages.push(b),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(b.canvas)}let m=new C(this._document,this._textureSize);return this._pages.push(m),this._activePages.push(m),this._onAddTextureAtlasCanvas.fire(m.canvas),m}_mergePages(m,S){let x=2*m[0].canvas.width,A=new C(this._document,x,m);for(let[k,D]of m.entries()){let T=k*D.canvas.width%x,b=Math.floor(k/2)*D.canvas.height;A.ctx.drawImage(D.canvas,T,b);for(let L of D.glyphs)L.texturePage=S,L.sizeClipSpace.x=L.size.x/x,L.sizeClipSpace.y=L.size.y/x,L.texturePosition.x+=T,L.texturePosition.y+=b,L.texturePositionClipSpace.x=L.texturePosition.x/x,L.texturePositionClipSpace.y=L.texturePosition.y/x;this._onRemoveTextureAtlasCanvas.fire(D.canvas);let E=this._activePages.indexOf(D);E!==-1&&this._activePages.splice(E,1)}return A}_deletePage(m){this._pages.splice(m,1);for(let S=m;S=this._config.colors.ansi.length)throw new Error("No color found for idx "+m);return this._config.colors.ansi[m]}_getBackgroundColor(m,S,x,A){if(this._config.allowTransparency)return v.NULL_COLOR;let k;switch(m){case 16777216:case 33554432:k=this._getColorFromAnsiIndex(S);break;case 50331648:let D=s.AttributeData.toColorRGB(S);k=v.rgba.toColor(D[0],D[1],D[2]);break;default:k=x?v.color.opaque(this._config.colors.foreground):this._config.colors.background}return k}_getForegroundColor(m,S,x,A,k,D,T,b,E,L){let R=this._getMinimumContrastColor(m,S,x,A,k,D,!1,E,b,L);if(R)return R;let P;switch(k){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&E&&D<8&&(D+=8),P=this._getColorFromAnsiIndex(D);break;case 50331648:let W=s.AttributeData.toColorRGB(D);P=v.rgba.toColor(W[0],W[1],W[2]);break;default:P=T?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=v.color.opaque(P)),b&&(P=v.color.multiplyOpacity(P,d.DIM_OPACITY)),P}_resolveBackgroundRgba(m,S,x){switch(m){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return x?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(m,S,x,A){switch(m){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&A&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return x?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(m,S,x,A,k,D,T,b,E,L){if(this._config.minimumContrastRatio===1||L)return;let R=this._getContrastCache(E),P=R.getColor(m,A);if(P!==void 0)return P||void 0;let W=this._resolveBackgroundRgba(S,x,T),N=this._resolveForegroundRgba(k,D,T,b),U=v.rgba.ensureContrastRatio(W,N,this._config.minimumContrastRatio/(E?2:1));if(!U)return void R.setColor(m,A,null);let q=v.rgba.toColor(U>>24&255,U>>16&255,U>>8&255);return R.setColor(m,A,q),q}_getContrastCache(m){return m?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(m,S,x,A,k=!1){let D=typeof m=="number"?String.fromCharCode(m):m,T=Math.min(this._config.deviceCellWidth*Math.max(D.length,2)+4,this._textureSize);this._tmpCanvas.width=12&&!this._config.allowTransparency&&D!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let ae=this._tmpCtx.measureText(D);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ae&&ae.actualBoundingBoxDescent>0){this._tmpCtx.save();let Y=new Path2D;Y.rect(he,ie-Math.ceil(j/2),this._config.deviceCellWidth*de,le-ie+Math.ceil(j/2)),this._tmpCtx.clip(Y),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=F.css,this._tmpCtx.strokeText(D,te,te+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){let j=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ee=j%2==1?.5:0;this._tmpCtx.lineWidth=j,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+ee),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*de,te+ee),this._tmpCtx.stroke()}if(K||this._tmpCtx.fillText(D,te,te+this._config.deviceCharHeight),D==="_"&&!this._config.allowTransparency){let j=a(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ne,ue);if(j)for(let ee=1;ee<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(D,te,te+this._config.deviceCharHeight-ee),j=a(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ne,ue),j);ee++);}if(N){let j=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ee=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=j,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+Math.floor(this._config.deviceCharHeight/2)-ee),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*de,te+Math.floor(this._config.deviceCharHeight/2)-ee),this._tmpCtx.stroke()}this._tmpCtx.restore();let fe=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),ve;if(ve=this._config.allowTransparency?function(j){for(let ee=0;ee0)return!1;return!0}(fe):a(fe,F,ne,ue),ve)return u;let Q=this._findGlyphBoundingBox(fe,this._workBoundingBox,T,re,K,te),X,J;for(;;){if(this._activePages.length===0){let j=this._createNewPage();X=j,J=j.currentRow,J.height=Q.size.y;break}X=this._activePages[this._activePages.length-1],J=X.currentRow;for(let j of this._activePages)Q.size.y<=j.currentRow.height&&(X=j,J=j.currentRow);for(let j=this._activePages.length-1;j>=0;j--)for(let ee of this._activePages[j].fixedRows)ee.height<=J.height&&Q.size.y<=ee.height&&(X=this._activePages[j],J=ee);if(J.y+Q.size.y>=X.canvas.height||J.height>Q.size.y+2){let j=!1;if(X.currentRow.y+X.currentRow.height+Q.size.y>=X.canvas.height){let ee;for(let he of this._activePages)if(he.currentRow.y+he.currentRow.height+Q.size.y=p.maxAtlasPages&&J.y+Q.size.y<=X.canvas.height&&J.height>=Q.size.y&&J.x+Q.size.x<=X.canvas.width)j=!0;else{let he=this._createNewPage();X=he,J=he.currentRow,J.height=Q.size.y,j=!0}}j||(X.currentRow.height>0&&X.fixedRows.push(X.currentRow),J={x:0,y:X.currentRow.y+X.currentRow.height,height:Q.size.y},X.fixedRows.push(J),X.currentRow={x:0,y:J.y+J.height,height:0})}if(J.x+Q.size.x<=X.canvas.width)break;J===X.currentRow?(J.x=0,J.y+=J.height,J.height=0):X.fixedRows.splice(X.fixedRows.indexOf(J),1)}return Q.texturePage=this._pages.indexOf(X),Q.texturePosition.x=J.x,Q.texturePosition.y=J.y,Q.texturePositionClipSpace.x=J.x/X.canvas.width,Q.texturePositionClipSpace.y=J.y/X.canvas.height,Q.sizeClipSpace.x/=X.canvas.width,Q.sizeClipSpace.y/=X.canvas.height,J.height=Math.max(J.height,Q.size.y),J.x+=Q.size.x,X.ctx.putImageData(fe,Q.texturePosition.x-this._workBoundingBox.left,Q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Q.size.x,Q.size.y),X.addGlyph(Q),X.version++,Q}_findGlyphBoundingBox(m,S,x,A,k,D){S.top=0;let T=A?this._config.deviceCellHeight:this._tmpCanvas.height,b=A?this._config.deviceCellWidth:x,E=!1;for(let L=0;L=D;L--){for(let R=0;R=0;L--){for(let R=0;R>>24,k=m.rgba>>>16&255,D=m.rgba>>>8&255,T=S.rgba>>>24,b=S.rgba>>>16&255,E=S.rgba>>>8&255,L=Math.floor((Math.abs(A-T)+Math.abs(k-b)+Math.abs(D-E))/12),R=!0;for(let P=0;P{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let l=o(399),d=0,n=0,c=0,v=0;var f,h,e,s,i;function r(_){let p=_.toString(16);return p.length<2?"0"+p:p}function u(_,p){return _>>0}}(f||(t.channels=f={})),function(_){function p(C,a){return v=Math.round(255*a),[d,n,c]=i.toChannels(C.rgba),{css:f.toCss(d,n,c,v),rgba:f.toRgba(d,n,c,v)}}_.blend=function(C,a){if(v=(255&a.rgba)/255,v===1)return{css:a.css,rgba:a.rgba};let g=a.rgba>>24&255,y=a.rgba>>16&255,m=a.rgba>>8&255,S=C.rgba>>24&255,x=C.rgba>>16&255,A=C.rgba>>8&255;return d=S+Math.round((g-S)*v),n=x+Math.round((y-x)*v),c=A+Math.round((m-A)*v),{css:f.toCss(d,n,c),rgba:f.toRgba(d,n,c)}},_.isOpaque=function(C){return(255&C.rgba)==255},_.ensureContrastRatio=function(C,a,g){let y=i.ensureContrastRatio(C.rgba,a.rgba,g);if(y)return i.toColor(y>>24&255,y>>16&255,y>>8&255)},_.opaque=function(C){let a=(255|C.rgba)>>>0;return[d,n,c]=i.toChannels(a),{css:f.toCss(d,n,c),rgba:a}},_.opacity=p,_.multiplyOpacity=function(C,a){return v=255&C.rgba,p(C,v*a/255)},_.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(h||(t.color=h={})),function(_){let p,C;if(!l.isNode){let a=document.createElement("canvas");a.width=1,a.height=1;let g=a.getContext("2d",{willReadFrequently:!0});g&&(p=g,p.globalCompositeOperation="copy",C=p.createLinearGradient(0,0,1,1))}_.toColor=function(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return d=parseInt(a.slice(1,2).repeat(2),16),n=parseInt(a.slice(2,3).repeat(2),16),c=parseInt(a.slice(3,4).repeat(2),16),i.toColor(d,n,c);case 5:return d=parseInt(a.slice(1,2).repeat(2),16),n=parseInt(a.slice(2,3).repeat(2),16),c=parseInt(a.slice(3,4).repeat(2),16),v=parseInt(a.slice(4,5).repeat(2),16),i.toColor(d,n,c,v);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let g=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return d=parseInt(g[1]),n=parseInt(g[2]),c=parseInt(g[3]),v=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),i.toColor(d,n,c,v);if(!p||!C)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=C,p.fillStyle=a,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[d,n,c,v]=p.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(d,n,c,v),css:a}}}(e||(t.css=e={})),function(_){function p(C,a,g){let y=C/255,m=a/255,S=g/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}_.relativeLuminance=function(C){return p(C>>16&255,C>>8&255,255&C)},_.relativeLuminance2=p}(s||(t.rgb=s={})),function(_){function p(a,g,y){let m=a>>24&255,S=a>>16&255,x=a>>8&255,A=g>>24&255,k=g>>16&255,D=g>>8&255,T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));for(;T0||k>0||D>0);)A-=Math.max(0,Math.ceil(.1*A)),k-=Math.max(0,Math.ceil(.1*k)),D-=Math.max(0,Math.ceil(.1*D)),T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));return(A<<24|k<<16|D<<8|255)>>>0}function C(a,g,y){let m=a>>24&255,S=a>>16&255,x=a>>8&255,A=g>>24&255,k=g>>16&255,D=g>>8&255,T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));for(;T>>0}_.ensureContrastRatio=function(a,g,y){let m=s.relativeLuminance(a>>8),S=s.relativeLuminance(g>>8);if(u(m,S)>8));if(Du(m,s.relativeLuminance(T>>8))?k:T}return k}let x=C(a,g,y),A=u(m,s.relativeLuminance(x>>8));if(Au(m,s.relativeLuminance(k>>8))?x:k}return x}},_.reduceLuminance=p,_.increaseLuminance=C,_.toChannels=function(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]},_.toColor=function(a,g,y,m){return{css:f.toCss(a,g,y,m),rgba:f.toRgba(a,g,y,m)}}}(i||(t.rgba=i={})),t.toPaddedHex=r,t.contrastRatio=u},345:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.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 l=0;ll.fire(d))}},859:(M,t)=>{function o(l){for(let d of l)d.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){let d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var d;this._isDisposed||l===this._value||((d=this._value)===null||d===void 0||d.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)===null||l===void 0||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=o,t.getDisposeArrayDisposable=function(l){return{dispose:()=>o(l)}}},485:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,n,c){this._data[d]||(this._data[d]={}),this._data[d][n]=c}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=o,t.FourKeyMap=class{constructor(){this._data=new o}set(l,d,n,c,v){this._data.get(l,d)||this._data.set(l,d,new o),this._data.get(l,d).set(n,c,v)}get(l,d,n,c){var v;return(v=this._data.get(l,d))===null||v===void 0?void 0:v.get(n,c)}clear(){this._data.clear()}}},399:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof navigator>"u";let o=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=o.includes("Firefox"),t.isLegacyEdge=o.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(o),t.getSafariVersion=function(){if(!t.isSafari)return 0;let d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(o)},385:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let l=o(399);class d{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._is)return e-f<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-f))}ms`),void this._start();e=s}this.clear()}}class n extends d{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){let f=Date.now()+v;return{timeRemaining:()=>Math.max(0,f-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},147:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){let n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=o;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,c=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=c}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let l=o(133),d=o(855),n=o(147);class c extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(f){let h=new c;return h.setFromCharData(f),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(f){this.fg=f[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(f[d.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(f[d.CHAR_DATA_CHAR_INDEX].length===2){let e=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){let s=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|f[d.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[d.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=f[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|f[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=c},855:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},t.utf32ToString=function(o,l=0,d=o.length){let n="";for(let c=l;c65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,l){let d=o.length;if(!d)return 0;let n=0,c=0;if(this._interim){let v=o.charCodeAt(c++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=c;v=d)return this._interim=f,n;let h=o.charCodeAt(v);56320<=h&&h<=57343?l[n++]=1024*(f-55296)+h-56320+65536:(l[n++]=f,l[n++]=h)}else f!==65279&&(l[n++]=f)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,l){let d=o.length;if(!d)return 0;let n,c,v,f,h=0,e=0,s=0;if(this.interim[0]){let u=!1,_=this.interim[0];_&=(224&_)==192?31:(240&_)==224?15:7;let p,C=0;for(;(p=63&this.interim[++C])&&C<4;)_<<=6,_|=p;let a=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=a-C;for(;s=d)return 0;if(p=o[s++],(192&p)!=128){s--,u=!0;break}this.interim[C++]=p,_<<=6,_|=63&p}u||(a===2?_<128?s--:l[h++]=_:a===3?_<2048||_>=55296&&_<=57343||_===65279||(l[h++]=_):_<65536||_>1114111||(l[h++]=_)),this.interim.fill(0)}let i=d-4,r=s;for(;r=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(e=(31&n)<<6|63&c,e<128){r--;continue}l[h++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,h;if(v=o[r++],(192&v)!=128){r--;continue}if(e=(15&n)<<12|(63&c)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;l[h++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,h;if(v=o[r++],(192&v)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,this.interim[2]=v,h;if(f=o[r++],(192&f)!=128){r--;continue}if(e=(7&n)<<18|(63&c)<<12|(63&v)<<6|63&f,e<65536||e>1114111)continue;l[h++]=e}}return h}}},776:function(M,t,o){var l=this&&this.__decorate||function(e,s,i,r){var u,_=arguments.length,p=_<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,s,i,r);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(p=(_<3?u(p):_>3?u(s,i,p):u(s,i))||p);return _>3&&p&&Object.defineProperty(s,i,p),p},d=this&&this.__param||function(e,s){return function(i,r){s(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let n=o(859),c=o(97),v={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF},f,h=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),f=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;sJSON.stringify(p)).join(", ")})`);let _=r.apply(this,u);return f.trace(`GlyphRenderer#${r.name} return`,_),_}}},726:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let o="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[l]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);let n=function(c,v,f){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,e,s){e[o]===e?e[l].push({id:h,index:s}):(e[l]=[{id:h,index:s}],e[o]=e)})(n,c,f)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},97:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let l=o(726);var d;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},B={};function I(M){var t=B[M];if(t!==void 0)return t.exports;var o=B[M]={exports:{}};return V[M].call(o.exports,o,o.exports,I),o.exports}var $={};return(()=>{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.WebglAddon=void 0;let t=I(345),o=I(859),l=I(399),d=I(666),n=I(776);class c extends o.Disposable{constructor(f){if(l.isSafari&&(0,l.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=f,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(f){let h=f._core;if(!f.element)return void this.register(h.onWillOpen(()=>this.activate(f)));this._terminal=f;let e=h.coreService,s=h.optionsService,i=h,r=i._renderService,u=i._characterJoinerService,_=i._charSizeService,p=i._coreBrowserService,C=i._decorationService,a=i._logService,g=i._themeService;(0,n.setTraceLogger)(a),this._renderer=this.register(new d.WebglRenderer(f,u,_,p,e,C,s,g,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{let y=this._terminal._core._renderService;y.setRenderer(this._terminal._core._createRenderer()),y.handleResize(f.cols,f.rows)}))}get textureAtlas(){var f;return(f=this._renderer)===null||f===void 0?void 0:f.textureAtlas}clearTextureAtlas(){var f;(f=this._renderer)===null||f===void 0||f.clearTextureAtlas()}}M.WebglAddon=c})(),$})())});var ze=pe((Le,Te)=>{(function(V,B){typeof Le=="object"&&typeof Te=="object"?Te.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Le=="object"?Le.WebLinksAddon=B():V.WebLinksAddon=B()})(self,()=>(()=>{"use strict";var V={6:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(l,d,n,c={}){this._terminal=l,this._regex=d,this._handler=n,this._options=c}provideLinks(l,d){let n=o.computeLink(l,this._regex,this._terminal,this._handler);d(this._addCallbacks(n))}_addCallbacks(l){return l.map(d=>(d.leave=this._options.leave,d.hover=(n,c)=>{if(this._options.hover){let{range:v}=d;this._options.hover(n,c,v)}},d))}};class o{static computeLink(d,n,c,v){let f=new RegExp(n.source,(n.flags||"")+"g"),[h,e]=o._getWindowedLineStrings(d-1,c),s=h.join(""),i,r=[];for(;i=f.exec(s);){let u=i[0];try{let y=new URL(u),m=decodeURI(y.toString());if(u!==m&&u+"/"!==m)continue}catch{continue}let[_,p]=o._mapStrIdx(c,e,0,i.index),[C,a]=o._mapStrIdx(c,_,p,u.length);if(_===-1||p===-1||C===-1||a===-1)continue;let g={start:{x:p+1,y:_+1},end:{x:a,y:C+1}};r.push({range:g,text:u,activate:v})}return r}static _getWindowedLineStrings(d,n){let c,v=d,f=d,h=0,e="",s=[];if(c=n.buffer.active.getLine(d)){let i=c.translateToString(!0);if(c.isWrapped&&i[0]!==" "){for(h=0;(c=n.buffer.active.getLine(--v))&&h<2048&&(e=c.translateToString(!0),h+=e.length,s.push(e),c.isWrapped&&e.indexOf(" ")===-1););s.reverse()}for(s.push(i),h=0;(c=n.buffer.active.getLine(++f))&&c.isWrapped&&h<2048&&(e=c.translateToString(!0),h+=e.length,s.push(e),e.indexOf(" ")===-1););}return[s,v]}static _mapStrIdx(d,n,c,v){let f=d.buffer.active,h=f.getNullCell(),e=c;for(;v;){let s=f.getLine(n);if(!s)return[-1,-1];for(let i=e;i{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.WebLinksAddon=void 0;let t=I(6),o=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(d,n){let c=window.open();if(c){try{c.opener=null}catch{}c.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}M.WebLinksAddon=class{constructor(d=l,n={}){this._handler=d,this._options=n}activate(d){this._terminal=d;let n=this._options,c=n.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,c,this._handler,n))}dispose(){var d;(d=this._linkProvider)===null||d===void 0||d.dispose()}}})(),$})())});var je=pe((Se,Be)=>{(function(V,B){typeof Se=="object"&&typeof Be=="object"?Be.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Se=="object"?Se.Unicode11Addon=B():V.Unicode11Addon=B()})(Se,()=>(()=>{"use strict";var V={433:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV11=void 0;let o=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],l=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],d=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],n=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],c;function v(f,h){let e,s=0,i=h.length-1;if(fh[i][1])return!1;for(;i>=s;)if(e=s+i>>1,f>h[e][1])s=e+1;else{if(!(f{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.Unicode11Addon=void 0;let t=I(433);M.Unicode11Addon=class{activate(o){o.unicode.register(new t.UnicodeV11)}dispose(){}}})(),$})())});var qe=pe((Ae,Oe)=>{(function(V,B){typeof Ae=="object"&&typeof Oe=="object"?Oe.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Ae=="object"?Ae.AttachAddon=B():V.AttachAddon=B()})(self,()=>(()=>{"use strict";var V={};return(()=>{var B=V;function I($,M,t){return $.addEventListener(M,t),{dispose:()=>{t&&$.removeEventListener(M,t)}}}Object.defineProperty(B,"__esModule",{value:!0}),B.AttachAddon=void 0,B.AttachAddon=class{constructor($,M){this._disposables=[],this._socket=$,this._socket.binaryType="arraybuffer",this._bidirectional=!(M&&M.bidirectional===!1)}activate($){this._disposables.push(I(this._socket,"message",M=>{let t=M.data;$.write(typeof t=="string"?t:new Uint8Array(t))})),this._bidirectional&&(this._disposables.push($.onData(M=>this._sendData(M))),this._disposables.push($.onBinary(M=>this._sendBinary(M)))),this._disposables.push(I(this._socket,"close",()=>this.dispose())),this._disposables.push(I(this._socket,"error",()=>this.dispose()))}dispose(){for(let $ of this._disposables)$.dispose()}_sendData($){this._checkOpenSocket()&&this._socket.send($)}_sendBinary($){if(!this._checkOpenSocket())return;let M=new Uint8Array($.length);for(let t=0;t<$.length;++t)M[t]=255&$.charCodeAt(t);this._socket.send(M)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),V})())});var ge={id:"bajrangcoder.acodex",name:"AcodeX - Terminal",main:"dist/main.js",version:"3.0.1",readme:"readme.md",icon:"icon.png",files:[],minVersionCode:290,author:{name:"Raunak Raj",email:"bajrangcoders@gmail.com",url:"https://github.com/bajrangCoder/acode-plugin-acodex",github:"bajrangCoder"}};var se={snazzy:{background:"#282A36",foreground:"#EFF0EB",cursor:"#EFF0EB",black:"#0C0D13",red:"#FF5C57",green:"#5AF78E",yellow:"#F3F99D",blue:"#57C7FF",magenta:"#FF6AC1",cyan:"#9AEDFE",white:"#EFF0EB",brightBlack:"#686868",brightRed:"#FF5C57",brightGreen:"#5AF78E",brightYellow:"#F3F99D",brightBlue:"#57C7FF",brightMagenta:"#FF6AC1",brightCyan:"#9AEDFE",brightWhite:"#EFF0EB"},xterm:{foreground:"#F8F8F8",background:"#2D2E2C",selectionBackground:"#5DA5D533",black:"#1E1E1D",brightBlack:"#262625",red:"#CE5C5C",brightRed:"#FF7272",green:"#5BCC5B",brightGreen:"#72FF72",yellow:"#CCCC5B",brightYellow:"#FFFF72",blue:"#5D5DD3",brightBlue:"#7279FF",magenta:"#BC5ED1",brightMagenta:"#E572FF",cyan:"#5DA5D5",brightCyan:"#72F0FF",white:"#F8F8F8",brightWhite:"#FFFFFF"},sapphire:{background:"#1c2431",foreground:"#cccccc",selectionBackground:"#399ef440",black:"#666666",blue:"#399ef4",brightBlack:"#666666",brightBlue:"#399ef4",brightCyan:"#21c5c7",brightGreen:"#4eb071",brightMagenta:"#b168df",brightRed:"#da6771",brightWhite:"#efefef",brightYellow:"#fff099",cyan:"#21c5c7",green:"#4eb071",magenta:"#b168df",red:"#da6771",white:"#efefef",yellow:"#fff099"},light:{background:"#ffffff",foreground:"#333333",cursor:"#333333",cursorAccent:"#ffffff",selectionBackground:"#add6ff",black:"#000000",blue:"#0451a5",brightBlack:"#666666",brightBlue:"#0451a5",brightCyan:"#0598bc",brightGreen:"#14ce14",brightMagenta:"#bc05bc",brightRed:"#cd3131",brightWhite:"#a5a5a5",brightYellow:"#b5ba00",cyan:"#0598bc",green:"#00bc00",magenta:"#bc05bc",red:"#cd3131",white:"#555555",yellow:"#949800"},custom:{background:"#1c2431",foreground:"#cccccc",cursor:"#ffffff",cursorAccent:"#fff",selectionBackground:"#399ef440",black:"#666666",blue:"#399ef4",brightBlack:"#666666",brightBlue:"#399ef4",brightCyan:"#21c5c7",brightGreen:"#4eb071",brightMagenta:"#b168df",brightRed:"#da6771",brightWhite:"#efefef",brightYellow:"#fff099",cyan:"#21c5c7",green:"#4eb071",magenta:"#b168df",red:"#da6771",white:"#efefef",yellow:"#fff099"},ayuDark:{background:"#090D13",foreground:"#FEFEFE",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#C6C6C6",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#FEFEFE"},catppuccin:{background:"#1E1D2F",foreground:"#D9E0EE",cursor:"#D9E0EE",black:"#6E6C7E",red:"#F28FAD",green:"#ABE9B3",yellow:"#FAE3B0",blue:"#96CDFB",magenta:"#F5C2E7",cyan:"#89DCEB",white:"#C3BAC6",brightBlack:"#988BA2",brightRed:"#F28FAD",brightGreen:"#ABE9B3",brightYellow:"#FAE3B0",brightBlue:"#96CDFB",brightMagenta:"#F5C2E7",brightCyan:"#89DCEB",brightWhite:"#D9E0EE"},oneDark:{background:"#1E2127",foreground:"#5C6370",cursor:"#5C6370",black:"#000000",red:"#E06C75",green:"#98C379",yellow:"#D19A66",blue:"#61AFEF",magenta:"#C678DD",cyan:"#56B6C2",white:"#ABB2BF",brightBlack:"#5C6370",brightRed:"#E06C75",brightGreen:"#98C379",brightYellow:"#D19A66",brightBlue:"#61AFEF",brightMagenta:"#C678DD",brightCyan:"#56B6C2",brightWhite:"#FFFEFE"},material:{background:"#1E282C",foreground:"#C3C7D1",cursor:"#657B83",black:"#073641",red:"#EB606B",green:"#C3E88D",yellow:"#F7EB95",blue:"#80CBC3",magenta:"#FF2490",cyan:"#AEDDFF",white:"#FFFFFF",brightBlack:"#002B36",brightRed:"#EB606B",brightGreen:"#C3E88D",brightYellow:"#F7EB95",brightBlue:"#7DC6BF",brightMagenta:"#6C71C3",brightCyan:"#34434D",brightWhite:"#FFFFFF"},nekonakoDjancoeg:{background:"#2a2c3a",foreground:"#eeeeee",cursor:"#fd6b85",black:"#2f343f",red:"#fd6b85",green:"#63e0be",yellow:"#fed270",blue:"#67d4f2",magenta:"#ff8167",cyan:"#63e0be",white:"#eeeeee",brightBlack:"#4f4f5b",brightRed:"#fd6b85",brightGreen:"#63e0be",brightYellow:"#fed270",brightBlue:"#67d4f2",brightMagenta:"#ff8167",brightCyan:"#63e0be",brightWhite:"#eeeeee"},dracula:{background:"#282a36",foreground:"#94A3A5",cursor:"#94A3A5",black:"#44475a",red:"#ff5555",green:"#50fa7b",yellow:"#ffb86c",blue:"#8be9fd",magenta:"#bd93f9",cyan:"#ff79c6",white:"#94A3A5",brightBlack:"#000000",brightRed:"#ff5555",brightGreen:"#50fa7b",brightYellow:"#ffb86c",brightBlue:"#8be9fd",brightMagenta:"#bd93f9",brightCyan:"#ff79c6",brightWhite:"#ffffff"},ayuMirage:{background:"#1F2430",foreground:"#E5E0CE",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#C6C6C6",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#FEFEFE"},siduckOneDark:{background:"#1e222a",foreground:"#c8ccd4",cursor:"#e06c75",black:"#1e222a",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#D8DEE9",brightBlack:"#545862",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#c8ccd4"},elementary:{background:"#101010",foreground:"#f2f2f2",cursor:"#f2f2f2",black:"#303030",red:"#e1321a",green:"#6ab017",yellow:"#ffc005",blue:"#004f9e",magenta:"#ec0048",cyan:"#2aa7e7",white:"#f2f2f2",brightBlack:"#5d5d5d",brightRed:"#ff361e",brightGreen:"#7bc91f",brightYellow:"#ffd00a",brightBlue:"#0071ff",brightMagenta:"#ff1d62",brightCyan:"#4bb8fd",brightWhite:"#a020f0"},ayuLight:{background:"#FEFEFE",foreground:"#090D13",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#c6c6c694",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#dacaca"},everblush:{name:"Everblush",background:"#141b1e",foreground:"#dadada",cursor:"#3b4244",black:"#232a2d",red:"#e57474",green:"#8ccf7e",yellow:"#e5c76b",blue:"#67b0e8",magenta:"#c47fd5",cyan:"#6cbfbf",white:"#b3b9b8",brightBlack:"#2d3437",brightRed:"#ef7e7e",brightGreen:"#96d988",brightYellow:"#f4d67a",brightBlue:"#71baf2",brightMagenta:"#ce89df",brightCyan:"#67cbe7",brightWhite:"#bdc3c2"}};var Ve=me(We()),Ke=me(Ne()),Ye=me(Ue()),Je=me(ze()),Ze=me(je()),Qe=me(qe()),Hi=acode.require("alert"),Ge=acode.require("confirm"),$i=acode.require("prompt"),oe=acode.require("settings"),Wi=acode.require("helpers"),Ce=acode.require("fsOperation"),at=acode.require("toInternalUrl"),ht=acode.require("select"),Xe=acode.require("loader"),{clipboard:lt}=cordova.plugins,{editor:Ni}=editorManager,Ie=["ayuDark","ayuLight","ayuMirage","catppuccin","dracula","elementary","everblush","light","material","nekonakoDjancoeg","oneDark","sapphire","siduckOneDark","snazzy","xterm","custom"],Pe=class{isDragging=!1;startY;startHeight;isFlotBtnDragging=!1;btnStartPosX;btnStartPosY;isTerminalMinimized=!1;isTerminalOpened=!1;previousTerminalHeight;pid;terminal=null;socket=null;$fitAddon=void 0;ALLOW_TRANSPRANCY=!1;CURSOR_BLINK=!0;SHOW_ARROW_BTN=!1;CURSOR_STYLE=["block","underline","bar"];CURSOR_INACTIVE_STYLE=["outline","block","bar","underline","none"];FONT_SIZE=11;FONT_FAMILY=oe.get("editorFont");FONT_WEIGHT=["normal","bold","100","200","300","400","500","600","700","800","900"];SCROLLBACK=1e3;SCROLL_SENSITIVITY=1e3;showTerminalBtnSize=35;constructor(){oe.value[ge.id]?this.settings.showTerminalBtnSize||(delete oe.value[ge.id],oe.update(!1),this._saveSetting()):this._saveSetting()}async init(B,I,$){try{await Ce(window.DATA_STORAGE+"acodex_fonts").exists()||this.downloadFont(),this.xtermCss=tag("link",{rel:"stylesheet",href:this.baseUrl+"xterm.css"}),this.$style=tag("link",{rel:"stylesheet",href:this.baseUrl+"main.css"}),this._loadCustomFontStyleSheet(),document.head.append(this.xtermCss,this.$style),editorManager.editor.commands.addCommand({name:"acodex:open_terminal",description:"Open Terminal",bindKey:{win:"Ctrl-K"},exec:()=>{this.openTerminalPanel(270,this.settings.port)}}),editorManager.editor.commands.addCommand({name:"acodex:close_terminal",description:"Close Terminal",bindKey:{win:"Ctrl-J"},exec:this.closeTerminal.bind(this)}),this.$terminalContainer=tag("div",{className:"terminal-container"}),this.$terminalHeader=tag("div",{className:"terminal-header"}),this.$terminalTitle=tag("h3",{textContent:"AcodeX 1",className:"terminal-title"});let M=tag("div",{className:"control-btn"}),t=tag("button",{className:"add-session-btn"});t.innerHTML='',this.$cdBtn=tag("button",{className:"cd-btn"}),this.$cdBtn.innerHTML='',this.$hideTermBtn=tag("button",{className:"hide-terminal-btn"}),this.$hideTermBtn.innerHTML='',this.$closeTermBtn=tag("button",{className:"close-terminal-btn"}),this.$closeTermBtn.innerHTML='',M.append(t,this.$cdBtn,this.$hideTermBtn,this.$closeTermBtn),this.$terminalHeader.append(this.$terminalTitle,M),this.$terminalContent=tag("div",{className:"terminal-content"}),this.$terminalContainer.append(this.$terminalHeader,this.$terminalContent),this.$showTermBtn=tag("button",{className:"show-terminal-btn"}),this.$showTermBtn.innerHTML='',app.get("main")&&app.get("main").append(this.$terminalContainer,this.$showTermBtn),this.$showTermBtn.classList.add("hide"),this.$terminalContainer.classList.add("hide"),this.settings.showTerminalBtnSize&&(this.$showTermBtn.style.height=this.settings.showTerminalBtnSize+"px",this.$showTermBtn.style.width=this.settings.showTerminalBtnSize+"px"),this.$cacheFile=I,this.$terminalHeader.addEventListener("mousedown",this.startDragging.bind(this)),this.$terminalHeader.addEventListener("touchstart",this.startDragging.bind(this)),t.addEventListener("click",this.createSession.bind(this)),this.$terminalTitle.addEventListener("click",async o=>{let l,d=await this.$cacheFile.readFile("utf8"),n=JSON.parse(d);Array.isArray(n)?l=n.map(f=>f.name):l=[];let c={hideOnSelect:!0,default:localStorage.getItem("AcodeX_Current_Session")},v=await ht("AcodeX Sessions",l,c);v&&this.changeSession(v)}),this.$closeTermBtn.addEventListener("click",this.closeTerminal.bind(this)),this.$hideTermBtn.addEventListener("click",this.minimise.bind(this)),this.$cdBtn.addEventListener("click",this._cdToActiveDir.bind(this)),this.$showTermBtn.addEventListener("mousedown",this.startDraggingFlotingBtn.bind(this)),document.addEventListener("mousemove",this.dragFlotButton.bind(this)),document.addEventListener("mouseup",this.stopDraggingFlotBtn.bind(this)),this.$showTermBtn.addEventListener("touchstart",this.startDraggingFlotingBtn.bind(this)),document.addEventListener("touchmove",this.dragFlotButton.bind(this)),document.addEventListener("touchend",this.stopDraggingFlotBtn.bind(this)),this.$showTermBtn.addEventListener("click",this.maxmise.bind(this)),window.addEventListener("mousemove",this.drag.bind(this)),window.addEventListener("touchmove",this.drag.bind(this)),window.addEventListener("mouseup",this.stopDragging.bind(this)),window.addEventListener("touchend",this.stopDragging.bind(this)),window.addEventListener("resize",()=>{if(this.$terminalContainer&&!this.$terminalContainer.classList.contains("hide")){let o=document.querySelector("#root header")?.offsetHeight||0,l=document.querySelector("#quick-tools")?.offsetHeight||0,d=window.innerHeight-(o+l),n=parseInt(this.$terminalContainer.style.height),c=Math.min(n,d);this.$terminalContainer.style.height=c+"px",localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight)}if(this.$showTermBtn&&!this.$showTermBtn.classList.contains("hide")){let o=document.querySelector("#root header")?.offsetHeight||0,l=window.innerHeight-o-this.$showTermBtn.offsetHeight,d=parseInt(this.$showTermBtn.style.bottom);this.$showTermBtn.style.bottom=Math.max(0,Math.min(l,d))+"px"}}),localStorage.getItem("AcodeX_Is_Opened")==="true"&&localStorage.getItem("AcodeX_Current_Session")&&await this.openTerminalPanel(localStorage.getItem("AcodeX_Terminal_Cont_Height")||270,this.settings.port),acode.define("acodex",{execute:o=>{try{if(!this.isTerminalOpened)return;this.socket.send(o+"\r")}catch(l){throw Error(l)}},isMinimized:()=>this.isTerminalMinimized,isTerminalOpened:()=>this.isTerminalOpened,maximiseTerminal:()=>{this.isTerminalOpened&&this.isTerminalMinimized&&this.maxmise()},openTerminal:(o=270,l=this.settings.port)=>{this.isTerminalOpened||this.createTerminal(o,l)},createSession:()=>{this.isTerminalOpened&&this.createSession()},closeTerminal:()=>{this.isTerminalOpened&&this.closeTerminal()},convertAcodeUriToTermReadable:o=>this._convertPath(o),addTheme:(o,l)=>{Ie.push(o),se[o]=l},applyTheme:o=>{this.settings.theme=o,oe.update()}})}catch(M){console.log(M)}}async openTerminalPanel(B,I){I&&(document.querySelector(".terminal-container")||app.get("main").append(this.$terminalContainer,this.$showTermBtn),this.settings.port=I,oe.update(!1),this.$terminalContainer.classList.remove("hide"),this.isTerminalOpened=!0,this.$terminalContainer.style.height=B+"px",this.$terminalContent.style.width="100%",this.$terminalContent.style.height=`calc(100% - ${this.$terminalContainer.offsetHeight}px)`,this.settings.transparency?(this.$terminalContainer.style.background="transparent",this.$terminalContainer.style.backdropFilter=`blur(${this.settings.blurValue})`,this.$terminalHeader.style.background=this.transparentColor(this.$terminalHeader),this.$terminalHeader.style.backdropFilter=`blur(${this.settings.blurValue})`):(this.$terminalContainer.style.background="var(--popup-background-color)",this.$terminalHeader.style.background="var(--primary-color)"),localStorage.getItem("AcodeX_Current_Session")?this.changeSession(localStorage.getItem("AcodeX_Current_Session"),!0):(this.$terminalContent.innerHTML="",this.createSession()))}transparentColor(B){var $=window.getComputedStyle(B).backgroundColor.match(/\d+/g),M=parseFloat($[3])||1;return`rgba(${$[0]}, ${$[1]}, ${$[2]}, 0.5)`}async createXtermTerminal(B){if(this.$terminal=this.terminalObj,this.$fitAddon=new Ke.FitAddon,this.$webglAddon=new Ye.WebglAddon,this.$unicode11Addon=new Ze.Unicode11Addon,this.$webLinkAddon=new Je.WebLinksAddon(async(I,$)=>{await Ge("AcodeX Link",`Do you want to open ${$} in browser?`)&&system.openInBrowser($)}),this.$terminal.loadAddon(this.$fitAddon),this.$terminal.loadAddon(this.$unicode11Addon),this.$terminal.loadAddon(this.$webLinkAddon),this.fitTerminal(),this.$webglAddon)try{this.$terminal.loadAddon(this.$webglAddon),this.$terminal.open(this.$terminalContent)}catch(I){window.toast("error during loading webgl addon: "+I,4e3),this.$webglAddon.dispose(),this.$webglAddon=void 0}this.$terminal.element||this.$terminal.open(this.$terminalContent),this.$terminal.focus(),this._updateTerminalHeight()}async attachSocketToXterm(B,I){this.$terminal.onResize($=>{if(!I)return;let M=$.cols,t=$.rows,o="http://localhost:"+B+"/terminals/"+I+"/size?cols="+M+"&rows="+t;fetch(o,{method:"POST"})}),this.socket=new WebSocket(`ws://localhost:${B}/terminals/${I}`),this.socket.onopen=()=>{this.$attachAddon=new Qe.AttachAddon(this.socket),this.$terminal.loadAddon(this.$attachAddon),this.$terminal.unicode.activeVersion="11",this._updateTerminalHeight(),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.getItem("AcodeX_Terminal_Is_Minimised")==="true"&&this.minimise(),this.$terminal.focus(),this._updateTerminalHeight()},this.socket.onerror=$=>{acode.alert("AcodeX Error",JSON.stringify($))},this.$terminal.attachCustomKeyEventHandler(async $=>{if($.type==="keydown"){let M=await this.$cacheFile.readFile("utf8"),t=M?JSON.parse(M):[];if($.ctrlKey&&$.keyCode===78)return this.createSession(),!1;if($.ctrlKey&&$.keyCode===87)return this.closeTerminal(),!1;if($.ctrlKey&&$.keyCode===86)return lt.paste(o=>{this.$terminal.paste(o)}),!1;if($.ctrlKey&&$.keyCode>=49&&$.keyCode<=53){let o=$.keyCode-49;if(t.length>o){let l=t[o];return this.changeSession(l.name),!1}}else if($.ctrlKey&&$.keyCode===37){let o=t.findIndex(l=>l.name===localStorage.getItem("AcodeX_Current_Session"));if(o>0){let l=t[o-1];return this.changeSession(l.name),!1}}else if($.ctrlKey&&$.keyCode===39){let o=t.findIndex(l=>l.name===localStorage.getItem("AcodeX_Current_Session"));if(o{let c=d.name.match(/^AcodeX(\d+)$/);if(c){let v=parseInt(c[1],10);return Math.max(l,v)}return l},0)+1}`;if(this.createXtermTerminal(this.settings.port),B=await this._generateProcessId(),!B)return;$.push({name:o,pid:B})}await Promise.all([this.$cacheFile.writeFile($),this.attachSocketToXterm(this.settings.port,B)]),this._updateTerminalHeight(),localStorage.setItem("AcodeX_Current_Session",$[$.length-1].name),this.$terminalTitle.textContent=$[$.length-1].name,window.toast(`Created Session: ${$[$.length-1].name}`,3e3)}_hideTerminalSession(){this.$attachAddon.dispose(),this.$fitAddon.dispose(),this.$unicode11Addon.dispose(),this.$webLinkAddon.dispose(),this.$webglAddon.dispose(),this.$terminal.dispose(),this.socket.close(),this.socket=null,this.$terminal=void 0,this.$attachAddon=void 0,this.$fitAddon=void 0,this.$unicode11Addon=void 0,this.$webLinkAddon=void 0,this.$webglAddon=void 0,this.$terminalContent.innerHTML=""}async _generateProcessId(){try{return await(await fetch("http://localhost:"+this.settings.port+"/terminals?cols="+this.$terminal.cols+"&rows="+this.$terminal.rows,{method:"POST"})).text()}catch{this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.removeItem("AcodeX_Current_Session"),window.toast("Start the acodex server in termux first!",4e3)}}async changeSession(B,I=!1){if(I){this.createXtermTerminal(this.settings.port);let $=await this._getPidBySessionName(B);if(!$)return;this.attachSocketToXterm(this.settings.port,$),localStorage.setItem("AcodeX_Current_Session",B),this.$terminalTitle.textContent=B}else{if(B===localStorage.getItem("AcodeX_Current_Session"))return;this._hideTerminalSession(),this.createXtermTerminal(this.settings.port);let $=await this._getPidBySessionName(B);if(!$)return;this.attachSocketToXterm(this.settings.port,$),localStorage.setItem("AcodeX_Current_Session",B),this.$terminalTitle.textContent=B}}async _getPidBySessionName(B){let I=await this.$cacheFile.readFile("utf8"),$=I?JSON.parse(I):[];if(Array.isArray($)){let M=$.find(t=>t.name===B);return M?M.pid:(console.log(`Error: Session '${B}' not found in JSON file.`),null)}else return console.log("Error: Sessions data is not an array in JSON file."),null}_saveSetting(){oe.value[ge.id]={port:8767,transparency:this.ALLOW_TRANSPRANCY,showTerminalBtnSize:35,blurValue:"4px",cursorBlink:this.CURSOR_BLINK,cursorStyle:this.CURSOR_STYLE[0],cursorInactiveStyle:this.CURSOR_INACTIVE_STYLE[0],fontSize:this.FONT_SIZE,fontFamily:this.FONT_FAMILY,fontWeight:this.FONT_WEIGHT[0],customFontStyleSheet:"",scrollBack:this.SCROLLBACK,scrollSensitivity:this.SCROLL_SENSITIVITY,theme:"catppuccin",background:se.catppuccin.background,foreground:se.catppuccin.foreground,cursor:se.catppuccin.cursor||"",cursorAccent:se.catppuccin.cursorAccent||"",selectionBackground:se.catppuccin.selectionBackground,black:se.catppuccin.black,blue:se.catppuccin.blue,brightBlack:se.catppuccin.brightBlack,brightBlue:se.catppuccin.brightBlue,brightCyan:se.catppuccin.brightCyan,brightGreen:se.catppuccin.brightGreen,brightMagenta:se.catppuccin.brightMagenta,brightRed:se.catppuccin.brightWhite,brightWhite:se.catppuccin.brightWhite,brightYellow:se.catppuccin.brightYellow,cyan:se.catppuccin.cyan,green:se.catppuccin.green,magenta:se.catppuccin.magenta,red:se.catppuccin.red,white:se.catppuccin.white,yellow:se.catppuccin.yellow},oe.update(!1)}_loadCustomFontStyleSheet(){if(this.settings.customFontStyleSheet!="")if(document.querySelector("#customFontAcodeXStyleSheet"))document.querySelector("#customFontAcodeXStyleSheet").href=this.settings.customFontStyleSheet;else{let B=tag("link",{href:this.settings.customFontStyleSheet,rel:"stylesheet",id:"customFontAcodeXStyleSheet"});document.head.append(B)}}_updateTerminalHeight(){let B=this.$terminalHeader.offsetHeight;this.$terminalContent.style.height=`calc(100vh - ${B}px)`,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.fitTerminal()}fitTerminal(){let B=this.$fitAddon.proposeDimensions();B&&this.$terminal.resize(B.cols+2,B.rows+1)}async _getLastSessionName(){try{let B=await this.$cacheFile.readFile("utf8"),I=B?JSON.parse(B):[];return Array.isArray(I)&&I.length>0?I[I.length-1].name:(console.error("Error: No sessions found in JSON file or sessions data is not an array."),null)}catch(B){return console.error("Error reading or parsing JSON file:",B),null}}async closeTerminal(){if(await Ge("Warning","Are you sure ?")&&this.$terminal!=null&&localStorage.getItem("AcodeX_Current_Session")){let I=await this._getPidBySessionName(localStorage.getItem("AcodeX_Current_Session"));fetch(`http://localhost:${this.settings.port}/terminals/${I}/terminate`,{method:"POST"}).then(async $=>{if($.ok){let M=await this.$cacheFile.readFile("utf8"),t=M?JSON.parse(M):[];if(t=t.filter(o=>o.name!==localStorage.getItem("AcodeX_Current_Session")),await this.$cacheFile.writeFile(t),t.length>0){let o=await this._getLastSessionName();this.changeSession(o)}else this._hideTerminalSession(),this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.removeItem("AcodeX_Current_Session"),localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight)}else acode.alert("AcodeX Error",`Failed to close terminal ${this.pid}.`)}).catch(async $=>{this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.removeItem("AcodeX_Current_Session"),await this.$cacheFile.writeFile(""),acode.alert("AcodeX Server","Disconnected from server because server gets closed \u{1F61E}!"),console.error(`Error while closing terminal ${this.pid}: ${$}`)})}}startDraggingFlotingBtn(B){try{this.isFlotBtnDragging=!0,this.$showTermBtn.style.border="2px solid #fff",B.type==="touchstart"?(this.btnStartPosX=B.touches[0].clientX,this.btnStartPosY=B.touches[0].clientY):(this.btnStartPosX=B.clientX,this.btnStartPosY=B.clientY)}catch(I){window.alert(I)}}dragFlotButton(B){try{if(!this.isFlotBtnDragging)return;B.preventDefault();let I,$;B.type==="touchmove"?(I=B.touches[0].clientX,$=B.touches[0].clientY):(I=B.clientX,$=B.clientY);let M=this.btnStartPosX-I,t=this.btnStartPosY-$;this.btnStartPosX=I,this.btnStartPosY=$;let o=window.innerHeight-(this.$showTermBtn.offsetTop+this.$showTermBtn.offsetHeight)+t,l=this.$showTermBtn.offsetLeft-M,d=document.querySelector("#root header").offsetHeight+document.querySelector("#root ul").offsetHeight,n=window.innerWidth-this.$showTermBtn.offsetWidth,c=window.innerHeight-d-this.$showTermBtn.offsetHeight;this.$showTermBtn.style.bottom=Math.max(0,Math.min(c,o))+"px",this.$showTermBtn.style.left=Math.max(0,Math.min(n,l))+"px"}catch(I){window.alert(I)}}stopDraggingFlotBtn(){try{this.isFlotBtnDragging=!1,this.$showTermBtn.style.border="none"}catch(B){window.alert(B)}}startDragging(B){B.type==="touchstart"?this.startY=B.touches[0].clientY:(B.preventDefault(),this.startY=B.clientY),this.startHeight=this.$terminalContainer.clientHeight,this.isDragging=!0,this.$terminalContainer.style.borderTop="2px solid var(--link-text-color)"}drag(B){if(!this.isDragging)return;B.preventDefault();let I;B.type==="touchmove"?I=B.touches[0].clientY:I=B.clientY;let $=I-this.startY,M=this.startHeight-$,t=document.querySelector("#root header").offsetHeight+document.querySelector("#root ul").offsetHeight,o=document.querySelector("#quick-tools").offsetHeight,l=window.innerHeight-(t+o);M=Math.max(100,Math.min(M,l)),this.$terminalContainer.style.height=M+"px",localStorage.setItem("AcodeX_Terminal_Cont_Height",M),this._updateTerminalHeight()}stopDragging(B){this.isDragging=!1,this.$terminalContainer.style.borderTop="1px solid var(--popup-border-color)"}minimise(){try{this.isTerminalMinimized||(this.previousTerminalHeight=window.getComputedStyle(this.$terminalContainer).height,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.$terminalContainer.style.height="0px",this.$terminalContainer.classList.add("hide"),this.isTerminalMinimized=!0,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),this.$showTermBtn.classList.remove("hide"))}catch(B){window.alert(B)}}maxmise(){this.isTerminalMinimized&&(parseInt(localStorage.getItem("AcodeX_Terminal_Cont_Height"))<=50?this.$terminalContainer.style.height="50px":this.$terminalContainer.style.height=localStorage.getItem("AcodeX_Terminal_Cont_Height")+"px",this.$terminalContainer.classList.remove("hide"),this.$terminalContent.style.height=`calc(100% - ${this.$terminalContainer.offsetHeight}px)`,this.fitTerminal(),localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),this._updateTerminalHeight())}_convertPath(B){return B.startsWith("content://com.termux.documents/tree")?B.split("::")[1].substring(0,B.split("::")[1].lastIndexOf("/")).replace(/^\/data\/data\/com\.termux\/files\/home/,"$HOME"):B.startsWith("file:///storage/emulated/0/")?"/sdcard"+B.substr(26).replace(/\.[^/.]+$/,"").split("/").slice(0,-1).join("/")+"/":B.startsWith("content://com.android.externalstorage.documents/tree/primary")?"/sdcard/"+B.split("::primary:")[1].substring(0,B.split("::primary:")[1].lastIndexOf("/")):!1}async _cdToActiveDir(){let{activeFile:B}=editorManager,I=this._convertPath(B.uri);if(!I){window.toast("unsupported path type.",3e3);return}this.socket.send(`cd "${I}"\r`)}async destroy(){this.$style.remove(),this.xtermCss.remove(),await Ce(window.DATA_STORAGE+"acodex_fonts").delete(),editorManager.editor.commands.removeCommand("terminal:open_terminal"),editorManager.editor.commands.removeCommand("terminal:close_terminal"),this.$terminalContainer.remove(),this.$showTermBtn.remove(),document.removeEventListener("mousemove",this.dragFlotButton.bind(this)),document.removeEventListener("mouseup",this.stopDraggingFlotBtn.bind(this)),document.removeEventListener("touchmove",this.dragFlotButton.bind(this)),document.removeEventListener("touchend",this.stopDraggingFlotBtn.bind(this)),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),localStorage.removeItem("AcodeX_Terminal_Is_Minimised"),localStorage.removeItem("AcodeX_Current_Session"),localStorage.removeItem("AcodeX_Terminal_Cont_Height"),localStorage.removeItem("AcodeX_Is_Opened")}async setCustomFontFile(){let{url:B}=await acode.fileBrowser("file","select custom font stylesheet");if(!B)return;let I=this._convertPath(B);if(I.startsWith("/sdcard"))I=I.replace("/sdcard","file:///storage/emulated/0");else if(I.startsWith("$HOME"))return;let $=B.split("/"),M=$[$.length-1];I=I+"/"+M;let t=await at(I);this.settings.customFontStyleSheet=t,oe.update()}async applyTheme(B){let I=se[B];this.settings.theme=B,this.settings.background=I.background,this.settings.foreground=I.foreground,this.settings.cursor=I.cursor||"#fff",this.settings.cursorAccent=I.cursorAccent||"#fff",this.settings.selectionBackground=I.selectionBackground,this.settings.black=I.black,this.settings.blue=I.blue,this.settings.brightBlack=I.brightBlack,this.settings.brightBlue=I.brightBlue,this.settings.brightCyan=I.brightCyan,this.settings.brightGreen=I.brightGreen,this.settings.brightMagenta=I.brightMagenta,this.settings.brightRed=I.brightRed,this.settings.brightWhite=I.brightWhite,this.settings.brightYellow=I.brightYellow,this.settings.cyan=I.cyan,this.settings.green=I.green,this.settings.magenta=I.magenta,this.settings.red=I.red,this.settings.white=I.white,this.settings.yellow=I.yellow,oe.update()}hexToTransparentRGBA(B,I){B=B.replace("#","");let $=parseInt(B.substring(0,2),16),M=parseInt(B.substring(2,4),16),t=parseInt(B.substring(4,6),16);return`rgba(${$}, ${M}, ${t}, ${I})`}get terminalThemeObj(){return{background:this.settings.transparency?this.hexToTransparentRGBA(this.settings.background,.5):this.settings.background,foreground:this.settings.foreground,selectionBackground:this.settings.selectionBackground,cursor:this.settings.cursor,cursorAccent:this.settings.cursorAccent,black:this.settings.black,blue:this.settings.blue,brightBlack:this.settings.brightBlack,brightBlue:this.settings.brightBlue,brightCyan:this.settings.brightCyan,brightGreen:this.settings.brightGreen,brightMagenta:this.settings.brightMagenta,brightRed:this.settings.brightRed,brightWhite:this.settings.brightWhite,brightYellow:this.settings.brightYellow,cyan:this.settings.cyan,green:this.settings.green,magenta:this.settings.magenta,red:this.settings.red,white:this.settings.white,yellow:this.settings.yellow}}get terminalObj(){return new Ve.Terminal({allowTransparency:this.settings.transparency,allowProposedApi:!0,scrollOnUserInput:!0,cursorBlink:this.settings.cursorBlink,cursorStyle:this.settings.cursorStyle,cursorInactiveStyle:this.settings.cursorInactiveStyle,scrollBack:this.settings.scrollBack,scrollSensitivity:this.settings.scrollSensitivity,fontSize:this.settings.fontSize,fontFamily:this.settings.fontFamily,fontWeight:this.settings.fontWeight,theme:this.terminalThemeObj})}async clearCache(){await this.$cacheFile.writeFile(""),window.toast("Cache cleared \u{1F525}",3e3)}get fontsList(){return[[oe.get("editorFont"),"Default Editor Font","file file_type_font",!0],["Fira Code Bold Nerd Font","Fira Code Bold Nerd Font","file file_type_font",!0],["Fira Code Medium Nerd Font","Fira Code Medium Nerd Font","file file_type_font",!0],["JetBrains Mono Bold Nerd Font","JetBrains Mono Bold Nerd Font","file file_type_font",!0],["JetBrains Mono Medium Nerd Font","JetBrains Mono Medium Nerd Font","file file_type_font",!0],["VictorMonoNerdFont Bold","VictorMonoNerdFont Bold","file file_type_font",!0],["VictorMonoNerdFont BoldItalic","VictorMonoNerdFont BoldItalic","file file_type_font",!0],["VictorMonoNerdFont Medium","VictorMonoNerdFont Medium","file file_type_font",!0],["VictorMonoNerdFont Italic","VictorMonoNerdFont Italic","file file_type_font",!0],["SauceCodeProNerdFont Bold","SauceCodeProNerdFont Bold","file file_type_font",!0],["SauceCodeProNerdFont Medium","SauceCodeProNerdFont Medium","file file_type_font",!0],["MesloLGS NF Bold Italic","MesloLGS NF Bold Italic","file file_type_font",!0],["MesloLGS NF Bold","MesloLGS NF Bold","file file_type_font",!0],["MesloLGS NF Italic","MesloLGS NF Italic","file file_type_font",!0],["MesloLGS NF Regular","MesloLGS NF Regular","file file_type_font",!0]]}async downloadFont(){try{let B=window.DATA_STORAGE+"acodex_fonts",I="https://cdn.jsdelivr.net/gh/bajrangCoder/acode-plugin-acodex@main/fonts/",$=[I+"Fira Code Bold Nerd Font.ttf",I+"Fira Code Medium Nerd Font Complete Mono.ttf",I+"JetBrains Mono Bold Nerd Font Complete.ttf",I+"JetBrains Mono Medium Nerd Font Complete.ttf",I+"MesloLGS NF Bold Italic.ttf",I+"MesloLGS NF Bold.ttf",I+"MesloLGS NF Italic.ttf",I+"MesloLGS NF Regular.ttf",I+"SauceCodeProNerdFont-Bold.ttf",I+"SauceCodeProNerdFont-Medium.ttf",I+"VictorMonoNerdFont-Bold.ttf",I+"VictorMonoNerdFont-BoldItalic.ttf",I+"VictorMonoNerdFont-Italic.ttf",I+"VictorMonoNerdFont-Medium.ttf"];if(!await Ce(B).exists()){await Ce(window.DATA_STORAGE).createDirectory("acodex_fonts");let M=Xe.create("AcodeX","Downloading Fonts...");$.forEach(async t=>{let o=t.split("/").pop();M.setMessage(`Downloading Font: ${o}`),fetch(t).then(l=>l.blob()).then(async l=>{await Ce(B).createFile(o,l)}).catch(l=>{M.destroy(),window.toast(`Error fetching font file: ${l.toString()}`,4e3)})}),M.destroy(),window.toast("Fonts Downloaded successfully \u{1F4A5}",3e3)}}catch(B){console.log(B),Xe.destroy()}}get settingsObj(){return this.settings.theme==="custom"?{list:[{key:"port",text:"Server Port",value:this.settings.port,info:"Port which is displayed on termux when starting the server",prompt:"Server Port",promptType:"number",promptOption:[{required:!0}]},{key:"showTerminalBtnSize",text:"Show Terminal button size",value:this.settings.showTerminalBtnSize,info:"Size of terminal show button (in px)",prompt:"Show Terminal button size",promptType:"number",promptOption:[{required:!0}]},{key:"blurValue",text:"Blur Value(in px)",value:this.settings.blurValue,info:"Blur value for terminal in transparent mode",prompt:"Blur Value",promptType:"text",promptOption:[{required:!0}]},{key:"clearCache",text:"Clear Cache",info:"Helps in clearing cache which contains session details in case of any problems or bug"},{index:4,key:"customFontStyleSheet",text:"Custom Font Stylesheet file",info:"Select css file in which you have to define about your custom font.",value:this.settings.customFontStyleSheet},{key:"transparency",text:"Allow Transparent Terminal",info:"Makes terminal transparent but it will also led to slightly performance decrement",checkbox:!!this.settings.transparency},{index:0,key:"cursorBlink",text:"Cursor Blink",info:"Whether the cursor blinks.",checkbox:!!this.settings.cursorBlink},{key:"fontWeight",text:"Font Weight",value:this.settings.fontWeight,info:"The font weight used to render non-bold text.",select:this.FONT_WEIGHT},{index:1,key:"cursorStyle",text:"Cursor Style",value:this.settings.cursorStyle,info:"The style of the cursor.",select:[this.CURSOR_STYLE[0],this.CURSOR_STYLE[1],this.CURSOR_STYLE[2]]},{key:"cursorInactiveStyle",text:"Cursor Inactive Style",value:this.settings.cursorInactiveStyle,info:"The style of the cursor when the terminal is not focused.",select:this.CURSOR_INACTIVE_STYLE},{index:2,key:"fontSize",text:"Font Size",value:this.settings.fontSize,info:"The font size used to render text.",prompt:"Font Size",promptType:"text",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:3,key:"fontFamily",text:"Font Family",value:this.settings.fontFamily,info:"The font family used to render text.",select:this.fontsList},{index:5,key:"scrollBack",text:"Scroll Back",value:this.settings.scrollBack,info:"The amount of scrollback in the terminal. Scrollback is the amount of rows that are retained when lines are scrolled beyond the initial viewport.",prompt:"Scroll Back",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:6,key:"scrollSensitivity",text:"Scroll Sensitivity",value:this.settings.scrollSensitivity,info:"The scrolling speed multiplier used for adjusting normal scrolling speed.",prompt:"Scroll Sensitivity",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:7,key:"theme",text:"Theme",value:this.settings.theme,info:"Theme of terminal.",select:Ie},{index:8,key:"background",text:"Background Color",value:this.settings.background,color:this.settings.background},{index:8,key:"foreground",text:"Foreground Color",value:this.settings.foreground,color:this.settings.foreground},{index:9,key:"selectionBackground",text:"Selection Background Color",value:this.settings.selectionBackground,color:this.settings.selectionBackground},{key:"cursor",text:"Cursor Color",value:this.settings.cursor,color:this.settings.cursor},{key:"cursorAccent",text:"Cursor Accent Color",value:this.settings.cursorAccent,color:this.settings.cursorAccent},{index:10,key:"black",text:"Black Color",value:this.settings.black,color:this.settings.black},{index:11,key:"blue",text:"Blue Color",value:this.settings.blue,color:this.settings.blue},{index:12,key:"brightBlack",text:"Bright Black Color",value:this.settings.brightBlack,color:this.settings.brightBlack},{index:13,key:"brightBlue",text:"Bright Blue Color",value:this.settings.brightBlue,color:this.settings.brightBlue},{index:14,key:"brightCyan",text:"Bright Cyan Color",value:this.settings.brightCyan,color:this.settings.brightCyan},{index:15,key:"brightGreen",text:"Bright Green Color",value:this.settings.brightGreen,color:this.settings.brightGreen},{index:16,key:"brightMagenta",text:"Bright Magenta Color",value:this.settings.brightMagenta,color:this.settings.brightMagenta},{index:17,key:"brightRed",text:"Bright Red Color",value:this.settings.brightRed,color:this.settings.brightRed},{index:18,key:"brightWhite",text:"Bright White Color",value:this.settings.brightWhite,color:this.settings.brightWhite},{index:19,key:"brightYellow",text:"Bright Yellow Color",value:this.settings.brightYellow,color:this.settings.brightYellow},{index:20,key:"cyan",text:"Cyan Color",value:this.settings.cyan,color:this.settings.cyan},{index:21,key:"green",text:"Green Color",value:this.settings.green,color:this.settings.green},{index:22,key:"magenta",text:"Magenta Color",value:this.settings.magenta,color:this.settings.magenta},{index:23,key:"red",text:"Red Color",value:this.settings.red,color:this.settings.red},{index:24,key:"white",text:"White Color",value:this.settings.white,color:this.settings.white},{index:25,key:"yellow",text:"Yellow Color",value:this.settings.yellow,color:this.settings.yellow}],cb:(B,I)=>this.settingsSaveCallback(B,I)}:{list:[{key:"port",text:"Server Port",value:this.settings.port,info:"Port which is displayed on termux when starting the server",prompt:"Server Port",promptType:"number",promptOption:[{required:!0}]},{key:"fontWeight",text:"Font Weight",value:this.settings.fontWeight,info:"The font weight used to render non-bold text.",select:this.FONT_WEIGHT},{key:"showTerminalBtnSize",text:"Show Terminal button size",value:this.settings.showTerminalBtnSize,info:"Size of terminal show button (in px)",prompt:"Show Terminal button size",promptType:"number",promptOption:[{required:!0}]},{key:"blurValue",text:"Blur Value(in px)",value:this.settings.blurValue,info:"Blur value for terminal in transparent mode",prompt:"Blur Value",promptType:"text",promptOption:[{required:!0}]},{key:"clearCache",text:"Clear Cache",info:"Helps in clearing cache which contains session details in case of any problems or bug"},{key:"transparency",text:"Allow Transparent Terminal",info:"Makes terminal transparent but it will also led to slightly performance decrement",checkbox:!!this.settings.transparency},{index:7,key:"customFontStyleSheet",text:"Custom Font Stylesheet file",info:"Select css file in which you have to define about your custom font.",value:this.settings.customFontStyleSheet},{index:0,key:"cursorBlink",text:"Cursor Blink",info:"Whether the cursor blinks.",checkbox:!!this.settings.cursorBlink},{index:1,key:"cursorStyle",text:"Cursor Style",value:this.settings.cursorStyle,info:"The style of the cursor.",select:[this.CURSOR_STYLE[0],this.CURSOR_STYLE[1],this.CURSOR_STYLE[2]]},{key:"cursorInactiveStyle",text:"Cursor Inactive Style",value:this.settings.cursorInactiveStyle,info:"The style of the cursor when the terminal is not focused.",select:this.CURSOR_INACTIVE_STYLE},{index:2,key:"fontSize",text:"Font Size",value:this.settings.fontSize,info:"The font size used to render text.",prompt:"Font Size",promptType:"text",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:3,key:"fontFamily",text:"Font Family",value:this.settings.fontFamily,info:"The font family used to render text.",select:this.fontsList},{index:4,key:"scrollBack",text:"Scroll Back",value:this.settings.scrollBack,info:"The amount of scrollback in the terminal. Scrollback is the amount of rows that are retained when lines are scrolled beyond the initial viewport.",prompt:"Scroll Back",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:5,key:"scrollSensitivity",text:"Scroll Sensitivity",value:this.settings.scrollSensitivity,info:"The scrolling speed multiplier used for adjusting normal scrolling speed.",prompt:"Scroll Sensitivity",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:6,key:"theme",text:"Theme",value:this.settings.theme,info:"Theme of terminal.",select:Ie}],cb:(B,I)=>this.settingsSaveCallback(B,I)}}settingsSaveCallback(B,I){switch(B){case"customFontStyleSheet":this.setCustomFontFile();break;case"theme":this.applyTheme(I),I==="custom"&&acode.alert("AcodeX Warning","Restart the app please"),this.$terminal&&(this.$terminal.options.theme=this.terminalThemeObj);break;case"clearCache":this.clearCache();break;case"showTerminalBtnSize":this.$showTermBtn&&(this.$showTermBtn.style.height=I+"px",this.$showTermBtn.style.width=I+"px");case"fontSize":this.$terminal&&(this.$terminal.options.fontSize=I),this.settings[B]=I,oe.update();break;case"fontFamily":this.$terminal&&(this.$terminal.options.fontFamily=I),this.settings[B]=I,oe.update();break;case"fontWeight":this.$terminal&&(this.$terminal.options.fontWeight=I),this.settings[B]=I,oe.update();break;case"cursorBlink":this.$terminal&&(this.$terminal.options.cursorBlink=I),this.settings[B]=I,oe.update();break;case"cursorStyle":this.$terminal&&(this.$terminal.options.cursorStyle=I),this.settings[B]=I,oe.update();break;case"cursorInactiveStyle":this.$terminal&&(this.$terminal.options.cursorInactiveStyle=I),this.settings[B]=I,oe.update();break;default:this.settings[B]=I,oe.update()}}get settings(){return oe.value[ge.id]}};if(window.acode){let V=new Pe;acode.setPluginInit(ge.id,async(B,I,{cacheFileUrl:$,cacheFile:M})=>{B.endsWith("/")||(B+="/"),V.baseUrl=B,await V.init(I,M,$)},V.settingsObj),acode.setPluginUnmount(ge.id,()=>{V.destroy()})}})(); +}`)),this.register((0,d.toDisposable)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,l.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let x=new Float32Array([0,0,1,0,0,1,1,1]),A=S.createBuffer();this.register((0,d.toDisposable)(()=>S.deleteBuffer(A))),S.bindBuffer(S.ARRAY_BUFFER,A),S.bufferData(S.ARRAY_BUFFER,x,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let k=new Uint8Array([0,1,2,3]),D=S.createBuffer();this.register((0,d.toDisposable)(()=>S.deleteBuffer(D))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,D),S.bufferData(S.ELEMENT_ARRAY_BUFFER,k,S.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(S.createBuffer()),this.register((0,d.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,v,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,v,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,v,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(m.colors),this.register(this._themeService.onChangeColors(T=>{this._updateCachedColors(T),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(a){let g=this._gl;g.useProgram(this._program),g.bindVertexArray(this._vertexArrayObject),g.uniformMatrix4fv(this._projectionLocation,!1,c.PROJECTION_MATRIX),g.bindBuffer(g.ARRAY_BUFFER,this._attributesBuffer),g.bufferData(g.ARRAY_BUFFER,a.attributes,g.DYNAMIC_DRAW),g.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,g.UNSIGNED_BYTE,0,a.count)}handleResize(){this._updateViewportRectangle()}setDimensions(a){this._dimensions=a}_updateCachedColors(a){this._bgFloat=this._colorToFloat32Array(a.background),this._cursorFloat=this._colorToFloat32Array(a.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(a){let g=this._terminal,y=this._vertices,m,S,x,A,k,D,T,b,E,L,R,P=1;for(m=0;m>24&255)/255,r=(h>>16&255)/255,u=(h>>8&255)/255,_=1,this._addRectangle(a.attributes,g,e,s,(x-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,i,r,u,_)}_addRectangle(a,g,y,m,S,x,A,k,D,T){a[g]=y/this._dimensions.device.canvas.width,a[g+1]=m/this._dimensions.device.canvas.height,a[g+2]=S/this._dimensions.device.canvas.width,a[g+3]=x/this._dimensions.device.canvas.height,a[g+4]=A,a[g+5]=k,a[g+6]=D,a[g+7]=T}_addRectangleFloat(a,g,y,m,S,x,A){a[g]=y/this._dimensions.device.canvas.width,a[g+1]=m/this._dimensions.device.canvas.height,a[g+2]=S/this._dimensions.device.canvas.width,a[g+3]=x/this._dimensions.device.canvas.height,a[g+4]=A[0],a[g+5]=A[1],a[g+6]=A[2],a[g+7]=A[3]}_colorToFloat32Array(a){return new Float32Array([(a.rgba>>24&255)/255,(a.rgba>>16&255)/255,(a.rgba>>8&255)/255,(255&a.rgba)/255])}}t.RectangleRenderer=p},310:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;let l=o(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,l.createSelectionRenderModel)()}resize(d,n){let c=d*n*t.RENDER_MODEL_INDICIES_PER_CELL;c!==this.cells.length&&(this.cells=new Uint32Array(c),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(M,t,o){var l=this&&this.__decorate||function(x,A,k,D){var T,b=arguments.length,E=b<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,k):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(x,A,k,D);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(E=(b<3?T(E):b>3?T(A,k,E):T(A,k))||E);return b>3&&E&&Object.defineProperty(A,k,E),E};Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;let d=o(820),n=o(274),c=o(627),v=o(457),f=o(56),h=o(374),e=o(345),s=o(859),i=o(147),r=o(782),u=o(855),_=o(776),p=o(965),C=o(742),a=o(310),g=o(733);class y extends s.Disposable{constructor(A,k,D,T,b,E,L,R,P){super(),this._terminal=A,this._characterJoinerService=k,this._charSizeService=D,this._coreBrowserService=T,this._coreService=b,this._decorationService=E,this._optionsService=L,this._themeService=R,this._cursorBlinkStateManager=new s.MutableDisposable,this._charAtlasDisposable=this.register(new s.MutableDisposable),this._model=new a.RenderModel,this._workCell=new r.CellData,this._rectangleRenderer=this.register(new s.MutableDisposable),this._glyphRenderer=this.register(new s.MutableDisposable),this._onChangeTextureAtlas=this.register(new e.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new e.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new e.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new e.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new e.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new n.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new g.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,L,this._themeService)],this.dimensions=(0,h.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(L.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");let W={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",W),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",N=>{console.log("webglcontextlost event received"),N.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(N)},3e3)})),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",N=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(N,U)=>this._setCanvasDevicePixelDimensions(N,U))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,s.toDisposable)(()=>{var N;for(let U of this._renderLayers)U.dispose();(N=this._canvas.parentElement)===null||N===void 0||N.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var A;return(A=this._charAtlas)===null||A===void 0?void 0:A.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(A,k){var D,T,b,E;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let L of this._renderLayers)L.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(D=this._rectangleRenderer.value)===null||D===void 0||D.setDimensions(this.dimensions),(T=this._rectangleRenderer.value)===null||T===void 0||T.handleResize(),(b=this._glyphRenderer.value)===null||b===void 0||b.setDimensions(this.dimensions),(E=this._glyphRenderer.value)===null||E===void 0||E.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var A;for(let k of this._renderLayers)k.handleBlur(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.pause(),this._requestRedrawViewport()}handleFocus(){var A;for(let k of this._renderLayers)k.handleFocus(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.resume(),this._requestRedrawViewport()}handleSelectionChanged(A,k,D){for(let T of this._renderLayers)T.handleSelectionChanged(this._terminal,A,k,D);this._model.selection.update(this._terminal,A,k,D),this._requestRedrawViewport()}handleCursorMove(){var A;for(let k of this._renderLayers)k.handleCursorMove(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new C.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new p.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var A;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);let k=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==k&&(this._onChangeTextureAtlas.fire(k.pages[0].canvas),this._charAtlasDisposable.value=(0,s.getDisposeArrayDisposable)([(0,e.forwardEvent)(k.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,e.forwardEvent)(k.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=k,this._charAtlas.warmUp(),(A=this._glyphRenderer.value)===null||A===void 0||A.setAtlas(this._charAtlas)}_clearModel(A){var k;this._model.clear(),A&&((k=this._glyphRenderer.value)===null||k===void 0||k.clear())}clearTextureAtlas(){var A;(A=this._charAtlas)===null||A===void 0||A.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var A;this._clearModel(!0);for(let k of this._renderLayers)k.reset(this._terminal);(A=this._cursorBlinkStateManager.value)===null||A===void 0||A.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(A){return-1}deregisterCharacterJoiner(A){return!1}renderRows(A,k){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(let D of this._renderLayers)D.handleGridChanged(this._terminal,A,k);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(A,k),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new v.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(A,k){let D=this._core,T,b,E,L,R,P,W,N,U,q,w,O,H,F=this._workCell;A=S(A,D.rows-1,0),k=S(k,D.rows-1,0);let G=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=Math.min(this._terminal.buffer.active.cursorX,D.cols-1),Z=-1,re=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ne=!1;for(b=A;b<=k;b++)for(E=b+D.buffer.ydisp,L=D.buffer.lines.get(E),this._model.lineLengths[b]=0,R=this._characterJoinerService.getJoinedCharacters(E),O=0;O0&&O===R[0][0]&&(P=!0,N=R.shift(),F=new m(F,L.translateToString(!0,N[0],N[1]),N[1]-N[0]),W=N[1]-1),U=F.getChars(),q=F.getCode(),w=(b*D.cols+O)*a.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(F,O,E),re&&E===G&&(O===z&&(this._model.cursor={x:z,y:this._terminal.buffer.active.cursorY,width:F.getWidth(),style:this._coreBrowserService.isFocused?D.options.cursorStyle||"block":D.options.cursorInactiveStyle,cursorWidth:D.options.cursorWidth,dpr:this._devicePixelRatio},Z=z+F.getWidth()-1),O>=z&&O<=Z&&(this._coreBrowserService.isFocused&&(D.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&D.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),q!==u.NULL_CELL_CODE&&(this._model.lineLengths[b]=O+1),(this._model.cells[w]!==q||this._model.cells[w+a.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[w+a.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[w+a.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ne=!0,U.length>1&&(q|=a.COMBINED_CHAR_BIT_MASK),this._model.cells[w]=q,this._model.cells[w+a.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[w+a.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[w+a.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(O,b,q,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,U,T),P))for(F=this._workCell,O++;O{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;let l=o(374);function d(n,c,v){let f=(0,l.throwIfFalsy)(n.createShader(c));if(n.shaderSource(f,v),n.compileShader(f),n.getShaderParameter(f,n.COMPILE_STATUS))return f;console.error(n.getShaderInfoLog(f)),n.deleteShader(f)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,c,v){let f=(0,l.throwIfFalsy)(n.createProgram());if(n.attachShader(f,(0,l.throwIfFalsy)(d(n,n.VERTEX_SHADER,c))),n.attachShader(f,(0,l.throwIfFalsy)(d(n,n.FRAGMENT_SHADER,v))),n.linkProgram(f),n.getProgramParameter(f,n.LINK_STATUS))return f;console.error(n.getProgramInfoLog(f)),n.deleteProgram(f)},t.createShader=d,t.expandFloat32Array=function(n,c){let v=Math.min(2*n.length,c),f=new Float32Array(v);for(let h=0;h{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let l=o(627),d=o(237),n=o(374),c=o(859);class v extends c.Disposable{constructor(h,e,s,i,r,u,_,p){super(),this._container=e,this._alpha=r,this._coreBrowserService=u,this._optionsService=_,this._themeService=p,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${s}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(C=>{this._refreshCharAtlas(h,C),this.reset(h)})),this.register((0,c.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(h){}handleFocus(h){}handleCursorMove(h){}handleGridChanged(h,e,s){}handleSelectionChanged(h,e,s,i=!1){}_setTransparency(h,e){if(e===this._alpha)return;let s=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,s),this._refreshCharAtlas(h,this._themeService.colors),this.handleGridChanged(h,0,h.rows-1)}_refreshCharAtlas(h,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,l.acquireTextureAtlas)(h,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(h,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(h,this._themeService.colors)}_fillBottomLineAtCells(h,e,s=1){this._ctx.fillRect(h*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,s*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(h,e,s,i){this._alpha?this._ctx.clearRect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight))}_fillCharTrueColor(h,e,s,i){this._ctx.font=this._getFont(h,!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipCell(s,i,e.getWidth()),this._ctx.fillText(e.getChars(),s*this._deviceCellWidth+this._deviceCharLeft,i*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(h,e,s){this._ctx.beginPath(),this._ctx.rect(h*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(h,e,s){return`${s?"italic":""} ${e?h.options.fontWeightBold:h.options.fontWeight} ${h.options.fontSize*this._coreBrowserService.dpr}px ${h.options.fontFamily}`}}t.BaseRenderLayer=v},733:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let l=o(197),d=o(237),n=o(592);class c extends n.BaseRenderLayer{constructor(f,h,e,s,i,r,u){super(e,f,"link",h,!0,i,r,u),this.register(s.onShowLinkUnderline(_=>this._handleShowLinkUnderline(_))),this.register(s.onHideLinkUnderline(_=>this._handleHideLinkUnderline(_)))}resize(f,h){super.resize(f,h),this._state=void 0}reset(f){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let f=this._state.y2-this._state.y1-1;f>0&&this._clearCells(0,this._state.y1+1,this._state.cols,f),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(f){if(f.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:f.fg!==void 0&&(0,l.is256Color)(f.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[f.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,f.y1===f.y2)this._fillBottomLineAtCells(f.x1,f.y1,f.x2-f.x1);else{this._fillBottomLineAtCells(f.x1,f.y1,f.cols-f.x1);for(let h=f.y1+1;h{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(o,l,d,n){o.addEventListener(l,d,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(l,d,n))}}}},274:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let o,l=0,d=0,n=!1,c=!1,v=!1;t.CellColorResolver=class{constructor(f,h,e,s,i){this._terminal=f,this._selectionRenderModel=h,this._decorationService=e,this._coreBrowserService=s,this._themeService=i,this.result={fg:0,bg:0,ext:0}}resolve(f,h,e){this.result.bg=f.bg,this.result.fg=f.fg,this.result.ext=268435456&f.bg?f.extended.ext:0,d=0,l=0,c=!1,n=!1,v=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(h,e,"bottom",s=>{s.backgroundColorRGB&&(d=s.backgroundColorRGB.rgba>>8&16777215,c=!0),s.foregroundColorRGB&&(l=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),v=this._selectionRenderModel.isCellSelected(this._terminal,h,e),v&&(d=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,c=!0,o.selectionForeground&&(l=o.selectionForeground.rgba>>8&16777215,n=!0)),this._decorationService.forEachDecorationAtCell(h,e,"top",s=>{s.backgroundColorRGB&&(d=s.backgroundColorRGB.rgba>>8&16777215,c=!0),s.foregroundColorRGB&&(l=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),c&&(d=v?-16777216&f.bg&-134217729|d|50331648:-16777216&f.bg|d|50331648),n&&(l=-16777216&f.fg&-67108865|l|50331648),67108864&this.result.fg&&(c&&!n&&(l=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,n=!0),!c&&n&&(d=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,c=!0)),o=void 0,this.result.bg=c?d:this.result.bg,this.result.fg=n?l:this.result.fg}}},627:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let l=o(509),d=o(197),n=[];t.acquireTextureAtlas=function(c,v,f,h,e,s,i,r){let u=(0,d.generateConfig)(h,e,s,i,v,f,r);for(let C=0;C=0){if((0,d.configEquals)(a.config,u))return a.atlas;a.ownedBy.length===1?(a.atlas.dispose(),n.splice(C,1)):a.ownedBy.splice(g,1);break}}for(let C=0;C{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let l=o(160);t.generateConfig=function(d,n,c,v,f,h,e){let s={foreground:h.foreground,background:h.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:h.ansi.slice(),contrastCache:h.contrastCache,halfContrastCache:h.halfContrastCache};return{customGlyphs:f.customGlyphs,devicePixelRatio:e,letterSpacing:f.letterSpacing,lineHeight:f.lineHeight,deviceCellWidth:d,deviceCellHeight:n,deviceCharWidth:c,deviceCharHeight:v,fontFamily:f.fontFamily,fontSize:f.fontSize,fontWeight:f.fontWeight,fontWeightBold:f.fontWeightBold,allowTransparency:f.allowTransparency,drawBoldTextInBrightColors:f.drawBoldTextInBrightColors,minimumContrastRatio:f.minimumContrastRatio,colors:s}},t.configEquals=function(d,n){for(let c=0;c{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let l=o(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(o,l){this._renderCallback=o,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let l=o(374);t.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:8,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};let d={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2551":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u2552":{1:(h,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u2553":{1:(h,e)=>`M${.5-h},1 L${.5-h},.5 L1,.5 M${.5+h},.5 L${.5+h},1`},"\u2554":{1:(h,e)=>`M1,${.5-e} L${.5-h},${.5-e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1`},"\u2555":{1:(h,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"\u2556":{1:(h,e)=>`M${.5+h},1 L${.5+h},.5 L0,.5 M${.5-h},.5 L${.5-h},1`},"\u2557":{1:(h,e)=>`M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M0,${.5-e} L${.5+h},${.5-e} L${.5+h},1`},"\u2558":{1:(h,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"\u2559":{1:(h,e)=>`M1,.5 L${.5-h},.5 L${.5-h},0 M${.5+h},.5 L${.5+h},0`},"\u255A":{1:(h,e)=>`M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0 M1,${.5+e} L${.5-h},${.5+e} L${.5-h},0`},"\u255B":{1:(h,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"\u255C":{1:(h,e)=>`M0,.5 L${.5+h},.5 L${.5+h},0 M${.5-h},.5 L${.5-h},0`},"\u255D":{1:(h,e)=>`M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M0,${.5+e} L${.5+h},${.5+e} L${.5+h},0`},"\u255E":{1:(h,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u255F":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1 M${.5+h},.5 L1,.5`},"\u2560":{1:(h,e)=>`M${.5-h},0 L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u2561":{1:(h,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"\u2562":{1:(h,e)=>`M0,.5 L${.5-h},.5 M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u2563":{1:(h,e)=>`M${.5+h},0 L${.5+h},1 M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0`},"\u2564":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"\u2565":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},.5 L${.5-h},1 M${.5+h},.5 L${.5+h},1`},"\u2566":{1:(h,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1`},"\u2567":{1:(h,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2568":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},.5 L${.5-h},0 M${.5+h},.5 L${.5+h},0`},"\u2569":{1:(h,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u256A":{1:(h,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u256B":{1:(h,e)=>`M0,.5 L1,.5 M${.5-h},0 L${.5-h},1 M${.5+h},0 L${.5+h},1`},"\u256C":{1:(h,e)=>`M0,${.5+e} L${.5-h},${.5+e} L${.5-h},1 M1,${.5+e} L${.5+h},${.5+e} L${.5+h},1 M0,${.5-e} L${.5-h},${.5-e} L${.5-h},0 M1,${.5-e} L${.5+h},${.5-e} L${.5+h},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u2509":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(h,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"\u256E":{1:(h,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"\u256F":{1:(h,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"\u2570":{1:(h,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"\uE0B5":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"\uE0B6":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"\uE0B7":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"\uE0B8":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"\uE0B9":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BA":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"\uE0BC":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"\uE0BD":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BE":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions["\uE0BB"]=t.powerlineDefinitions["\uE0BD"],t.powerlineDefinitions["\uE0BF"]=t.powerlineDefinitions["\uE0B9"],t.tryDrawCustomChar=function(h,e,s,i,r,u,_,p){let C=t.blockElementDefinitions[e];if(C)return function(m,S,x,A,k,D){for(let T=0;T7&&parseInt(b.slice(7,9),16)||1;else{if(!b.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${b}" when drawing pattern glyph`);[U,q,w,O]=b.substring(5,b.length-1).split(",").map(H=>parseFloat(H))}for(let H=0;Hh.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(h,e)=>h.lineTo(e[0],e[1]),M:(h,e)=>h.moveTo(e[0],e[1])};function f(h,e,s,i,r,u,_,p=0,C=0){let a=h.map(g=>parseFloat(g)||parseInt(g));if(a.length<2)throw new Error("Too few arguments for instruction");for(let g=0;g{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let l=o(859);t.observeDevicePixelDimensions=function(d,n,c){let v=new n.ResizeObserver(f=>{let h=f.find(i=>i.target===d);if(!h)return;if(!("devicePixelContentBoxSize"in h))return v?.disconnect(),void(v=void 0);let e=h.devicePixelContentBoxSize[0].inlineSize,s=h.devicePixelContentBoxSize[0].blockSize;e>0&&s>0&&c(e,s)});try{v.observe(d,{box:["device-pixel-content-box"]})}catch{v.disconnect(),v=void 0}return(0,l.toDisposable)(()=>v?.disconnect())}},374:(M,t)=>{function o(l){return 57508<=l&&l<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(l){if(!l)throw new Error("value must not be falsy");return l},t.isPowerlineGlyph=o,t.isRestrictedPowerlineGlyph=function(l){return 57520<=l&&l<=57527},t.excludeFromContrastRatioDemands=function(l){return o(l)||function(d){return 9472<=d&&d<=9631}(l)},t.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}}}}},296:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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,n,c,v=!1){if(this.selectionStart=n,this.selectionEnd=c,!n||!c||n[0]===c[0]&&n[1]===c[1])return void this.clear();let f=n[1]-d.buffer.active.viewportY,h=c[1]-d.buffer.active.viewportY,e=Math.max(f,0),s=Math.min(h,d.rows-1);e>=d.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=f,this.viewportEndRow=h,this.viewportCappedStartRow=e,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=c[0])}isCellSelected(d,n,c){return!!this.hasSelection&&(c-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&c>=this.viewportCappedStartRow&&n=this.viewportCappedStartRow&&n>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c=this.startCol&&n=this.startCol)}}t.createSelectionRenderModel=function(){return new o}},509:function(M,t,o){var l=this&&this.__decorate||function(y,m,S,x){var A,k=arguments.length,D=k<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,S,x);else for(var T=y.length-1;T>=0;T--)(A=y[T])&&(D=(k<3?A(D):k>3?A(m,S,D):A(m,S))||D);return k>3&&D&&Object.defineProperty(m,S,D),D};Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let d=o(237),n=o(860),c=o(374),v=o(160),f=o(345),h=o(485),e=o(385),s=o(147),i=o(855),r=o(776),u={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},_;class p{get pages(){return this._pages}constructor(m,S,x){this._document=m,this._config=S,this._unicodeService=x,this._didWarmUp=!1,this._cacheMap=new h.FourKeyMap,this._cacheMapCombined=new h.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new s.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=g(m,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let m of this.pages)m.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let m=new e.IdleTaskQueue;for(let S=33;S<126;S++)m.enqueue(()=>{if(!this._cacheMap.get(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT)){let x=this._drawToCache(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT);this._cacheMap.set(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT,x)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let m of this._pages)m.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(p.maxAtlasPages&&this._pages.length>=Math.max(4,p.maxAtlasPages)){let S=this._pages.filter(E=>2*E.canvas.width<=(p.maxTextureSize||4096)).sort((E,L)=>L.canvas.width!==E.canvas.width?L.canvas.width-E.canvas.width:L.percentageUsed-E.percentageUsed),x=-1,A=0;for(let E=0;EE.glyphs[0].texturePage).sort((E,L)=>E>L?1:-1),T=this.pages.length-k.length,b=this._mergePages(k,T);b.version++;for(let E=D.length-1;E>=0;E--)this._deletePage(D[E]);this.pages.push(b),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(b.canvas)}let m=new C(this._document,this._textureSize);return this._pages.push(m),this._activePages.push(m),this._onAddTextureAtlasCanvas.fire(m.canvas),m}_mergePages(m,S){let x=2*m[0].canvas.width,A=new C(this._document,x,m);for(let[k,D]of m.entries()){let T=k*D.canvas.width%x,b=Math.floor(k/2)*D.canvas.height;A.ctx.drawImage(D.canvas,T,b);for(let L of D.glyphs)L.texturePage=S,L.sizeClipSpace.x=L.size.x/x,L.sizeClipSpace.y=L.size.y/x,L.texturePosition.x+=T,L.texturePosition.y+=b,L.texturePositionClipSpace.x=L.texturePosition.x/x,L.texturePositionClipSpace.y=L.texturePosition.y/x;this._onRemoveTextureAtlasCanvas.fire(D.canvas);let E=this._activePages.indexOf(D);E!==-1&&this._activePages.splice(E,1)}return A}_deletePage(m){this._pages.splice(m,1);for(let S=m;S=this._config.colors.ansi.length)throw new Error("No color found for idx "+m);return this._config.colors.ansi[m]}_getBackgroundColor(m,S,x,A){if(this._config.allowTransparency)return v.NULL_COLOR;let k;switch(m){case 16777216:case 33554432:k=this._getColorFromAnsiIndex(S);break;case 50331648:let D=s.AttributeData.toColorRGB(S);k=v.rgba.toColor(D[0],D[1],D[2]);break;default:k=x?v.color.opaque(this._config.colors.foreground):this._config.colors.background}return k}_getForegroundColor(m,S,x,A,k,D,T,b,E,L){let R=this._getMinimumContrastColor(m,S,x,A,k,D,!1,E,b,L);if(R)return R;let P;switch(k){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&E&&D<8&&(D+=8),P=this._getColorFromAnsiIndex(D);break;case 50331648:let W=s.AttributeData.toColorRGB(D);P=v.rgba.toColor(W[0],W[1],W[2]);break;default:P=T?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=v.color.opaque(P)),b&&(P=v.color.multiplyOpacity(P,d.DIM_OPACITY)),P}_resolveBackgroundRgba(m,S,x){switch(m){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return x?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(m,S,x,A){switch(m){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&A&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return x?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(m,S,x,A,k,D,T,b,E,L){if(this._config.minimumContrastRatio===1||L)return;let R=this._getContrastCache(E),P=R.getColor(m,A);if(P!==void 0)return P||void 0;let W=this._resolveBackgroundRgba(S,x,T),N=this._resolveForegroundRgba(k,D,T,b),U=v.rgba.ensureContrastRatio(W,N,this._config.minimumContrastRatio/(E?2:1));if(!U)return void R.setColor(m,A,null);let q=v.rgba.toColor(U>>24&255,U>>16&255,U>>8&255);return R.setColor(m,A,q),q}_getContrastCache(m){return m?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(m,S,x,A,k=!1){let D=typeof m=="number"?String.fromCharCode(m):m,T=Math.min(this._config.deviceCellWidth*Math.max(D.length,2)+4,this._textureSize);this._tmpCanvas.width=12&&!this._config.allowTransparency&&D!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let ae=this._tmpCtx.measureText(D);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ae&&ae.actualBoundingBoxDescent>0){this._tmpCtx.save();let Y=new Path2D;Y.rect(he,ie-Math.ceil(j/2),this._config.deviceCellWidth*de,le-ie+Math.ceil(j/2)),this._tmpCtx.clip(Y),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=F.css,this._tmpCtx.strokeText(D,te,te+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){let j=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ee=j%2==1?.5:0;this._tmpCtx.lineWidth=j,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+ee),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*de,te+ee),this._tmpCtx.stroke()}if(K||this._tmpCtx.fillText(D,te,te+this._config.deviceCharHeight),D==="_"&&!this._config.allowTransparency){let j=a(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ne,ue);if(j)for(let ee=1;ee<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=F.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(D,te,te+this._config.deviceCharHeight-ee),j=a(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),F,ne,ue),j);ee++);}if(N){let j=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ee=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=j,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+Math.floor(this._config.deviceCharHeight/2)-ee),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*de,te+Math.floor(this._config.deviceCharHeight/2)-ee),this._tmpCtx.stroke()}this._tmpCtx.restore();let fe=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),ve;if(ve=this._config.allowTransparency?function(j){for(let ee=0;ee0)return!1;return!0}(fe):a(fe,F,ne,ue),ve)return u;let Q=this._findGlyphBoundingBox(fe,this._workBoundingBox,T,re,K,te),X,J;for(;;){if(this._activePages.length===0){let j=this._createNewPage();X=j,J=j.currentRow,J.height=Q.size.y;break}X=this._activePages[this._activePages.length-1],J=X.currentRow;for(let j of this._activePages)Q.size.y<=j.currentRow.height&&(X=j,J=j.currentRow);for(let j=this._activePages.length-1;j>=0;j--)for(let ee of this._activePages[j].fixedRows)ee.height<=J.height&&Q.size.y<=ee.height&&(X=this._activePages[j],J=ee);if(J.y+Q.size.y>=X.canvas.height||J.height>Q.size.y+2){let j=!1;if(X.currentRow.y+X.currentRow.height+Q.size.y>=X.canvas.height){let ee;for(let he of this._activePages)if(he.currentRow.y+he.currentRow.height+Q.size.y=p.maxAtlasPages&&J.y+Q.size.y<=X.canvas.height&&J.height>=Q.size.y&&J.x+Q.size.x<=X.canvas.width)j=!0;else{let he=this._createNewPage();X=he,J=he.currentRow,J.height=Q.size.y,j=!0}}j||(X.currentRow.height>0&&X.fixedRows.push(X.currentRow),J={x:0,y:X.currentRow.y+X.currentRow.height,height:Q.size.y},X.fixedRows.push(J),X.currentRow={x:0,y:J.y+J.height,height:0})}if(J.x+Q.size.x<=X.canvas.width)break;J===X.currentRow?(J.x=0,J.y+=J.height,J.height=0):X.fixedRows.splice(X.fixedRows.indexOf(J),1)}return Q.texturePage=this._pages.indexOf(X),Q.texturePosition.x=J.x,Q.texturePosition.y=J.y,Q.texturePositionClipSpace.x=J.x/X.canvas.width,Q.texturePositionClipSpace.y=J.y/X.canvas.height,Q.sizeClipSpace.x/=X.canvas.width,Q.sizeClipSpace.y/=X.canvas.height,J.height=Math.max(J.height,Q.size.y),J.x+=Q.size.x,X.ctx.putImageData(fe,Q.texturePosition.x-this._workBoundingBox.left,Q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Q.size.x,Q.size.y),X.addGlyph(Q),X.version++,Q}_findGlyphBoundingBox(m,S,x,A,k,D){S.top=0;let T=A?this._config.deviceCellHeight:this._tmpCanvas.height,b=A?this._config.deviceCellWidth:x,E=!1;for(let L=0;L=D;L--){for(let R=0;R=0;L--){for(let R=0;R>>24,k=m.rgba>>>16&255,D=m.rgba>>>8&255,T=S.rgba>>>24,b=S.rgba>>>16&255,E=S.rgba>>>8&255,L=Math.floor((Math.abs(A-T)+Math.abs(k-b)+Math.abs(D-E))/12),R=!0;for(let P=0;P{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let l=o(399),d=0,n=0,c=0,v=0;var f,h,e,s,i;function r(_){let p=_.toString(16);return p.length<2?"0"+p:p}function u(_,p){return _>>0}}(f||(t.channels=f={})),function(_){function p(C,a){return v=Math.round(255*a),[d,n,c]=i.toChannels(C.rgba),{css:f.toCss(d,n,c,v),rgba:f.toRgba(d,n,c,v)}}_.blend=function(C,a){if(v=(255&a.rgba)/255,v===1)return{css:a.css,rgba:a.rgba};let g=a.rgba>>24&255,y=a.rgba>>16&255,m=a.rgba>>8&255,S=C.rgba>>24&255,x=C.rgba>>16&255,A=C.rgba>>8&255;return d=S+Math.round((g-S)*v),n=x+Math.round((y-x)*v),c=A+Math.round((m-A)*v),{css:f.toCss(d,n,c),rgba:f.toRgba(d,n,c)}},_.isOpaque=function(C){return(255&C.rgba)==255},_.ensureContrastRatio=function(C,a,g){let y=i.ensureContrastRatio(C.rgba,a.rgba,g);if(y)return i.toColor(y>>24&255,y>>16&255,y>>8&255)},_.opaque=function(C){let a=(255|C.rgba)>>>0;return[d,n,c]=i.toChannels(a),{css:f.toCss(d,n,c),rgba:a}},_.opacity=p,_.multiplyOpacity=function(C,a){return v=255&C.rgba,p(C,v*a/255)},_.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(h||(t.color=h={})),function(_){let p,C;if(!l.isNode){let a=document.createElement("canvas");a.width=1,a.height=1;let g=a.getContext("2d",{willReadFrequently:!0});g&&(p=g,p.globalCompositeOperation="copy",C=p.createLinearGradient(0,0,1,1))}_.toColor=function(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return d=parseInt(a.slice(1,2).repeat(2),16),n=parseInt(a.slice(2,3).repeat(2),16),c=parseInt(a.slice(3,4).repeat(2),16),i.toColor(d,n,c);case 5:return d=parseInt(a.slice(1,2).repeat(2),16),n=parseInt(a.slice(2,3).repeat(2),16),c=parseInt(a.slice(3,4).repeat(2),16),v=parseInt(a.slice(4,5).repeat(2),16),i.toColor(d,n,c,v);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let g=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return d=parseInt(g[1]),n=parseInt(g[2]),c=parseInt(g[3]),v=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),i.toColor(d,n,c,v);if(!p||!C)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=C,p.fillStyle=a,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[d,n,c,v]=p.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(d,n,c,v),css:a}}}(e||(t.css=e={})),function(_){function p(C,a,g){let y=C/255,m=a/255,S=g/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}_.relativeLuminance=function(C){return p(C>>16&255,C>>8&255,255&C)},_.relativeLuminance2=p}(s||(t.rgb=s={})),function(_){function p(a,g,y){let m=a>>24&255,S=a>>16&255,x=a>>8&255,A=g>>24&255,k=g>>16&255,D=g>>8&255,T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));for(;T0||k>0||D>0);)A-=Math.max(0,Math.ceil(.1*A)),k-=Math.max(0,Math.ceil(.1*k)),D-=Math.max(0,Math.ceil(.1*D)),T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));return(A<<24|k<<16|D<<8|255)>>>0}function C(a,g,y){let m=a>>24&255,S=a>>16&255,x=a>>8&255,A=g>>24&255,k=g>>16&255,D=g>>8&255,T=u(s.relativeLuminance2(A,k,D),s.relativeLuminance2(m,S,x));for(;T>>0}_.ensureContrastRatio=function(a,g,y){let m=s.relativeLuminance(a>>8),S=s.relativeLuminance(g>>8);if(u(m,S)>8));if(Du(m,s.relativeLuminance(T>>8))?k:T}return k}let x=C(a,g,y),A=u(m,s.relativeLuminance(x>>8));if(Au(m,s.relativeLuminance(k>>8))?x:k}return x}},_.reduceLuminance=p,_.increaseLuminance=C,_.toChannels=function(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]},_.toColor=function(a,g,y,m){return{css:f.toCss(a,g,y,m),rgba:f.toRgba(a,g,y,m)}}}(i||(t.rgba=i={})),t.toPaddedHex=r,t.contrastRatio=u},345:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.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 l=0;ll.fire(d))}},859:(M,t)=>{function o(l){for(let d of l)d.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){let d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var d;this._isDisposed||l===this._value||((d=this._value)===null||d===void 0||d.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)===null||l===void 0||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=o,t.getDisposeArrayDisposable=function(l){return{dispose:()=>o(l)}}},485:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,n,c){this._data[d]||(this._data[d]={}),this._data[d][n]=c}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=o,t.FourKeyMap=class{constructor(){this._data=new o}set(l,d,n,c,v){this._data.get(l,d)||this._data.set(l,d,new o),this._data.get(l,d).set(n,c,v)}get(l,d,n,c){var v;return(v=this._data.get(l,d))===null||v===void 0?void 0:v.get(n,c)}clear(){this._data.clear()}}},399:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof navigator>"u";let o=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=o.includes("Firefox"),t.isLegacyEdge=o.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(o),t.getSafariVersion=function(){if(!t.isSafari)return 0;let d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(o)},385:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let l=o(399);class d{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._is)return e-f<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-f))}ms`),void this._start();e=s}this.clear()}}class n extends d{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){let f=Date.now()+v;return{timeRemaining:()=>Math.max(0,f-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},147:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){let n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=o;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,c=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=c}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let l=o(133),d=o(855),n=o(147);class c extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(f){let h=new c;return h.setFromCharData(f),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(f){this.fg=f[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(f[d.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(f[d.CHAR_DATA_CHAR_INDEX].length===2){let e=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){let s=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|f[d.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=f[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[d.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=f[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|f[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=c},855:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},t.utf32ToString=function(o,l=0,d=o.length){let n="";for(let c=l;c65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,l){let d=o.length;if(!d)return 0;let n=0,c=0;if(this._interim){let v=o.charCodeAt(c++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=c;v=d)return this._interim=f,n;let h=o.charCodeAt(v);56320<=h&&h<=57343?l[n++]=1024*(f-55296)+h-56320+65536:(l[n++]=f,l[n++]=h)}else f!==65279&&(l[n++]=f)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,l){let d=o.length;if(!d)return 0;let n,c,v,f,h=0,e=0,s=0;if(this.interim[0]){let u=!1,_=this.interim[0];_&=(224&_)==192?31:(240&_)==224?15:7;let p,C=0;for(;(p=63&this.interim[++C])&&C<4;)_<<=6,_|=p;let a=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=a-C;for(;s=d)return 0;if(p=o[s++],(192&p)!=128){s--,u=!0;break}this.interim[C++]=p,_<<=6,_|=63&p}u||(a===2?_<128?s--:l[h++]=_:a===3?_<2048||_>=55296&&_<=57343||_===65279||(l[h++]=_):_<65536||_>1114111||(l[h++]=_)),this.interim.fill(0)}let i=d-4,r=s;for(;r=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(e=(31&n)<<6|63&c,e<128){r--;continue}l[h++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,h;if(v=o[r++],(192&v)!=128){r--;continue}if(e=(15&n)<<12|(63&c)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;l[h++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,h;if(c=o[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,h;if(v=o[r++],(192&v)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,this.interim[2]=v,h;if(f=o[r++],(192&f)!=128){r--;continue}if(e=(7&n)<<18|(63&c)<<12|(63&v)<<6|63&f,e<65536||e>1114111)continue;l[h++]=e}}return h}}},776:function(M,t,o){var l=this&&this.__decorate||function(e,s,i,r){var u,_=arguments.length,p=_<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,s,i,r);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(p=(_<3?u(p):_>3?u(s,i,p):u(s,i))||p);return _>3&&p&&Object.defineProperty(s,i,p),p},d=this&&this.__param||function(e,s){return function(i,r){s(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let n=o(859),c=o(97),v={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF},f,h=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),f=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;sJSON.stringify(p)).join(", ")})`);let _=r.apply(this,u);return f.trace(`GlyphRenderer#${r.name} return`,_),_}}},726:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let o="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[l]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);let n=function(c,v,f){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,e,s){e[o]===e?e[l].push({id:h,index:s}):(e[l]=[{id:h,index:s}],e[o]=e)})(n,c,f)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},97:(M,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let l=o(726);var d;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},B={};function I(M){var t=B[M];if(t!==void 0)return t.exports;var o=B[M]={exports:{}};return V[M].call(o.exports,o,o.exports,I),o.exports}var $={};return(()=>{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.WebglAddon=void 0;let t=I(345),o=I(859),l=I(399),d=I(666),n=I(776);class c extends o.Disposable{constructor(f){if(l.isSafari&&(0,l.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=f,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(f){let h=f._core;if(!f.element)return void this.register(h.onWillOpen(()=>this.activate(f)));this._terminal=f;let e=h.coreService,s=h.optionsService,i=h,r=i._renderService,u=i._characterJoinerService,_=i._charSizeService,p=i._coreBrowserService,C=i._decorationService,a=i._logService,g=i._themeService;(0,n.setTraceLogger)(a),this._renderer=this.register(new d.WebglRenderer(f,u,_,p,e,C,s,g,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{let y=this._terminal._core._renderService;y.setRenderer(this._terminal._core._createRenderer()),y.handleResize(f.cols,f.rows)}))}get textureAtlas(){var f;return(f=this._renderer)===null||f===void 0?void 0:f.textureAtlas}clearTextureAtlas(){var f;(f=this._renderer)===null||f===void 0||f.clearTextureAtlas()}}M.WebglAddon=c})(),$})())});var ze=pe((Le,Te)=>{(function(V,B){typeof Le=="object"&&typeof Te=="object"?Te.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Le=="object"?Le.WebLinksAddon=B():V.WebLinksAddon=B()})(self,()=>(()=>{"use strict";var V={6:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(l,d,n,c={}){this._terminal=l,this._regex=d,this._handler=n,this._options=c}provideLinks(l,d){let n=o.computeLink(l,this._regex,this._terminal,this._handler);d(this._addCallbacks(n))}_addCallbacks(l){return l.map(d=>(d.leave=this._options.leave,d.hover=(n,c)=>{if(this._options.hover){let{range:v}=d;this._options.hover(n,c,v)}},d))}};class o{static computeLink(d,n,c,v){let f=new RegExp(n.source,(n.flags||"")+"g"),[h,e]=o._getWindowedLineStrings(d-1,c),s=h.join(""),i,r=[];for(;i=f.exec(s);){let u=i[0];try{let y=new URL(u),m=decodeURI(y.toString());if(u!==m&&u+"/"!==m)continue}catch{continue}let[_,p]=o._mapStrIdx(c,e,0,i.index),[C,a]=o._mapStrIdx(c,_,p,u.length);if(_===-1||p===-1||C===-1||a===-1)continue;let g={start:{x:p+1,y:_+1},end:{x:a,y:C+1}};r.push({range:g,text:u,activate:v})}return r}static _getWindowedLineStrings(d,n){let c,v=d,f=d,h=0,e="",s=[];if(c=n.buffer.active.getLine(d)){let i=c.translateToString(!0);if(c.isWrapped&&i[0]!==" "){for(h=0;(c=n.buffer.active.getLine(--v))&&h<2048&&(e=c.translateToString(!0),h+=e.length,s.push(e),c.isWrapped&&e.indexOf(" ")===-1););s.reverse()}for(s.push(i),h=0;(c=n.buffer.active.getLine(++f))&&c.isWrapped&&h<2048&&(e=c.translateToString(!0),h+=e.length,s.push(e),e.indexOf(" ")===-1););}return[s,v]}static _mapStrIdx(d,n,c,v){let f=d.buffer.active,h=f.getNullCell(),e=c;for(;v;){let s=f.getLine(n);if(!s)return[-1,-1];for(let i=e;i{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.WebLinksAddon=void 0;let t=I(6),o=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(d,n){let c=window.open();if(c){try{c.opener=null}catch{}c.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}M.WebLinksAddon=class{constructor(d=l,n={}){this._handler=d,this._options=n}activate(d){this._terminal=d;let n=this._options,c=n.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,c,this._handler,n))}dispose(){var d;(d=this._linkProvider)===null||d===void 0||d.dispose()}}})(),$})())});var je=pe((Se,Be)=>{(function(V,B){typeof Se=="object"&&typeof Be=="object"?Be.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Se=="object"?Se.Unicode11Addon=B():V.Unicode11Addon=B()})(Se,()=>(()=>{"use strict";var V={433:(M,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV11=void 0;let o=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],l=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],d=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],n=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],c;function v(f,h){let e,s=0,i=h.length-1;if(fh[i][1])return!1;for(;i>=s;)if(e=s+i>>1,f>h[e][1])s=e+1;else{if(!(f{var M=$;Object.defineProperty(M,"__esModule",{value:!0}),M.Unicode11Addon=void 0;let t=I(433);M.Unicode11Addon=class{activate(o){o.unicode.register(new t.UnicodeV11)}dispose(){}}})(),$})())});var qe=pe((Ae,Oe)=>{(function(V,B){typeof Ae=="object"&&typeof Oe=="object"?Oe.exports=B():typeof define=="function"&&define.amd?define([],B):typeof Ae=="object"?Ae.AttachAddon=B():V.AttachAddon=B()})(self,()=>(()=>{"use strict";var V={};return(()=>{var B=V;function I($,M,t){return $.addEventListener(M,t),{dispose:()=>{t&&$.removeEventListener(M,t)}}}Object.defineProperty(B,"__esModule",{value:!0}),B.AttachAddon=void 0,B.AttachAddon=class{constructor($,M){this._disposables=[],this._socket=$,this._socket.binaryType="arraybuffer",this._bidirectional=!(M&&M.bidirectional===!1)}activate($){this._disposables.push(I(this._socket,"message",M=>{let t=M.data;$.write(typeof t=="string"?t:new Uint8Array(t))})),this._bidirectional&&(this._disposables.push($.onData(M=>this._sendData(M))),this._disposables.push($.onBinary(M=>this._sendBinary(M)))),this._disposables.push(I(this._socket,"close",()=>this.dispose())),this._disposables.push(I(this._socket,"error",()=>this.dispose()))}dispose(){for(let $ of this._disposables)$.dispose()}_sendData($){this._checkOpenSocket()&&this._socket.send($)}_sendBinary($){if(!this._checkOpenSocket())return;let M=new Uint8Array($.length);for(let t=0;t<$.length;++t)M[t]=255&$.charCodeAt(t);this._socket.send(M)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),V})())});var ge={id:"bajrangcoder.acodex",name:"AcodeX - Terminal",main:"dist/main.js",version:"3.0.1",readme:"readme.md",icon:"icon.png",files:[],minVersionCode:290,author:{name:"Raunak Raj",email:"bajrangcoders@gmail.com",url:"https://github.com/bajrangCoder/acode-plugin-acodex",github:"bajrangCoder"}};var se={snazzy:{background:"#282A36",foreground:"#EFF0EB",cursor:"#EFF0EB",black:"#0C0D13",red:"#FF5C57",green:"#5AF78E",yellow:"#F3F99D",blue:"#57C7FF",magenta:"#FF6AC1",cyan:"#9AEDFE",white:"#EFF0EB",brightBlack:"#686868",brightRed:"#FF5C57",brightGreen:"#5AF78E",brightYellow:"#F3F99D",brightBlue:"#57C7FF",brightMagenta:"#FF6AC1",brightCyan:"#9AEDFE",brightWhite:"#EFF0EB"},xterm:{foreground:"#F8F8F8",background:"#2D2E2C",selectionBackground:"#5DA5D533",black:"#1E1E1D",brightBlack:"#262625",red:"#CE5C5C",brightRed:"#FF7272",green:"#5BCC5B",brightGreen:"#72FF72",yellow:"#CCCC5B",brightYellow:"#FFFF72",blue:"#5D5DD3",brightBlue:"#7279FF",magenta:"#BC5ED1",brightMagenta:"#E572FF",cyan:"#5DA5D5",brightCyan:"#72F0FF",white:"#F8F8F8",brightWhite:"#FFFFFF"},sapphire:{background:"#1c2431",foreground:"#cccccc",selectionBackground:"#399ef440",black:"#666666",blue:"#399ef4",brightBlack:"#666666",brightBlue:"#399ef4",brightCyan:"#21c5c7",brightGreen:"#4eb071",brightMagenta:"#b168df",brightRed:"#da6771",brightWhite:"#efefef",brightYellow:"#fff099",cyan:"#21c5c7",green:"#4eb071",magenta:"#b168df",red:"#da6771",white:"#efefef",yellow:"#fff099"},light:{background:"#ffffff",foreground:"#333333",cursor:"#333333",cursorAccent:"#ffffff",selectionBackground:"#add6ff",black:"#000000",blue:"#0451a5",brightBlack:"#666666",brightBlue:"#0451a5",brightCyan:"#0598bc",brightGreen:"#14ce14",brightMagenta:"#bc05bc",brightRed:"#cd3131",brightWhite:"#a5a5a5",brightYellow:"#b5ba00",cyan:"#0598bc",green:"#00bc00",magenta:"#bc05bc",red:"#cd3131",white:"#555555",yellow:"#949800"},custom:{background:"#1c2431",foreground:"#cccccc",cursor:"#ffffff",cursorAccent:"#fff",selectionBackground:"#399ef440",black:"#666666",blue:"#399ef4",brightBlack:"#666666",brightBlue:"#399ef4",brightCyan:"#21c5c7",brightGreen:"#4eb071",brightMagenta:"#b168df",brightRed:"#da6771",brightWhite:"#efefef",brightYellow:"#fff099",cyan:"#21c5c7",green:"#4eb071",magenta:"#b168df",red:"#da6771",white:"#efefef",yellow:"#fff099"},ayuDark:{background:"#090D13",foreground:"#FEFEFE",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#C6C6C6",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#FEFEFE"},catppuccin:{background:"#1E1D2F",foreground:"#D9E0EE",cursor:"#D9E0EE",black:"#6E6C7E",red:"#F28FAD",green:"#ABE9B3",yellow:"#FAE3B0",blue:"#96CDFB",magenta:"#F5C2E7",cyan:"#89DCEB",white:"#C3BAC6",brightBlack:"#988BA2",brightRed:"#F28FAD",brightGreen:"#ABE9B3",brightYellow:"#FAE3B0",brightBlue:"#96CDFB",brightMagenta:"#F5C2E7",brightCyan:"#89DCEB",brightWhite:"#D9E0EE"},oneDark:{background:"#1E2127",foreground:"#5C6370",cursor:"#5C6370",black:"#000000",red:"#E06C75",green:"#98C379",yellow:"#D19A66",blue:"#61AFEF",magenta:"#C678DD",cyan:"#56B6C2",white:"#ABB2BF",brightBlack:"#5C6370",brightRed:"#E06C75",brightGreen:"#98C379",brightYellow:"#D19A66",brightBlue:"#61AFEF",brightMagenta:"#C678DD",brightCyan:"#56B6C2",brightWhite:"#FFFEFE"},material:{background:"#1E282C",foreground:"#C3C7D1",cursor:"#657B83",black:"#073641",red:"#EB606B",green:"#C3E88D",yellow:"#F7EB95",blue:"#80CBC3",magenta:"#FF2490",cyan:"#AEDDFF",white:"#FFFFFF",brightBlack:"#002B36",brightRed:"#EB606B",brightGreen:"#C3E88D",brightYellow:"#F7EB95",brightBlue:"#7DC6BF",brightMagenta:"#6C71C3",brightCyan:"#34434D",brightWhite:"#FFFFFF"},nekonakoDjancoeg:{background:"#2a2c3a",foreground:"#eeeeee",cursor:"#fd6b85",black:"#2f343f",red:"#fd6b85",green:"#63e0be",yellow:"#fed270",blue:"#67d4f2",magenta:"#ff8167",cyan:"#63e0be",white:"#eeeeee",brightBlack:"#4f4f5b",brightRed:"#fd6b85",brightGreen:"#63e0be",brightYellow:"#fed270",brightBlue:"#67d4f2",brightMagenta:"#ff8167",brightCyan:"#63e0be",brightWhite:"#eeeeee"},dracula:{background:"#282a36",foreground:"#94A3A5",cursor:"#94A3A5",black:"#44475a",red:"#ff5555",green:"#50fa7b",yellow:"#ffb86c",blue:"#8be9fd",magenta:"#bd93f9",cyan:"#ff79c6",white:"#94A3A5",brightBlack:"#000000",brightRed:"#ff5555",brightGreen:"#50fa7b",brightYellow:"#ffb86c",brightBlue:"#8be9fd",brightMagenta:"#bd93f9",brightCyan:"#ff79c6",brightWhite:"#ffffff"},ayuMirage:{background:"#1F2430",foreground:"#E5E0CE",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#C6C6C6",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#FEFEFE"},siduckOneDark:{background:"#1e222a",foreground:"#c8ccd4",cursor:"#e06c75",black:"#1e222a",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#D8DEE9",brightBlack:"#545862",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#c8ccd4"},elementary:{background:"#101010",foreground:"#f2f2f2",cursor:"#f2f2f2",black:"#303030",red:"#e1321a",green:"#6ab017",yellow:"#ffc005",blue:"#004f9e",magenta:"#ec0048",cyan:"#2aa7e7",white:"#f2f2f2",brightBlack:"#5d5d5d",brightRed:"#ff361e",brightGreen:"#7bc91f",brightYellow:"#ffd00a",brightBlue:"#0071ff",brightMagenta:"#ff1d62",brightCyan:"#4bb8fd",brightWhite:"#a020f0"},ayuLight:{background:"#FEFEFE",foreground:"#090D13",cursor:"#E96B72",black:"#00050D",red:"#E96B72",green:"#90B261",yellow:"#F8AE4E",blue:"#52BCF9",magenta:"#F9E893",cyan:"#8FE0C5",white:"#c6c6c694",brightBlack:"#676767",brightRed:"#EF7077",brightGreen:"#C1D84B",brightYellow:"#FEB353",brightBlue:"#58C1FE",brightMagenta:"#FEED98",brightCyan:"#94E5CA",brightWhite:"#dacaca"},everblush:{name:"Everblush",background:"#141b1e",foreground:"#dadada",cursor:"#3b4244",black:"#232a2d",red:"#e57474",green:"#8ccf7e",yellow:"#e5c76b",blue:"#67b0e8",magenta:"#c47fd5",cyan:"#6cbfbf",white:"#b3b9b8",brightBlack:"#2d3437",brightRed:"#ef7e7e",brightGreen:"#96d988",brightYellow:"#f4d67a",brightBlue:"#71baf2",brightMagenta:"#ce89df",brightCyan:"#67cbe7",brightWhite:"#bdc3c2"}};var Ve=me(We()),Ke=me(Ne()),Ye=me(Ue()),Je=me(ze()),Ze=me(je()),Qe=me(qe()),Hi=acode.require("alert"),Ge=acode.require("confirm"),$i=acode.require("prompt"),oe=acode.require("settings"),Wi=acode.require("helpers"),Ce=acode.require("fsOperation"),at=acode.require("toInternalUrl"),ht=acode.require("select"),Xe=acode.require("loader"),{clipboard:lt}=cordova.plugins,{editor:Ni}=editorManager,Ie=["ayuDark","ayuLight","ayuMirage","catppuccin","dracula","elementary","everblush","light","material","nekonakoDjancoeg","oneDark","sapphire","siduckOneDark","snazzy","xterm","custom"],Pe=class{isDragging=!1;startY;startHeight;isFlotBtnDragging=!1;btnStartPosX;btnStartPosY;isTerminalMinimized=!1;isTerminalOpened=!1;previousTerminalHeight;pid;terminal=null;socket=null;$fitAddon=void 0;ALLOW_TRANSPRANCY=!1;CURSOR_BLINK=!0;SHOW_ARROW_BTN=!1;CURSOR_STYLE=["block","underline","bar"];CURSOR_INACTIVE_STYLE=["outline","block","bar","underline","none"];FONT_SIZE=11;FONT_FAMILY=oe.get("editorFont");FONT_WEIGHT=["normal","bold","100","200","300","400","500","600","700","800","900"];SCROLLBACK=1e3;SCROLL_SENSITIVITY=1e3;showTerminalBtnSize=35;constructor(){oe.value[ge.id]?this.settings.showTerminalBtnSize||(delete oe.value[ge.id],oe.update(!1),this._saveSetting()):this._saveSetting()}async init(B,I,$){try{await Ce(window.DATA_STORAGE+"acodex_fonts").exists()||this.downloadFont(),this.xtermCss=tag("link",{rel:"stylesheet",href:this.baseUrl+"xterm.css"}),this.$style=tag("link",{rel:"stylesheet",href:this.baseUrl+"main.css"}),this._loadCustomFontStyleSheet(),document.head.append(this.xtermCss,this.$style),editorManager.editor.commands.addCommand({name:"acodex:open_terminal",description:"Open Terminal",bindKey:{win:"Ctrl-K"},exec:()=>{this.openTerminalPanel(270,this.settings.port)}}),editorManager.editor.commands.addCommand({name:"acodex:close_terminal",description:"Close Terminal",bindKey:{win:"Ctrl-J"},exec:this.closeTerminal.bind(this)}),this.$terminalContainer=tag("div",{className:"terminal-container"}),this.$terminalHeader=tag("div",{className:"terminal-header"}),this.$terminalTitle=tag("h3",{textContent:"AcodeX 1",className:"terminal-title"});let M=tag("div",{className:"control-btn"}),t=tag("button",{className:"add-session-btn"});t.innerHTML='',this.$cdBtn=tag("button",{className:"cd-btn"}),this.$cdBtn.innerHTML='',this.$hideTermBtn=tag("button",{className:"hide-terminal-btn"}),this.$hideTermBtn.innerHTML='',this.$closeTermBtn=tag("button",{className:"close-terminal-btn"}),this.$closeTermBtn.innerHTML='',M.append(t,this.$cdBtn,this.$hideTermBtn,this.$closeTermBtn),this.$terminalHeader.append(this.$terminalTitle,M),this.$terminalContent=tag("div",{className:"terminal-content"}),this.$terminalContainer.append(this.$terminalHeader,this.$terminalContent),this.$showTermBtn=tag("button",{className:"show-terminal-btn"}),this.$showTermBtn.innerHTML='',app.get("main")&&app.get("main").append(this.$terminalContainer,this.$showTermBtn),this.$showTermBtn.classList.add("hide"),this.$terminalContainer.classList.add("hide"),this.settings.showTerminalBtnSize&&(this.$showTermBtn.style.height=this.settings.showTerminalBtnSize+"px",this.$showTermBtn.style.width=this.settings.showTerminalBtnSize+"px"),this.$cacheFile=I,this.$terminalHeader.addEventListener("mousedown",this.startDragging.bind(this)),this.$terminalHeader.addEventListener("touchstart",this.startDragging.bind(this)),t.addEventListener("click",this.createSession.bind(this)),this.$terminalTitle.addEventListener("click",async o=>{let l,d=await this.$cacheFile.readFile("utf8"),n=JSON.parse(d);Array.isArray(n)?l=n.map(f=>f.name):l=[];let c={hideOnSelect:!0,default:localStorage.getItem("AcodeX_Current_Session")},v=await ht("AcodeX Sessions",l,c);v&&this.changeSession(v)}),this.$closeTermBtn.addEventListener("click",this.closeTerminal.bind(this)),this.$hideTermBtn.addEventListener("click",this.minimise.bind(this)),this.$cdBtn.addEventListener("click",this._cdToActiveDir.bind(this)),this.$showTermBtn.addEventListener("mousedown",this.startDraggingFlotingBtn.bind(this)),document.addEventListener("mousemove",this.dragFlotButton.bind(this)),document.addEventListener("mouseup",this.stopDraggingFlotBtn.bind(this)),this.$showTermBtn.addEventListener("touchstart",this.startDraggingFlotingBtn.bind(this)),document.addEventListener("touchmove",this.dragFlotButton.bind(this)),document.addEventListener("touchend",this.stopDraggingFlotBtn.bind(this)),this.$showTermBtn.addEventListener("click",this.maxmise.bind(this)),window.addEventListener("mousemove",this.drag.bind(this)),window.addEventListener("touchmove",this.drag.bind(this)),window.addEventListener("mouseup",this.stopDragging.bind(this)),window.addEventListener("touchend",this.stopDragging.bind(this)),window.addEventListener("resize",()=>{if(this.$terminalContainer&&!this.$terminalContainer.classList.contains("hide")){let o=document.querySelector("#root header")?.offsetHeight||0,l=document.querySelector("#quick-tools")?.offsetHeight||0,d=window.innerHeight-(o+l),n=parseInt(this.$terminalContainer.style.height),c=Math.min(n,d);this.$terminalContainer.style.height=c+"px",localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight)}if(this.$showTermBtn&&!this.$showTermBtn.classList.contains("hide")){let o=document.querySelector("#root header")?.offsetHeight||0,l=window.innerHeight-o-this.$showTermBtn.offsetHeight,d=parseInt(this.$showTermBtn.style.bottom);this.$showTermBtn.style.bottom=Math.max(0,Math.min(l,d))+"px"}}),localStorage.getItem("AcodeX_Is_Opened")==="true"&&localStorage.getItem("AcodeX_Current_Session")&&await this.openTerminalPanel(localStorage.getItem("AcodeX_Terminal_Cont_Height")||270,this.settings.port),acode.define("acodex",{execute:o=>{try{if(!this.isTerminalOpened)return;this.socket.send(o+"\r")}catch(l){throw Error(l)}},isMinimized:()=>this.isTerminalMinimized,isTerminalOpened:()=>this.isTerminalOpened,maximiseTerminal:()=>{this.isTerminalOpened&&this.isTerminalMinimized&&this.maxmise()},openTerminal:(o=270,l=this.settings.port)=>{this.isTerminalOpened||this.createTerminal(o,l)},createSession:()=>{this.isTerminalOpened&&this.createSession()},closeTerminal:()=>{this.isTerminalOpened&&this.closeTerminal()},convertAcodeUriToTermReadable:o=>this._convertPath(o),addTheme:(o,l)=>{Ie.push(o),se[o]=l},applyTheme:o=>{this.settings.theme=o,oe.update()}})}catch(M){console.log(M)}}async openTerminalPanel(B,I){I&&(document.querySelector(".terminal-container")||app.get("main").append(this.$terminalContainer,this.$showTermBtn),this.settings.port=I,oe.update(!1),this.$terminalContainer.classList.remove("hide"),this.isTerminalOpened=!0,this.$terminalContainer.style.height=B+"px",this.$terminalContent.style.width="100%",this.$terminalContent.style.height=`calc(100% - ${this.$terminalContainer.offsetHeight}px)`,this.settings.transparency?(this.$terminalContainer.style.background="transparent",this.$terminalContainer.style.backdropFilter=`blur(${this.settings.blurValue})`,this.$terminalHeader.style.background=this.transparentColor(this.$terminalHeader),this.$terminalHeader.style.backdropFilter=`blur(${this.settings.blurValue})`):(this.$terminalContainer.style.background="var(--popup-background-color)",this.$terminalHeader.style.background="var(--primary-color)"),localStorage.getItem("AcodeX_Current_Session")?this.changeSession(localStorage.getItem("AcodeX_Current_Session"),!0):(this.$terminalContent.innerHTML="",this.createSession()))}transparentColor(B){var $=window.getComputedStyle(B).backgroundColor.match(/\d+/g),M=parseFloat($[3])||1;return`rgba(${$[0]}, ${$[1]}, ${$[2]}, 0.5)`}async createXtermTerminal(B){if(this.$terminal=this.terminalObj,this.$fitAddon=new Ke.FitAddon,this.$webglAddon=new Ye.WebglAddon,this.$unicode11Addon=new Ze.Unicode11Addon,this.$webLinkAddon=new Je.WebLinksAddon(async(I,$)=>{await Ge("AcodeX Link",`Do you want to open ${$} in browser?`)&&system.openInBrowser($)}),this.$terminal.loadAddon(this.$fitAddon),this.$terminal.loadAddon(this.$unicode11Addon),this.$terminal.loadAddon(this.$webLinkAddon),this.fitTerminal(),this.$webglAddon)try{this.$terminal.loadAddon(this.$webglAddon),this.$terminal.open(this.$terminalContent)}catch(I){window.toast("error during loading webgl addon: "+I,4e3),this.$webglAddon.dispose(),this.$webglAddon=void 0}this.$terminal.element||this.$terminal.open(this.$terminalContent),this.$terminal.focus(),this._updateTerminalHeight()}async attachSocketToXterm(B,I){this.$terminal.onResize($=>{if(!I)return;let M=$.cols,t=$.rows,o="http://localhost:"+B+"/terminals/"+I+"/size?cols="+M+"&rows="+t;fetch(o,{method:"POST"})}),this.socket=new WebSocket(`ws://localhost:${B}/terminals/${I}`),this.socket.onopen=()=>{this.$attachAddon=new Qe.AttachAddon(this.socket),this.$terminal.loadAddon(this.$attachAddon),this.$terminal.unicode.activeVersion="11",this._updateTerminalHeight(),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.getItem("AcodeX_Terminal_Is_Minimised")==="true"&&this.minimise(),this.$terminal.focus(),this._updateTerminalHeight()},this.socket.onerror=$=>{acode.alert("AcodeX Error",JSON.stringify($))},this.$terminal.attachCustomKeyEventHandler(async $=>{if($.type==="keydown"){let M=await this.$cacheFile.readFile("utf8"),t=M?JSON.parse(M):[];if($.ctrlKey&&$.keyCode===78)return this.createSession(),!1;if($.ctrlKey&&$.keyCode===87)return this.closeTerminal(),!1;if($.ctrlKey&&$.keyCode===86)return lt.paste(o=>{this.$terminal.paste(o)}),!1;if($.ctrlKey&&$.keyCode>=49&&$.keyCode<=53){let o=$.keyCode-49;if(t.length>o){let l=t[o];return this.changeSession(l.name),!1}}else if($.ctrlKey&&$.keyCode===37){let o=t.findIndex(l=>l.name===localStorage.getItem("AcodeX_Current_Session"));if(o>0){let l=t[o-1];return this.changeSession(l.name),!1}}else if($.ctrlKey&&$.keyCode===39){let o=t.findIndex(l=>l.name===localStorage.getItem("AcodeX_Current_Session"));if(o{let c=d.name.match(/^AcodeX(\d+)$/);if(c){let v=parseInt(c[1],10);return Math.max(l,v)}return l},0)+1}`;if(this.createXtermTerminal(this.settings.port),B=await this._generateProcessId(),!B)return;$.push({name:o,pid:B})}await Promise.all([this.$cacheFile.writeFile($),this.attachSocketToXterm(this.settings.port,B)]),this._updateTerminalHeight(),localStorage.setItem("AcodeX_Current_Session",$[$.length-1].name),this.$terminalTitle.textContent=$[$.length-1].name,window.toast(`Created Session: ${$[$.length-1].name}`,3e3)}_hideTerminalSession(){this.$attachAddon.dispose(),this.$fitAddon.dispose(),this.$unicode11Addon.dispose(),this.$webLinkAddon.dispose(),this.$webglAddon.dispose(),this.$terminal.dispose(),this.socket.close(),this.socket=null,this.$terminal=void 0,this.$attachAddon=void 0,this.$fitAddon=void 0,this.$unicode11Addon=void 0,this.$webLinkAddon=void 0,this.$webglAddon=void 0,this.$terminalContent.innerHTML=""}async _generateProcessId(){try{return await(await fetch("http://localhost:"+this.settings.port+"/terminals?cols="+this.$terminal.cols+"&rows="+this.$terminal.rows,{method:"POST"})).text()}catch{this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.removeItem("AcodeX_Current_Session"),window.toast("Start the acodex server in termux first!",4e3)}}async changeSession(B,I=!1){if(I){this.createXtermTerminal(this.settings.port);let $=await this._getPidBySessionName(B);if(!$)return;this.attachSocketToXterm(this.settings.port,$),localStorage.setItem("AcodeX_Current_Session",B),this.$terminalTitle.textContent=B}else{if(B===localStorage.getItem("AcodeX_Current_Session"))return;this._hideTerminalSession(),this.createXtermTerminal(this.settings.port);let $=await this._getPidBySessionName(B);if(!$)return;this.attachSocketToXterm(this.settings.port,$),localStorage.setItem("AcodeX_Current_Session",B),this.$terminalTitle.textContent=B}}async _getPidBySessionName(B){let I=await this.$cacheFile.readFile("utf8"),$=I?JSON.parse(I):[];if(Array.isArray($)){let M=$.find(t=>t.name===B);return M?M.pid:(console.log(`Error: Session '${B}' not found in JSON file.`),null)}else return console.log("Error: Sessions data is not an array in JSON file."),null}_saveSetting(){oe.value[ge.id]={port:8767,transparency:this.ALLOW_TRANSPRANCY,showTerminalBtnSize:35,blurValue:"4px",cursorBlink:this.CURSOR_BLINK,cursorStyle:this.CURSOR_STYLE[0],cursorInactiveStyle:this.CURSOR_INACTIVE_STYLE[0],fontSize:this.FONT_SIZE,fontFamily:this.FONT_FAMILY,fontWeight:this.FONT_WEIGHT[0],customFontStyleSheet:"",scrollBack:this.SCROLLBACK,scrollSensitivity:this.SCROLL_SENSITIVITY,theme:"catppuccin",background:se.catppuccin.background,foreground:se.catppuccin.foreground,cursor:se.catppuccin.cursor||"",cursorAccent:se.catppuccin.cursorAccent||"",selectionBackground:se.catppuccin.selectionBackground,black:se.catppuccin.black,blue:se.catppuccin.blue,brightBlack:se.catppuccin.brightBlack,brightBlue:se.catppuccin.brightBlue,brightCyan:se.catppuccin.brightCyan,brightGreen:se.catppuccin.brightGreen,brightMagenta:se.catppuccin.brightMagenta,brightRed:se.catppuccin.brightWhite,brightWhite:se.catppuccin.brightWhite,brightYellow:se.catppuccin.brightYellow,cyan:se.catppuccin.cyan,green:se.catppuccin.green,magenta:se.catppuccin.magenta,red:se.catppuccin.red,white:se.catppuccin.white,yellow:se.catppuccin.yellow},oe.update(!1)}_loadCustomFontStyleSheet(){if(this.settings.customFontStyleSheet!="")if(document.querySelector("#customFontAcodeXStyleSheet"))document.querySelector("#customFontAcodeXStyleSheet").href=this.settings.customFontStyleSheet;else{let B=tag("link",{href:this.settings.customFontStyleSheet,rel:"stylesheet",id:"customFontAcodeXStyleSheet"});document.head.append(B)}}_updateTerminalHeight(){let B=this.$terminalHeader.offsetHeight;this.$terminalContent.style.height=`calc(100vh - ${B}px)`,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.fitTerminal()}fitTerminal(){let B=this.$fitAddon.proposeDimensions();B&&this.$terminal.resize(B.cols+2,B.rows+1)}async _getLastSessionName(){try{let B=await this.$cacheFile.readFile("utf8"),I=B?JSON.parse(B):[];return Array.isArray(I)&&I.length>0?I[I.length-1].name:(console.error("Error: No sessions found in JSON file or sessions data is not an array."),null)}catch(B){return console.error("Error reading or parsing JSON file:",B),null}}async closeTerminal(){if(await Ge("Warning","Are you sure ?")&&this.$terminal!=null&&localStorage.getItem("AcodeX_Current_Session")){let I=await this._getPidBySessionName(localStorage.getItem("AcodeX_Current_Session"));fetch(`http://localhost:${this.settings.port}/terminals/${I}/terminate`,{method:"POST"}).then(async $=>{if($.ok){let M=await this.$cacheFile.readFile("utf8"),t=M?JSON.parse(M):[];if(t=t.filter(o=>o.name!==localStorage.getItem("AcodeX_Current_Session")),await this.$cacheFile.writeFile(t),t.length>0){let o=await this._getLastSessionName();this.changeSession(o)}else this._hideTerminalSession(),this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.removeItem("AcodeX_Current_Session"),localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight)}else acode.alert("AcodeX Error",`Failed to close terminal ${this.pid}.`)}).catch(async $=>{this.$terminalContainer.classList.contains("hide")||this.$terminalContainer.classList.add("hide"),this.$showTermBtn.classList.contains("hide")||this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,this.isTerminalOpened=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),localStorage.setItem("AcodeX_Is_Opened",this.isTerminalOpened),this.$terminalContainer.style.height=this.previousTerminalHeight,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),localStorage.removeItem("AcodeX_Current_Session"),await this.$cacheFile.writeFile(""),acode.alert("AcodeX Server","Disconnected from server because server gets closed \u{1F61E}!"),console.error(`Error while closing terminal ${this.pid}: ${$}`)})}}startDraggingFlotingBtn(B){try{this.isFlotBtnDragging=!0,this.$showTermBtn.style.border="2px solid #fff",B.type==="touchstart"?(this.btnStartPosX=B.touches[0].clientX,this.btnStartPosY=B.touches[0].clientY):(this.btnStartPosX=B.clientX,this.btnStartPosY=B.clientY)}catch(I){window.alert(I)}}dragFlotButton(B){try{if(!this.isFlotBtnDragging)return;B.preventDefault();let I,$;B.type==="touchmove"?(I=B.touches[0].clientX,$=B.touches[0].clientY):(I=B.clientX,$=B.clientY);let M=this.btnStartPosX-I,t=this.btnStartPosY-$;this.btnStartPosX=I,this.btnStartPosY=$;let o=window.innerHeight-(this.$showTermBtn.offsetTop+this.$showTermBtn.offsetHeight)+t,l=this.$showTermBtn.offsetLeft-M,d=document.querySelector("#root header")?.offsetHeight||0+document.querySelector("#root ul")?.offsetHeight||0,n=window.innerWidth-this.$showTermBtn.offsetWidth,c=window.innerHeight-d-this.$showTermBtn.offsetHeight;this.$showTermBtn.style.bottom=Math.max(0,Math.min(c,o))+"px",this.$showTermBtn.style.left=Math.max(0,Math.min(n,l))+"px"}catch(I){window.alert(I)}}stopDraggingFlotBtn(){try{this.isFlotBtnDragging=!1,this.$showTermBtn.style.border="none"}catch(B){window.alert(B)}}startDragging(B){B.type==="touchstart"?this.startY=B.touches[0].clientY:(B.preventDefault(),this.startY=B.clientY),this.startHeight=this.$terminalContainer.clientHeight,this.isDragging=!0,this.$terminalContainer.style.borderTop="2px solid var(--link-text-color)"}drag(B){if(!this.isDragging)return;B.preventDefault();let I;B.type==="touchmove"?I=B.touches[0].clientY:I=B.clientY;let $=I-this.startY,M=this.startHeight-$,t=document.querySelector("#root header")?.offsetHeight||0+document.querySelector("#root ul")?.offsetHeight||0,o=document.querySelector("#quick-tools")?.offsetHeight||0,l=window.innerHeight-(t+o);M=Math.max(100,Math.min(M,l)),this.$terminalContainer.style.height=M+"px",localStorage.setItem("AcodeX_Terminal_Cont_Height",M),this._updateTerminalHeight()}stopDragging(B){this.isDragging=!1,this.$terminalContainer.style.borderTop="1px solid var(--popup-border-color)"}minimise(){try{this.isTerminalMinimized||(this.previousTerminalHeight=window.getComputedStyle(this.$terminalContainer).height,localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.$terminalContainer.style.height="0px",this.$terminalContainer.classList.add("hide"),this.isTerminalMinimized=!0,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),this.$showTermBtn.classList.remove("hide"))}catch(B){window.alert(B)}}maxmise(){this.isTerminalMinimized&&(parseInt(localStorage.getItem("AcodeX_Terminal_Cont_Height"))<=50?this.$terminalContainer.style.height="50px":this.$terminalContainer.style.height=localStorage.getItem("AcodeX_Terminal_Cont_Height")+"px",this.$terminalContainer.classList.remove("hide"),this.$terminalContent.style.height=`calc(100% - ${this.$terminalContainer.offsetHeight}px)`,this.fitTerminal(),localStorage.setItem("AcodeX_Terminal_Cont_Height",this.$terminalContainer.offsetHeight),this.$showTermBtn.classList.add("hide"),this.isTerminalMinimized=!1,localStorage.setItem("AcodeX_Terminal_Is_Minimised",this.isTerminalMinimized),this._updateTerminalHeight())}_convertPath(B){return B.startsWith("content://com.termux.documents/tree")?B.split("::")[1].substring(0,B.split("::")[1].lastIndexOf("/")).replace(/^\/data\/data\/com\.termux\/files\/home/,"$HOME"):B.startsWith("file:///storage/emulated/0/")?"/sdcard"+B.substr(26).replace(/\.[^/.]+$/,"").split("/").slice(0,-1).join("/")+"/":B.startsWith("content://com.android.externalstorage.documents/tree/primary")?"/sdcard/"+B.split("::primary:")[1].substring(0,B.split("::primary:")[1].lastIndexOf("/")):!1}async _cdToActiveDir(){let{activeFile:B}=editorManager,I=this._convertPath(B.uri);if(!I){window.toast("unsupported path type.",3e3);return}this.socket.send(`cd "${I}"\r`)}async destroy(){this.$style.remove(),this.xtermCss.remove(),await Ce(window.DATA_STORAGE+"acodex_fonts").delete(),editorManager.editor.commands.removeCommand("terminal:open_terminal"),editorManager.editor.commands.removeCommand("terminal:close_terminal"),this.$terminalContainer.remove(),this.$showTermBtn.remove(),document.removeEventListener("mousemove",this.dragFlotButton.bind(this)),document.removeEventListener("mouseup",this.stopDraggingFlotBtn.bind(this)),document.removeEventListener("touchmove",this.dragFlotButton.bind(this)),document.removeEventListener("touchend",this.stopDraggingFlotBtn.bind(this)),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),localStorage.removeItem("AcodeX_Terminal_Is_Minimised"),localStorage.removeItem("AcodeX_Current_Session"),localStorage.removeItem("AcodeX_Terminal_Cont_Height"),localStorage.removeItem("AcodeX_Is_Opened")}async setCustomFontFile(){let{url:B}=await acode.fileBrowser("file","select custom font stylesheet");if(!B)return;let I=this._convertPath(B);if(I.startsWith("/sdcard"))I=I.replace("/sdcard","file:///storage/emulated/0");else if(I.startsWith("$HOME"))return;let $=B.split("/"),M=$[$.length-1];I=I+"/"+M;let t=await at(I);this.settings.customFontStyleSheet=t,oe.update()}async applyTheme(B){let I=se[B];this.settings.theme=B,this.settings.background=I.background,this.settings.foreground=I.foreground,this.settings.cursor=I.cursor||"#fff",this.settings.cursorAccent=I.cursorAccent||"#fff",this.settings.selectionBackground=I.selectionBackground,this.settings.black=I.black,this.settings.blue=I.blue,this.settings.brightBlack=I.brightBlack,this.settings.brightBlue=I.brightBlue,this.settings.brightCyan=I.brightCyan,this.settings.brightGreen=I.brightGreen,this.settings.brightMagenta=I.brightMagenta,this.settings.brightRed=I.brightRed,this.settings.brightWhite=I.brightWhite,this.settings.brightYellow=I.brightYellow,this.settings.cyan=I.cyan,this.settings.green=I.green,this.settings.magenta=I.magenta,this.settings.red=I.red,this.settings.white=I.white,this.settings.yellow=I.yellow,oe.update()}hexToTransparentRGBA(B,I){B=B.replace("#","");let $=parseInt(B.substring(0,2),16),M=parseInt(B.substring(2,4),16),t=parseInt(B.substring(4,6),16);return`rgba(${$}, ${M}, ${t}, ${I})`}get terminalThemeObj(){return{background:this.settings.transparency?this.hexToTransparentRGBA(this.settings.background,.5):this.settings.background,foreground:this.settings.foreground,selectionBackground:this.settings.selectionBackground,cursor:this.settings.cursor,cursorAccent:this.settings.cursorAccent,black:this.settings.black,blue:this.settings.blue,brightBlack:this.settings.brightBlack,brightBlue:this.settings.brightBlue,brightCyan:this.settings.brightCyan,brightGreen:this.settings.brightGreen,brightMagenta:this.settings.brightMagenta,brightRed:this.settings.brightRed,brightWhite:this.settings.brightWhite,brightYellow:this.settings.brightYellow,cyan:this.settings.cyan,green:this.settings.green,magenta:this.settings.magenta,red:this.settings.red,white:this.settings.white,yellow:this.settings.yellow}}get terminalObj(){return new Ve.Terminal({allowTransparency:this.settings.transparency,allowProposedApi:!0,scrollOnUserInput:!0,cursorBlink:this.settings.cursorBlink,cursorStyle:this.settings.cursorStyle,cursorInactiveStyle:this.settings.cursorInactiveStyle,scrollBack:this.settings.scrollBack,scrollSensitivity:this.settings.scrollSensitivity,fontSize:this.settings.fontSize,fontFamily:this.settings.fontFamily,fontWeight:this.settings.fontWeight,theme:this.terminalThemeObj})}async clearCache(){await this.$cacheFile.writeFile(""),window.toast("Cache cleared \u{1F525}",3e3)}get fontsList(){return[[oe.get("editorFont"),"Default Editor Font","file file_type_font",!0],["Fira Code Bold Nerd Font","Fira Code Bold Nerd Font","file file_type_font",!0],["Fira Code Medium Nerd Font","Fira Code Medium Nerd Font","file file_type_font",!0],["JetBrains Mono Bold Nerd Font","JetBrains Mono Bold Nerd Font","file file_type_font",!0],["JetBrains Mono Medium Nerd Font","JetBrains Mono Medium Nerd Font","file file_type_font",!0],["VictorMonoNerdFont Bold","VictorMonoNerdFont Bold","file file_type_font",!0],["VictorMonoNerdFont BoldItalic","VictorMonoNerdFont BoldItalic","file file_type_font",!0],["VictorMonoNerdFont Medium","VictorMonoNerdFont Medium","file file_type_font",!0],["VictorMonoNerdFont Italic","VictorMonoNerdFont Italic","file file_type_font",!0],["SauceCodeProNerdFont Bold","SauceCodeProNerdFont Bold","file file_type_font",!0],["SauceCodeProNerdFont Medium","SauceCodeProNerdFont Medium","file file_type_font",!0],["MesloLGS NF Bold Italic","MesloLGS NF Bold Italic","file file_type_font",!0],["MesloLGS NF Bold","MesloLGS NF Bold","file file_type_font",!0],["MesloLGS NF Italic","MesloLGS NF Italic","file file_type_font",!0],["MesloLGS NF Regular","MesloLGS NF Regular","file file_type_font",!0]]}async downloadFont(){try{let B=window.DATA_STORAGE+"acodex_fonts",I="https://cdn.jsdelivr.net/gh/bajrangCoder/acode-plugin-acodex@main/fonts/",$=[I+"Fira Code Bold Nerd Font.ttf",I+"Fira Code Medium Nerd Font Complete Mono.ttf",I+"JetBrains Mono Bold Nerd Font Complete.ttf",I+"JetBrains Mono Medium Nerd Font Complete.ttf",I+"MesloLGS NF Bold Italic.ttf",I+"MesloLGS NF Bold.ttf",I+"MesloLGS NF Italic.ttf",I+"MesloLGS NF Regular.ttf",I+"SauceCodeProNerdFont-Bold.ttf",I+"SauceCodeProNerdFont-Medium.ttf",I+"VictorMonoNerdFont-Bold.ttf",I+"VictorMonoNerdFont-BoldItalic.ttf",I+"VictorMonoNerdFont-Italic.ttf",I+"VictorMonoNerdFont-Medium.ttf"];if(!await Ce(B).exists()){await Ce(window.DATA_STORAGE).createDirectory("acodex_fonts");let M=Xe.create("AcodeX","Downloading Fonts...");$.forEach(async t=>{let o=t.split("/").pop();M.setMessage(`Downloading Font: ${o}`),fetch(t).then(l=>l.blob()).then(async l=>{await Ce(B).createFile(o,l)}).catch(l=>{M.destroy(),window.toast(`Error fetching font file: ${l.toString()}`,4e3)})}),M.destroy(),window.toast("Fonts Downloaded successfully \u{1F4A5}",3e3)}}catch(B){console.log(B),Xe.destroy()}}get settingsObj(){return this.settings.theme==="custom"?{list:[{key:"port",text:"Server Port",value:this.settings.port,info:"Port which is displayed on termux when starting the server",prompt:"Server Port",promptType:"number",promptOption:[{required:!0}]},{key:"showTerminalBtnSize",text:"Show Terminal button size",value:this.settings.showTerminalBtnSize,info:"Size of terminal show button (in px)",prompt:"Show Terminal button size",promptType:"number",promptOption:[{required:!0}]},{key:"blurValue",text:"Blur Value(in px)",value:this.settings.blurValue,info:"Blur value for terminal in transparent mode",prompt:"Blur Value",promptType:"text",promptOption:[{required:!0}]},{key:"clearCache",text:"Clear Cache",info:"Helps in clearing cache which contains session details in case of any problems or bug"},{index:4,key:"customFontStyleSheet",text:"Custom Font Stylesheet file",info:"Select css file in which you have to define about your custom font.",value:this.settings.customFontStyleSheet},{key:"transparency",text:"Allow Transparent Terminal",info:"Makes terminal transparent but it will also led to slightly performance decrement",checkbox:!!this.settings.transparency},{index:0,key:"cursorBlink",text:"Cursor Blink",info:"Whether the cursor blinks.",checkbox:!!this.settings.cursorBlink},{key:"fontWeight",text:"Font Weight",value:this.settings.fontWeight,info:"The font weight used to render non-bold text.",select:this.FONT_WEIGHT},{index:1,key:"cursorStyle",text:"Cursor Style",value:this.settings.cursorStyle,info:"The style of the cursor.",select:[this.CURSOR_STYLE[0],this.CURSOR_STYLE[1],this.CURSOR_STYLE[2]]},{key:"cursorInactiveStyle",text:"Cursor Inactive Style",value:this.settings.cursorInactiveStyle,info:"The style of the cursor when the terminal is not focused.",select:this.CURSOR_INACTIVE_STYLE},{index:2,key:"fontSize",text:"Font Size",value:this.settings.fontSize,info:"The font size used to render text.",prompt:"Font Size",promptType:"text",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:3,key:"fontFamily",text:"Font Family",value:this.settings.fontFamily,info:"The font family used to render text.",select:this.fontsList},{index:5,key:"scrollBack",text:"Scroll Back",value:this.settings.scrollBack,info:"The amount of scrollback in the terminal. Scrollback is the amount of rows that are retained when lines are scrolled beyond the initial viewport.",prompt:"Scroll Back",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:6,key:"scrollSensitivity",text:"Scroll Sensitivity",value:this.settings.scrollSensitivity,info:"The scrolling speed multiplier used for adjusting normal scrolling speed.",prompt:"Scroll Sensitivity",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:7,key:"theme",text:"Theme",value:this.settings.theme,info:"Theme of terminal.",select:Ie},{index:8,key:"background",text:"Background Color",value:this.settings.background,color:this.settings.background},{index:8,key:"foreground",text:"Foreground Color",value:this.settings.foreground,color:this.settings.foreground},{index:9,key:"selectionBackground",text:"Selection Background Color",value:this.settings.selectionBackground,color:this.settings.selectionBackground},{key:"cursor",text:"Cursor Color",value:this.settings.cursor,color:this.settings.cursor},{key:"cursorAccent",text:"Cursor Accent Color",value:this.settings.cursorAccent,color:this.settings.cursorAccent},{index:10,key:"black",text:"Black Color",value:this.settings.black,color:this.settings.black},{index:11,key:"blue",text:"Blue Color",value:this.settings.blue,color:this.settings.blue},{index:12,key:"brightBlack",text:"Bright Black Color",value:this.settings.brightBlack,color:this.settings.brightBlack},{index:13,key:"brightBlue",text:"Bright Blue Color",value:this.settings.brightBlue,color:this.settings.brightBlue},{index:14,key:"brightCyan",text:"Bright Cyan Color",value:this.settings.brightCyan,color:this.settings.brightCyan},{index:15,key:"brightGreen",text:"Bright Green Color",value:this.settings.brightGreen,color:this.settings.brightGreen},{index:16,key:"brightMagenta",text:"Bright Magenta Color",value:this.settings.brightMagenta,color:this.settings.brightMagenta},{index:17,key:"brightRed",text:"Bright Red Color",value:this.settings.brightRed,color:this.settings.brightRed},{index:18,key:"brightWhite",text:"Bright White Color",value:this.settings.brightWhite,color:this.settings.brightWhite},{index:19,key:"brightYellow",text:"Bright Yellow Color",value:this.settings.brightYellow,color:this.settings.brightYellow},{index:20,key:"cyan",text:"Cyan Color",value:this.settings.cyan,color:this.settings.cyan},{index:21,key:"green",text:"Green Color",value:this.settings.green,color:this.settings.green},{index:22,key:"magenta",text:"Magenta Color",value:this.settings.magenta,color:this.settings.magenta},{index:23,key:"red",text:"Red Color",value:this.settings.red,color:this.settings.red},{index:24,key:"white",text:"White Color",value:this.settings.white,color:this.settings.white},{index:25,key:"yellow",text:"Yellow Color",value:this.settings.yellow,color:this.settings.yellow}],cb:(B,I)=>this.settingsSaveCallback(B,I)}:{list:[{key:"port",text:"Server Port",value:this.settings.port,info:"Port which is displayed on termux when starting the server",prompt:"Server Port",promptType:"number",promptOption:[{required:!0}]},{key:"fontWeight",text:"Font Weight",value:this.settings.fontWeight,info:"The font weight used to render non-bold text.",select:this.FONT_WEIGHT},{key:"showTerminalBtnSize",text:"Show Terminal button size",value:this.settings.showTerminalBtnSize,info:"Size of terminal show button (in px)",prompt:"Show Terminal button size",promptType:"number",promptOption:[{required:!0}]},{key:"blurValue",text:"Blur Value(in px)",value:this.settings.blurValue,info:"Blur value for terminal in transparent mode",prompt:"Blur Value",promptType:"text",promptOption:[{required:!0}]},{key:"clearCache",text:"Clear Cache",info:"Helps in clearing cache which contains session details in case of any problems or bug"},{key:"transparency",text:"Allow Transparent Terminal",info:"Makes terminal transparent but it will also led to slightly performance decrement",checkbox:!!this.settings.transparency},{index:7,key:"customFontStyleSheet",text:"Custom Font Stylesheet file",info:"Select css file in which you have to define about your custom font.",value:this.settings.customFontStyleSheet},{index:0,key:"cursorBlink",text:"Cursor Blink",info:"Whether the cursor blinks.",checkbox:!!this.settings.cursorBlink},{index:1,key:"cursorStyle",text:"Cursor Style",value:this.settings.cursorStyle,info:"The style of the cursor.",select:[this.CURSOR_STYLE[0],this.CURSOR_STYLE[1],this.CURSOR_STYLE[2]]},{key:"cursorInactiveStyle",text:"Cursor Inactive Style",value:this.settings.cursorInactiveStyle,info:"The style of the cursor when the terminal is not focused.",select:this.CURSOR_INACTIVE_STYLE},{index:2,key:"fontSize",text:"Font Size",value:this.settings.fontSize,info:"The font size used to render text.",prompt:"Font Size",promptType:"text",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:3,key:"fontFamily",text:"Font Family",value:this.settings.fontFamily,info:"The font family used to render text.",select:this.fontsList},{index:4,key:"scrollBack",text:"Scroll Back",value:this.settings.scrollBack,info:"The amount of scrollback in the terminal. Scrollback is the amount of rows that are retained when lines are scrolled beyond the initial viewport.",prompt:"Scroll Back",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:5,key:"scrollSensitivity",text:"Scroll Sensitivity",value:this.settings.scrollSensitivity,info:"The scrolling speed multiplier used for adjusting normal scrolling speed.",prompt:"Scroll Sensitivity",promptType:"number",promptOption:[{match:/^[0-9]+$/,required:!0}]},{index:6,key:"theme",text:"Theme",value:this.settings.theme,info:"Theme of terminal.",select:Ie}],cb:(B,I)=>this.settingsSaveCallback(B,I)}}settingsSaveCallback(B,I){switch(B){case"customFontStyleSheet":this.setCustomFontFile();break;case"theme":this.applyTheme(I),I==="custom"&&acode.alert("AcodeX Warning","Restart the app please"),this.$terminal&&(this.$terminal.options.theme=this.terminalThemeObj);break;case"clearCache":this.clearCache();break;case"showTerminalBtnSize":this.$showTermBtn&&(this.$showTermBtn.style.height=I+"px",this.$showTermBtn.style.width=I+"px");case"fontSize":this.$terminal&&(this.$terminal.options.fontSize=I),this.settings[B]=I,oe.update();break;case"fontFamily":this.$terminal&&(this.$terminal.options.fontFamily=I),this.settings[B]=I,oe.update();break;case"fontWeight":this.$terminal&&(this.$terminal.options.fontWeight=I),this.settings[B]=I,oe.update();break;case"cursorBlink":this.$terminal&&(this.$terminal.options.cursorBlink=I),this.settings[B]=I,oe.update();break;case"cursorStyle":this.$terminal&&(this.$terminal.options.cursorStyle=I),this.settings[B]=I,oe.update();break;case"cursorInactiveStyle":this.$terminal&&(this.$terminal.options.cursorInactiveStyle=I),this.settings[B]=I,oe.update();break;default:this.settings[B]=I,oe.update()}}get settings(){return oe.value[ge.id]}};if(window.acode){let V=new Pe;acode.setPluginInit(ge.id,async(B,I,{cacheFileUrl:$,cacheFile:M})=>{B.endsWith("/")||(B+="/"),V.baseUrl=B,await V.init(I,M,$)},V.settingsObj),acode.setPluginUnmount(ge.id,()=>{V.destroy()})}})(); diff --git a/src/main.js b/src/main.js index b195855..26a33bc 100644 --- a/src/main.js +++ b/src/main.js @@ -992,8 +992,8 @@ class AcodeX { newY; let buttonLeft = this.$showTermBtn.offsetLeft - newX; let totalHeaderHeight = - document.querySelector("#root header").offsetHeight + - document.querySelector("#root ul").offsetHeight; + document.querySelector("#root header")?.offsetHeight || 0 + + document.querySelector("#root ul")?.offsetHeight || 0; let maxX = window.innerWidth - this.$showTermBtn.offsetWidth; let maxY = window.innerHeight - @@ -1047,10 +1047,10 @@ class AcodeX { let newHeight = this.startHeight - diffY; const totalHeaderHeight = - document.querySelector("#root header").offsetHeight + - document.querySelector("#root ul").offsetHeight; + document.querySelector("#root header")?.offsetHeight || 0 + + document.querySelector("#root ul")?.offsetHeight || 0; const totalFooterHeight = - document.querySelector("#quick-tools").offsetHeight; + document.querySelector("#quick-tools")?.offsetHeight || 0; const maximumHeight = window.innerHeight - (totalHeaderHeight + totalFooterHeight); const minimumHeight = 100;