deckide 3.5.13 → 3.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/websocket.js
CHANGED
|
@@ -143,7 +143,7 @@ export function setupWebSocketServer(server, terminals) {
|
|
|
143
143
|
const session = terminals.get(id);
|
|
144
144
|
if (!session) {
|
|
145
145
|
untrackConnection(clientIP, socket);
|
|
146
|
-
socket.close(
|
|
146
|
+
socket.close(1000, 'Terminal not found');
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
session.sockets.add(socket);
|
package/package.json
CHANGED
|
@@ -104,10 +104,10 @@ void main() {
|
|
|
104
104
|
outColor = v_color;
|
|
105
105
|
}`)),this.register((0,g.toDisposable)(()=>k.deleteProgram(this._program))),this._projectionLocation=(0,d.throwIfFalsy)(k.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=k.createVertexArray(),k.bindVertexArray(this._vertexArrayObject);const M=new Float32Array([0,0,1,0,0,1,1,1]),O=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(O))),k.bindBuffer(k.ARRAY_BUFFER,O),k.bufferData(k.ARRAY_BUFFER,M,k.STATIC_DRAW),k.enableVertexAttribArray(3),k.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const N=new Uint8Array([0,1,2,3]),F=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(F))),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,F),k.bufferData(k.ELEMENT_ARRAY_BUFFER,N,k.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(k.createBuffer()),this.register((0,g.toDisposable)(()=>k.deleteBuffer(this._attributesBuffer))),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.enableVertexAttribArray(0),k.vertexAttribPointer(0,2,k.FLOAT,!1,w,0),k.vertexAttribDivisor(0,1),k.enableVertexAttribArray(1),k.vertexAttribPointer(1,2,k.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(1,1),k.enableVertexAttribArray(2),k.vertexAttribPointer(2,4,k.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(2,1),this._updateCachedColors(L.colors),this.register(this._themeService.onChangeColors(j=>{this._updateCachedColors(j),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),x.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.attributes,x.DYNAMIC_DRAW),x.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,p.count)}handleResize(){this._updateViewportRectangle()}setDimensions(p){this._dimensions=p}_updateCachedColors(p){this._bgFloat=this._colorToFloat32Array(p.background),this._cursorFloat=this._colorToFloat32Array(p.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(p){const x=this._terminal,D=this._vertices;let L,k,M,O,N,F,j,R,T,P,I,$=1;for(L=0;L<x.rows;L++){for(M=-1,O=0,N=0,F=!1,k=0;k<x.cols;k++)j=(L*x.cols+k)*u.RENDER_MODEL_INDICIES_PER_CELL,R=p.cells[j+u.RENDER_MODEL_BG_OFFSET],T=p.cells[j+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&T),(R!==O||T!==N&&(F||P))&&((O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,k,L)),M=k,O=R,N=T,F=P);(O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,x.cols,L))}D.count=$}updateCursor(p){const x=this._verticesCursor,D=p.cursor;if(!D||D.style==="block")return void(x.count=0);let L,k=0;D.style!=="bar"&&D.style!=="outline"||(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.style==="bar"?D.dpr*D.cursorWidth:D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),D.style!=="underline"&&D.style!=="outline"||(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,(D.y+1)*this._dimensions.device.cell.height-D.dpr,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat)),D.style==="outline"&&(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat),L=8*k++,this._addRectangleFloat(x.attributes,L,(D.x+D.width)*this._dimensions.device.cell.width-D.dpr,D.y*this._dimensions.device.cell.height,D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),x.count=k}_updateRectangle(p,x,D,L,k,M,O){if(67108864&D)switch(50331648&D){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&D].rgba;break;case 50331648:f=(16777215&D)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&L){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:f=(16777215&L)<<8;break;default:f=this._themeService.colors.background.rgba}p.attributes.length<x+4&&(p.attributes=(0,v.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),n=k*this._dimensions.device.cell.width,l=O*this._dimensions.device.cell.height,o=(f>>24&255)/255,c=(f>>16&255)/255,m=(f>>8&255)/255,y=1,this._addRectangle(p.attributes,x,n,l,(M-k)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,o,c,m,y)}_addRectangle(p,x,D,L,k,M,O,N,F,j){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=L/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O,p[x+5]=N,p[x+6]=F,p[x+7]=j}_addRectangleFloat(p,x,D,L,k,M,O){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=L/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O[0],p[x+5]=O[1],p[x+6]=O[2],p[x+7]=O[3]}_colorToFloat32Array(p){return new Float32Array([(p.rgba>>24&255)/255,(p.rgba>>16&255)/255,(p.rgba>>8&255)/255,(255&p.rgba)/255])}}s.RectangleRenderer=b},310:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=a(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(g,u){const v=g*u*s.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(C,s,a){var d=this&&this.__decorate||function(M,O,N,F){var j,R=arguments.length,T=R<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,N):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(M,O,N,F);else for(var P=M.length-1;P>=0;P--)(j=M[P])&&(T=(R<3?j(T):R>3?j(O,N,T):j(O,N))||T);return R>3&&T&&Object.defineProperty(O,N,T),T};Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const g=a(820),u=a(274),v=a(627),w=a(457),S=a(56),f=a(374),n=a(345),l=a(859),o=a(147),c=a(782),m=a(855),y=a(776),b=a(965),E=a(742),p=a(310),x=a(733);class D extends l.Disposable{constructor(O,N,F,j,R,T,P,I,$){super(),this._terminal=O,this._characterJoinerService=N,this._charSizeService=F,this._coreBrowserService=j,this._coreService=R,this._decorationService=T,this._optionsService=P,this._themeService=I,this._cursorBlinkStateManager=new l.MutableDisposable,this._charAtlasDisposable=this.register(new l.MutableDisposable),this._model=new p.RenderModel,this._workCell=new c.CellData,this._rectangleRenderer=this.register(new l.MutableDisposable),this._glyphRenderer=this.register(new l.MutableDisposable),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,P,this._themeService)],this.dimensions=(0,f.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const V={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",V),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",G=>{console.log("webglcontextlost event received"),G.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(G)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",G=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,v.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(G,K)=>this._setCanvasDevicePixelDimensions(G,K))),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,l.toDisposable)(()=>{var G;for(const K of this._renderLayers)K.dispose();(G=this._canvas.parentElement)===null||G===void 0||G.removeChild(this._canvas),(0,v.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var O;return(O=this._charAtlas)===null||O===void 0?void 0:O.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(O,N){var F,j,R,T;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const P of this._renderLayers)P.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`,(F=this._rectangleRenderer.value)===null||F===void 0||F.setDimensions(this.dimensions),(j=this._rectangleRenderer.value)===null||j===void 0||j.handleResize(),(R=this._glyphRenderer.value)===null||R===void 0||R.setDimensions(this.dimensions),(T=this._glyphRenderer.value)===null||T===void 0||T.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var O;for(const N of this._renderLayers)N.handleBlur(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.pause(),this._requestRedrawViewport()}handleFocus(){var O;for(const N of this._renderLayers)N.handleFocus(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.resume(),this._requestRedrawViewport()}handleSelectionChanged(O,N,F){for(const j of this._renderLayers)j.handleSelectionChanged(this._terminal,O,N,F);this._model.selection.update(this._terminal,O,N,F),this._requestRedrawViewport()}handleCursorMove(){var O;for(const N of this._renderLayers)N.handleCursorMove(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new E.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var O;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const N=(0,v.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!==N&&(this._onChangeTextureAtlas.fire(N.pages[0].canvas),this._charAtlasDisposable.value=(0,l.getDisposeArrayDisposable)([(0,n.forwardEvent)(N.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,n.forwardEvent)(N.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=N,this._charAtlas.warmUp(),(O=this._glyphRenderer.value)===null||O===void 0||O.setAtlas(this._charAtlas)}_clearModel(O){var N;this._model.clear(),O&&((N=this._glyphRenderer.value)===null||N===void 0||N.clear())}clearTextureAtlas(){var O;(O=this._charAtlas)===null||O===void 0||O.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var O;this._clearModel(!0);for(const N of this._renderLayers)N.reset(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(O){return-1}deregisterCharacterJoiner(O){return!1}renderRows(O,N){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(const F of this._renderLayers)F.handleGridChanged(this._terminal,O,N);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(O,N),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 w.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(O,N){const F=this._core;let j,R,T,P,I,$,V,G,K,J,B,z,W,U=this._workCell;O=k(O,F.rows-1,0),N=k(N,F.rows-1,0);const te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Y=Math.min(this._terminal.buffer.active.cursorX,F.cols-1);let oe=-1;const ge=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let fe=!1;for(R=O;R<=N;R++)for(T=R+F.buffer.ydisp,P=F.buffer.lines.get(T),this._model.lineLengths[R]=0,I=this._characterJoinerService.getJoinedCharacters(T),z=0;z<F.cols;z++)if(j=this._cellColorResolver.result.bg,P.loadCell(z,U),z===0&&(j=this._cellColorResolver.result.bg),$=!1,V=z,I.length>0&&z===I[0][0]&&($=!0,G=I.shift(),U=new L(U,P.translateToString(!0,G[0],G[1]),G[1]-G[0]),V=G[1]-1),K=U.getChars(),J=U.getCode(),B=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(U,z,T),ge&&T===te&&(z===Y&&(this._model.cursor={x:Y,y:this._terminal.buffer.active.cursorY,width:U.getWidth(),style:this._coreBrowserService.isFocused?F.options.cursorStyle||"block":F.options.cursorInactiveStyle,cursorWidth:F.options.cursorWidth,dpr:this._devicePixelRatio},oe=Y+U.getWidth()-1),z>=Y&&z<=oe&&(this._coreBrowserService.isFocused&&(F.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&F.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)),J!==m.NULL_CELL_CODE&&(this._model.lineLengths[R]=z+1),(this._model.cells[B]!==J||this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(fe=!0,K.length>1&&(J|=p.COMBINED_CHAR_BIT_MASK),this._model.cells[B]=J,this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(z,R,J,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,j),$))for(U=this._workCell,z++;z<V;z++)W=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(z,R,m.NULL_CELL_CODE,0,0,0,m.NULL_CELL_CHAR,0),this._model.cells[W]=m.NULL_CELL_CODE,this._model.cells[W+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;fe&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(O,N){this._canvas.width===O&&this._canvas.height===N||(this._canvas.width=O,this._canvas.height=N,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const O=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:O,end:O})}}s.WebglRenderer=D,d([y.traceCall],D.prototype,"renderRows",null);class L extends o.AttributeData{constructor(O,N,F){super(),this.content=0,this.combinedData="",this.fg=O.fg,this.bg=O.bg,this.combinedData=N,this._width=F}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(O){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function k(M,O,N=0){return Math.max(Math.min(M,O),N)}s.JoinedCellData=L},381:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const d=a(374);function g(u,v,w){const S=(0,d.throwIfFalsy)(u.createShader(v));if(u.shaderSource(S,w),u.compileShader(S),u.getShaderParameter(S,u.COMPILE_STATUS))return S;console.error(u.getShaderInfoLog(S)),u.deleteShader(S)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,v,w){const S=(0,d.throwIfFalsy)(u.createProgram());if(u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.VERTEX_SHADER,v))),u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.FRAGMENT_SHADER,w))),u.linkProgram(S),u.getProgramParameter(S,u.LINK_STATUS))return S;console.error(u.getProgramInfoLog(S)),u.deleteProgram(S)},s.createShader=g,s.expandFloat32Array=function(u,v){const w=Math.min(2*u.length,v),S=new Float32Array(w);for(let f=0;f<u.length;f++)S[f]=u[f];return S},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const d=a(627),g=a(237),u=a(374),v=a(859);class w extends v.Disposable{constructor(f,n,l,o,c,m,y,b){super(),this._container=n,this._alpha=c,this._coreBrowserService=m,this._optionsService=y,this._themeService=b,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-${l}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(E=>{this._refreshCharAtlas(f,E),this.reset(f)})),this.register((0,v.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,l){}handleSelectionChanged(f,n,l,o=!1){}_setTransparency(f,n){if(n===this._alpha)return;const l=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,l=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,l*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(f,n,l,o){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(f,n,l,o){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(l,o,n.getWidth()),this._ctx.fillText(n.getChars(),l*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,l){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,l){return`${l?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}s.BaseRenderLayer=w},733:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const d=a(197),g=a(237),u=a(592);class v extends u.BaseRenderLayer{constructor(S,f,n,l,o,c,m){super(n,S,"link",f,!0,o,c,m),this.register(l.onShowLinkUnderline(y=>this._handleShowLinkUnderline(y))),this.register(l.onHideLinkUnderline(y=>this._handleHideLinkUnderline(y)))}resize(S,f){super.resize(S,f),this._state=void 0}reset(S){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg!==void 0&&(0,d.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let f=S.y1+1;f<S.y2;f++)this._fillBottomLineAtCells(0,f,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}s.LinkRenderLayer=v},820:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},274:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;let a,d=0,g=0,u=!1,v=!1,w=!1;s.CellColorResolver=class{constructor(S,f,n,l,o){this._terminal=S,this._selectionRenderModel=f,this._decorationService=n,this._coreBrowserService=l,this._themeService=o,this.result={fg:0,bg:0,ext:0}}resolve(S,f,n){this.result.bg=S.bg,this.result.fg=S.fg,this.result.ext=268435456&S.bg?S.extended.ext:0,g=0,d=0,v=!1,u=!1,w=!1,a=this._themeService.colors,this._decorationService.forEachDecorationAtCell(f,n,"bottom",l=>{l.backgroundColorRGB&&(g=l.backgroundColorRGB.rgba>>8&16777215,v=!0),l.foregroundColorRGB&&(d=l.foregroundColorRGB.rgba>>8&16777215,u=!0)}),w=this._selectionRenderModel.isCellSelected(this._terminal,f,n),w&&(g=(this._coreBrowserService.isFocused?a.selectionBackgroundOpaque:a.selectionInactiveBackgroundOpaque).rgba>>8&16777215,v=!0,a.selectionForeground&&(d=a.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(f,n,"top",l=>{l.backgroundColorRGB&&(g=l.backgroundColorRGB.rgba>>8&16777215,v=!0),l.foregroundColorRGB&&(d=l.foregroundColorRGB.rgba>>8&16777215,u=!0)}),v&&(g=w?-16777216&S.bg&-134217729|g|50331648:-16777216&S.bg|g|50331648),u&&(d=-16777216&S.fg&-67108865|d|50331648),67108864&this.result.fg&&(v&&!u&&(d=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&a.background.rgba>>8|50331648,u=!0),!v&&u&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&a.foreground.rgba>>8|50331648,v=!0)),a=void 0,this.result.bg=v?g:this.result.bg,this.result.fg=u?d:this.result.fg}}},627:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const d=a(509),g=a(197),u=[];s.acquireTextureAtlas=function(v,w,S,f,n,l,o,c){const m=(0,g.generateConfig)(f,n,l,o,w,S,c);for(let E=0;E<u.length;E++){const p=u[E],x=p.ownedBy.indexOf(v);if(x>=0){if((0,g.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),u.splice(E,1)):p.ownedBy.splice(x,1);break}}for(let E=0;E<u.length;E++){const p=u[E];if((0,g.configEquals)(p.config,m))return p.ownedBy.push(v),p.atlas}const y=v._core,b={atlas:new d.TextureAtlas(document,m,y.unicodeService),config:m,ownedBy:[v]};return u.push(b),b.atlas},s.removeTerminalFromCache=function(v){for(let w=0;w<u.length;w++){const S=u[w].ownedBy.indexOf(v);if(S!==-1){u[w].ownedBy.length===1?(u[w].atlas.dispose(),u.splice(w,1)):u[w].ownedBy.splice(S,1);break}}}},197:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const d=a(160);s.generateConfig=function(g,u,v,w,S,f,n){const l={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:n,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:g,deviceCellHeight:u,deviceCharWidth:v,deviceCharHeight:w,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:l}},s.configEquals=function(g,u){for(let v=0;v<g.colors.ansi.length;v++)if(g.colors.ansi[v].rgba!==u.colors.ansi[v].rgba)return!1;return g.devicePixelRatio===u.devicePixelRatio&&g.customGlyphs===u.customGlyphs&&g.lineHeight===u.lineHeight&&g.letterSpacing===u.letterSpacing&&g.fontFamily===u.fontFamily&&g.fontSize===u.fontSize&&g.fontWeight===u.fontWeight&&g.fontWeightBold===u.fontWeightBold&&g.allowTransparency===u.allowTransparency&&g.deviceCharWidth===u.deviceCharWidth&&g.deviceCharHeight===u.deviceCharHeight&&g.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&g.minimumContrastRatio===u.minimumContrastRatio&&g.colors.foreground.rgba===u.colors.foreground.rgba&&g.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(a,d){this._renderCallback=a,this._coreBrowserService=d,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(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}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:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const d=a(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{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}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{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}],"🮖":[{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}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{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"},"┉":{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"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{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},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{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},"":{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},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(f,n,l,o,c,m,y,b){const E=s.blockElementDefinitions[n];if(E)return function(L,k,M,O,N,F){for(let j=0;j<k.length;j++){const R=k[j],T=N/8,P=F/8;L.fillRect(M+R.x*T,O+R.y*P,R.w*T,R.h*P)}}(f,E,l,o,c,m),!0;const p=g[n];if(p)return function(L,k,M,O,N,F){let j=u.get(k);j||(j=new Map,u.set(k,j));const R=L.fillStyle;if(typeof R!="string")throw new Error(`Unexpected fillStyle type "${R}"`);let T=j.get(R);if(!T){const P=k[0].length,I=k.length,$=document.createElement("canvas");$.width=P,$.height=I;const V=(0,d.throwIfFalsy)($.getContext("2d")),G=new ImageData(P,I);let K,J,B,z;if(R.startsWith("#"))K=parseInt(R.slice(1,3),16),J=parseInt(R.slice(3,5),16),B=parseInt(R.slice(5,7),16),z=R.length>7&&parseInt(R.slice(7,9),16)||1;else{if(!R.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${R}" when drawing pattern glyph`);[K,J,B,z]=R.substring(5,R.length-1).split(",").map(W=>parseFloat(W))}for(let W=0;W<I;W++)for(let U=0;U<P;U++)G.data[4*(W*P+U)]=K,G.data[4*(W*P+U)+1]=J,G.data[4*(W*P+U)+2]=B,G.data[4*(W*P+U)+3]=k[W][U]*(255*z);V.putImageData(G,0,0),T=(0,d.throwIfFalsy)(L.createPattern($,null)),j.set(R,T)}L.fillStyle=T,L.fillRect(M,O,N,F)}(f,p,l,o,c,m),!0;const x=s.boxDrawingDefinitions[n];if(x)return function(L,k,M,O,N,F,j){L.strokeStyle=L.fillStyle;for(const[R,T]of Object.entries(k)){let P;L.beginPath(),L.lineWidth=j*Number.parseInt(R),P=typeof T=="function"?T(.15,.15/F*N):T;for(const I of P.split(" ")){const $=I[0],V=w[$];if(!V){console.error(`Could not find drawing instructions for "${$}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&V(L,S(G,N,F,M,O,!0,j))}L.stroke(),L.closePath()}}(f,x,l,o,c,m,b),!0;const D=s.powerlineDefinitions[n];return!!D&&(function(L,k,M,O,N,F,j,R){var T,P;const I=new Path2D;I.rect(M,O,N,F),L.clip(I),L.beginPath();const $=j/12;L.lineWidth=R*$;for(const V of k.d.split(" ")){const G=V[0],K=w[G];if(!K){console.error(`Could not find drawing instructions for "${G}"`);continue}const J=V.substring(1).split(",");J[0]&&J[1]&&K(L,S(J,N,F,M,O,!1,R,((T=k.leftPadding)!==null&&T!==void 0?T:0)*($/2),((P=k.rightPadding)!==null&&P!==void 0?P:0)*($/2)))}k.type===1?(L.strokeStyle=L.fillStyle,L.stroke()):L.fill(),L.closePath()}(f,D,l,o,c,m,y,b),!0)};const u=new Map;function v(f,n,l=0){return Math.max(Math.min(f,n),l)}const w={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function S(f,n,l,o,c,m,y,b=0,E=0){const p=f.map(x=>parseFloat(x)||parseInt(x));if(p.length<2)throw new Error("Too few arguments for instruction");for(let x=0;x<p.length;x+=2)p[x]*=n-b*y-E*y,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,n,0)),p[x]+=o+b*y;for(let x=1;x<p.length;x+=2)p[x]*=l,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,l,0)),p[x]+=c;return p}},56:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const d=a(859);s.observeDevicePixelDimensions=function(g,u,v){let w=new u.ResizeObserver(S=>{const f=S.find(o=>o.target===g);if(!f)return;if(!("devicePixelContentBoxSize"in f))return w==null||w.disconnect(),void(w=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,l=f.devicePixelContentBoxSize[0].blockSize;n>0&&l>0&&v(n,l)});try{w.observe(g,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)(()=>w==null?void 0:w.disconnect())}},374:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.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:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,u,v,w=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const S=u[1]-g.buffer.active.viewportY,f=v[1]-g.buffer.active.viewportY,n=Math.max(S,0),l=Math.min(f,g.rows-1);n>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=S,this.viewportEndRow=f,this.viewportCappedStartRow=n,this.viewportCappedEndRow=l,this.startCol=u[0],this.endCol=v[0])}isCellSelected(g,u,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},509:function(C,s,a){var d=this&&this.__decorate||function(D,L,k,M){var O,N=arguments.length,F=N<3?L:M===null?M=Object.getOwnPropertyDescriptor(L,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,L,k,M);else for(var j=D.length-1;j>=0;j--)(O=D[j])&&(F=(N<3?O(F):N>3?O(L,k,F):O(L,k))||F);return N>3&&F&&Object.defineProperty(L,k,F),F};Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const g=a(237),u=a(860),v=a(374),w=a(160),S=a(345),f=a(485),n=a(385),l=a(147),o=a(855),c=a(776),m={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}};let y;class b{get pages(){return this._pages}constructor(L,k,M){this._document=L,this._config=k,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new f.FourKeyMap,this._cacheMapCombined=new f.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new l.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=x(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,v.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new n.IdleTaskQueue;for(let k=33;k<126;k++)L.enqueue(()=>{if(!this._cacheMap.get(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const M=this._drawToCache(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const k=this._pages.filter(T=>2*T.canvas.width<=(b.maxTextureSize||4096)).sort((T,P)=>P.canvas.width!==T.canvas.width?P.canvas.width-T.canvas.width:P.percentageUsed-T.percentageUsed);let M=-1,O=0;for(let T=0;T<k.length;T++)if(k[T].canvas.width!==O)M=T,O=k[T].canvas.width;else if(T-M==3)break;const N=k.slice(M,M+4),F=N.map(T=>T.glyphs[0].texturePage).sort((T,P)=>T>P?1:-1),j=this.pages.length-N.length,R=this._mergePages(N,j);R.version++;for(let T=F.length-1;T>=0;T--)this._deletePage(F[T]);this.pages.push(R),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(R.canvas)}const L=new E(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,k){const M=2*L[0].canvas.width,O=new E(this._document,M,L);for(const[N,F]of L.entries()){const j=N*F.canvas.width%M,R=Math.floor(N/2)*F.canvas.height;O.ctx.drawImage(F.canvas,j,R);for(const P of F.glyphs)P.texturePage=k,P.sizeClipSpace.x=P.size.x/M,P.sizeClipSpace.y=P.size.y/M,P.texturePosition.x+=j,P.texturePosition.y+=R,P.texturePositionClipSpace.x=P.texturePosition.x/M,P.texturePositionClipSpace.y=P.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(F.canvas);const T=this._activePages.indexOf(F);T!==-1&&this._activePages.splice(T,1)}return O}_deletePage(L){this._pages.splice(L,1);for(let k=L;k<this._pages.length;k++){const M=this._pages[k];for(const O of M.glyphs)O.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(L,k,M,O,N){return this._getFromCacheMap(this._cacheMapCombined,L,k,M,O,N)}getRasterizedGlyph(L,k,M,O,N){return this._getFromCacheMap(this._cacheMap,L,k,M,O,N)}_getFromCacheMap(L,k,M,O,N,F=!1){return y=L.get(k,M,O,N),y||(y=this._drawToCache(k,M,O,N,F),L.set(k,M,O,N,y)),y}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,k,M,O){if(this._config.allowTransparency)return w.NULL_COLOR;let N;switch(L){case 16777216:case 33554432:N=this._getColorFromAnsiIndex(k);break;case 50331648:const F=l.AttributeData.toColorRGB(k);N=w.rgba.toColor(F[0],F[1],F[2]);break;default:N=M?w.color.opaque(this._config.colors.foreground):this._config.colors.background}return N}_getForegroundColor(L,k,M,O,N,F,j,R,T,P){const I=this._getMinimumContrastColor(L,k,M,O,N,F,!1,T,R,P);if(I)return I;let $;switch(N){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&F<8&&(F+=8),$=this._getColorFromAnsiIndex(F);break;case 50331648:const V=l.AttributeData.toColorRGB(F);$=w.rgba.toColor(V[0],V[1],V[2]);break;default:$=j?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=w.color.opaque($)),R&&($=w.color.multiplyOpacity($,g.DIM_OPACITY)),$}_resolveBackgroundRgba(L,k,M){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,k,M,O){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&O&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,k,M,O,N,F,j,R,T,P){if(this._config.minimumContrastRatio===1||P)return;const I=this._getContrastCache(T),$=I.getColor(L,O);if($!==void 0)return $||void 0;const V=this._resolveBackgroundRgba(k,M,j),G=this._resolveForegroundRgba(N,F,j,R),K=w.rgba.ensureContrastRatio(V,G,this._config.minimumContrastRatio/(T?2:1));if(!K)return void I.setColor(L,O,null);const J=w.rgba.toColor(K>>24&255,K>>16&255,K>>8&255);return I.setColor(L,O,J),J}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,k,M,O,N=!1){const F=typeof L=="number"?String.fromCharCode(L):L,j=Math.min(this._config.deviceCellWidth*Math.max(F.length,2)+4,this._textureSize);this._tmpCanvas.width<j&&(this._tmpCanvas.width=j);const R=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<R&&(this._tmpCanvas.height=R),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=O,this._workAttributeData.isInvisible())return m;const T=!!this._workAttributeData.isBold(),P=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),V=!!this._workAttributeData.isUnderline(),G=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let J=this._workAttributeData.getFgColor(),B=this._workAttributeData.getFgColorMode(),z=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(P){const ee=J;J=z,z=ee;const ue=B;B=W,W=ue}const U=this._getBackgroundColor(W,z,P,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const te=T?this._config.fontWeightBold:this._config.fontWeight,Y=$?"italic":"";this._tmpCtx.font=`${Y} ${te} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const oe=F.length===1&&(0,v.isPowerlineGlyph)(F.charCodeAt(0)),ge=F.length===1&&(0,v.isRestrictedPowerlineGlyph)(F.charCodeAt(0)),fe=this._getForegroundColor(k,W,z,M,B,J,P,I,T,(0,v.excludeFromContrastRatioDemands)(F.charCodeAt(0)));this._tmpCtx.fillStyle=fe.css;const he=ge?0:4;let ie=!1;this._config.customGlyphs!==!1&&(ie=(0,u.tryDrawCustomChar)(this._tmpCtx,F,he,he,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let De,mt=!oe;if(De=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),V){this._tmpCtx.save();const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;if(this._tmpCtx.lineWidth=ee,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())mt=!1,this._tmpCtx.strokeStyle=`rgb(${l.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{mt=!1;let Ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ae<8&&(Ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ae).css}this._tmpCtx.beginPath();const Ie=he,pe=Math.ceil(he+this._config.deviceCharHeight)-ue-(N?2*ee:0),Ct=pe+ee,$e=pe+2*ee;for(let Ae=0;Ae<De;Ae++){this._tmpCtx.save();const se=Ie+Ae*this._config.deviceCellWidth,ze=Ie+(Ae+1)*this._config.deviceCellWidth,li=se+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe),this._tmpCtx.moveTo(se,$e),this._tmpCtx.lineTo(ze,$e);break;case 3:const kr=ee<=1?$e:Math.ceil(he+this._config.deviceCharHeight-ee/2)-ue,Rr=ee<=1?pe:Math.ceil(he+this._config.deviceCharHeight+ee/2)-ue,ss=new Path2D;ss.rect(se,pe,this._config.deviceCellWidth,$e-pe),this._tmpCtx.clip(ss),this._tmpCtx.moveTo(se-this._config.deviceCellWidth/2,Ct),this._tmpCtx.bezierCurveTo(se-this._config.deviceCellWidth/2,Rr,se,Rr,se,Ct),this._tmpCtx.bezierCurveTo(se,kr,li,kr,li,Ct),this._tmpCtx.bezierCurveTo(li,Rr,ze,Rr,ze,Ct),this._tmpCtx.bezierCurveTo(ze,kr,ze+this._config.deviceCellWidth/2,kr,ze+this._config.deviceCellWidth/2,Ct);break;case 4:this._tmpCtx.setLineDash([Math.round(ee),Math.round(ee)]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;default:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ie&&this._config.fontSize>=12&&!this._config.allowTransparency&&F!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ae=this._tmpCtx.measureText(F);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ae&&Ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const se=new Path2D;se.rect(Ie,pe-Math.ceil(ee/2),this._config.deviceCellWidth*De,$e-pe+Math.ceil(ee/2)),this._tmpCtx.clip(se),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText(F,he,he+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+ue),this._tmpCtx.stroke()}if(ie||this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight),F==="_"&&!this._config.allowTransparency){let ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt);if(ee)for(let ue=1;ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight-ue),ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt),ee);ue++);}if(G){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const yt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Wt;if(Wt=this._config.allowTransparency?function(ee){for(let ue=0;ue<ee.data.length;ue+=4)if(ee.data[ue+3]>0)return!1;return!0}(yt):p(yt,U,fe,mt),Wt)return m;const le=this._findGlyphBoundingBox(yt,this._workBoundingBox,j,ge,ie,he);let re,ne;for(;;){if(this._activePages.length===0){const ee=this._createNewPage();re=ee,ne=ee.currentRow,ne.height=le.size.y;break}re=this._activePages[this._activePages.length-1],ne=re.currentRow;for(const ee of this._activePages)le.size.y<=ee.currentRow.height&&(re=ee,ne=ee.currentRow);for(let ee=this._activePages.length-1;ee>=0;ee--)for(const ue of this._activePages[ee].fixedRows)ue.height<=ne.height&&le.size.y<=ue.height&&(re=this._activePages[ee],ne=ue);if(ne.y+le.size.y>=re.canvas.height||ne.height>le.size.y+2){let ee=!1;if(re.currentRow.y+re.currentRow.height+le.size.y>=re.canvas.height){let ue;for(const Ie of this._activePages)if(Ie.currentRow.y+Ie.currentRow.height+le.size.y<Ie.canvas.height){ue=Ie;break}if(ue)re=ue;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&ne.y+le.size.y<=re.canvas.height&&ne.height>=le.size.y&&ne.x+le.size.x<=re.canvas.width)ee=!0;else{const Ie=this._createNewPage();re=Ie,ne=Ie.currentRow,ne.height=le.size.y,ee=!0}}ee||(re.currentRow.height>0&&re.fixedRows.push(re.currentRow),ne={x:0,y:re.currentRow.y+re.currentRow.height,height:le.size.y},re.fixedRows.push(ne),re.currentRow={x:0,y:ne.y+ne.height,height:0})}if(ne.x+le.size.x<=re.canvas.width)break;ne===re.currentRow?(ne.x=0,ne.y+=ne.height,ne.height=0):re.fixedRows.splice(re.fixedRows.indexOf(ne),1)}return le.texturePage=this._pages.indexOf(re),le.texturePosition.x=ne.x,le.texturePosition.y=ne.y,le.texturePositionClipSpace.x=ne.x/re.canvas.width,le.texturePositionClipSpace.y=ne.y/re.canvas.height,le.sizeClipSpace.x/=re.canvas.width,le.sizeClipSpace.y/=re.canvas.height,ne.height=Math.max(ne.height,le.size.y),ne.x+=le.size.x,re.ctx.putImageData(yt,le.texturePosition.x-this._workBoundingBox.left,le.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,le.size.x,le.size.y),re.addGlyph(le),re.version++,le}_findGlyphBoundingBox(L,k,M,O,N,F){k.top=0;const j=O?this._config.deviceCellHeight:this._tmpCanvas.height,R=O?this._config.deviceCellWidth:M;let T=!1;for(let P=0;P<j;P++){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(L.data[$]!==0){k.top=P,T=!0;break}}if(T)break}k.left=0,T=!1;for(let P=0;P<F+R;P++){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(L.data[$]!==0){k.left=P,T=!0;break}}if(T)break}k.right=R,T=!1;for(let P=F+R-1;P>=F;P--){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(L.data[$]!==0){k.right=P,T=!0;break}}if(T)break}k.bottom=j,T=!1;for(let P=j-1;P>=0;P--){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(L.data[$]!==0){k.bottom=P,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+F+(O||N?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+F+(O||N?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=b,d([c.traceCall],b.prototype,"_drawToCache",null);class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,k,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const O of M)this._glyphs.push(...O.glyphs),this._usedPixels+=O._usedPixels;this.canvas=x(L,k,k),this.ctx=(0,v.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function p(D,L,k,M){const O=L.rgba>>>24,N=L.rgba>>>16&255,F=L.rgba>>>8&255,j=k.rgba>>>24,R=k.rgba>>>16&255,T=k.rgba>>>8&255,P=Math.floor((Math.abs(O-j)+Math.abs(N-R)+Math.abs(F-T))/12);let I=!0;for(let $=0;$<D.data.length;$+=4)D.data[$]===O&&D.data[$+1]===N&&D.data[$+2]===F||M&&Math.abs(D.data[$]-O)+Math.abs(D.data[$+1]-N)+Math.abs(D.data[$+2]-F)<P?D.data[$+3]=0:I=!1;return I}function x(D,L,k){const M=D.createElement("canvas");return M.width=L,M.height=k,M}},160:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(399);let g=0,u=0,v=0,w=0;var S,f,n,l,o;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=o.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,L=p.rgba>>8&255,k=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return g=k+Math.round((x-k)*w),u=M+Math.round((D-M)*w),v=O+Math.round((L-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=o.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return o.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=o.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),o.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),o.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),o.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,L=p/255,k=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(l||(s.rgb=l={})),function(y){function b(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O>0||N>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),F-=Math.max(0,Math.ceil(.1*F)),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}function E(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O<255||N<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=Math.min(255,F+Math.ceil(.1*(255-F))),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const L=l.relativeLuminance(p>>8),k=l.relativeLuminance(x>>8);if(m(L,k)<D){if(k<L){const N=b(p,x,D),F=m(L,l.relativeLuminance(N>>8));if(F<D){const j=E(p,x,D);return F>m(L,l.relativeLuminance(j>>8))?N:j}return N}const M=E(p,x,D),O=m(L,l.relativeLuminance(M>>8));if(O<D){const N=b(p,x,D);return O>m(L,l.relativeLuminance(N>>8))?M:N}return M}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,L){return{css:S.toCss(p,x,D,L),rgba:S.toRgba(p,x,D,L)}}}(o||(s.rgba=o={})),s.toPaddedHex=c,s.contrastRatio=m},345:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},859:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},485:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},399:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},385:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),l=w.timeRemaining(),1.5*f>l)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=l}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},782:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(133),g=a(855),u=a(147);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},855:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,l=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;l<x;){if(l>=g)return 0;if(b=a[l++],(192&b)!=128){l--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?l--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const o=g-4;let c=l;for(;c<g;){for(;!(!(c<o)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(859),v=a(97),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}debug(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}info(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,l)}warn(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,l)}error(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,l)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,l,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},726:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,l){n[a]===n?n[d].push({id:f,index:l}):(n[d]=[{id:f,index:l}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},97:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(726);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebglAddon=void 0;const s=h(345),a=h(859),d=h(399),g=h(666),u=h(776);class v extends a.Disposable{constructor(S){if(d.isSafari&&(0,d.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=S,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(S){const f=S._core;if(!S.element)return void this.register(f.onWillOpen(()=>this.activate(S)));this._terminal=S;const n=f.coreService,l=f.optionsService,o=f,c=o._renderService,m=o._characterJoinerService,y=o._charSizeService,b=o._coreBrowserService,E=o._decorationService,p=o._logService,x=o._themeService;(0,u.setTraceLogger)(p),this._renderer=this.register(new g.WebglRenderer(S,m,y,b,n,E,l,x,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const D=this._terminal._core._renderService;D.setRenderer(this._terminal._core._createRenderer()),D.handleResize(S.cols,S.rows)}))}get textureAtlas(){var S;return(S=this._renderer)===null||S===void 0?void 0:S.textureAtlas}clearTextureAtlas(){var S;(S=this._renderer)===null||S===void 0||S.clearTextureAtlas()}}C.WebglAddon=v})(),_})())})(td);var Vp=td.exports;const Kp="",Gp="",rd="保存しました。",qp="デッキを作成する前にワークスペースを追加してください。",Xp="ワークスペースを選択してください。",Yp=2e3,id='"JetBrains Mono", monospace',sd=14,Qp='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',Jp=13,dc="#000000",fc="#ffffff",nd="deck-theme",Zp=204;async function ce(e,t={}){const r=await fetch(`${Kp}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Zp?null:r.json()}const Ge="application/json",st="POST",od="PUT",rs="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ce("/api/ws-token")}function rv(){return ce("/api/workspaces")}function iv(){return ce("/api/config")}function sv(e){return ce("/api/workspaces",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({path:e})})}function nv(e){return ce(`/api/workspaces/${e}`,{method:rs})}function ov(){return ce("/api/decks")}function lv(e,t){return ce("/api/decks",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ce(`/api/decks/${e}`,{method:rs})}function cv(e){return ce("/api/decks/order",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({deckIds:e})})}function _c(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/files?${r.toString()}`)}function pc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ce(`/api/preview?${r.toString()}`)}function hv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`)}function uv(e,t,r){return ce("/api/file",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ce("/api/file",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`,{method:rs})}function _v(e,t){return ce("/api/dir",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t})})}function pv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/dir?${r.toString()}`,{method:rs})}function vv(e,t,r){return ce("/api/terminals",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({deckId:e,title:t,command:r})})}function gv(e){const t=new URLSearchParams({deckId:e});return ce(`/api/terminals?${t.toString()}`)}function mv(e){return ce(`/api/terminals/${e}`,{method:rs})}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ce(`/api/git/repos?${t.toString()}`)}function ad(e,t,r){return ce("/api/git/stage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function cd(e,t,r){return ce("/api/git/unstage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Cv(e,t,r){return ce("/api/git/commit",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Sv(e,t,r){return ce("/api/git/discard",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const h={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(h.repoPath=i);const _=new URLSearchParams(h);return ce(`/api/git/diff?${_.toString()}`)}function xv(e,t){return ce("/api/git/push",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ce("/api/git/pull",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ce("/api/git/fetch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function hd(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branch-status?${i.toString()}`)}function ud(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/remotes?${i.toString()}`)}function Lv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branches?${i.toString()}`)}function kv(e,t,r){return ce("/api/git/checkout",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Rv(e,t,r=!0,i){return ce("/api/git/create-branch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Dv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const h=new URLSearchParams(i);return ce(`/api/git/log?${h.toString()}`)}const Av="ターミナルを起動しました: ",Tv="接続しました。",vc="接続が終了しました。",Mv="\0resize:",gc=5,mc=1e3;function Pv({session:e,wsUrl:t,onDelete:r}){const i=H.useRef(null),h=H.useRef(null),_=H.useRef(null),C=H.useRef(null),s=H.useRef(0);return H.useEffect(()=>{if(!i.current)return;s.current=0,i.current.innerHTML="";const a=new $p.Terminal({cursorBlink:!0,fontFamily:Qp,fontSize:Jp,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,theme:{background:dc,foreground:fc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),d=new zp.FitAddon,g=new Up.Unicode11Addon,u=new Wp.WebLinksAddon;a.loadAddon(d),a.loadAddon(g),a.loadAddon(u),a.unicode.activeVersion="11",h.current=d,a.open(i.current);try{const D=new Vp.WebglAddon;a.loadAddon(D),_.current=D,D.onContextLoss(()=>{console.warn("[WebGL] Context lost, disposing addon");try{D.dispose(),_.current=null}catch(L){console.error("[WebGL] Error disposing after context loss:",L)}})}catch(D){console.warn("[WebGL] Failed to load WebGL addon, using canvas renderer:",D),_.current=null}let v=!0;const w=D=>{if(v)return;const L=C.current;L&&L.readyState===WebSocket.OPEN&&L.send(D)};a.parser.registerCsiHandler({final:"n"},D=>{const L=D.length>0?D[0]:0;if(L===6){const k=a.buffer.active,M=k.cursorY+k.baseY+1,O=k.cursorX+1;return w(`\x1B[${M};${O}R`),!0}else if(L===5)return w("\x1B[0n"),!0;return!1}),a.parser.registerCsiHandler({final:"c"},D=>(w("\x1B[?62;1;2;4;6;7;8;9;15;22c"),!0)),a.parser.registerCsiHandler({prefix:">",final:"c"},D=>(w("\x1B[>1;500;0c"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},D=>{const L=D[0]||0;let k=0;const M=[1,25,1049,2004,1004,1006,1002],O=[2026,1e3,1003];return M.includes(L)?k=1:O.includes(L)&&(k=2),w(`\x1B[?${L};${k}$y`),!0});const S=D=>(D*257).toString(16).padStart(4,"0");a.parser.registerOscHandler(10,D=>{if(D==="?"){const L=fc,k=parseInt(L.slice(1,3),16),M=parseInt(L.slice(3,5),16),O=parseInt(L.slice(5,7),16);return w(`\x1B]10;rgb:${S(k)}/${S(M)}/${S(O)}\x07`),!0}return!1}),a.parser.registerOscHandler(11,D=>{if(D==="?"){const L=dc,k=parseInt(L.slice(1,3),16),M=parseInt(L.slice(3,5),16),O=parseInt(L.slice(5,7),16);return w(`\x1B]11;rgb:${S(k)}/${S(M)}/${S(O)}\x07`),!0}return!1}),a.parser.registerOscHandler(12,D=>D==="?"?(w("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),a.parser.registerOscHandler(4,D=>{const L=D.match(/^(\d+);?\?$/);if(L){const k=parseInt(L[1]),M=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],O=k<8?M[k]:"0000/0000/0000";return w(`\x1B]4;${k};rgb:${O}\x07`),!0}return!1}),a.parser.registerOscHandler(52,D=>!!D.includes("?")),a.parser.registerCsiHandler({prefix:">",final:"q"},D=>(w("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"u"},D=>!0),a.parser.registerCsiHandler({prefix:"?",final:"m"},D=>D[0]===4?(w("\x1B[?4;1m"),!0):!1),a.parser.registerCsiHandler({final:"t"},D=>{const L=D[0];return L===19?(w(`\x1B[9;${a.rows};${a.cols}t`),!0):L===20?(w("\x1B]LTerminal\x1B\\"),!0):L===21?(w("\x1B]lTerminal\x1B\\"),!0):!1}),a.parser.registerCsiHandler({prefix:"?",final:"S"},D=>!0),a.parser.registerDcsHandler({intermediates:"$",final:"q"},(D,L)=>D==="m"?(w("\x1BP1$rm\x1B\\"),!0):D==='"p'?(w('\x1BP1$r62;1"p\x1B\\'),!0):D==="r"?(w(`\x1BP1$r1;${a.rows}r\x1B\\`),!0):(w("\x1BP0$r\x1B\\"),!0)),a.parser.registerDcsHandler({intermediates:"+",final:"q"},(D,L)=>{try{const M=(D.match(/.{2}/g)||[]).map(N=>String.fromCharCode(parseInt(N,16))).join(""),O={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(M in O){const F=O[M].split("").map(j=>j.charCodeAt(0).toString(16).padStart(2,"0")).join("");return w(`\x1BP1+r${F}\x1B\\`),!0}}catch(k){console.error("[XTGETTCAP] Failed to decode:",k)}return w("\x1BP0+r\x1B\\"),!0}),a.parser.registerCsiHandler({final:"b"},D=>{const L=D[0]||1;return L>65535?(console.warn(`[REP] Large repeat count ${L} clamped to 65535 for security`),!0):!1}),d.fit(),a.write(`${Av}${e.title}\r
|
|
106
106
|
\r
|
|
107
|
-
`);const f=()=>{const D=C.current;if(!D||D.readyState!==WebSocket.OPEN)return;const L=a.cols,k=a.rows;!L||!k||D.send(`${Mv}${L},${k}`)},n=new ResizeObserver(()=>{d.fit(),f()});n.observe(i.current);const l=new IntersectionObserver(D=>{D[0].isIntersecting&&(d.fit(),f())},{threshold:.8});l.observe(i.current);let o=null,c=null,m=!1,y=0,b=null,E=!1,p=!1;const x=async(D=!1)=>{if(!m){v=!0;try{const{token:L,authEnabled:k}=await tv();if(m)return;const M=k?`${t}?token=${L}`:t;let O=M;if(D&&s.current>0){const N=M.includes("?")?"&":"?";O=`${M}${N}bufferOffset=${s.current}`}o=new WebSocket(O),C.current=o,o.addEventListener("open",()=>{y=0,p=!0,setTimeout(()=>{v=!1},
|
|
107
|
+
`);const f=()=>{const D=C.current;if(!D||D.readyState!==WebSocket.OPEN)return;const L=a.cols,k=a.rows;!L||!k||D.send(`${Mv}${L},${k}`)},n=new ResizeObserver(()=>{d.fit(),f()});n.observe(i.current);const l=new IntersectionObserver(D=>{D[0].isIntersecting&&(d.fit(),f())},{threshold:.8});l.observe(i.current);let o=null,c=null,m=!1,y=0,b=null,E=!1,p=!1;const x=async(D=!1)=>{if(!m){v=!0;try{const{token:L,authEnabled:k}=await tv();if(m)return;const M=k?`${t}?token=${L}`:t;let O=M;if(D&&s.current>0){const N=M.includes("?")?"&":"?";O=`${M}${N}bufferOffset=${s.current}`}o=new WebSocket(O),C.current=o,o.addEventListener("open",()=>{y=0,p=!0,setTimeout(()=>{v=!1},300),f(),D||a.write(`\r
|
|
108
108
|
${Tv}\r
|
|
109
109
|
\r
|
|
110
|
-
`)}),o.addEventListener("message",N=>{typeof N.data=="string"&&(s.current+=N.data.length,a.write(N.data))}),o.addEventListener("close",N=>{if(!(m||E)){if(N.code===1e3){a.write(`\r
|
|
110
|
+
`)}),o.addEventListener("message",N=>{typeof N.data=="string"&&(s.current+=N.data.length,a.write(N.data),v=!1)}),o.addEventListener("close",N=>{if(!(m||E)){if(N.code===1e3){a.write(`\r
|
|
111
111
|
${vc}\r
|
|
112
112
|
`);return}if(y<gc){y++;const F=mc*Math.pow(2,y-1);b=setTimeout(()=>x(!0),F)}else a.write(`\r
|
|
113
113
|
\x1B[31m${vc}\x1B[0m\r
|
package/web/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>Deck IDE</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-BRKvvC_T.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-B72bb78r.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|