@opensumi/cli-engine 2.25.1 → 2.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/browser/3.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{3393:function(t,e,i){self,t.exports=(()=>{"use strict";var t={965:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphRenderer=void 0;const s=i(381),r=i(455),o=i(855),n=i(859),a=10,l=a*Float32Array.BYTES_PER_ELEMENT,h={i:0,glyph:void 0,leftCellPadding:0,clippedPixels:0};class c extends n.Disposable{constructor(t,e,i,r){super(),this._terminal=t,this._colors=e,this._gl=i,this._dimensions=r,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const o=this._gl;this._program=(0,s.throwIfFalsy)((0,s.createProgram)(o,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in vec2 a_texcoord;\nlayout (location = 5) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}","#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\n\nuniform sampler2D u_texture;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = texture(u_texture, v_texcoord);\n}")),this.register((0,n.toDisposable)(()=>o.deleteProgram(this._program))),this._projectionLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);const a=new Float32Array([0,0,1,0,0,1,1,1]),h=o.createBuffer();this.register((0,n.toDisposable)(()=>o.deleteBuffer(h))),o.bindBuffer(o.ARRAY_BUFFER,h),o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const c=new Uint8Array([0,1,3,0,2,3]),_=o.createBuffer();this.register((0,n.toDisposable)(()=>o.deleteBuffer(_))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,_),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(o.createBuffer()),this.register((0,n.toDisposable)(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,l,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,2,o.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,l,6*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,l,8*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),this._atlasTexture=(0,s.throwIfFalsy)(o.createTexture()),this.register((0,n.toDisposable)(()=>o.deleteTexture(this._atlasTexture))),o.bindTexture(o.TEXTURE_2D,this._atlasTexture),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.onResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(t,e,i,s,r,o,n,a){this._updateCell(this._vertices.attributes,t,e,i,s,r,o,n,a)}_updateCell(t,e,i,s,n,l,c,_,d){h.i=(i*this._terminal.cols+e)*a,s!==o.NULL_CELL_CODE&&void 0!==s?this._atlas&&(_&&_.length>1?h.glyph=this._atlas.getRasterizedGlyphCombinedChar(_,n,l,c):h.glyph=this._atlas.getRasterizedGlyph(s,n,l,c),h.leftCellPadding=Math.floor((this._dimensions.scaledCellWidth-this._dimensions.scaledCharWidth)/2),n!==d&&h.glyph.offset.x>h.leftCellPadding?(h.clippedPixels=h.glyph.offset.x-h.leftCellPadding,t[h.i]=-(h.glyph.offset.x-h.clippedPixels)+this._dimensions.scaledCharLeft,t[h.i+1]=-h.glyph.offset.y+this._dimensions.scaledCharTop,t[h.i+2]=(h.glyph.size.x-h.clippedPixels)/this._dimensions.scaledCanvasWidth,t[h.i+3]=h.glyph.size.y/this._dimensions.scaledCanvasHeight,t[h.i+4]=h.glyph.texturePositionClipSpace.x+h.clippedPixels/this._atlas.cacheCanvas.width,t[h.i+5]=h.glyph.texturePositionClipSpace.y,t[h.i+6]=h.glyph.sizeClipSpace.x-h.clippedPixels/this._atlas.cacheCanvas.width,t[h.i+7]=h.glyph.sizeClipSpace.y):(t[h.i]=-h.glyph.offset.x+this._dimensions.scaledCharLeft,t[h.i+1]=-h.glyph.offset.y+this._dimensions.scaledCharTop,t[h.i+2]=h.glyph.size.x/this._dimensions.scaledCanvasWidth,t[h.i+3]=h.glyph.size.y/this._dimensions.scaledCanvasHeight,t[h.i+4]=h.glyph.texturePositionClipSpace.x,t[h.i+5]=h.glyph.texturePositionClipSpace.y,t[h.i+6]=h.glyph.sizeClipSpace.x,t[h.i+7]=h.glyph.sizeClipSpace.y)):(0,r.fill)(t,0,h.i,h.i+a-1-2)}clear(){const t=this._terminal,e=t.cols*t.rows*a;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);for(let t=0;t<this._vertices.attributesBuffers.length;t++)this._vertices.count!==e?this._vertices.attributesBuffers[t]=new Float32Array(e):this._vertices.attributesBuffers[t].fill(0);this._vertices.count=e;let i=0;for(let e=0;e<t.rows;e++)for(let s=0;s<t.cols;s++)this._vertices.attributes[i+8]=s/t.cols,this._vertices.attributes[i+9]=e/t.rows,i+=a}onResize(){const t=this._gl;t.viewport(0,0,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;const e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const i=this._vertices.attributesBuffers[this._activeBuffer];let r=0;for(let e=0;e<t.lineLengths.length;e++){const s=e*this._terminal.cols*a,o=this._vertices.attributes.subarray(s,s+t.lineLengths[e]*a);i.set(o,r),r+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,r),e.STREAM_DRAW),this._atlas.hasCanvasChanged&&(this._atlas.hasCanvasChanged=!1,e.uniform1i(this._textureLocation,0),e.activeTexture(e.TEXTURE0+0),e.bindTexture(e.TEXTURE_2D,this._atlasTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._atlas.cacheCanvas),e.generateMipmap(e.TEXTURE_2D)),e.uniformMatrix4fv(this._projectionLocation,!1,s.PROJECTION_MATRIX),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),e.drawElementsInstanced(e.TRIANGLES,6,e.UNSIGNED_BYTE,0,r/a)}setAtlas(t){const e=this._gl;this._atlas=t,e.bindTexture(e.TEXTURE_2D,this._atlasTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.cacheCanvas),e.generateMipmap(e.TEXTURE_2D)}setDimensions(t){this._dimensions=t}}e.GlyphRenderer=c},742:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleRenderer=void 0;const s=i(381),r=i(310),o=i(859),n=i(302),a=8*Float32Array.BYTES_PER_ELEMENT,l={rgba:0,isDefault:!1,x1:0,y1:0,r:0,g:0,b:0,a:0};class h extends o.Disposable{constructor(t,e,i,r){super(),this._terminal=t,this._colors=e,this._gl=i,this._dimensions=r,this._vertices={count:0,attributes:new Float32Array(160)};const n=this._gl;this._program=(0,s.throwIfFalsy)((0,s.createProgram)(n,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),this.register((0,o.toDisposable)(()=>n.deleteProgram(this._program))),this._projectionLocation=(0,s.throwIfFalsy)(n.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=n.createVertexArray(),n.bindVertexArray(this._vertexArrayObject);const l=new Float32Array([0,0,1,0,0,1,1,1]),h=n.createBuffer();this.register((0,o.toDisposable)(()=>n.deleteBuffer(h))),n.bindBuffer(n.ARRAY_BUFFER,h),n.bufferData(n.ARRAY_BUFFER,l,n.STATIC_DRAW),n.enableVertexAttribArray(3),n.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const c=new Uint8Array([0,1,3,0,2,3]),_=n.createBuffer();this.register((0,o.toDisposable)(()=>n.deleteBuffer(_))),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,_),n.bufferData(n.ELEMENT_ARRAY_BUFFER,c,n.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(n.createBuffer()),this.register((0,o.toDisposable)(()=>n.deleteBuffer(this._attributesBuffer))),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.enableVertexAttribArray(0),n.vertexAttribPointer(0,2,n.FLOAT,!1,a,0),n.vertexAttribDivisor(0,1),n.enableVertexAttribArray(1),n.vertexAttribPointer(1,2,n.FLOAT,!1,a,2*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(1,1),n.enableVertexAttribArray(2),n.vertexAttribPointer(2,4,n.FLOAT,!1,a,4*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(2,1),this._updateCachedColors()}render(){const t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,s.PROJECTION_MATRIX),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,this._vertices.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLES,6,t.UNSIGNED_BYTE,0,this._vertices.count)}onResize(){this._updateViewportRectangle()}setColors(){this._updateCachedColors(),this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(){this._bgFloat=this._colorToFloat32Array(this._colors.background)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.scaledCellWidth,this._terminal.rows*this._dimensions.scaledCellHeight,this._bgFloat)}updateBackgrounds(t){const e=this._terminal,i=this._vertices;let s,o,n,a,l,h,c,_,d,u,g,f=1;for(s=0;s<e.rows;s++){for(n=-1,a=0,l=0,h=!1,o=0;o<e.cols;o++)c=(s*e.cols+o)*r.RENDER_MODEL_INDICIES_PER_CELL,_=t.cells[c+r.RENDER_MODEL_BG_OFFSET],d=t.cells[c+r.RENDER_MODEL_FG_OFFSET],u=!!(67108864&d),(_!==a||d!==l&&(h||u))&&((0!==a||h&&0!==l)&&(g=8*f++,this._updateRectangle(i,g,l,a,n,o,s)),n=o,a=_,l=d,h=u);(0!==a||h&&0!==l)&&(g=8*f++,this._updateRectangle(i,g,l,a,n,e.cols,s))}i.count=f}_updateRectangle(t,e,i,r,o,a,h){if(l.isDefault=!1,67108864&i)switch(50331648&i){case 16777216:case 33554432:l.rgba=this._colors.ansi[255&i].rgba;break;case 50331648:l.rgba=(16777215&i)<<8;break;default:l.rgba=this._colors.foreground.rgba}else switch(50331648&r){case 16777216:case 33554432:l.rgba=this._colors.ansi[255&r].rgba;break;case 50331648:l.rgba=(16777215&r)<<8;break;default:l.rgba=this._colors.background.rgba,l.isDefault=!0}t.attributes.length<e+4&&(t.attributes=(0,s.expandFloat32Array)(t.attributes,this._terminal.rows*this._terminal.cols*8)),l.x1=o*this._dimensions.scaledCellWidth,l.y1=h*this._dimensions.scaledCellHeight,l.r=(l.rgba>>24&255)/255,l.g=(l.rgba>>16&255)/255,l.b=(l.rgba>>8&255)/255,l.a=!l.isDefault&&134217728&r?n.DIM_OPACITY:1,this._addRectangle(t.attributes,e,l.x1,l.y1,(a-o)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,l.r,l.g,l.b,l.a)}_addRectangle(t,e,i,s,r,o,n,a,l,h){t[e]=i/this._dimensions.scaledCanvasWidth,t[e+1]=s/this._dimensions.scaledCanvasHeight,t[e+2]=r/this._dimensions.scaledCanvasWidth,t[e+3]=o/this._dimensions.scaledCanvasHeight,t[e+4]=n,t[e+5]=a,t[e+6]=l,t[e+7]=h}_addRectangleFloat(t,e,i,s,r,o,n){t[e]=i/this._dimensions.scaledCanvasWidth,t[e+1]=s/this._dimensions.scaledCanvasHeight,t[e+2]=r/this._dimensions.scaledCanvasWidth,t[e+3]=o/this._dimensions.scaledCanvasHeight,t[e+4]=n[0],t[e+5]=n[1],t[e+6]=n[2],t[e+7]=n[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(255&t.rgba)/255])}}e.RectangleRenderer=h},310:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderModel=e.COMBINED_CHAR_BIT_MASK=e.RENDER_MODEL_EXT_OFFSET=e.RENDER_MODEL_FG_OFFSET=e.RENDER_MODEL_BG_OFFSET=e.RENDER_MODEL_INDICIES_PER_CELL=void 0;const s=i(455);e.RENDER_MODEL_INDICIES_PER_CELL=4,e.RENDER_MODEL_BG_OFFSET=1,e.RENDER_MODEL_FG_OFFSET=2,e.RENDER_MODEL_EXT_OFFSET=3,e.COMBINED_CHAR_BIT_MASK=2147483648,e.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection={hasSelection:!1,columnSelectMode:!1,viewportStartRow:0,viewportEndRow:0,viewportCappedStartRow:0,viewportCappedEndRow:0,startCol:0,endCol:0}}resize(t,i){const s=t*i*e.RENDER_MODEL_INDICIES_PER_CELL;s!==this.cells.length&&(this.cells=new Uint32Array(s),this.lineLengths=new Uint32Array(i))}clear(){(0,s.fill)(this.cells,0,0),(0,s.fill)(this.lineLengths,0,0)}clearSelection(){this.selection.hasSelection=!1,this.selection.viewportStartRow=0,this.selection.viewportEndRow=0,this.selection.viewportCappedStartRow=0,this.selection.viewportCappedEndRow=0,this.selection.startCol=0,this.selection.endCol=0}}},666:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JoinedCellData=e.WebglRenderer=void 0;const s=i(965),r=i(733),o=i(461),n=i(713),a=i(742),l=i(310),h=i(859),c=i(855),_=i(476),d=i(345),u=i(782),g=i(820),f=i(147),C={fg:0,bg:0,hasFg:!1,hasBg:!1,isSelected:!1};class p extends h.Disposable{constructor(t,e,i,s,a,h,c){super(),this._terminal=t,this._colors=e,this._characterJoinerService=i,this._coreBrowserService=s,this._decorationService=h,this._model=new l.RenderModel,this._workCell=new u.CellData,this._workColors={fg:0,bg:0,ext:0},this._onChangeTextureAtlas=new d.EventEmitter,this._onRequestRedraw=new d.EventEmitter,this._onContextLoss=new d.EventEmitter,this._core=this._terminal._core,this._renderLayers=[new r.LinkRenderLayer(this._core.screenElement,2,this._colors,this._core,this._coreBrowserService),new o.CursorRenderLayer(t,this._core.screenElement,3,this._colors,this._onRequestRedraw,this._coreBrowserService,a)],this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._canvas=document.createElement("canvas");const f={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",f),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",t=>{console.log("webglcontextlost event received"),t.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(t)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",t=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,_.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(t,e)=>this._setCanvasDevicePixelDimensions(t,e))),this._core.screenElement.appendChild(this._canvas),this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement)}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onRequestRedraw(){return this._onRequestRedraw.event}get onContextLoss(){return this._onContextLoss.event}dispose(){var t;for(const t of this._renderLayers)t.dispose();null===(t=this._canvas.parentElement)||void 0===t||t.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal),super.dispose()}get textureAtlas(){var t;return null===(t=this._charAtlas)||void 0===t?void 0:t.cacheCanvas}setColors(t){this._colors=t;for(const t of this._renderLayers)t.setColors(this._terminal,this._colors),t.reset(this._terminal);this._rectangleRenderer.setColors(),this._refreshCharAtlas(),this._clearModel(!0)}onDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.onResize(this._terminal.cols,this._terminal.rows))}onResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const t of this._renderLayers)t.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.scaledCanvasWidth,this._canvas.height=this.dimensions.scaledCanvasHeight,this._canvas.style.width=this.dimensions.canvasWidth+"px",this._canvas.style.height=this.dimensions.canvasHeight+"px",this._core.screenElement.style.width=this.dimensions.canvasWidth+"px",this._core.screenElement.style.height=this.dimensions.canvasHeight+"px",this._rectangleRenderer.setDimensions(this.dimensions),this._rectangleRenderer.onResize(),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.onResize(),this._refreshCharAtlas(),this._clearModel(!1)}onCharSizeChanged(){this.onResize(this._terminal.cols,this._terminal.rows)}onBlur(){for(const t of this._renderLayers)t.onBlur(this._terminal);this._requestRedrawViewport()}onFocus(){for(const t of this._renderLayers)t.onFocus(this._terminal);this._requestRedrawViewport()}onSelectionChanged(t,e,i){for(const s of this._renderLayers)s.onSelectionChanged(this._terminal,t,e,i);this._updateSelectionModel(t,e,i),this._requestRedrawViewport()}onCursorMove(){for(const t of this._renderLayers)t.onCursorMove(this._terminal)}onOptionsChanged(){for(const t of this._renderLayers)t.onOptionsChanged(this._terminal);this._updateDimensions(),this._refreshCharAtlas()}_initializeWebGLState(){var t,e;null===(t=this._rectangleRenderer)||void 0===t||t.dispose(),null===(e=this._glyphRenderer)||void 0===e||e.dispose(),this._rectangleRenderer=new a.RectangleRenderer(this._terminal,this._colors,this._gl,this.dimensions),this._glyphRenderer=new s.GlyphRenderer(this._terminal,this._colors,this._gl,this.dimensions),this.onCharSizeChanged()}_refreshCharAtlas(){if(this.dimensions.scaledCharWidth<=0&&this.dimensions.scaledCharHeight<=0)return void(this._isAttached=!1);const t=(0,n.acquireCharAtlas)(this._terminal,this._colors,this.dimensions.scaledCellWidth,this.dimensions.scaledCellHeight,this.dimensions.scaledCharWidth,this.dimensions.scaledCharHeight,this._coreBrowserService.dpr);if(!("getRasterizedGlyph"in t))throw new Error("The webgl renderer only works with the webgl char atlas");this._charAtlas!==t&&this._onChangeTextureAtlas.fire(t.cacheCanvas),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.clear()}clearCharAtlas(){var t;null===(t=this._charAtlas)||void 0===t||t.clearTexture(),this._clearModel(!0),this._updateModel(0,this._terminal.rows-1),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const t of this._renderLayers)t.reset(this._terminal)}registerCharacterJoiner(t){return-1}deregisterCharacterJoiner(t){return!1}renderRows(t,e){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._core._charSizeService.width&&this._core._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const i of this._renderLayers)i.onGridChanged(this._terminal,t,e);this._glyphRenderer.beginFrame()&&(this._clearModel(!0),this._updateSelectionModel(void 0,void 0)),this._updateModel(t,e),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model)}_updateModel(t,e){const i=this._core;let s,r,o,n,a,h,_,d,u,g,f,C,p,v=this._workCell;for(r=t;r<=e;r++)for(o=r+i.buffer.ydisp,n=i.buffer.lines.get(o),this._model.lineLengths[r]=0,a=this._characterJoinerService.getJoinedCharacters(o),C=0;C<i.cols;C++)if(s=this._workColors.bg,n.loadCell(C,v),0===C&&(s=this._workColors.bg),h=!1,_=C,a.length>0&&C===a[0][0]&&(h=!0,d=a.shift(),v=new m(v,n.translateToString(!0,d[0],d[1]),d[1]-d[0]),_=d[1]-1),u=v.getChars(),g=v.getCode(),f=(r*i.cols+C)*l.RENDER_MODEL_INDICIES_PER_CELL,this._loadColorsForCell(C,o),g!==c.NULL_CELL_CODE&&(this._model.lineLengths[r]=C+1),(this._model.cells[f]!==g||this._model.cells[f+l.RENDER_MODEL_BG_OFFSET]!==this._workColors.bg||this._model.cells[f+l.RENDER_MODEL_FG_OFFSET]!==this._workColors.fg||this._model.cells[f+l.RENDER_MODEL_EXT_OFFSET]!==this._workColors.ext)&&(u.length>1&&(g|=l.COMBINED_CHAR_BIT_MASK),this._model.cells[f]=g,this._model.cells[f+l.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[f+l.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[f+l.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext,this._glyphRenderer.updateCell(C,r,g,this._workColors.bg,this._workColors.fg,this._workColors.ext,u,s),h))for(v=this._workCell,C++;C<_;C++)p=(r*i.cols+C)*l.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.updateCell(C,r,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0),this._model.cells[p]=c.NULL_CELL_CODE,this._model.cells[p+l.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[p+l.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[p+l.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext;this._rectangleRenderer.updateBackgrounds(this._model)}_loadColorsForCell(t,e){this._workColors.bg=this._workCell.bg,this._workColors.fg=this._workCell.fg,this._workColors.ext=268435456&this._workCell.bg?this._workCell.extended.ext:0,C.bg=0,C.fg=0,C.hasBg=!1,C.hasFg=!1,C.isSelected=!1,this._decorationService.forEachDecorationAtCell(t,e,"bottom",t=>{t.backgroundColorRGB&&(C.bg=t.backgroundColorRGB.rgba>>8&16777215,C.hasBg=!0),t.foregroundColorRGB&&(C.fg=t.foregroundColorRGB.rgba>>8&16777215,C.hasFg=!0)}),C.isSelected=this._isCellSelected(t,e),C.isSelected&&(C.bg=(this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque).rgba>>8&16777215,C.hasBg=!0,this._colors.selectionForeground&&(C.fg=this._colors.selectionForeground.rgba>>8&16777215,C.hasFg=!0)),this._decorationService.forEachDecorationAtCell(t,e,"top",t=>{t.backgroundColorRGB&&(C.bg=t.backgroundColorRGB.rgba>>8&16777215,C.hasBg=!0),t.foregroundColorRGB&&(C.fg=t.foregroundColorRGB.rgba>>8&16777215,C.hasFg=!0)}),C.hasBg&&(C.isSelected?C.bg=-16777216&this._workCell.bg&-134217729|C.bg|50331648:C.bg=-16777216&this._workCell.bg|C.bg|50331648),C.hasFg&&(C.fg=-16777216&this._workCell.fg&-67108865|C.fg|50331648),67108864&this._workColors.fg&&(C.hasBg&&!C.hasFg&&(0==(50331648&this._workColors.bg)?C.fg=-134217728&this._workColors.fg|16777215&this._colors.background.rgba>>8|50331648:C.fg=-134217728&this._workColors.fg|67108863&this._workColors.bg,C.hasFg=!0),!C.hasBg&&C.hasFg&&(0==(50331648&this._workColors.fg)?C.bg=-67108864&this._workColors.bg|16777215&this._colors.foreground.rgba>>8|50331648:C.bg=-67108864&this._workColors.bg|67108863&this._workColors.fg,C.hasBg=!0)),this._workColors.bg=C.hasBg?C.bg:this._workColors.bg,this._workColors.fg=C.hasFg?C.fg:this._workColors.fg}_isCellSelected(t,e){return!!this._model.selection.hasSelection&&(e-=this._terminal.buffer.active.viewportY,this._model.selection.columnSelectMode?this._model.selection.startCol<=this._model.selection.endCol?t>=this._model.selection.startCol&&e>=this._model.selection.viewportCappedStartRow&&t<this._model.selection.endCol&&e<=this._model.selection.viewportCappedEndRow:t<this._model.selection.startCol&&e>=this._model.selection.viewportCappedStartRow&&t>=this._model.selection.endCol&&e<=this._model.selection.viewportCappedEndRow:e>this._model.selection.viewportStartRow&&e<this._model.selection.viewportEndRow||this._model.selection.viewportStartRow===this._model.selection.viewportEndRow&&e===this._model.selection.viewportStartRow&&t>=this._model.selection.startCol&&t<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&e===this._model.selection.viewportEndRow&&t<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&e===this._model.selection.viewportStartRow&&t>=this._model.selection.startCol)}_updateSelectionModel(t,e,i=!1){const s=this._terminal;if(!t||!e||t[0]===e[0]&&t[1]===e[1])return void this._model.clearSelection();const r=t[1]-s.buffer.active.viewportY,o=e[1]-s.buffer.active.viewportY,n=Math.max(r,0),a=Math.min(o,s.rows-1);n>=s.rows||a<0?this._model.clearSelection():(this._model.selection.hasSelection=!0,this._model.selection.columnSelectMode=i,this._model.selection.viewportStartRow=r,this._model.selection.viewportEndRow=o,this._model.selection.viewportCappedStartRow=n,this._model.selection.viewportCappedEndRow=a,this._model.selection.startCol=t[0],this._model.selection.endCol=e[0])}_updateDimensions(){this._core._charSizeService.width&&this._core._charSizeService.height&&(this.dimensions.scaledCharWidth=Math.floor(this._core._charSizeService.width*this._devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._core._charSizeService.height*this._devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/this._devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/this._devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.scaledCellHeight/this._devicePixelRatio,this.dimensions.actualCellWidth=this.dimensions.scaledCellWidth/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}}e.WebglRenderer=p;class m extends f.AttributeData{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=m},381:(t,e)=>{function i(t,e,i){const r=s(t.createShader(e));if(t.shaderSource(r,i),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;console.error(t.getShaderInfoLog(r)),t.deleteShader(r)}function s(t){if(!t)throw new Error("value must not be falsy");return t}Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfFalsy=e.expandFloat32Array=e.createShader=e.createProgram=e.PROJECTION_MATRIX=void 0,e.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),e.createProgram=function(t,e,r){const o=s(t.createProgram());if(t.attachShader(o,s(i(t,t.VERTEX_SHADER,e))),t.attachShader(o,s(i(t,t.FRAGMENT_SHADER,r))),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS))return o;console.error(t.getProgramInfoLog(o)),t.deleteProgram(o)},e.createShader=i,e.expandFloat32Array=function(t,e){const i=Math.min(2*t.length,e),s=new Float32Array(i);for(let e=0;e<t.length;e++)s[e]=t[e];return s},e.throwIfFalsy=s},713:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeTerminalFromCache=e.acquireCharAtlas=void 0;const s=i(433),r=i(167),o=[];e.acquireCharAtlas=function(t,e,i,n,a,l,h){const c=(0,s.generateConfig)(i,n,a,l,t,e,h);for(let e=0;e<o.length;e++){const i=o[e],r=i.ownedBy.indexOf(t);if(r>=0){if((0,s.configEquals)(i.config,c))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(e,1)):i.ownedBy.splice(r,1);break}}for(let e=0;e<o.length;e++){const i=o[e];if((0,s.configEquals)(i.config,c))return i.ownedBy.push(t),i.atlas}const _=t._core,d={atlas:new r.WebglCharAtlas(document,c,_.unicodeService),config:c,ownedBy:[t]};return o.push(d),d.atlas},e.removeTerminalFromCache=function(t){for(let e=0;e<o.length;e++){const i=o[e].ownedBy.indexOf(t);if(-1!==i){1===o[e].ownedBy.length?(o[e].atlas.dispose(),o.splice(e,1)):o[e].ownedBy.splice(i,1);break}}}},433:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.is256Color=e.configEquals=e.generateConfig=void 0;const i={css:"",rgba:0};e.generateConfig=function(t,e,s,r,o,n,a){const l={foreground:n.foreground,background:n.background,cursor:i,cursorAccent:i,selectionForeground:i,selectionBackgroundTransparent:i,selectionBackgroundOpaque:i,selectionInactiveBackgroundTransparent:i,selectionInactiveBackgroundOpaque:i,ansi:n.ansi.slice(),contrastCache:n.contrastCache};return{customGlyphs:o.options.customGlyphs,devicePixelRatio:a,letterSpacing:o.options.letterSpacing,lineHeight:o.options.lineHeight,scaledCellWidth:t,scaledCellHeight:e,scaledCharWidth:s,scaledCharHeight:r,fontFamily:o.options.fontFamily,fontSize:o.options.fontSize,fontWeight:o.options.fontWeight,fontWeightBold:o.options.fontWeightBold,allowTransparency:o.options.allowTransparency,drawBoldTextInBrightColors:o.options.drawBoldTextInBrightColors,minimumContrastRatio:o.options.minimumContrastRatio,colors:l}},e.configEquals=function(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.scaledCharWidth===e.scaledCharWidth&&t.scaledCharHeight===e.scaledCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground===e.colors.foreground&&t.colors.background===e.colors.background},e.is256Color=function(t){return 16777216==(50331648&t)||33554432==(50331648&t)}},167:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebglCharAtlas=void 0;const s=i(302),r=i(855),o=i(381),n=i(147),a=i(160),l=i(14),h=i(634),c=i(485),_=1024,d=1024,u=Math.floor(819.2),g={css:"rgba(0, 0, 0, 0)",rgba:0},f={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},C={glyph:void 0};function p(t,e,i,s){const r=e.rgba>>>24,o=e.rgba>>>16&255,n=e.rgba>>>8&255,a=i.rgba>>>24,l=i.rgba>>>16&255,h=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(o-l)+Math.abs(n-h))/12);let _=!0;for(let e=0;e<t.data.length;e+=4)t.data[e]===r&&t.data[e+1]===o&&t.data[e+2]===n||s&&Math.abs(t.data[e]-r)+Math.abs(t.data[e+1]-o)+Math.abs(t.data[e+2]-n)<c?t.data[e+3]=0:_=!1;return _}e.WebglCharAtlas=class{constructor(t,e,i){this._config=e,this._unicodeService=i,this._didWarmUp=!1,this._cacheMap=new c.FourKeyMap,this._cacheMapCombined=new c.FourKeyMap,this._currentRow={x:0,y:0,height:0},this._fixedRows=[],this.hasCanvasChanged=!1,this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this.cacheCanvas=t.createElement("canvas"),this.cacheCanvas.width=_,this.cacheCanvas.height=d,this._cacheCtx=(0,o.throwIfFalsy)(this.cacheCanvas.getContext("2d",{alpha:!0})),this._tmpCanvas=t.createElement("canvas"),this._tmpCanvas.width=4*this._config.scaledCellWidth+4,this._tmpCanvas.height=this._config.scaledCellHeight+4,this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency}))}dispose(){this.cacheCanvas.parentElement&&this.cacheCanvas.parentElement.removeChild(this.cacheCanvas)}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){for(let t=33;t<126;t++){const e=this._drawToCache(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,e)}}beginFrame(){return this._currentRow.y>u&&(this.clearTexture(),this.warmUp(),!0)}clearTexture(){0===this._currentRow.x&&0===this._currentRow.y||(this._cacheCtx.clearRect(0,0,_,d),this._cacheMap.clear(),this._cacheMapCombined.clear(),this._currentRow.x=0,this._currentRow.y=0,this._currentRow.height=0,this._fixedRows.length=0,this._didWarmUp=!1)}getRasterizedGlyphCombinedChar(t,e,i,s){return this._getFromCacheMap(this._cacheMapCombined,t,e,i,s)}getRasterizedGlyph(t,e,i,s){return this._getFromCacheMap(this._cacheMap,t,e,i,s)}_getFromCacheMap(t,e,i,s,r){return C.glyph=t.get(e,i,s,r),C.glyph||(C.glyph=this._drawToCache(e,i,s,r),t.set(e,i,s,r,C.glyph)),C.glyph}_getColorFromAnsiIndex(t){if(t>=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,e,i,r){if(this._config.allowTransparency)return g;let o;switch(t){case 16777216:case 33554432:o=this._getColorFromAnsiIndex(e);break;case 50331648:const t=n.AttributeData.toColorRGB(e);o=a.rgba.toColor(t[0],t[1],t[2]);break;default:o=i?this._config.colors.foreground:this._config.colors.background}return r&&(o=a.color.blend(this._config.colors.background,a.color.multiplyOpacity(o,s.DIM_OPACITY))),o}_getForegroundColor(t,e,i,r,o,l,h,c,_,d){const u=this._getMinimumContrastColor(t,e,i,r,o,l,!1,_,d);if(u)return u;let g;switch(o){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&_&&l<8&&(l+=8),g=this._getColorFromAnsiIndex(l);break;case 50331648:const t=n.AttributeData.toColorRGB(l);g=a.rgba.toColor(t[0],t[1],t[2]);break;default:g=h?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(g=a.color.opaque(g)),c&&(g=a.color.multiplyOpacity(g,s.DIM_OPACITY)),g}_resolveBackgroundRgba(t,e,i){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(e).rgba;case 50331648:return e<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,e,i,s){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&e<8&&(e+=8),this._getColorFromAnsiIndex(e).rgba;case 50331648:return e<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,e,i,s,r,o,n,l,h){if(1===this._config.minimumContrastRatio||h)return;const c=this._config.colors.contrastCache.getColor(t,s);if(void 0!==c)return c||void 0;const _=this._resolveBackgroundRgba(e,i,n),d=this._resolveForegroundRgba(r,o,n,l),u=a.rgba.ensureContrastRatio(_,d,this._config.minimumContrastRatio);if(!u)return void this._config.colors.contrastCache.setColor(t,s,null);const g=a.rgba.toColor(u>>24&255,u>>16&255,u>>8&255);return this._config.colors.contrastCache.setColor(t,s,g),g}_drawToCache(t,e,i,r){const o="number"==typeof t?String.fromCharCode(t):t;this.hasCanvasChanged=!0;const a=this._config.scaledCellWidth*Math.max(o.length,2)+4;this._tmpCanvas.width<a&&(this._tmpCanvas.width=a);const c=this._config.scaledCellHeight+8;if(this._tmpCanvas.height<c&&(this._tmpCanvas.height=c),this._tmpCtx.save(),this._workAttributeData.fg=i,this._workAttributeData.bg=e,this._workAttributeData.extended.ext=r,this._workAttributeData.isInvisible())return f;const u=!!this._workAttributeData.isBold(),g=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),m=!!this._workAttributeData.isItalic(),v=!!this._workAttributeData.isUnderline(),L=!!this._workAttributeData.isStrikethrough();let w=this._workAttributeData.getFgColor(),x=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),M=this._workAttributeData.getBgColorMode();if(g){const t=w;w=b,b=t;const e=x;x=M,M=e}const y=this._getBackgroundColor(M,b,g,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const R=u?this._config.fontWeightBold:this._config.fontWeight,E=m?"italic":"";this._tmpCtx.font=`${E} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=s.TEXT_BASELINE;const A=1===o.length&&(0,h.isPowerlineGlyph)(o.charCodeAt(0)),D=1===o.length&&(0,h.isRestrictedPowerlineGlyph)(o.charCodeAt(0)),T=this._getForegroundColor(e,M,b,i,x,w,g,C,u,(0,h.excludeFromContrastRatioDemands)(o.charCodeAt(0)));this._tmpCtx.fillStyle=T.css;const S=D?0:4;let B=!1;!1!==this._config.customGlyphs&&(B=(0,l.tryDrawCustomChar)(this._tmpCtx,o,S,S,this._config.scaledCellWidth,this._config.scaledCellHeight,this._config.fontSize,this._config.devicePixelRatio));let F,k=!A;if(F="number"==typeof t?this._unicodeService.wcwidth(t):this._unicodeService.getStringCellWidth(t),v){this._tmpCtx.save();const t=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),e=t%2==1?.5:0;if(this._tmpCtx.lineWidth=t,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())k=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{k=!1;let t=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&t<8&&(t+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(t).css}this._tmpCtx.beginPath();const i=S,s=Math.ceil(S+this._config.scaledCharHeight)-e,r=S+this._config.scaledCharHeight+t-e,a=Math.ceil(S+this._config.scaledCharHeight+2*t)-e;for(let o=0;o<F;o++){this._tmpCtx.save();const n=i+o*this._config.scaledCellWidth,l=i+(o+1)*this._config.scaledCellWidth,h=n+this._config.scaledCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s),this._tmpCtx.moveTo(n,a),this._tmpCtx.lineTo(l,a);break;case 3:const i=t<=1?a:Math.ceil(S+this._config.scaledCharHeight-t/2)-e,o=t<=1?s:Math.ceil(S+this._config.scaledCharHeight+t/2)-e,c=new Path2D;c.rect(n,s,this._config.scaledCellWidth,a-s),this._tmpCtx.clip(c),this._tmpCtx.moveTo(n-this._config.scaledCellWidth/2,r),this._tmpCtx.bezierCurveTo(n-this._config.scaledCellWidth/2,o,n,o,n,r),this._tmpCtx.bezierCurveTo(n,i,h,i,h,r),this._tmpCtx.bezierCurveTo(h,o,l,o,l,r),this._tmpCtx.bezierCurveTo(l,i,l+this._config.scaledCellWidth/2,i,l+this._config.scaledCellWidth/2,r);break;case 4:this._tmpCtx.setLineDash([2*this._config.devicePixelRatio,this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s);break;default:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!B&&this._config.fontSize>=12&&!this._config.allowTransparency&&" "!==o){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const e=this._tmpCtx.measureText(o);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in e&&e.actualBoundingBoxDescent>0){this._tmpCtx.save();const e=new Path2D;e.rect(i,s-Math.ceil(t/2),this._config.scaledCellWidth,a-s+Math.ceil(t/2)),this._tmpCtx.clip(e),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=y.css,this._tmpCtx.strokeText(o,S,S+this._config.scaledCharHeight),this._tmpCtx.restore()}}}if(B||this._tmpCtx.fillText(o,S,S+this._config.scaledCharHeight),"_"===o&&!this._config.allowTransparency){let t=p(this._tmpCtx.getImageData(S,S,this._config.scaledCellWidth,this._config.scaledCellHeight),y,T,k);if(t)for(let e=1;e<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(o,S,S+this._config.scaledCharHeight-e),t=p(this._tmpCtx.getImageData(S,S,this._config.scaledCellWidth,this._config.scaledCellHeight),y,T,k),t);e++);}if(L){const t=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),e=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=t,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(S,S+Math.floor(this._config.scaledCharHeight/2)-e),this._tmpCtx.lineTo(S+this._config.scaledCharWidth*F,S+Math.floor(this._config.scaledCharHeight/2)-e),this._tmpCtx.stroke()}this._tmpCtx.restore();const I=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let $;if($=this._config.allowTransparency?function(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}(I):p(I,y,T,k),$)return f;const P=this._findGlyphBoundingBox(I,this._workBoundingBox,a,D,B,S),W=this._clipImageData(I,this._workBoundingBox);let O;for(;;){O=this._currentRow;for(const t of this._fixedRows)(O===this._currentRow||t.height<O.height)&&P.size.y<=t.height&&(O=t);if(O.height>2*P.size.y&&(this._currentRow.height>0&&this._fixedRows.push(this._currentRow),O={x:0,y:this._currentRow.y+this._currentRow.height,height:P.size.y},this._fixedRows.push(O),this._currentRow={x:0,y:O.y+O.height,height:0}),O.x+P.size.x<=_)break;O===this._currentRow?(O.x=0,O.y+=O.height,O.height=0):this._fixedRows.splice(this._fixedRows.indexOf(O),1)}return P.texturePosition.x=O.x,P.texturePosition.y=O.y,P.texturePositionClipSpace.x=O.x/_,P.texturePositionClipSpace.y=O.y/d,O.height=Math.max(O.height,P.size.y),O.x+=P.size.x,this._cacheCtx.putImageData(W,P.texturePosition.x,P.texturePosition.y),P}_findGlyphBoundingBox(t,e,i,s,r,o){e.top=0;const n=s?this._config.scaledCellHeight:this._tmpCanvas.height,a=s?this._config.scaledCellWidth:i;let l=!1;for(let i=0;i<n;i++){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==t.data[r]){e.top=i,l=!0;break}}if(l)break}e.left=0,l=!1;for(let i=0;i<a;i++){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==t.data[r]){e.left=i,l=!0;break}}if(l)break}e.right=a,l=!1;for(let i=a-1;i>=0;i--){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==t.data[r]){e.right=i,l=!0;break}}if(l)break}e.bottom=n,l=!1;for(let i=n-1;i>=0;i--){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==t.data[r]){e.bottom=i,l=!0;break}}if(l)break}return{texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:e.right-e.left+1,y:e.bottom-e.top+1},sizeClipSpace:{x:(e.right-e.left+1)/_,y:(e.bottom-e.top+1)/d},offset:{x:-e.left+o+(s||r?Math.floor((this._config.scaledCellWidth-this._config.scaledCharWidth)/2):0),y:-e.top+o+(s||r?1===this._config.lineHeight?0:Math.round((this._config.scaledCellHeight-this._config.scaledCharHeight)/2):0)}}}_clipImageData(t,e){const i=e.right-e.left+1,s=e.bottom-e.top+1,r=new Uint8ClampedArray(i*s*4);for(let s=e.top;s<=e.bottom;s++)for(let o=e.left;o<=e.right;o++){const n=s*this._tmpCanvas.width*4+4*o,a=(s-e.top)*i*4+4*(o-e.left);r[a]=t.data[n],r[a+1]=t.data[n+1],r[a+2]=t.data[n+2],r[a+3]=t.data[n+3]}return new ImageData(r,i,s)}}},592:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRenderLayer=void 0;const s=i(713),r=i(302),o=i(381);e.BaseRenderLayer=class{constructor(t,e,i,s,r,o){this._container=t,this._alpha=s,this._colors=r,this._coreBrowserService=o,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${e}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}dispose(){this._canvas.remove(),this._charAtlas&&this._charAtlas.dispose()}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}onOptionsChanged(t){}onBlur(t){}onFocus(t){}onCursorMove(t){}onGridChanged(t,e,i){}onSelectionChanged(t,e,i,s=!1){}setColors(t,e){this._refreshCharAtlas(t,e)}_setTransparency(t,e){if(e===this._alpha)return;const i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._colors),this.onGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,s.acquireCharAtlas)(t,e,this._scaledCellWidth,this._scaledCellHeight,this._scaledCharWidth,this._scaledCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(t,e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._colors)}_fillCells(t,e,i,s){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._scaledCellWidth,(e+1)*this._scaledCellHeight-this._coreBrowserService.dpr-1,i*this._scaledCellWidth,this._coreBrowserService.dpr)}_fillLeftLineAtCell(t,e,i){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,this._coreBrowserService.dpr*i,this._scaledCellHeight)}_strokeRectAtCell(t,e,i,s){this._ctx.lineWidth=this._coreBrowserService.dpr,this._ctx.strokeRect(t*this._scaledCellWidth+this._coreBrowserService.dpr/2,e*this._scaledCellHeight+this._coreBrowserService.dpr/2,i*this._scaledCellWidth-this._coreBrowserService.dpr,s*this._scaledCellHeight-this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,s){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight))}_fillCharTrueColor(t,e,i,s){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=r.TEXT_BASELINE,this._clipCell(i,s,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()}_getFont(t,e,i){return`${i?"italic":""} ${e?t.options.fontWeightBold:t.options.fontWeight} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}}},461:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorRenderLayer=void 0;const s=i(592),r=i(782);class o extends s.BaseRenderLayer{constructor(t,e,i,s,o,n,a){super(e,"cursor",i,!0,s,n),this._onRequestRefreshRowsEvent=o,this._coreService=a,this._cell=new r.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this.onOptionsChanged(t)}dispose(){var t;null===(t=this._cursorBlinkStateManager)||void 0===t||t.dispose(),this._cursorBlinkStateManager=void 0,super.dispose()}resize(t,e){super.resize(t,e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(t){var e;this._clearCursor(),null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(t),this.onOptionsChanged(t)}onBlur(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.pause(),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onFocus(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.resume(t),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onOptionsChanged(t){var e;t.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new n(()=>{this._render(t,!0)},this._coreBrowserService)):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onCursorMove(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(t)}onGridChanged(t,e,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(t,!1):this._cursorBlinkStateManager.restartBlinkAnimation(t)}_render(t,e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const i=t.buffer.active.baseY+t.buffer.active.cursorY,s=i-t.buffer.active.viewportY,r=Math.min(t.buffer.active.cursorX,t.cols-1);if(s<0||s>=t.rows)this._clearCursor();else if(t._core.buffer.lines.get(i).loadCell(r,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;const e=t.options.cursorStyle;return e&&"block"!==e?this._cursorRenderers[e](t,r,s,this._cell):this._renderBlurCursor(t,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=e,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,i,t.options.cursorWidth),this._ctx.restore()}_renderBlockCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,i,s.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(t,s,e,i),this._ctx.restore()}_renderUnderlineCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,i),this._ctx.restore()}_renderBlurCursor(t,e,i,s){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,i,s.getWidth(),1),this._ctx.restore()}}e.CursorRenderLayer=o;class n{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,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(t){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const t=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0)return void this._restartInterval(t)}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 t=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(t)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},t)}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(t){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation(t)}}},733:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkRenderLayer=void 0;const s=i(592),r=i(302),o=i(433);class n extends s.BaseRenderLayer{constructor(t,e,i,s,r){super(t,"link",e,!0,i,r),s.linkifier2.onShowLinkUnderline(t=>this._onShowLinkUnderline(t)),s.linkifier2.onHideLinkUnderline(t=>this._onHideLinkUnderline(t))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_onShowLinkUnderline(t){if(t.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:void 0!==t.fg&&(0,o.is256Color)(t.fg)?this._ctx.fillStyle=this._colors.ansi[t.fg].css:this._ctx.fillStyle=this._colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_onHideLinkUnderline(t){this._clearCurrentLink()}}e.LinkRenderLayer=n},820:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addDisposableDomListener=void 0,e.addDisposableDomListener=function(t,e,i,s){t.addEventListener(e,i,s);let r=!1;return{dispose:()=>{r||(r=!0,t.removeEventListener(e,i,s))}}}},302:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=e.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);e.INVERTED_DEFAULT_COLOR=257,e.DIM_OPACITY=.5,e.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},14:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tryDrawCustomChar=e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0;const s=i(634);e.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:9,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 r={"░":[[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]]};e.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:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},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:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},e.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:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,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:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1}},e.tryDrawCustomChar=function(t,i,n,h,c,_,d,u){const g=e.blockElementDefinitions[i];if(g)return function(t,e,i,s,r,o){for(let n=0;n<e.length;n++){const a=e[n],l=r/8,h=o/8;t.fillRect(i+a.x*l,s+a.y*h,a.w*l,a.h*h)}}(t,g,n,h,c,_),!0;const f=r[i];if(f)return function(t,e,i,r,n,a){let l=o.get(e);l||(l=new Map,o.set(e,l));const h=t.fillStyle;if("string"!=typeof h)throw new Error(`Unexpected fillStyle type "${h}"`);let c=l.get(h);if(!c){const i=e[0].length,r=e.length,o=document.createElement("canvas");o.width=i,o.height=r;const n=(0,s.throwIfFalsy)(o.getContext("2d")),a=new ImageData(i,r);let _,d,u,g;if(h.startsWith("#"))_=parseInt(h.slice(1,3),16),d=parseInt(h.slice(3,5),16),u=parseInt(h.slice(5,7),16),g=h.length>7&&parseInt(h.slice(7,9),16)||1;else{if(!h.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${h}" when drawing pattern glyph`);[_,d,u,g]=h.substring(5,h.length-1).split(",").map(t=>parseFloat(t))}for(let t=0;t<r;t++)for(let s=0;s<i;s++)a.data[4*(t*i+s)]=_,a.data[4*(t*i+s)+1]=d,a.data[4*(t*i+s)+2]=u,a.data[4*(t*i+s)+3]=e[t][s]*(255*g);n.putImageData(a,0,0),c=(0,s.throwIfFalsy)(t.createPattern(o,null)),l.set(h,c)}t.fillStyle=c,t.fillRect(i,r,n,a)}(t,f,n,h,c,_),!0;const C=e.boxDrawingDefinitions[i];if(C)return function(t,e,i,s,r,o,n){t.strokeStyle=t.fillStyle;for(const[h,c]of Object.entries(e)){let e;t.beginPath(),t.lineWidth=n*Number.parseInt(h),e="function"==typeof c?c(.15,.15/o*r):c;for(const h of e.split(" ")){const e=h[0],c=a[e];if(!c){console.error(`Could not find drawing instructions for "${e}"`);continue}const _=h.substring(1).split(",");_[0]&&_[1]&&c(t,l(_,r,o,i,s,!0,n))}t.stroke(),t.closePath()}}(t,C,n,h,c,_,u),!0;const p=e.powerlineDefinitions[i];return!!p&&(function(t,e,i,s,r,o,n,h){var c,_;t.beginPath();const d=n/12;t.lineWidth=h*d;for(const n of e.d.split(" ")){const h=n[0],u=a[h];if(!u){console.error(`Could not find drawing instructions for "${h}"`);continue}const g=n.substring(1).split(",");g[0]&&g[1]&&u(t,l(g,r,o,i,s,!1,(null!==(c=e.leftPadding)&&void 0!==c?c:0)*(d/2),(null!==(_=e.rightPadding)&&void 0!==_?_:0)*(d/2)))}1===e.type?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}(t,p,n,h,c,_,d,u),!0)};const o=new Map;function n(t,e,i=0){return Math.max(Math.min(t,e),i)}const a={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function l(t,e,i,s,r,o,a,l=0,h=0){const c=t.map(t=>parseFloat(t)||parseInt(t));if(c.length<2)throw new Error("Too few arguments for instruction");for(let t=0;t<c.length;t+=2)c[t]*=e-l*a-h*a,o&&0!==c[t]&&(c[t]=n(Math.round(c[t]+.5)-.5,e,0)),c[t]+=s+l*a;for(let t=1;t<c.length;t+=2)c[t]*=i,o&&0!==c[t]&&(c[t]=n(Math.round(c[t]+.5)-.5,i,0)),c[t]+=r;return c}},476:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=void 0;const s=i(859);e.observeDevicePixelDimensions=function(t,e,i){let r=new e.ResizeObserver(e=>{const s=e.find(e=>e.target===t);if(!s)return;if(!("devicePixelContentBoxSize"in s))return null==r||r.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)});try{r.observe(t,{box:["device-pixel-content-box"]})}catch(t){r.disconnect(),r=void 0}return(0,s.toDisposable)(()=>null==r?void 0:r.disconnect())}},634:(t,e)=>{function i(t){return 57508<=t&&t<=57558}Object.defineProperty(e,"__esModule",{value:!0}),e.excludeFromContrastRatioDemands=e.isRestrictedPowerlineGlyph=e.isPowerlineGlyph=e.throwIfFalsy=void 0,e.throwIfFalsy=function(t){if(!t)throw new Error("value must not be falsy");return t},e.isPowerlineGlyph=i,e.isRestrictedPowerlineGlyph=function(t){return 57520<=t&&t<=57527},e.excludeFromContrastRatioDemands=function(t){return i(t)||function(t){return 9472<=t&&t<=9631}(t)}},160:(t,e)=>{var i,s,r;function o(t){const e=t.toString(16);return e.length<2?"0"+e:e}function n(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}Object.defineProperty(e,"__esModule",{value:!0}),e.contrastRatio=e.toPaddedHex=e.rgba=e.rgb=e.css=e.color=e.channels=void 0,function(t){t.toCss=function(t,e,i,s){return void 0!==s?`#${o(t)}${o(e)}${o(i)}${o(s)}`:`#${o(t)}${o(e)}${o(i)}`},t.toRgba=function(t,e,i,s=255){return(t<<24|e<<16|i<<8|s)>>>0}}(i=e.channels||(e.channels={})),function(t){function e(t,e){const s=Math.round(255*e),[o,n,a]=r.toChannels(t.rgba);return{css:i.toCss(o,n,a,s),rgba:i.toRgba(o,n,a,s)}}t.blend=function(t,e){const s=(255&e.rgba)/255;if(1===s)return{css:e.css,rgba:e.rgba};const r=e.rgba>>24&255,o=e.rgba>>16&255,n=e.rgba>>8&255,a=t.rgba>>24&255,l=t.rgba>>16&255,h=t.rgba>>8&255,c=a+Math.round((r-a)*s),_=l+Math.round((o-l)*s),d=h+Math.round((n-h)*s);return{css:i.toCss(c,_,d),rgba:i.toRgba(c,_,d)}},t.isOpaque=function(t){return 255==(255&t.rgba)},t.ensureContrastRatio=function(t,e,i){const s=r.ensureContrastRatio(t.rgba,e.rgba,i);if(s)return r.toColor(s>>24&255,s>>16&255,s>>8&255)},t.opaque=function(t){const e=(255|t.rgba)>>>0,[s,o,n]=r.toChannels(e);return{css:i.toCss(s,o,n),rgba:e}},t.opacity=e,t.multiplyOpacity=function(t,i){return e(t,(255&t.rgba)*i/255)},t.toColorRGB=function(t){return[t.rgba>>24&255,t.rgba>>16&255,t.rgba>>8&255]}}(e.color||(e.color={})),(e.css||(e.css={})).toColor=function(t){if(t.match(/#[0-9a-f]{3,8}/i))switch(t.length){case 4:{const e=parseInt(t.slice(1,2).repeat(2),16),i=parseInt(t.slice(2,3).repeat(2),16),s=parseInt(t.slice(3,4).repeat(2),16);return r.toColor(e,i,s)}case 5:{const e=parseInt(t.slice(1,2).repeat(2),16),i=parseInt(t.slice(2,3).repeat(2),16),s=parseInt(t.slice(3,4).repeat(2),16),o=parseInt(t.slice(4,5).repeat(2),16);return r.toColor(e,i,s,o)}case 7:return{css:t,rgba:(parseInt(t.slice(1),16)<<8|255)>>>0};case 9:return{css:t,rgba:parseInt(t.slice(1),16)>>>0}}const e=t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(e){const t=parseInt(e[1]),i=parseInt(e[2]),s=parseInt(e[3]),o=Math.round(255*(void 0===e[5]?1:parseFloat(e[5])));return r.toColor(t,i,s,o)}throw new Error("css.toColor: Unsupported css format")},function(t){function e(t,e,i){const s=t/255,r=e/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}t.relativeLuminance=function(t){return e(t>>16&255,t>>8&255,255&t)},t.relativeLuminance2=e}(s=e.rgb||(e.rgb={})),function(t){function e(t,e,i){const r=t>>24&255,o=t>>16&255,a=t>>8&255;let l=e>>24&255,h=e>>16&255,c=e>>8&255,_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));for(;_<i&&(l>0||h>0||c>0);)l-=Math.max(0,Math.ceil(.1*l)),h-=Math.max(0,Math.ceil(.1*h)),c-=Math.max(0,Math.ceil(.1*c)),_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));return(l<<24|h<<16|c<<8|255)>>>0}function r(t,e,i){const r=t>>24&255,o=t>>16&255,a=t>>8&255;let l=e>>24&255,h=e>>16&255,c=e>>8&255,_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));for(;_<i&&(l<255||h<255||c<255);)l=Math.min(255,l+Math.ceil(.1*(255-l))),h=Math.min(255,h+Math.ceil(.1*(255-h))),c=Math.min(255,c+Math.ceil(.1*(255-c))),_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));return(l<<24|h<<16|c<<8|255)>>>0}t.ensureContrastRatio=function(t,i,o){const a=s.relativeLuminance(t>>8),l=s.relativeLuminance(i>>8);if(n(a,l)<o){if(l<a){const l=e(t,i,o),h=n(a,s.relativeLuminance(l>>8));if(h<o){const e=r(t,i,o);return h>n(a,s.relativeLuminance(e>>8))?l:e}return l}const h=r(t,i,o),c=n(a,s.relativeLuminance(h>>8));if(c<o){const r=e(t,i,o);return c>n(a,s.relativeLuminance(r>>8))?h:r}return h}},t.reduceLuminance=e,t.increaseLuminance=r,t.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},t.toColor=function(t,e,s,r){return{css:i.toCss(t,e,s,r),rgba:i.toRgba(t,e,s,r)}}}(r=e.rgba||(e.rgba={})),e.toPaddedHex=o,e.contrastRatio=n},345:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.forwardEvent=e.EventEmitter=void 0,e.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let e=0;e<this._listeners.length;e++)if(this._listeners[e]===t)return void this._listeners.splice(e,1)}})),this._event}fire(t,e){const i=[];for(let t=0;t<this._listeners.length;t++)i.push(this._listeners[t]);for(let s=0;s<i.length;s++)i[s].call(void 0,t,e)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},e.forwardEvent=function(t,e){return t(t=>e.fire(t))}},859:(t,e)=>{function i(t){for(const e of t)e.dispose();t.length=0}Object.defineProperty(e,"__esModule",{value:!0}),e.getDisposeArrayDisposable=e.disposeArray=e.toDisposable=e.Disposable=void 0,e.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const t of this._disposables)t.dispose();this._disposables.length=0}register(t){return this._disposables.push(t),t}unregister(t){const e=this._disposables.indexOf(t);-1!==e&&this._disposables.splice(e,1)}},e.toDisposable=function(t){return{dispose:t}},e.disposeArray=i,e.getDisposeArrayDisposable=function(t){return{dispose:()=>i(t)}}},485:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FourKeyMap=e.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}}e.TwoKeyMap=i,e.FourKeyMap=class{constructor(){this._data=new i}set(t,e,s,r,o){this._data.get(t,e)||this._data.set(t,e,new i),this._data.get(t,e).set(s,r,o)}get(t,e,i,s){var r;return null===(r=this._data.get(t,e))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},399:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isLinux=e.isWindows=e.isIphone=e.isIpad=e.isMac=e.isSafari=e.isLegacyEdge=e.isFirefox=void 0;const i="undefined"==typeof navigator,s=i?"node":navigator.userAgent,r=i?"node":navigator.platform;e.isFirefox=s.includes("Firefox"),e.isLegacyEdge=s.includes("Edge"),e.isSafari=/^((?!chrome|android).)*safari/i.test(s),e.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(r),e.isIpad="iPad"===r,e.isIphone="iPhone"===r,e.isWindows=["Windows","Win16","Win32","WinCE"].includes(r),e.isLinux=r.indexOf("Linux")>=0},455:(t,e)=>{function i(t,e,i=0,s=t.length){if(i>=t.length)return t;i=(t.length+i)%t.length,s=s>=t.length?t.length:(t.length+s)%t.length;for(let r=i;r<s;++r)t[r]=e;return t}Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.fillFallback=e.fill=void 0,e.fill=function(t,e,s,r){return t.fill?t.fill(e,s,r):i(t,e,s,r)},e.fillFallback=i,e.concat=function(t,e){const i=new t.constructor(t.length+e.length);return i.set(t),i.set(e,t.length),i}},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedAttrs=e.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(t){return[t>>>16&255,t>>>8&255,255&t]}static fromColorRGB(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]}clone(){const t=new i;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?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}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}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==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}e.AttributeData=i;class s{constructor(t=0,e=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=e}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(t){this._ext&=-67108864,this._ext|=67108863&t}get urlId(){return this._urlId}set urlId(t){this._urlId=t}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}e.ExtendedAttrs=s},782:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(t){const e=new n;return e.setFromCharData(t),e}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(t){this.fg=t[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let e=!1;if(t[r.CHAR_DATA_CHAR_INDEX].length>2)e=!0;else if(2===t[r.CHAR_DATA_CHAR_INDEX].length){const i=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|t[r.CHAR_DATA_WIDTH_INDEX]<<22:e=!0}else e=!0}else this.content=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22;e&&(this.combinedData=t[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|t[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.CellData=n},855:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WHITESPACE_CELL_CODE=e.WHITESPACE_CELL_WIDTH=e.WHITESPACE_CELL_CHAR=e.NULL_CELL_CODE=e.NULL_CELL_WIDTH=e.NULL_CELL_CHAR=e.CHAR_DATA_CODE_INDEX=e.CHAR_DATA_WIDTH_INDEX=e.CHAR_DATA_CHAR_INDEX=e.CHAR_DATA_ATTR_INDEX=e.DEFAULT_EXT=e.DEFAULT_ATTR=e.DEFAULT_COLOR=void 0,e.DEFAULT_COLOR=256,e.DEFAULT_ATTR=256|e.DEFAULT_COLOR<<9,e.DEFAULT_EXT=0,e.CHAR_DATA_ATTR_INDEX=0,e.CHAR_DATA_CHAR_INDEX=1,e.CHAR_DATA_WIDTH_INDEX=2,e.CHAR_DATA_CODE_INDEX=3,e.NULL_CELL_CHAR="",e.NULL_CELL_WIDTH=1,e.NULL_CELL_CODE=0,e.WHITESPACE_CELL_CHAR=" ",e.WHITESPACE_CELL_WIDTH=1,e.WHITESPACE_CELL_CODE=32},133:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utf8ToUtf32=e.StringToUtf32=e.utf32ToString=e.stringFromCodePoint=void 0,e.stringFromCodePoint=function(t){return t>65535?(t-=65536,String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},e.utf32ToString=function(t,e=0,i=t.length){let s="";for(let r=e;r<i;++r){let e=t[r];e>65535?(e-=65536,s+=String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):s+=String.fromCharCode(e)}return s},e.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){const i=t.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=t.charCodeAt(r++);56320<=i&&i<=57343?e[s++]=1024*(this._interim-55296)+i-56320+65536:(e[s++]=this._interim,e[s++]=i),this._interim=0}for(let o=r;o<i;++o){const r=t.charCodeAt(o);if(55296<=r&&r<=56319){if(++o>=i)return this._interim=r,s;const n=t.charCodeAt(o);56320<=n&&n<=57343?e[s++]=1024*(r-55296)+n-56320+65536:(e[s++]=r,e[s++]=n)}else 65279!==r&&(e[s++]=r)}return s}},e.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){const i=t.length;if(!i)return 0;let s,r,o,n,a=0,l=0,h=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const l=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=l-n;for(;h<c;){if(h>=i)return 0;if(o=t[h++],128!=(192&o)){h--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===l?r<128?h--:e[a++]=r:3===l?r<2048||r>=55296&&r<=57343||65279===r||(e[a++]=r):r<65536||r>1114111||(e[a++]=r)),this.interim.fill(0)}const c=i-4;let _=h;for(;_<i;){for(;!(!(_<c)||128&(s=t[_])||128&(r=t[_+1])||128&(o=t[_+2])||128&(n=t[_+3]));)e[a++]=s,e[a++]=r,e[a++]=o,e[a++]=n,_+=4;if(s=t[_++],s<128)e[a++]=s;else if(192==(224&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(l=(31&s)<<6|63&r,l<128){_--;continue}e[a++]=l}else if(224==(240&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=t[_++],128!=(192&o)){_--;continue}if(l=(15&s)<<12|(63&r)<<6|63&o,l<2048||l>=55296&&l<=57343||65279===l)continue;e[a++]=l}else if(240==(248&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=t[_++],128!=(192&o)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,a;if(n=t[_++],128!=(192&n)){_--;continue}if(l=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,l<65536||l>1114111)continue;e[a++]=l}}return a}}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}var s={};return(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:!0}),t.WebglAddon=void 0;const e=i(666),r=i(345),o=i(399);t.WebglAddon=class{constructor(t){this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=new r.EventEmitter,this._onContextLoss=new r.EventEmitter}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onContextLoss(){return this._onContextLoss.event}activate(t){if(!t.element)throw new Error("Cannot activate WebglAddon before Terminal.open");if(o.isSafari)throw new Error("Webgl is not currently supported on Safari");this._terminal=t;const i=t._core._renderService,s=t._core._characterJoinerService,n=t._core._coreBrowserService,a=t._core.coreService,l=t._core._decorationService,h=t._core._colorManager.colors;this._renderer=new e.WebglRenderer(t,h,s,n,a,l,this._preserveDrawingBuffer),(0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss),(0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas),i.setRenderer(this._renderer)}dispose(){var t;if(!this._terminal)throw new Error("Cannot dispose WebglAddon because it is activated");const e=this._terminal._core._renderService;e.setRenderer(this._terminal._core._createRenderer()),e.onResize(this._terminal.cols,this._terminal.rows),null===(t=this._renderer)||void 0===t||t.dispose(),this._renderer=void 0}get textureAtlas(){var t;return null===(t=this._renderer)||void 0===t?void 0:t.textureAtlas}clearTextureAtlas(){var t;null===(t=this._renderer)||void 0===t||t.clearCharAtlas()}}})(),s})()}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{3321:function(t,e,i){self,t.exports=(()=>{"use strict";var t={965:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphRenderer=void 0;const s=i(381),r=i(455),o=i(855),n=i(859),a=10,l=a*Float32Array.BYTES_PER_ELEMENT,h={i:0,glyph:void 0,leftCellPadding:0,clippedPixels:0};class c extends n.Disposable{constructor(t,e,i,r){super(),this._terminal=t,this._colors=e,this._gl=i,this._dimensions=r,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const o=this._gl;this._program=(0,s.throwIfFalsy)((0,s.createProgram)(o,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in vec2 a_texcoord;\nlayout (location = 5) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}","#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\n\nuniform sampler2D u_texture;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = texture(u_texture, v_texcoord);\n}")),this.register((0,n.toDisposable)(()=>o.deleteProgram(this._program))),this._projectionLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,s.throwIfFalsy)(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);const a=new Float32Array([0,0,1,0,0,1,1,1]),h=o.createBuffer();this.register((0,n.toDisposable)(()=>o.deleteBuffer(h))),o.bindBuffer(o.ARRAY_BUFFER,h),o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const c=new Uint8Array([0,1,3,0,2,3]),_=o.createBuffer();this.register((0,n.toDisposable)(()=>o.deleteBuffer(_))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,_),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(o.createBuffer()),this.register((0,n.toDisposable)(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,l,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,2,o.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,l,6*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,l,8*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),this._atlasTexture=(0,s.throwIfFalsy)(o.createTexture()),this.register((0,n.toDisposable)(()=>o.deleteTexture(this._atlasTexture))),o.bindTexture(o.TEXTURE_2D,this._atlasTexture),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.onResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(t,e,i,s,r,o,n,a){this._updateCell(this._vertices.attributes,t,e,i,s,r,o,n,a)}_updateCell(t,e,i,s,n,l,c,_,d){h.i=(i*this._terminal.cols+e)*a,s!==o.NULL_CELL_CODE&&void 0!==s?this._atlas&&(_&&_.length>1?h.glyph=this._atlas.getRasterizedGlyphCombinedChar(_,n,l,c):h.glyph=this._atlas.getRasterizedGlyph(s,n,l,c),h.leftCellPadding=Math.floor((this._dimensions.scaledCellWidth-this._dimensions.scaledCharWidth)/2),n!==d&&h.glyph.offset.x>h.leftCellPadding?(h.clippedPixels=h.glyph.offset.x-h.leftCellPadding,t[h.i]=-(h.glyph.offset.x-h.clippedPixels)+this._dimensions.scaledCharLeft,t[h.i+1]=-h.glyph.offset.y+this._dimensions.scaledCharTop,t[h.i+2]=(h.glyph.size.x-h.clippedPixels)/this._dimensions.scaledCanvasWidth,t[h.i+3]=h.glyph.size.y/this._dimensions.scaledCanvasHeight,t[h.i+4]=h.glyph.texturePositionClipSpace.x+h.clippedPixels/this._atlas.cacheCanvas.width,t[h.i+5]=h.glyph.texturePositionClipSpace.y,t[h.i+6]=h.glyph.sizeClipSpace.x-h.clippedPixels/this._atlas.cacheCanvas.width,t[h.i+7]=h.glyph.sizeClipSpace.y):(t[h.i]=-h.glyph.offset.x+this._dimensions.scaledCharLeft,t[h.i+1]=-h.glyph.offset.y+this._dimensions.scaledCharTop,t[h.i+2]=h.glyph.size.x/this._dimensions.scaledCanvasWidth,t[h.i+3]=h.glyph.size.y/this._dimensions.scaledCanvasHeight,t[h.i+4]=h.glyph.texturePositionClipSpace.x,t[h.i+5]=h.glyph.texturePositionClipSpace.y,t[h.i+6]=h.glyph.sizeClipSpace.x,t[h.i+7]=h.glyph.sizeClipSpace.y)):(0,r.fill)(t,0,h.i,h.i+a-1-2)}clear(){const t=this._terminal,e=t.cols*t.rows*a;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);for(let t=0;t<this._vertices.attributesBuffers.length;t++)this._vertices.count!==e?this._vertices.attributesBuffers[t]=new Float32Array(e):this._vertices.attributesBuffers[t].fill(0);this._vertices.count=e;let i=0;for(let e=0;e<t.rows;e++)for(let s=0;s<t.cols;s++)this._vertices.attributes[i+8]=s/t.cols,this._vertices.attributes[i+9]=e/t.rows,i+=a}onResize(){const t=this._gl;t.viewport(0,0,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;const e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const i=this._vertices.attributesBuffers[this._activeBuffer];let r=0;for(let e=0;e<t.lineLengths.length;e++){const s=e*this._terminal.cols*a,o=this._vertices.attributes.subarray(s,s+t.lineLengths[e]*a);i.set(o,r),r+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,r),e.STREAM_DRAW),this._atlas.hasCanvasChanged&&(this._atlas.hasCanvasChanged=!1,e.uniform1i(this._textureLocation,0),e.activeTexture(e.TEXTURE0+0),e.bindTexture(e.TEXTURE_2D,this._atlasTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._atlas.cacheCanvas),e.generateMipmap(e.TEXTURE_2D)),e.uniformMatrix4fv(this._projectionLocation,!1,s.PROJECTION_MATRIX),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),e.drawElementsInstanced(e.TRIANGLES,6,e.UNSIGNED_BYTE,0,r/a)}setAtlas(t){const e=this._gl;this._atlas=t,e.bindTexture(e.TEXTURE_2D,this._atlasTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.cacheCanvas),e.generateMipmap(e.TEXTURE_2D)}setDimensions(t){this._dimensions=t}}e.GlyphRenderer=c},742:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleRenderer=void 0;const s=i(381),r=i(310),o=i(859),n=i(302),a=8*Float32Array.BYTES_PER_ELEMENT,l={rgba:0,isDefault:!1,x1:0,y1:0,r:0,g:0,b:0,a:0};class h extends o.Disposable{constructor(t,e,i,r){super(),this._terminal=t,this._colors=e,this._gl=i,this._dimensions=r,this._vertices={count:0,attributes:new Float32Array(160)};const n=this._gl;this._program=(0,s.throwIfFalsy)((0,s.createProgram)(n,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),this.register((0,o.toDisposable)(()=>n.deleteProgram(this._program))),this._projectionLocation=(0,s.throwIfFalsy)(n.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=n.createVertexArray(),n.bindVertexArray(this._vertexArrayObject);const l=new Float32Array([0,0,1,0,0,1,1,1]),h=n.createBuffer();this.register((0,o.toDisposable)(()=>n.deleteBuffer(h))),n.bindBuffer(n.ARRAY_BUFFER,h),n.bufferData(n.ARRAY_BUFFER,l,n.STATIC_DRAW),n.enableVertexAttribArray(3),n.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const c=new Uint8Array([0,1,3,0,2,3]),_=n.createBuffer();this.register((0,o.toDisposable)(()=>n.deleteBuffer(_))),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,_),n.bufferData(n.ELEMENT_ARRAY_BUFFER,c,n.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(n.createBuffer()),this.register((0,o.toDisposable)(()=>n.deleteBuffer(this._attributesBuffer))),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.enableVertexAttribArray(0),n.vertexAttribPointer(0,2,n.FLOAT,!1,a,0),n.vertexAttribDivisor(0,1),n.enableVertexAttribArray(1),n.vertexAttribPointer(1,2,n.FLOAT,!1,a,2*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(1,1),n.enableVertexAttribArray(2),n.vertexAttribPointer(2,4,n.FLOAT,!1,a,4*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(2,1),this._updateCachedColors()}render(){const t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,s.PROJECTION_MATRIX),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,this._vertices.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLES,6,t.UNSIGNED_BYTE,0,this._vertices.count)}onResize(){this._updateViewportRectangle()}setColors(){this._updateCachedColors(),this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(){this._bgFloat=this._colorToFloat32Array(this._colors.background)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.scaledCellWidth,this._terminal.rows*this._dimensions.scaledCellHeight,this._bgFloat)}updateBackgrounds(t){const e=this._terminal,i=this._vertices;let s,o,n,a,l,h,c,_,d,u,g,f=1;for(s=0;s<e.rows;s++){for(n=-1,a=0,l=0,h=!1,o=0;o<e.cols;o++)c=(s*e.cols+o)*r.RENDER_MODEL_INDICIES_PER_CELL,_=t.cells[c+r.RENDER_MODEL_BG_OFFSET],d=t.cells[c+r.RENDER_MODEL_FG_OFFSET],u=!!(67108864&d),(_!==a||d!==l&&(h||u))&&((0!==a||h&&0!==l)&&(g=8*f++,this._updateRectangle(i,g,l,a,n,o,s)),n=o,a=_,l=d,h=u);(0!==a||h&&0!==l)&&(g=8*f++,this._updateRectangle(i,g,l,a,n,e.cols,s))}i.count=f}_updateRectangle(t,e,i,r,o,a,h){if(l.isDefault=!1,67108864&i)switch(50331648&i){case 16777216:case 33554432:l.rgba=this._colors.ansi[255&i].rgba;break;case 50331648:l.rgba=(16777215&i)<<8;break;default:l.rgba=this._colors.foreground.rgba}else switch(50331648&r){case 16777216:case 33554432:l.rgba=this._colors.ansi[255&r].rgba;break;case 50331648:l.rgba=(16777215&r)<<8;break;default:l.rgba=this._colors.background.rgba,l.isDefault=!0}t.attributes.length<e+4&&(t.attributes=(0,s.expandFloat32Array)(t.attributes,this._terminal.rows*this._terminal.cols*8)),l.x1=o*this._dimensions.scaledCellWidth,l.y1=h*this._dimensions.scaledCellHeight,l.r=(l.rgba>>24&255)/255,l.g=(l.rgba>>16&255)/255,l.b=(l.rgba>>8&255)/255,l.a=!l.isDefault&&134217728&r?n.DIM_OPACITY:1,this._addRectangle(t.attributes,e,l.x1,l.y1,(a-o)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,l.r,l.g,l.b,l.a)}_addRectangle(t,e,i,s,r,o,n,a,l,h){t[e]=i/this._dimensions.scaledCanvasWidth,t[e+1]=s/this._dimensions.scaledCanvasHeight,t[e+2]=r/this._dimensions.scaledCanvasWidth,t[e+3]=o/this._dimensions.scaledCanvasHeight,t[e+4]=n,t[e+5]=a,t[e+6]=l,t[e+7]=h}_addRectangleFloat(t,e,i,s,r,o,n){t[e]=i/this._dimensions.scaledCanvasWidth,t[e+1]=s/this._dimensions.scaledCanvasHeight,t[e+2]=r/this._dimensions.scaledCanvasWidth,t[e+3]=o/this._dimensions.scaledCanvasHeight,t[e+4]=n[0],t[e+5]=n[1],t[e+6]=n[2],t[e+7]=n[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(255&t.rgba)/255])}}e.RectangleRenderer=h},310:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderModel=e.COMBINED_CHAR_BIT_MASK=e.RENDER_MODEL_EXT_OFFSET=e.RENDER_MODEL_FG_OFFSET=e.RENDER_MODEL_BG_OFFSET=e.RENDER_MODEL_INDICIES_PER_CELL=void 0;const s=i(455);e.RENDER_MODEL_INDICIES_PER_CELL=4,e.RENDER_MODEL_BG_OFFSET=1,e.RENDER_MODEL_FG_OFFSET=2,e.RENDER_MODEL_EXT_OFFSET=3,e.COMBINED_CHAR_BIT_MASK=2147483648,e.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection={hasSelection:!1,columnSelectMode:!1,viewportStartRow:0,viewportEndRow:0,viewportCappedStartRow:0,viewportCappedEndRow:0,startCol:0,endCol:0}}resize(t,i){const s=t*i*e.RENDER_MODEL_INDICIES_PER_CELL;s!==this.cells.length&&(this.cells=new Uint32Array(s),this.lineLengths=new Uint32Array(i))}clear(){(0,s.fill)(this.cells,0,0),(0,s.fill)(this.lineLengths,0,0)}clearSelection(){this.selection.hasSelection=!1,this.selection.viewportStartRow=0,this.selection.viewportEndRow=0,this.selection.viewportCappedStartRow=0,this.selection.viewportCappedEndRow=0,this.selection.startCol=0,this.selection.endCol=0}}},666:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JoinedCellData=e.WebglRenderer=void 0;const s=i(965),r=i(733),o=i(461),n=i(713),a=i(742),l=i(310),h=i(859),c=i(855),_=i(476),d=i(345),u=i(782),g=i(820),f=i(147),C={fg:0,bg:0,hasFg:!1,hasBg:!1,isSelected:!1};class p extends h.Disposable{constructor(t,e,i,s,a,h,c){super(),this._terminal=t,this._colors=e,this._characterJoinerService=i,this._coreBrowserService=s,this._decorationService=h,this._model=new l.RenderModel,this._workCell=new u.CellData,this._workColors={fg:0,bg:0,ext:0},this._onChangeTextureAtlas=new d.EventEmitter,this._onRequestRedraw=new d.EventEmitter,this._onContextLoss=new d.EventEmitter,this._core=this._terminal._core,this._renderLayers=[new r.LinkRenderLayer(this._core.screenElement,2,this._colors,this._core,this._coreBrowserService),new o.CursorRenderLayer(t,this._core.screenElement,3,this._colors,this._onRequestRedraw,this._coreBrowserService,a)],this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._canvas=document.createElement("canvas");const f={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",f),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",t=>{console.log("webglcontextlost event received"),t.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(t)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",t=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,_.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(t,e)=>this._setCanvasDevicePixelDimensions(t,e))),this._core.screenElement.appendChild(this._canvas),this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement)}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onRequestRedraw(){return this._onRequestRedraw.event}get onContextLoss(){return this._onContextLoss.event}dispose(){var t;for(const t of this._renderLayers)t.dispose();null===(t=this._canvas.parentElement)||void 0===t||t.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal),super.dispose()}get textureAtlas(){var t;return null===(t=this._charAtlas)||void 0===t?void 0:t.cacheCanvas}setColors(t){this._colors=t;for(const t of this._renderLayers)t.setColors(this._terminal,this._colors),t.reset(this._terminal);this._rectangleRenderer.setColors(),this._refreshCharAtlas(),this._clearModel(!0)}onDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.onResize(this._terminal.cols,this._terminal.rows))}onResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const t of this._renderLayers)t.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.scaledCanvasWidth,this._canvas.height=this.dimensions.scaledCanvasHeight,this._canvas.style.width=this.dimensions.canvasWidth+"px",this._canvas.style.height=this.dimensions.canvasHeight+"px",this._core.screenElement.style.width=this.dimensions.canvasWidth+"px",this._core.screenElement.style.height=this.dimensions.canvasHeight+"px",this._rectangleRenderer.setDimensions(this.dimensions),this._rectangleRenderer.onResize(),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.onResize(),this._refreshCharAtlas(),this._clearModel(!1)}onCharSizeChanged(){this.onResize(this._terminal.cols,this._terminal.rows)}onBlur(){for(const t of this._renderLayers)t.onBlur(this._terminal);this._requestRedrawViewport()}onFocus(){for(const t of this._renderLayers)t.onFocus(this._terminal);this._requestRedrawViewport()}onSelectionChanged(t,e,i){for(const s of this._renderLayers)s.onSelectionChanged(this._terminal,t,e,i);this._updateSelectionModel(t,e,i),this._requestRedrawViewport()}onCursorMove(){for(const t of this._renderLayers)t.onCursorMove(this._terminal)}onOptionsChanged(){for(const t of this._renderLayers)t.onOptionsChanged(this._terminal);this._updateDimensions(),this._refreshCharAtlas()}_initializeWebGLState(){var t,e;null===(t=this._rectangleRenderer)||void 0===t||t.dispose(),null===(e=this._glyphRenderer)||void 0===e||e.dispose(),this._rectangleRenderer=new a.RectangleRenderer(this._terminal,this._colors,this._gl,this.dimensions),this._glyphRenderer=new s.GlyphRenderer(this._terminal,this._colors,this._gl,this.dimensions),this.onCharSizeChanged()}_refreshCharAtlas(){if(this.dimensions.scaledCharWidth<=0&&this.dimensions.scaledCharHeight<=0)return void(this._isAttached=!1);const t=(0,n.acquireCharAtlas)(this._terminal,this._colors,this.dimensions.scaledCellWidth,this.dimensions.scaledCellHeight,this.dimensions.scaledCharWidth,this.dimensions.scaledCharHeight,this._coreBrowserService.dpr);if(!("getRasterizedGlyph"in t))throw new Error("The webgl renderer only works with the webgl char atlas");this._charAtlas!==t&&this._onChangeTextureAtlas.fire(t.cacheCanvas),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.clear()}clearCharAtlas(){var t;null===(t=this._charAtlas)||void 0===t||t.clearTexture(),this._clearModel(!0),this._updateModel(0,this._terminal.rows-1),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const t of this._renderLayers)t.reset(this._terminal)}registerCharacterJoiner(t){return-1}deregisterCharacterJoiner(t){return!1}renderRows(t,e){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._core._charSizeService.width&&this._core._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const i of this._renderLayers)i.onGridChanged(this._terminal,t,e);this._glyphRenderer.beginFrame()&&(this._clearModel(!0),this._updateSelectionModel(void 0,void 0)),this._updateModel(t,e),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model)}_updateModel(t,e){const i=this._core;let s,r,o,n,a,h,_,d,u,g,f,C,p,v=this._workCell;for(r=t;r<=e;r++)for(o=r+i.buffer.ydisp,n=i.buffer.lines.get(o),this._model.lineLengths[r]=0,a=this._characterJoinerService.getJoinedCharacters(o),C=0;C<i.cols;C++)if(s=this._workColors.bg,n.loadCell(C,v),0===C&&(s=this._workColors.bg),h=!1,_=C,a.length>0&&C===a[0][0]&&(h=!0,d=a.shift(),v=new m(v,n.translateToString(!0,d[0],d[1]),d[1]-d[0]),_=d[1]-1),u=v.getChars(),g=v.getCode(),f=(r*i.cols+C)*l.RENDER_MODEL_INDICIES_PER_CELL,this._loadColorsForCell(C,o),g!==c.NULL_CELL_CODE&&(this._model.lineLengths[r]=C+1),(this._model.cells[f]!==g||this._model.cells[f+l.RENDER_MODEL_BG_OFFSET]!==this._workColors.bg||this._model.cells[f+l.RENDER_MODEL_FG_OFFSET]!==this._workColors.fg||this._model.cells[f+l.RENDER_MODEL_EXT_OFFSET]!==this._workColors.ext)&&(u.length>1&&(g|=l.COMBINED_CHAR_BIT_MASK),this._model.cells[f]=g,this._model.cells[f+l.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[f+l.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[f+l.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext,this._glyphRenderer.updateCell(C,r,g,this._workColors.bg,this._workColors.fg,this._workColors.ext,u,s),h))for(v=this._workCell,C++;C<_;C++)p=(r*i.cols+C)*l.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.updateCell(C,r,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0),this._model.cells[p]=c.NULL_CELL_CODE,this._model.cells[p+l.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[p+l.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[p+l.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext;this._rectangleRenderer.updateBackgrounds(this._model)}_loadColorsForCell(t,e){this._workColors.bg=this._workCell.bg,this._workColors.fg=this._workCell.fg,this._workColors.ext=268435456&this._workCell.bg?this._workCell.extended.ext:0,C.bg=0,C.fg=0,C.hasBg=!1,C.hasFg=!1,C.isSelected=!1,this._decorationService.forEachDecorationAtCell(t,e,"bottom",t=>{t.backgroundColorRGB&&(C.bg=t.backgroundColorRGB.rgba>>8&16777215,C.hasBg=!0),t.foregroundColorRGB&&(C.fg=t.foregroundColorRGB.rgba>>8&16777215,C.hasFg=!0)}),C.isSelected=this._isCellSelected(t,e),C.isSelected&&(C.bg=(this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque).rgba>>8&16777215,C.hasBg=!0,this._colors.selectionForeground&&(C.fg=this._colors.selectionForeground.rgba>>8&16777215,C.hasFg=!0)),this._decorationService.forEachDecorationAtCell(t,e,"top",t=>{t.backgroundColorRGB&&(C.bg=t.backgroundColorRGB.rgba>>8&16777215,C.hasBg=!0),t.foregroundColorRGB&&(C.fg=t.foregroundColorRGB.rgba>>8&16777215,C.hasFg=!0)}),C.hasBg&&(C.isSelected?C.bg=-16777216&this._workCell.bg&-134217729|C.bg|50331648:C.bg=-16777216&this._workCell.bg|C.bg|50331648),C.hasFg&&(C.fg=-16777216&this._workCell.fg&-67108865|C.fg|50331648),67108864&this._workColors.fg&&(C.hasBg&&!C.hasFg&&(0==(50331648&this._workColors.bg)?C.fg=-134217728&this._workColors.fg|16777215&this._colors.background.rgba>>8|50331648:C.fg=-134217728&this._workColors.fg|67108863&this._workColors.bg,C.hasFg=!0),!C.hasBg&&C.hasFg&&(0==(50331648&this._workColors.fg)?C.bg=-67108864&this._workColors.bg|16777215&this._colors.foreground.rgba>>8|50331648:C.bg=-67108864&this._workColors.bg|67108863&this._workColors.fg,C.hasBg=!0)),this._workColors.bg=C.hasBg?C.bg:this._workColors.bg,this._workColors.fg=C.hasFg?C.fg:this._workColors.fg}_isCellSelected(t,e){return!!this._model.selection.hasSelection&&(e-=this._terminal.buffer.active.viewportY,this._model.selection.columnSelectMode?this._model.selection.startCol<=this._model.selection.endCol?t>=this._model.selection.startCol&&e>=this._model.selection.viewportCappedStartRow&&t<this._model.selection.endCol&&e<=this._model.selection.viewportCappedEndRow:t<this._model.selection.startCol&&e>=this._model.selection.viewportCappedStartRow&&t>=this._model.selection.endCol&&e<=this._model.selection.viewportCappedEndRow:e>this._model.selection.viewportStartRow&&e<this._model.selection.viewportEndRow||this._model.selection.viewportStartRow===this._model.selection.viewportEndRow&&e===this._model.selection.viewportStartRow&&t>=this._model.selection.startCol&&t<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&e===this._model.selection.viewportEndRow&&t<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&e===this._model.selection.viewportStartRow&&t>=this._model.selection.startCol)}_updateSelectionModel(t,e,i=!1){const s=this._terminal;if(!t||!e||t[0]===e[0]&&t[1]===e[1])return void this._model.clearSelection();const r=t[1]-s.buffer.active.viewportY,o=e[1]-s.buffer.active.viewportY,n=Math.max(r,0),a=Math.min(o,s.rows-1);n>=s.rows||a<0?this._model.clearSelection():(this._model.selection.hasSelection=!0,this._model.selection.columnSelectMode=i,this._model.selection.viewportStartRow=r,this._model.selection.viewportEndRow=o,this._model.selection.viewportCappedStartRow=n,this._model.selection.viewportCappedEndRow=a,this._model.selection.startCol=t[0],this._model.selection.endCol=e[0])}_updateDimensions(){this._core._charSizeService.width&&this._core._charSizeService.height&&(this.dimensions.scaledCharWidth=Math.floor(this._core._charSizeService.width*this._devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._core._charSizeService.height*this._devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/this._devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/this._devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.scaledCellHeight/this._devicePixelRatio,this.dimensions.actualCellWidth=this.dimensions.scaledCellWidth/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}}e.WebglRenderer=p;class m extends f.AttributeData{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=m},381:(t,e)=>{function i(t,e,i){const r=s(t.createShader(e));if(t.shaderSource(r,i),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;console.error(t.getShaderInfoLog(r)),t.deleteShader(r)}function s(t){if(!t)throw new Error("value must not be falsy");return t}Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfFalsy=e.expandFloat32Array=e.createShader=e.createProgram=e.PROJECTION_MATRIX=void 0,e.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),e.createProgram=function(t,e,r){const o=s(t.createProgram());if(t.attachShader(o,s(i(t,t.VERTEX_SHADER,e))),t.attachShader(o,s(i(t,t.FRAGMENT_SHADER,r))),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS))return o;console.error(t.getProgramInfoLog(o)),t.deleteProgram(o)},e.createShader=i,e.expandFloat32Array=function(t,e){const i=Math.min(2*t.length,e),s=new Float32Array(i);for(let e=0;e<t.length;e++)s[e]=t[e];return s},e.throwIfFalsy=s},713:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeTerminalFromCache=e.acquireCharAtlas=void 0;const s=i(433),r=i(167),o=[];e.acquireCharAtlas=function(t,e,i,n,a,l,h){const c=(0,s.generateConfig)(i,n,a,l,t,e,h);for(let e=0;e<o.length;e++){const i=o[e],r=i.ownedBy.indexOf(t);if(r>=0){if((0,s.configEquals)(i.config,c))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(e,1)):i.ownedBy.splice(r,1);break}}for(let e=0;e<o.length;e++){const i=o[e];if((0,s.configEquals)(i.config,c))return i.ownedBy.push(t),i.atlas}const _=t._core,d={atlas:new r.WebglCharAtlas(document,c,_.unicodeService),config:c,ownedBy:[t]};return o.push(d),d.atlas},e.removeTerminalFromCache=function(t){for(let e=0;e<o.length;e++){const i=o[e].ownedBy.indexOf(t);if(-1!==i){1===o[e].ownedBy.length?(o[e].atlas.dispose(),o.splice(e,1)):o[e].ownedBy.splice(i,1);break}}}},433:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.is256Color=e.configEquals=e.generateConfig=void 0;const i={css:"",rgba:0};e.generateConfig=function(t,e,s,r,o,n,a){const l={foreground:n.foreground,background:n.background,cursor:i,cursorAccent:i,selectionForeground:i,selectionBackgroundTransparent:i,selectionBackgroundOpaque:i,selectionInactiveBackgroundTransparent:i,selectionInactiveBackgroundOpaque:i,ansi:n.ansi.slice(),contrastCache:n.contrastCache};return{customGlyphs:o.options.customGlyphs,devicePixelRatio:a,letterSpacing:o.options.letterSpacing,lineHeight:o.options.lineHeight,scaledCellWidth:t,scaledCellHeight:e,scaledCharWidth:s,scaledCharHeight:r,fontFamily:o.options.fontFamily,fontSize:o.options.fontSize,fontWeight:o.options.fontWeight,fontWeightBold:o.options.fontWeightBold,allowTransparency:o.options.allowTransparency,drawBoldTextInBrightColors:o.options.drawBoldTextInBrightColors,minimumContrastRatio:o.options.minimumContrastRatio,colors:l}},e.configEquals=function(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.scaledCharWidth===e.scaledCharWidth&&t.scaledCharHeight===e.scaledCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground===e.colors.foreground&&t.colors.background===e.colors.background},e.is256Color=function(t){return 16777216==(50331648&t)||33554432==(50331648&t)}},167:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebglCharAtlas=void 0;const s=i(302),r=i(855),o=i(381),n=i(147),a=i(160),l=i(14),h=i(634),c=i(485),_=1024,d=1024,u=Math.floor(819.2),g={css:"rgba(0, 0, 0, 0)",rgba:0},f={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},C={glyph:void 0};function p(t,e,i,s){const r=e.rgba>>>24,o=e.rgba>>>16&255,n=e.rgba>>>8&255,a=i.rgba>>>24,l=i.rgba>>>16&255,h=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(o-l)+Math.abs(n-h))/12);let _=!0;for(let e=0;e<t.data.length;e+=4)t.data[e]===r&&t.data[e+1]===o&&t.data[e+2]===n||s&&Math.abs(t.data[e]-r)+Math.abs(t.data[e+1]-o)+Math.abs(t.data[e+2]-n)<c?t.data[e+3]=0:_=!1;return _}e.WebglCharAtlas=class{constructor(t,e,i){this._config=e,this._unicodeService=i,this._didWarmUp=!1,this._cacheMap=new c.FourKeyMap,this._cacheMapCombined=new c.FourKeyMap,this._currentRow={x:0,y:0,height:0},this._fixedRows=[],this.hasCanvasChanged=!1,this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this.cacheCanvas=t.createElement("canvas"),this.cacheCanvas.width=_,this.cacheCanvas.height=d,this._cacheCtx=(0,o.throwIfFalsy)(this.cacheCanvas.getContext("2d",{alpha:!0})),this._tmpCanvas=t.createElement("canvas"),this._tmpCanvas.width=4*this._config.scaledCellWidth+4,this._tmpCanvas.height=this._config.scaledCellHeight+4,this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency}))}dispose(){this.cacheCanvas.parentElement&&this.cacheCanvas.parentElement.removeChild(this.cacheCanvas)}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){for(let t=33;t<126;t++){const e=this._drawToCache(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,e)}}beginFrame(){return this._currentRow.y>u&&(this.clearTexture(),this.warmUp(),!0)}clearTexture(){0===this._currentRow.x&&0===this._currentRow.y||(this._cacheCtx.clearRect(0,0,_,d),this._cacheMap.clear(),this._cacheMapCombined.clear(),this._currentRow.x=0,this._currentRow.y=0,this._currentRow.height=0,this._fixedRows.length=0,this._didWarmUp=!1)}getRasterizedGlyphCombinedChar(t,e,i,s){return this._getFromCacheMap(this._cacheMapCombined,t,e,i,s)}getRasterizedGlyph(t,e,i,s){return this._getFromCacheMap(this._cacheMap,t,e,i,s)}_getFromCacheMap(t,e,i,s,r){return C.glyph=t.get(e,i,s,r),C.glyph||(C.glyph=this._drawToCache(e,i,s,r),t.set(e,i,s,r,C.glyph)),C.glyph}_getColorFromAnsiIndex(t){if(t>=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,e,i,r){if(this._config.allowTransparency)return g;let o;switch(t){case 16777216:case 33554432:o=this._getColorFromAnsiIndex(e);break;case 50331648:const t=n.AttributeData.toColorRGB(e);o=a.rgba.toColor(t[0],t[1],t[2]);break;default:o=i?this._config.colors.foreground:this._config.colors.background}return r&&(o=a.color.blend(this._config.colors.background,a.color.multiplyOpacity(o,s.DIM_OPACITY))),o}_getForegroundColor(t,e,i,r,o,l,h,c,_,d){const u=this._getMinimumContrastColor(t,e,i,r,o,l,!1,_,d);if(u)return u;let g;switch(o){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&_&&l<8&&(l+=8),g=this._getColorFromAnsiIndex(l);break;case 50331648:const t=n.AttributeData.toColorRGB(l);g=a.rgba.toColor(t[0],t[1],t[2]);break;default:g=h?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(g=a.color.opaque(g)),c&&(g=a.color.multiplyOpacity(g,s.DIM_OPACITY)),g}_resolveBackgroundRgba(t,e,i){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(e).rgba;case 50331648:return e<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,e,i,s){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&e<8&&(e+=8),this._getColorFromAnsiIndex(e).rgba;case 50331648:return e<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,e,i,s,r,o,n,l,h){if(1===this._config.minimumContrastRatio||h)return;const c=this._config.colors.contrastCache.getColor(t,s);if(void 0!==c)return c||void 0;const _=this._resolveBackgroundRgba(e,i,n),d=this._resolveForegroundRgba(r,o,n,l),u=a.rgba.ensureContrastRatio(_,d,this._config.minimumContrastRatio);if(!u)return void this._config.colors.contrastCache.setColor(t,s,null);const g=a.rgba.toColor(u>>24&255,u>>16&255,u>>8&255);return this._config.colors.contrastCache.setColor(t,s,g),g}_drawToCache(t,e,i,r){const o="number"==typeof t?String.fromCharCode(t):t;this.hasCanvasChanged=!0;const a=this._config.scaledCellWidth*Math.max(o.length,2)+4;this._tmpCanvas.width<a&&(this._tmpCanvas.width=a);const c=this._config.scaledCellHeight+8;if(this._tmpCanvas.height<c&&(this._tmpCanvas.height=c),this._tmpCtx.save(),this._workAttributeData.fg=i,this._workAttributeData.bg=e,this._workAttributeData.extended.ext=r,this._workAttributeData.isInvisible())return f;const u=!!this._workAttributeData.isBold(),g=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),m=!!this._workAttributeData.isItalic(),v=!!this._workAttributeData.isUnderline(),L=!!this._workAttributeData.isStrikethrough();let w=this._workAttributeData.getFgColor(),x=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),M=this._workAttributeData.getBgColorMode();if(g){const t=w;w=b,b=t;const e=x;x=M,M=e}const y=this._getBackgroundColor(M,b,g,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const R=u?this._config.fontWeightBold:this._config.fontWeight,E=m?"italic":"";this._tmpCtx.font=`${E} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=s.TEXT_BASELINE;const A=1===o.length&&(0,h.isPowerlineGlyph)(o.charCodeAt(0)),D=1===o.length&&(0,h.isRestrictedPowerlineGlyph)(o.charCodeAt(0)),T=this._getForegroundColor(e,M,b,i,x,w,g,C,u,(0,h.excludeFromContrastRatioDemands)(o.charCodeAt(0)));this._tmpCtx.fillStyle=T.css;const S=D?0:4;let B=!1;!1!==this._config.customGlyphs&&(B=(0,l.tryDrawCustomChar)(this._tmpCtx,o,S,S,this._config.scaledCellWidth,this._config.scaledCellHeight,this._config.fontSize,this._config.devicePixelRatio));let F,k=!A;if(F="number"==typeof t?this._unicodeService.wcwidth(t):this._unicodeService.getStringCellWidth(t),v){this._tmpCtx.save();const t=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),e=t%2==1?.5:0;if(this._tmpCtx.lineWidth=t,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())k=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{k=!1;let t=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&t<8&&(t+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(t).css}this._tmpCtx.beginPath();const i=S,s=Math.ceil(S+this._config.scaledCharHeight)-e,r=S+this._config.scaledCharHeight+t-e,a=Math.ceil(S+this._config.scaledCharHeight+2*t)-e;for(let o=0;o<F;o++){this._tmpCtx.save();const n=i+o*this._config.scaledCellWidth,l=i+(o+1)*this._config.scaledCellWidth,h=n+this._config.scaledCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s),this._tmpCtx.moveTo(n,a),this._tmpCtx.lineTo(l,a);break;case 3:const i=t<=1?a:Math.ceil(S+this._config.scaledCharHeight-t/2)-e,o=t<=1?s:Math.ceil(S+this._config.scaledCharHeight+t/2)-e,c=new Path2D;c.rect(n,s,this._config.scaledCellWidth,a-s),this._tmpCtx.clip(c),this._tmpCtx.moveTo(n-this._config.scaledCellWidth/2,r),this._tmpCtx.bezierCurveTo(n-this._config.scaledCellWidth/2,o,n,o,n,r),this._tmpCtx.bezierCurveTo(n,i,h,i,h,r),this._tmpCtx.bezierCurveTo(h,o,l,o,l,r),this._tmpCtx.bezierCurveTo(l,i,l+this._config.scaledCellWidth/2,i,l+this._config.scaledCellWidth/2,r);break;case 4:this._tmpCtx.setLineDash([2*this._config.devicePixelRatio,this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s);break;default:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(l,s)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!B&&this._config.fontSize>=12&&!this._config.allowTransparency&&" "!==o){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const e=this._tmpCtx.measureText(o);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in e&&e.actualBoundingBoxDescent>0){this._tmpCtx.save();const e=new Path2D;e.rect(i,s-Math.ceil(t/2),this._config.scaledCellWidth,a-s+Math.ceil(t/2)),this._tmpCtx.clip(e),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=y.css,this._tmpCtx.strokeText(o,S,S+this._config.scaledCharHeight),this._tmpCtx.restore()}}}if(B||this._tmpCtx.fillText(o,S,S+this._config.scaledCharHeight),"_"===o&&!this._config.allowTransparency){let t=p(this._tmpCtx.getImageData(S,S,this._config.scaledCellWidth,this._config.scaledCellHeight),y,T,k);if(t)for(let e=1;e<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(o,S,S+this._config.scaledCharHeight-e),t=p(this._tmpCtx.getImageData(S,S,this._config.scaledCellWidth,this._config.scaledCellHeight),y,T,k),t);e++);}if(L){const t=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),e=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=t,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(S,S+Math.floor(this._config.scaledCharHeight/2)-e),this._tmpCtx.lineTo(S+this._config.scaledCharWidth*F,S+Math.floor(this._config.scaledCharHeight/2)-e),this._tmpCtx.stroke()}this._tmpCtx.restore();const I=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let $;if($=this._config.allowTransparency?function(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}(I):p(I,y,T,k),$)return f;const P=this._findGlyphBoundingBox(I,this._workBoundingBox,a,D,B,S),W=this._clipImageData(I,this._workBoundingBox);let O;for(;;){O=this._currentRow;for(const t of this._fixedRows)(O===this._currentRow||t.height<O.height)&&P.size.y<=t.height&&(O=t);if(O.height>2*P.size.y&&(this._currentRow.height>0&&this._fixedRows.push(this._currentRow),O={x:0,y:this._currentRow.y+this._currentRow.height,height:P.size.y},this._fixedRows.push(O),this._currentRow={x:0,y:O.y+O.height,height:0}),O.x+P.size.x<=_)break;O===this._currentRow?(O.x=0,O.y+=O.height,O.height=0):this._fixedRows.splice(this._fixedRows.indexOf(O),1)}return P.texturePosition.x=O.x,P.texturePosition.y=O.y,P.texturePositionClipSpace.x=O.x/_,P.texturePositionClipSpace.y=O.y/d,O.height=Math.max(O.height,P.size.y),O.x+=P.size.x,this._cacheCtx.putImageData(W,P.texturePosition.x,P.texturePosition.y),P}_findGlyphBoundingBox(t,e,i,s,r,o){e.top=0;const n=s?this._config.scaledCellHeight:this._tmpCanvas.height,a=s?this._config.scaledCellWidth:i;let l=!1;for(let i=0;i<n;i++){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==t.data[r]){e.top=i,l=!0;break}}if(l)break}e.left=0,l=!1;for(let i=0;i<a;i++){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==t.data[r]){e.left=i,l=!0;break}}if(l)break}e.right=a,l=!1;for(let i=a-1;i>=0;i--){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==t.data[r]){e.right=i,l=!0;break}}if(l)break}e.bottom=n,l=!1;for(let i=n-1;i>=0;i--){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==t.data[r]){e.bottom=i,l=!0;break}}if(l)break}return{texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:e.right-e.left+1,y:e.bottom-e.top+1},sizeClipSpace:{x:(e.right-e.left+1)/_,y:(e.bottom-e.top+1)/d},offset:{x:-e.left+o+(s||r?Math.floor((this._config.scaledCellWidth-this._config.scaledCharWidth)/2):0),y:-e.top+o+(s||r?1===this._config.lineHeight?0:Math.round((this._config.scaledCellHeight-this._config.scaledCharHeight)/2):0)}}}_clipImageData(t,e){const i=e.right-e.left+1,s=e.bottom-e.top+1,r=new Uint8ClampedArray(i*s*4);for(let s=e.top;s<=e.bottom;s++)for(let o=e.left;o<=e.right;o++){const n=s*this._tmpCanvas.width*4+4*o,a=(s-e.top)*i*4+4*(o-e.left);r[a]=t.data[n],r[a+1]=t.data[n+1],r[a+2]=t.data[n+2],r[a+3]=t.data[n+3]}return new ImageData(r,i,s)}}},592:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRenderLayer=void 0;const s=i(713),r=i(302),o=i(381);e.BaseRenderLayer=class{constructor(t,e,i,s,r,o){this._container=t,this._alpha=s,this._colors=r,this._coreBrowserService=o,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${e}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}dispose(){this._canvas.remove(),this._charAtlas&&this._charAtlas.dispose()}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}onOptionsChanged(t){}onBlur(t){}onFocus(t){}onCursorMove(t){}onGridChanged(t,e,i){}onSelectionChanged(t,e,i,s=!1){}setColors(t,e){this._refreshCharAtlas(t,e)}_setTransparency(t,e){if(e===this._alpha)return;const i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._colors),this.onGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,s.acquireCharAtlas)(t,e,this._scaledCellWidth,this._scaledCellHeight,this._scaledCharWidth,this._scaledCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(t,e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._colors)}_fillCells(t,e,i,s){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._scaledCellWidth,(e+1)*this._scaledCellHeight-this._coreBrowserService.dpr-1,i*this._scaledCellWidth,this._coreBrowserService.dpr)}_fillLeftLineAtCell(t,e,i){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,this._coreBrowserService.dpr*i,this._scaledCellHeight)}_strokeRectAtCell(t,e,i,s){this._ctx.lineWidth=this._coreBrowserService.dpr,this._ctx.strokeRect(t*this._scaledCellWidth+this._coreBrowserService.dpr/2,e*this._scaledCellHeight+this._coreBrowserService.dpr/2,i*this._scaledCellWidth-this._coreBrowserService.dpr,s*this._scaledCellHeight-this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,s){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,s*this._scaledCellHeight))}_fillCharTrueColor(t,e,i,s){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=r.TEXT_BASELINE,this._clipCell(i,s,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._scaledCellWidth,e*this._scaledCellHeight,i*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()}_getFont(t,e,i){return`${i?"italic":""} ${e?t.options.fontWeightBold:t.options.fontWeight} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}}},461:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorRenderLayer=void 0;const s=i(592),r=i(782);class o extends s.BaseRenderLayer{constructor(t,e,i,s,o,n,a){super(e,"cursor",i,!0,s,n),this._onRequestRefreshRowsEvent=o,this._coreService=a,this._cell=new r.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this.onOptionsChanged(t)}dispose(){var t;null===(t=this._cursorBlinkStateManager)||void 0===t||t.dispose(),this._cursorBlinkStateManager=void 0,super.dispose()}resize(t,e){super.resize(t,e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(t){var e;this._clearCursor(),null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(t),this.onOptionsChanged(t)}onBlur(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.pause(),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onFocus(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.resume(t),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onOptionsChanged(t){var e;t.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new n(()=>{this._render(t,!0)},this._coreBrowserService)):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:t.buffer.active.cursorY,end:t.buffer.active.cursorY})}onCursorMove(t){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(t)}onGridChanged(t,e,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(t,!1):this._cursorBlinkStateManager.restartBlinkAnimation(t)}_render(t,e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const i=t.buffer.active.baseY+t.buffer.active.cursorY,s=i-t.buffer.active.viewportY,r=Math.min(t.buffer.active.cursorX,t.cols-1);if(s<0||s>=t.rows)this._clearCursor();else if(t._core.buffer.lines.get(i).loadCell(r,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;const e=t.options.cursorStyle;return e&&"block"!==e?this._cursorRenderers[e](t,r,s,this._cell):this._renderBlurCursor(t,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=e,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,i,t.options.cursorWidth),this._ctx.restore()}_renderBlockCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,i,s.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(t,s,e,i),this._ctx.restore()}_renderUnderlineCursor(t,e,i,s){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,i),this._ctx.restore()}_renderBlurCursor(t,e,i,s){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,i,s.getWidth(),1),this._ctx.restore()}}e.CursorRenderLayer=o;class n{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,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(t){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const t=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0)return void this._restartInterval(t)}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 t=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(t)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},t)}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(t){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation(t)}}},733:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkRenderLayer=void 0;const s=i(592),r=i(302),o=i(433);class n extends s.BaseRenderLayer{constructor(t,e,i,s,r){super(t,"link",e,!0,i,r),s.linkifier2.onShowLinkUnderline(t=>this._onShowLinkUnderline(t)),s.linkifier2.onHideLinkUnderline(t=>this._onHideLinkUnderline(t))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_onShowLinkUnderline(t){if(t.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:void 0!==t.fg&&(0,o.is256Color)(t.fg)?this._ctx.fillStyle=this._colors.ansi[t.fg].css:this._ctx.fillStyle=this._colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_onHideLinkUnderline(t){this._clearCurrentLink()}}e.LinkRenderLayer=n},820:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addDisposableDomListener=void 0,e.addDisposableDomListener=function(t,e,i,s){t.addEventListener(e,i,s);let r=!1;return{dispose:()=>{r||(r=!0,t.removeEventListener(e,i,s))}}}},302:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=e.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);e.INVERTED_DEFAULT_COLOR=257,e.DIM_OPACITY=.5,e.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},14:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tryDrawCustomChar=e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0;const s=i(634);e.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:9,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 r={"░":[[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]]};e.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:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},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:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},e.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:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,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:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1}},e.tryDrawCustomChar=function(t,i,n,h,c,_,d,u){const g=e.blockElementDefinitions[i];if(g)return function(t,e,i,s,r,o){for(let n=0;n<e.length;n++){const a=e[n],l=r/8,h=o/8;t.fillRect(i+a.x*l,s+a.y*h,a.w*l,a.h*h)}}(t,g,n,h,c,_),!0;const f=r[i];if(f)return function(t,e,i,r,n,a){let l=o.get(e);l||(l=new Map,o.set(e,l));const h=t.fillStyle;if("string"!=typeof h)throw new Error(`Unexpected fillStyle type "${h}"`);let c=l.get(h);if(!c){const i=e[0].length,r=e.length,o=document.createElement("canvas");o.width=i,o.height=r;const n=(0,s.throwIfFalsy)(o.getContext("2d")),a=new ImageData(i,r);let _,d,u,g;if(h.startsWith("#"))_=parseInt(h.slice(1,3),16),d=parseInt(h.slice(3,5),16),u=parseInt(h.slice(5,7),16),g=h.length>7&&parseInt(h.slice(7,9),16)||1;else{if(!h.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${h}" when drawing pattern glyph`);[_,d,u,g]=h.substring(5,h.length-1).split(",").map(t=>parseFloat(t))}for(let t=0;t<r;t++)for(let s=0;s<i;s++)a.data[4*(t*i+s)]=_,a.data[4*(t*i+s)+1]=d,a.data[4*(t*i+s)+2]=u,a.data[4*(t*i+s)+3]=e[t][s]*(255*g);n.putImageData(a,0,0),c=(0,s.throwIfFalsy)(t.createPattern(o,null)),l.set(h,c)}t.fillStyle=c,t.fillRect(i,r,n,a)}(t,f,n,h,c,_),!0;const C=e.boxDrawingDefinitions[i];if(C)return function(t,e,i,s,r,o,n){t.strokeStyle=t.fillStyle;for(const[h,c]of Object.entries(e)){let e;t.beginPath(),t.lineWidth=n*Number.parseInt(h),e="function"==typeof c?c(.15,.15/o*r):c;for(const h of e.split(" ")){const e=h[0],c=a[e];if(!c){console.error(`Could not find drawing instructions for "${e}"`);continue}const _=h.substring(1).split(",");_[0]&&_[1]&&c(t,l(_,r,o,i,s,!0,n))}t.stroke(),t.closePath()}}(t,C,n,h,c,_,u),!0;const p=e.powerlineDefinitions[i];return!!p&&(function(t,e,i,s,r,o,n,h){var c,_;t.beginPath();const d=n/12;t.lineWidth=h*d;for(const n of e.d.split(" ")){const h=n[0],u=a[h];if(!u){console.error(`Could not find drawing instructions for "${h}"`);continue}const g=n.substring(1).split(",");g[0]&&g[1]&&u(t,l(g,r,o,i,s,!1,(null!==(c=e.leftPadding)&&void 0!==c?c:0)*(d/2),(null!==(_=e.rightPadding)&&void 0!==_?_:0)*(d/2)))}1===e.type?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}(t,p,n,h,c,_,d,u),!0)};const o=new Map;function n(t,e,i=0){return Math.max(Math.min(t,e),i)}const a={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function l(t,e,i,s,r,o,a,l=0,h=0){const c=t.map(t=>parseFloat(t)||parseInt(t));if(c.length<2)throw new Error("Too few arguments for instruction");for(let t=0;t<c.length;t+=2)c[t]*=e-l*a-h*a,o&&0!==c[t]&&(c[t]=n(Math.round(c[t]+.5)-.5,e,0)),c[t]+=s+l*a;for(let t=1;t<c.length;t+=2)c[t]*=i,o&&0!==c[t]&&(c[t]=n(Math.round(c[t]+.5)-.5,i,0)),c[t]+=r;return c}},476:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=void 0;const s=i(859);e.observeDevicePixelDimensions=function(t,e,i){let r=new e.ResizeObserver(e=>{const s=e.find(e=>e.target===t);if(!s)return;if(!("devicePixelContentBoxSize"in s))return null==r||r.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)});try{r.observe(t,{box:["device-pixel-content-box"]})}catch(t){r.disconnect(),r=void 0}return(0,s.toDisposable)(()=>null==r?void 0:r.disconnect())}},634:(t,e)=>{function i(t){return 57508<=t&&t<=57558}Object.defineProperty(e,"__esModule",{value:!0}),e.excludeFromContrastRatioDemands=e.isRestrictedPowerlineGlyph=e.isPowerlineGlyph=e.throwIfFalsy=void 0,e.throwIfFalsy=function(t){if(!t)throw new Error("value must not be falsy");return t},e.isPowerlineGlyph=i,e.isRestrictedPowerlineGlyph=function(t){return 57520<=t&&t<=57527},e.excludeFromContrastRatioDemands=function(t){return i(t)||function(t){return 9472<=t&&t<=9631}(t)}},160:(t,e)=>{var i,s,r;function o(t){const e=t.toString(16);return e.length<2?"0"+e:e}function n(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}Object.defineProperty(e,"__esModule",{value:!0}),e.contrastRatio=e.toPaddedHex=e.rgba=e.rgb=e.css=e.color=e.channels=void 0,function(t){t.toCss=function(t,e,i,s){return void 0!==s?`#${o(t)}${o(e)}${o(i)}${o(s)}`:`#${o(t)}${o(e)}${o(i)}`},t.toRgba=function(t,e,i,s=255){return(t<<24|e<<16|i<<8|s)>>>0}}(i=e.channels||(e.channels={})),function(t){function e(t,e){const s=Math.round(255*e),[o,n,a]=r.toChannels(t.rgba);return{css:i.toCss(o,n,a,s),rgba:i.toRgba(o,n,a,s)}}t.blend=function(t,e){const s=(255&e.rgba)/255;if(1===s)return{css:e.css,rgba:e.rgba};const r=e.rgba>>24&255,o=e.rgba>>16&255,n=e.rgba>>8&255,a=t.rgba>>24&255,l=t.rgba>>16&255,h=t.rgba>>8&255,c=a+Math.round((r-a)*s),_=l+Math.round((o-l)*s),d=h+Math.round((n-h)*s);return{css:i.toCss(c,_,d),rgba:i.toRgba(c,_,d)}},t.isOpaque=function(t){return 255==(255&t.rgba)},t.ensureContrastRatio=function(t,e,i){const s=r.ensureContrastRatio(t.rgba,e.rgba,i);if(s)return r.toColor(s>>24&255,s>>16&255,s>>8&255)},t.opaque=function(t){const e=(255|t.rgba)>>>0,[s,o,n]=r.toChannels(e);return{css:i.toCss(s,o,n),rgba:e}},t.opacity=e,t.multiplyOpacity=function(t,i){return e(t,(255&t.rgba)*i/255)},t.toColorRGB=function(t){return[t.rgba>>24&255,t.rgba>>16&255,t.rgba>>8&255]}}(e.color||(e.color={})),(e.css||(e.css={})).toColor=function(t){if(t.match(/#[0-9a-f]{3,8}/i))switch(t.length){case 4:{const e=parseInt(t.slice(1,2).repeat(2),16),i=parseInt(t.slice(2,3).repeat(2),16),s=parseInt(t.slice(3,4).repeat(2),16);return r.toColor(e,i,s)}case 5:{const e=parseInt(t.slice(1,2).repeat(2),16),i=parseInt(t.slice(2,3).repeat(2),16),s=parseInt(t.slice(3,4).repeat(2),16),o=parseInt(t.slice(4,5).repeat(2),16);return r.toColor(e,i,s,o)}case 7:return{css:t,rgba:(parseInt(t.slice(1),16)<<8|255)>>>0};case 9:return{css:t,rgba:parseInt(t.slice(1),16)>>>0}}const e=t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(e){const t=parseInt(e[1]),i=parseInt(e[2]),s=parseInt(e[3]),o=Math.round(255*(void 0===e[5]?1:parseFloat(e[5])));return r.toColor(t,i,s,o)}throw new Error("css.toColor: Unsupported css format")},function(t){function e(t,e,i){const s=t/255,r=e/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}t.relativeLuminance=function(t){return e(t>>16&255,t>>8&255,255&t)},t.relativeLuminance2=e}(s=e.rgb||(e.rgb={})),function(t){function e(t,e,i){const r=t>>24&255,o=t>>16&255,a=t>>8&255;let l=e>>24&255,h=e>>16&255,c=e>>8&255,_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));for(;_<i&&(l>0||h>0||c>0);)l-=Math.max(0,Math.ceil(.1*l)),h-=Math.max(0,Math.ceil(.1*h)),c-=Math.max(0,Math.ceil(.1*c)),_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));return(l<<24|h<<16|c<<8|255)>>>0}function r(t,e,i){const r=t>>24&255,o=t>>16&255,a=t>>8&255;let l=e>>24&255,h=e>>16&255,c=e>>8&255,_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));for(;_<i&&(l<255||h<255||c<255);)l=Math.min(255,l+Math.ceil(.1*(255-l))),h=Math.min(255,h+Math.ceil(.1*(255-h))),c=Math.min(255,c+Math.ceil(.1*(255-c))),_=n(s.relativeLuminance2(l,h,c),s.relativeLuminance2(r,o,a));return(l<<24|h<<16|c<<8|255)>>>0}t.ensureContrastRatio=function(t,i,o){const a=s.relativeLuminance(t>>8),l=s.relativeLuminance(i>>8);if(n(a,l)<o){if(l<a){const l=e(t,i,o),h=n(a,s.relativeLuminance(l>>8));if(h<o){const e=r(t,i,o);return h>n(a,s.relativeLuminance(e>>8))?l:e}return l}const h=r(t,i,o),c=n(a,s.relativeLuminance(h>>8));if(c<o){const r=e(t,i,o);return c>n(a,s.relativeLuminance(r>>8))?h:r}return h}},t.reduceLuminance=e,t.increaseLuminance=r,t.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},t.toColor=function(t,e,s,r){return{css:i.toCss(t,e,s,r),rgba:i.toRgba(t,e,s,r)}}}(r=e.rgba||(e.rgba={})),e.toPaddedHex=o,e.contrastRatio=n},345:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.forwardEvent=e.EventEmitter=void 0,e.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let e=0;e<this._listeners.length;e++)if(this._listeners[e]===t)return void this._listeners.splice(e,1)}})),this._event}fire(t,e){const i=[];for(let t=0;t<this._listeners.length;t++)i.push(this._listeners[t]);for(let s=0;s<i.length;s++)i[s].call(void 0,t,e)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},e.forwardEvent=function(t,e){return t(t=>e.fire(t))}},859:(t,e)=>{function i(t){for(const e of t)e.dispose();t.length=0}Object.defineProperty(e,"__esModule",{value:!0}),e.getDisposeArrayDisposable=e.disposeArray=e.toDisposable=e.Disposable=void 0,e.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const t of this._disposables)t.dispose();this._disposables.length=0}register(t){return this._disposables.push(t),t}unregister(t){const e=this._disposables.indexOf(t);-1!==e&&this._disposables.splice(e,1)}},e.toDisposable=function(t){return{dispose:t}},e.disposeArray=i,e.getDisposeArrayDisposable=function(t){return{dispose:()=>i(t)}}},485:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FourKeyMap=e.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}}e.TwoKeyMap=i,e.FourKeyMap=class{constructor(){this._data=new i}set(t,e,s,r,o){this._data.get(t,e)||this._data.set(t,e,new i),this._data.get(t,e).set(s,r,o)}get(t,e,i,s){var r;return null===(r=this._data.get(t,e))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},399:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isLinux=e.isWindows=e.isIphone=e.isIpad=e.isMac=e.isSafari=e.isLegacyEdge=e.isFirefox=void 0;const i="undefined"==typeof navigator,s=i?"node":navigator.userAgent,r=i?"node":navigator.platform;e.isFirefox=s.includes("Firefox"),e.isLegacyEdge=s.includes("Edge"),e.isSafari=/^((?!chrome|android).)*safari/i.test(s),e.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(r),e.isIpad="iPad"===r,e.isIphone="iPhone"===r,e.isWindows=["Windows","Win16","Win32","WinCE"].includes(r),e.isLinux=r.indexOf("Linux")>=0},455:(t,e)=>{function i(t,e,i=0,s=t.length){if(i>=t.length)return t;i=(t.length+i)%t.length,s=s>=t.length?t.length:(t.length+s)%t.length;for(let r=i;r<s;++r)t[r]=e;return t}Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.fillFallback=e.fill=void 0,e.fill=function(t,e,s,r){return t.fill?t.fill(e,s,r):i(t,e,s,r)},e.fillFallback=i,e.concat=function(t,e){const i=new t.constructor(t.length+e.length);return i.set(t),i.set(e,t.length),i}},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedAttrs=e.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(t){return[t>>>16&255,t>>>8&255,255&t]}static fromColorRGB(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]}clone(){const t=new i;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?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}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}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==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}e.AttributeData=i;class s{constructor(t=0,e=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=e}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(t){this._ext&=-67108864,this._ext|=67108863&t}get urlId(){return this._urlId}set urlId(t){this._urlId=t}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}e.ExtendedAttrs=s},782:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(t){const e=new n;return e.setFromCharData(t),e}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(t){this.fg=t[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let e=!1;if(t[r.CHAR_DATA_CHAR_INDEX].length>2)e=!0;else if(2===t[r.CHAR_DATA_CHAR_INDEX].length){const i=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|t[r.CHAR_DATA_WIDTH_INDEX]<<22:e=!0}else e=!0}else this.content=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22;e&&(this.combinedData=t[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|t[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.CellData=n},855:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WHITESPACE_CELL_CODE=e.WHITESPACE_CELL_WIDTH=e.WHITESPACE_CELL_CHAR=e.NULL_CELL_CODE=e.NULL_CELL_WIDTH=e.NULL_CELL_CHAR=e.CHAR_DATA_CODE_INDEX=e.CHAR_DATA_WIDTH_INDEX=e.CHAR_DATA_CHAR_INDEX=e.CHAR_DATA_ATTR_INDEX=e.DEFAULT_EXT=e.DEFAULT_ATTR=e.DEFAULT_COLOR=void 0,e.DEFAULT_COLOR=256,e.DEFAULT_ATTR=256|e.DEFAULT_COLOR<<9,e.DEFAULT_EXT=0,e.CHAR_DATA_ATTR_INDEX=0,e.CHAR_DATA_CHAR_INDEX=1,e.CHAR_DATA_WIDTH_INDEX=2,e.CHAR_DATA_CODE_INDEX=3,e.NULL_CELL_CHAR="",e.NULL_CELL_WIDTH=1,e.NULL_CELL_CODE=0,e.WHITESPACE_CELL_CHAR=" ",e.WHITESPACE_CELL_WIDTH=1,e.WHITESPACE_CELL_CODE=32},133:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utf8ToUtf32=e.StringToUtf32=e.utf32ToString=e.stringFromCodePoint=void 0,e.stringFromCodePoint=function(t){return t>65535?(t-=65536,String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},e.utf32ToString=function(t,e=0,i=t.length){let s="";for(let r=e;r<i;++r){let e=t[r];e>65535?(e-=65536,s+=String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):s+=String.fromCharCode(e)}return s},e.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){const i=t.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=t.charCodeAt(r++);56320<=i&&i<=57343?e[s++]=1024*(this._interim-55296)+i-56320+65536:(e[s++]=this._interim,e[s++]=i),this._interim=0}for(let o=r;o<i;++o){const r=t.charCodeAt(o);if(55296<=r&&r<=56319){if(++o>=i)return this._interim=r,s;const n=t.charCodeAt(o);56320<=n&&n<=57343?e[s++]=1024*(r-55296)+n-56320+65536:(e[s++]=r,e[s++]=n)}else 65279!==r&&(e[s++]=r)}return s}},e.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){const i=t.length;if(!i)return 0;let s,r,o,n,a=0,l=0,h=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const l=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=l-n;for(;h<c;){if(h>=i)return 0;if(o=t[h++],128!=(192&o)){h--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===l?r<128?h--:e[a++]=r:3===l?r<2048||r>=55296&&r<=57343||65279===r||(e[a++]=r):r<65536||r>1114111||(e[a++]=r)),this.interim.fill(0)}const c=i-4;let _=h;for(;_<i;){for(;!(!(_<c)||128&(s=t[_])||128&(r=t[_+1])||128&(o=t[_+2])||128&(n=t[_+3]));)e[a++]=s,e[a++]=r,e[a++]=o,e[a++]=n,_+=4;if(s=t[_++],s<128)e[a++]=s;else if(192==(224&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(l=(31&s)<<6|63&r,l<128){_--;continue}e[a++]=l}else if(224==(240&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=t[_++],128!=(192&o)){_--;continue}if(l=(15&s)<<12|(63&r)<<6|63&o,l<2048||l>=55296&&l<=57343||65279===l)continue;e[a++]=l}else if(240==(248&s)){if(_>=i)return this.interim[0]=s,a;if(r=t[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=t[_++],128!=(192&o)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,a;if(n=t[_++],128!=(192&n)){_--;continue}if(l=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,l<65536||l>1114111)continue;e[a++]=l}}return a}}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}var s={};return(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:!0}),t.WebglAddon=void 0;const e=i(666),r=i(345),o=i(399);t.WebglAddon=class{constructor(t){this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=new r.EventEmitter,this._onContextLoss=new r.EventEmitter}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onContextLoss(){return this._onContextLoss.event}activate(t){if(!t.element)throw new Error("Cannot activate WebglAddon before Terminal.open");if(o.isSafari)throw new Error("Webgl is not currently supported on Safari");this._terminal=t;const i=t._core._renderService,s=t._core._characterJoinerService,n=t._core._coreBrowserService,a=t._core.coreService,l=t._core._decorationService,h=t._core._colorManager.colors;this._renderer=new e.WebglRenderer(t,h,s,n,a,l,this._preserveDrawingBuffer),(0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss),(0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas),i.setRenderer(this._renderer)}dispose(){var t;if(!this._terminal)throw new Error("Cannot dispose WebglAddon because it is activated");const e=this._terminal._core._renderService;e.setRenderer(this._terminal._core._createRenderer()),e.onResize(this._terminal.cols,this._terminal.rows),null===(t=this._renderer)||void 0===t||t.dispose(),this._renderer=void 0}get textureAtlas(){var t;return null===(t=this._renderer)||void 0===t?void 0:t.textureAtlas}clearTextureAtlas(){var t;null===(t=this._renderer)||void 0===t||t.clearCharAtlas()}}})(),s})()}}]);
|