@openscout/scout 0.2.65 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -3
- package/bin/openscout-runtime.mjs +11 -0
- package/dist/client/assets/addon-fit-DtSNdpy5.js +1 -0
- package/dist/client/assets/addon-webgl-YYNKPQUg.js +82 -0
- package/dist/client/assets/index-5-XOQrKH.js +186 -0
- package/dist/client/assets/index-BnA2HAbt.css +1 -0
- package/dist/client/assets/xterm-fBtFsYpq.js +34 -0
- package/dist/client/index.html +3 -3
- package/dist/main.mjs +18897 -7052
- package/dist/openscout-terminal-relay.mjs +678 -0
- package/dist/pair-supervisor.mjs +27100 -21822
- package/dist/runtime/base-daemon.mjs +103 -12
- package/dist/runtime/broker-daemon.mjs +8238 -1089
- package/dist/runtime/broker-process-manager.mjs +79 -10
- package/dist/runtime/mesh-discover.mjs +79 -10
- package/dist/scout-control-plane-web.mjs +19364 -1812
- package/dist/scout-web-server.mjs +19364 -1812
- package/package.json +16 -2
- package/dist/client/assets/addon-fit-DX4qG4td.js +0 -1
- package/dist/client/assets/addon-webgl-DCtw1yLn.js +0 -64
- package/dist/client/assets/index-BOdG2WWL.css +0 -1
- package/dist/client/assets/index-TVkH_WDG.js +0 -1
- package/dist/client/assets/index-mL1LA8IG.js +0 -159
- package/dist/client/assets/xterm-B-qIQCd3.js +0 -16
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import{g as We}from"./index-5-XOQrKH.js";function Ke(Ie,ke){for(var Se=0;Se<ke.length;Se++){const Ee=ke[Se];if(typeof Ee!="string"&&!Array.isArray(Ee)){for(const ge in Ee)if(ge!=="default"&&!(ge in Ie)){const De=Object.getOwnPropertyDescriptor(Ee,ge);De&&Object.defineProperty(Ie,ge,De.get?De:{enumerable:!0,get:()=>Ee[ge]})}}}return Object.freeze(Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"}))}var Ne={exports:{}},Fe;function He(){return Fe||(Fe=1,(function(Ie,ke){(function(Se,Ee){Ie.exports=Ee()})(globalThis,(()=>(()=>{var Se={6864:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellColorResolver=void 0;const i=v(1564),f=v(7993),h=v(4959);let C,b=0,_=0,o=!1,r=!1,p=!1,E=0;e.CellColorResolver=class{constructor(t,R,u,n,s,a){this._terminal=t,this._optionService=R,this._selectionRenderModel=u,this._decorationService=n,this._coreBrowserService=s,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(t,R,u,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=268435456&t.bg?t.extended.ext:0,_=0,b=0,r=!1,o=!1,p=!1,C=this._themeService.colors,E=0,t.getCode()!==i.NULL_CELL_CODE&&t.extended.underlineStyle===4){const s=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));E=R*n%(2*Math.round(s))}if(this._decorationService.forEachDecorationAtCell(R,u,"bottom",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),p=this._selectionRenderModel.isCellSelected(this._terminal,R,u),p){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}_=f.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else _=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,C.selectionForeground&&(b=C.selectionForeground.rgba>>8&16777215,o=!0),(0,h.treatGlyphAsBackgroundColor)(t.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))b=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=f.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(R,u,"top",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(_=p?-16777216&t.bg&-134217729|_|50331648:-16777216&t.bg|_|50331648),o&&(b=-16777216&t.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!o&&(b=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&C.background.rgba>>8|50331648,o=!0),!r&&o&&(_=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&C.foreground.rgba>>8|50331648,r=!0)),C=void 0,this.result.bg=r?_:this.result.bg,this.result.fg=o?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=E<<29&3758096384}}},5670:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.acquireTextureAtlas=function(C,b,_,o,r,p,E,t,R){const u=(0,f.generateConfig)(o,r,p,E,b,_,t,R);for(let a=0;a<h.length;a++){const c=h[a],l=c.ownedBy.indexOf(C);if(l>=0){if((0,f.configEquals)(c.config,u))return c.atlas;c.ownedBy.length===1?(c.atlas.dispose(),h.splice(a,1)):c.ownedBy.splice(l,1);break}}for(let a=0;a<h.length;a++){const c=h[a];if((0,f.configEquals)(c.config,u))return c.ownedBy.push(C),c.atlas}const n=C._core,s={atlas:new i.TextureAtlas(document,u,n.unicodeService),config:u,ownedBy:[C]};return h.push(s),s.atlas},e.removeTerminalFromCache=function(C){for(let b=0;b<h.length;b++){const _=h[b].ownedBy.indexOf(C);if(_!==-1){h[b].ownedBy.length===1?(h[b].atlas.dispose(),h.splice(b,1)):h[b].ownedBy.splice(_,1);break}}};const i=v(2115),f=v(3657),h=[]},3657:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.generateConfig=function(f,h,C,b,_,o,r,p){const E={foreground:o.foreground,background:o.background,cursor:i.NULL_COLOR,cursorAccent:i.NULL_COLOR,selectionForeground:i.NULL_COLOR,selectionBackgroundTransparent:i.NULL_COLOR,selectionBackgroundOpaque:i.NULL_COLOR,selectionInactiveBackgroundTransparent:i.NULL_COLOR,selectionInactiveBackgroundOpaque:i.NULL_COLOR,overviewRulerBorder:i.NULL_COLOR,scrollbarSliderBackground:i.NULL_COLOR,scrollbarSliderHoverBackground:i.NULL_COLOR,scrollbarSliderActiveBackground:i.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:_.customGlyphs,devicePixelRatio:r,deviceMaxTextureSize:p,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:f,deviceCellHeight:h,deviceCharWidth:C,deviceCharHeight:b,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:E}},e.configEquals=function(f,h){for(let C=0;C<f.colors.ansi.length;C++)if(f.colors.ansi[C].rgba!==h.colors.ansi[C].rgba)return!1;return f.devicePixelRatio===h.devicePixelRatio&&f.customGlyphs===h.customGlyphs&&f.lineHeight===h.lineHeight&&f.letterSpacing===h.letterSpacing&&f.fontFamily===h.fontFamily&&f.fontSize===h.fontSize&&f.fontWeight===h.fontWeight&&f.fontWeightBold===h.fontWeightBold&&f.allowTransparency===h.allowTransparency&&f.deviceCharWidth===h.deviceCharWidth&&f.deviceCharHeight===h.deviceCharHeight&&f.drawBoldTextInBrightColors===h.drawBoldTextInBrightColors&&f.minimumContrastRatio===h.minimumContrastRatio&&f.colors.foreground.rgba===h.colors.foreground.rgba&&f.colors.background.rgba===h.colors.background.rgba},e.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432};const i=v(7993)},2e3:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=void 0;const i=v(7095);e.DIM_OPACITY=.5,e.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},3773:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorBlinkStateManager=void 0,e.CursorBlinkStateManager=class{constructor(v,i){this._renderCallback=v,this._coreBrowserService=i,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(v=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const i=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0)return void this._restartInterval(i)}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 i=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(i)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),v)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},9705:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0,e.tryDrawCustomChar=function(o,r,p,E,t,R,u,n){const s=e.blockElementDefinitions[r];if(s)return(function(L,w,S,g,A,U){for(let D=0;D<w.length;D++){const P=w[D],B=A/8,M=U/8;L.fillRect(S+P.x*B,g+P.y*M,P.w*B,P.h*M)}})(o,s,p,E,t,R),!0;const a=f[r];if(a)return(function(L,w,S,g,A,U){let D=h.get(w);D||(D=new Map,h.set(w,D));const P=L.fillStyle;if(typeof P!="string")throw new Error(`Unexpected fillStyle type "${P}"`);let B=D.get(P);if(!B){const M=w[0].length,y=w.length,x=L.canvas.ownerDocument.createElement("canvas");x.width=M,x.height=y;const I=(0,i.throwIfFalsy)(x.getContext("2d")),O=new ImageData(M,y);let N,W,K,$;if(P.startsWith("#"))N=parseInt(P.slice(1,3),16),W=parseInt(P.slice(3,5),16),K=parseInt(P.slice(5,7),16),$=P.length>7&&parseInt(P.slice(7,9),16)||1;else{if(!P.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${P}" when drawing pattern glyph`);[N,W,K,$]=P.substring(5,P.length-1).split(",").map((X=>parseFloat(X)))}for(let X=0;X<y;X++)for(let Z=0;Z<M;Z++)O.data[4*(X*M+Z)]=N,O.data[4*(X*M+Z)+1]=W,O.data[4*(X*M+Z)+2]=K,O.data[4*(X*M+Z)+3]=w[X][Z]*(255*$);I.putImageData(O,0,0),B=(0,i.throwIfFalsy)(L.createPattern(x,null)),D.set(P,B)}L.fillStyle=B,L.fillRect(S,g,A,U)})(o,a,p,E,t,R),!0;const c=e.boxDrawingDefinitions[r];if(c)return(function(L,w,S,g,A,U,D){L.strokeStyle=L.fillStyle;for(const[P,B]of Object.entries(w)){let M;L.beginPath(),L.lineWidth=D*Number.parseInt(P),M=typeof B=="function"?B(.15,.15/U*A):B;for(const y of M.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!0,D))}L.stroke(),L.closePath()}})(o,c,p,E,t,R,n),!0;const l=e.powerlineDefinitions[r];return!!l&&((function(L,w,S,g,A,U,D,P){const B=new Path2D;B.rect(S,g,A,U),L.clip(B),L.beginPath();const M=D/12;L.lineWidth=P*M;for(const y of w.d.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!1,P,(w.leftPadding??0)*(M/2),(w.rightPadding??0)*(M/2)))}w.type===1?(L.strokeStyle=L.fillStyle,L.stroke()):L.fill(),L.closePath()})(o,l,p,E,t,R,u,n),!0)};const i=v(4959);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:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[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:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},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:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},e.powerlineDefinitions={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},e.powerlineDefinitions[""]=e.powerlineDefinitions[""],e.powerlineDefinitions[""]=e.powerlineDefinitions[""];const h=new Map;function C(o,r,p=0){return Math.max(Math.min(o,r),p)}const b={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function _(o,r,p,E,t,R,u,n=0,s=0){const a=o.map((c=>parseFloat(c)||parseInt(c)));if(a.length<2)throw new Error("Too few arguments for instruction");for(let c=0;c<a.length;c+=2)a[c]*=r-n*u-s*u,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,r,0)),a[c]+=E+n*u;for(let c=1;c<a.length;c+=2)a[c]*=p,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,p,0)),a[c]+=t;return a}},697:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=function(f,h,C){let b=new h.ResizeObserver((_=>{const o=_.find((E=>E.target===f));if(!o)return;if(!("devicePixelContentBoxSize"in o))return b?.disconnect(),void(b=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,p=o.devicePixelContentBoxSize[0].blockSize;r>0&&p>0&&C(r,p)}));try{b.observe(f,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,i.toDisposable)((()=>b?.disconnect()))};const i=v(2540)},3028:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphRenderer=void 0;const i=v(2115),f=v(1564),h=v(2540),C=v(5719),b=v(4959),_=11,o=_*Float32Array.BYTES_PER_ELEMENT;let r,p=0,E=0,t=0;class R extends h.Disposable{constructor(n,s,a,c){super(),this._terminal=n,this._gl=s,this._dimensions=a,this._optionsService=c,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const l=this._gl;i.TextureAtlas.maxAtlasPages===void 0&&(i.TextureAtlas.maxAtlasPages=Math.min(32,(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),i.TextureAtlas.maxTextureSize=(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=(0,b.throwIfFalsy)((0,C.createProgram)(l,`#version 300 es
|
|
2
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
3
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
4
|
+
layout (location = 2) in vec2 a_offset;
|
|
5
|
+
layout (location = 3) in vec2 a_size;
|
|
6
|
+
layout (location = 4) in float a_texpage;
|
|
7
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
8
|
+
layout (location = 6) in vec2 a_texsize;
|
|
9
|
+
|
|
10
|
+
uniform mat4 u_projection;
|
|
11
|
+
uniform vec2 u_resolution;
|
|
12
|
+
|
|
13
|
+
out vec2 v_texcoord;
|
|
14
|
+
flat out int v_texpage;
|
|
15
|
+
|
|
16
|
+
void main() {
|
|
17
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
18
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
19
|
+
v_texpage = int(a_texpage);
|
|
20
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
21
|
+
}`,(function(U){let D="";for(let P=1;P<U;P++)D+=` else if (v_texpage == ${P}) { outColor = texture(u_texture[${P}], v_texcoord); }`;return`#version 300 es
|
|
22
|
+
precision lowp float;
|
|
23
|
+
|
|
24
|
+
in vec2 v_texcoord;
|
|
25
|
+
flat in int v_texpage;
|
|
26
|
+
|
|
27
|
+
uniform sampler2D u_texture[${U}];
|
|
28
|
+
|
|
29
|
+
out vec4 outColor;
|
|
30
|
+
|
|
31
|
+
void main() {
|
|
32
|
+
if (v_texpage == 0) {
|
|
33
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
34
|
+
} ${D}
|
|
35
|
+
}`})(i.TextureAtlas.maxAtlasPages))),this._register((0,h.toDisposable)((()=>l.deleteProgram(this._program)))),this._projectionLocation=(0,b.throwIfFalsy)(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,b.throwIfFalsy)(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,b.throwIfFalsy)(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);const L=new Float32Array([0,0,1,0,0,1,1,1]),w=l.createBuffer();this._register((0,h.toDisposable)((()=>l.deleteBuffer(w)))),l.bindBuffer(l.ARRAY_BUFFER,w),l.bufferData(l.ARRAY_BUFFER,L,l.STATIC_DRAW),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const S=new Uint8Array([0,1,2,3]),g=l.createBuffer();this._register((0,h.toDisposable)((()=>l.deleteBuffer(g)))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,g),l.bufferData(l.ELEMENT_ARRAY_BUFFER,S,l.STATIC_DRAW),this._attributesBuffer=(0,b.throwIfFalsy)(l.createBuffer()),this._register((0,h.toDisposable)((()=>l.deleteBuffer(this._attributesBuffer)))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,o,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);const A=new Int32Array(i.TextureAtlas.maxAtlasPages);for(let U=0;U<i.TextureAtlas.maxAtlasPages;U++)A[U]=U;l.uniform1iv(this._textureLocation,A),l.uniformMatrix4fv(this._projectionLocation,!1,C.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<i.TextureAtlas.maxAtlasPages;U++){const D=new C.GLTexture((0,b.throwIfFalsy)(l.createTexture()));this._register((0,h.toDisposable)((()=>l.deleteTexture(D.texture)))),l.activeTexture(l.TEXTURE0+U),l.bindTexture(l.TEXTURE_2D,D.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[U]=D}l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(n,s,a,c,l,L,w,S,g){this._updateCell(this._vertices.attributes,n,s,a,c,l,L,w,S,g)}_updateCell(n,s,a,c,l,L,w,S,g,A){p=(a*this._terminal.cols+s)*_,c!==f.NULL_CELL_CODE&&c!==void 0?this._atlas&&(r=S&&S.length>1?this._atlas.getRasterizedGlyphCombinedChar(S,l,L,w,!1,this._terminal.element):this._atlas.getRasterizedGlyph(c,l,L,w,!1,this._terminal.element),E=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==A&&r.offset.x>E?(t=r.offset.x-E,n[p]=-(r.offset.x-t)+this._dimensions.device.char.left,n[p+1]=-r.offset.y+this._dimensions.device.char.top,n[p+2]=(r.size.x-t)/this._dimensions.device.canvas.width,n[p+3]=r.size.y/this._dimensions.device.canvas.height,n[p+4]=r.texturePage,n[p+5]=r.texturePositionClipSpace.x+t/this._atlas.pages[r.texturePage].canvas.width,n[p+6]=r.texturePositionClipSpace.y,n[p+7]=r.sizeClipSpace.x-t/this._atlas.pages[r.texturePage].canvas.width,n[p+8]=r.sizeClipSpace.y):(n[p]=-r.offset.x+this._dimensions.device.char.left,n[p+1]=-r.offset.y+this._dimensions.device.char.top,n[p+2]=r.size.x/this._dimensions.device.canvas.width,n[p+3]=r.size.y/this._dimensions.device.canvas.height,n[p+4]=r.texturePage,n[p+5]=r.texturePositionClipSpace.x,n[p+6]=r.texturePositionClipSpace.y,n[p+7]=r.sizeClipSpace.x,n[p+8]=r.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,b.allowRescaling)(c,g,r.size.x,this._dimensions.device.cell.width)&&(n[p+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):n.fill(0,p,p+_-1-2)}clear(){const n=this._terminal,s=n.cols*n.rows*_;this._vertices.count!==s?this._vertices.attributes=new Float32Array(s):this._vertices.attributes.fill(0);let a=0;for(;a<this._vertices.attributesBuffers.length;a++)this._vertices.count!==s?this._vertices.attributesBuffers[a]=new Float32Array(s):this._vertices.attributesBuffers[a].fill(0);this._vertices.count=s,a=0;for(let c=0;c<n.rows;c++)for(let l=0;l<n.cols;l++)this._vertices.attributes[a+9]=l/n.cols,this._vertices.attributes[a+10]=c/n.rows,a+=_}handleResize(){const n=this._gl;n.useProgram(this._program),n.viewport(0,0,n.canvas.width,n.canvas.height),n.uniform2f(this._resolutionLocation,n.canvas.width,n.canvas.height),this.clear()}render(n){if(!this._atlas)return;const s=this._gl;s.useProgram(this._program),s.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const a=this._vertices.attributesBuffers[this._activeBuffer];let c=0;for(let l=0;l<n.lineLengths.length;l++){const L=l*this._terminal.cols*_,w=this._vertices.attributes.subarray(L,L+n.lineLengths[l]*_);a.set(w,c),c+=w.length}s.bindBuffer(s.ARRAY_BUFFER,this._attributesBuffer),s.bufferData(s.ARRAY_BUFFER,a.subarray(0,c),s.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(s,this._atlas,l);s.drawElementsInstanced(s.TRIANGLE_STRIP,4,s.UNSIGNED_BYTE,0,c/_)}setAtlas(n){this._atlas=n;for(const s of this._atlasTextures)s.version=-1}_bindAtlasPageTexture(n,s,a){n.activeTexture(n.TEXTURE0+a),n.bindTexture(n.TEXTURE_2D,this._atlasTextures[a].texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s.pages[a].canvas),n.generateMipmap(n.TEXTURE_2D),this._atlasTextures[a].version=s.pages[a].version}setDimensions(n){this._dimensions=n}}e.GlyphRenderer=R},6203:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleRenderer=void 0;const i=v(2540),f=v(4208),h=v(5719),C=v(4959),b=8*Float32Array.BYTES_PER_ELEMENT;class _{constructor(){this.attributes=new Float32Array(160),this.count=0}}let o=0,r=0,p=0,E=0,t=0,R=0,u=0;class n extends i.Disposable{constructor(a,c,l,L){super(),this._terminal=a,this._gl=c,this._dimensions=l,this._themeService=L,this._vertices=new _,this._verticesCursor=new _;const w=this._gl;this._program=(0,C.throwIfFalsy)((0,h.createProgram)(w,`#version 300 es
|
|
36
|
+
layout (location = 0) in vec2 a_position;
|
|
37
|
+
layout (location = 1) in vec2 a_size;
|
|
38
|
+
layout (location = 2) in vec4 a_color;
|
|
39
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
40
|
+
|
|
41
|
+
uniform mat4 u_projection;
|
|
42
|
+
|
|
43
|
+
out vec4 v_color;
|
|
44
|
+
|
|
45
|
+
void main() {
|
|
46
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
47
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
48
|
+
v_color = a_color;
|
|
49
|
+
}`,`#version 300 es
|
|
50
|
+
precision lowp float;
|
|
51
|
+
|
|
52
|
+
in vec4 v_color;
|
|
53
|
+
|
|
54
|
+
out vec4 outColor;
|
|
55
|
+
|
|
56
|
+
void main() {
|
|
57
|
+
outColor = v_color;
|
|
58
|
+
}`)),this._register((0,i.toDisposable)((()=>w.deleteProgram(this._program)))),this._projectionLocation=(0,C.throwIfFalsy)(w.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=w.createVertexArray(),w.bindVertexArray(this._vertexArrayObject);const S=new Float32Array([0,0,1,0,0,1,1,1]),g=w.createBuffer();this._register((0,i.toDisposable)((()=>w.deleteBuffer(g)))),w.bindBuffer(w.ARRAY_BUFFER,g),w.bufferData(w.ARRAY_BUFFER,S,w.STATIC_DRAW),w.enableVertexAttribArray(3),w.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const A=new Uint8Array([0,1,2,3]),U=w.createBuffer();this._register((0,i.toDisposable)((()=>w.deleteBuffer(U)))),w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,U),w.bufferData(w.ELEMENT_ARRAY_BUFFER,A,w.STATIC_DRAW),this._attributesBuffer=(0,C.throwIfFalsy)(w.createBuffer()),this._register((0,i.toDisposable)((()=>w.deleteBuffer(this._attributesBuffer)))),w.bindBuffer(w.ARRAY_BUFFER,this._attributesBuffer),w.enableVertexAttribArray(0),w.vertexAttribPointer(0,2,w.FLOAT,!1,b,0),w.vertexAttribDivisor(0,1),w.enableVertexAttribArray(1),w.vertexAttribPointer(1,2,w.FLOAT,!1,b,2*Float32Array.BYTES_PER_ELEMENT),w.vertexAttribDivisor(1,1),w.enableVertexAttribArray(2),w.vertexAttribPointer(2,4,w.FLOAT,!1,b,4*Float32Array.BYTES_PER_ELEMENT),w.vertexAttribDivisor(2,1),this._updateCachedColors(L.colors),this._register(this._themeService.onChangeColors((D=>{this._updateCachedColors(D),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(a){const c=this._gl;c.useProgram(this._program),c.bindVertexArray(this._vertexArrayObject),c.uniformMatrix4fv(this._projectionLocation,!1,h.PROJECTION_MATRIX),c.bindBuffer(c.ARRAY_BUFFER,this._attributesBuffer),c.bufferData(c.ARRAY_BUFFER,a.attributes,c.DYNAMIC_DRAW),c.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,c.UNSIGNED_BYTE,0,a.count)}handleResize(){this._updateViewportRectangle()}setDimensions(a){this._dimensions=a}_updateCachedColors(a){this._bgFloat=this._colorToFloat32Array(a.background),this._cursorFloat=this._colorToFloat32Array(a.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(a){const c=this._terminal,l=this._vertices;let L,w,S,g,A,U,D,P,B,M,y,x=1;for(L=0;L<c.rows;L++){for(S=-1,g=0,A=0,U=!1,w=0;w<c.cols;w++)D=(L*c.cols+w)*f.RENDER_MODEL_INDICIES_PER_CELL,P=a.cells[D+f.RENDER_MODEL_BG_OFFSET],B=a.cells[D+f.RENDER_MODEL_FG_OFFSET],M=!!(67108864&B),(P!==g||B!==A&&(U||M))&&((g!==0||U&&A!==0)&&(y=8*x++,this._updateRectangle(l,y,A,g,S,w,L)),S=w,g=P,A=B,U=M);(g!==0||U&&A!==0)&&(y=8*x++,this._updateRectangle(l,y,A,g,S,c.cols,L))}l.count=x}updateCursor(a){const c=this._verticesCursor,l=a.cursor;if(!l||l.style==="block")return void(c.count=0);let L,w=0;l.style!=="bar"&&l.style!=="outline"||(L=8*w++,this._addRectangleFloat(c.attributes,L,l.x*this._dimensions.device.cell.width,l.y*this._dimensions.device.cell.height,l.style==="bar"?l.dpr*l.cursorWidth:l.dpr,this._dimensions.device.cell.height,this._cursorFloat)),l.style!=="underline"&&l.style!=="outline"||(L=8*w++,this._addRectangleFloat(c.attributes,L,l.x*this._dimensions.device.cell.width,(l.y+1)*this._dimensions.device.cell.height-l.dpr,l.width*this._dimensions.device.cell.width,l.dpr,this._cursorFloat)),l.style==="outline"&&(L=8*w++,this._addRectangleFloat(c.attributes,L,l.x*this._dimensions.device.cell.width,l.y*this._dimensions.device.cell.height,l.width*this._dimensions.device.cell.width,l.dpr,this._cursorFloat),L=8*w++,this._addRectangleFloat(c.attributes,L,(l.x+l.width)*this._dimensions.device.cell.width-l.dpr,l.y*this._dimensions.device.cell.height,l.dpr,this._dimensions.device.cell.height,this._cursorFloat)),c.count=w}_updateRectangle(a,c,l,L,w,S,g){if(67108864&l)switch(50331648&l){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&l].rgba;break;case 50331648:o=(16777215&l)<<8;break;default:o=this._themeService.colors.foreground.rgba}else switch(50331648&L){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:o=(16777215&L)<<8;break;default:o=this._themeService.colors.background.rgba}a.attributes.length<c+4&&(a.attributes=(0,h.expandFloat32Array)(a.attributes,this._terminal.rows*this._terminal.cols*8)),r=w*this._dimensions.device.cell.width,p=g*this._dimensions.device.cell.height,E=(o>>24&255)/255,t=(o>>16&255)/255,R=(o>>8&255)/255,u=1,this._addRectangle(a.attributes,c,r,p,(S-w)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,E,t,R,u)}_addRectangle(a,c,l,L,w,S,g,A,U,D){a[c]=l/this._dimensions.device.canvas.width,a[c+1]=L/this._dimensions.device.canvas.height,a[c+2]=w/this._dimensions.device.canvas.width,a[c+3]=S/this._dimensions.device.canvas.height,a[c+4]=g,a[c+5]=A,a[c+6]=U,a[c+7]=D}_addRectangleFloat(a,c,l,L,w,S,g){a[c]=l/this._dimensions.device.canvas.width,a[c+1]=L/this._dimensions.device.canvas.height,a[c+2]=w/this._dimensions.device.canvas.width,a[c+3]=S/this._dimensions.device.canvas.height,a[c+4]=g[0],a[c+5]=g[1],a[c+6]=g[2],a[c+7]=g[3]}_colorToFloat32Array(a){return new Float32Array([(a.rgba>>24&255)/255,(a.rgba>>16&255)/255,(a.rgba>>8&255)/255,(255&a.rgba)/255])}}e.RectangleRenderer=n},4208:(j,e,v)=>{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 i=v(5948);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=(0,i.createSelectionRenderModel)()}resize(f,h){const C=f*h*e.RENDER_MODEL_INDICIES_PER_CELL;C!==this.cells.length&&(this.cells=new Uint32Array(C),this.lineLengths=new Uint32Array(h))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},2115:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureAtlas=void 0;const i=v(2e3),f=v(9705),h=v(4959),C=v(7993),b=v(1836),_=v(9930),o=v(9917),r=v(1564),p=v(5276),E={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let t;class R{get pages(){return this._pages}constructor(c,l,L){this._document=c,this._config=l,this._unicodeService=L,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.Emitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.Emitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=s(c,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,h.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){this._tmpCanvas.remove();for(const c of this.pages)c.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const c=new _.IdleTaskQueue;for(let l=33;l<126;l++)c.enqueue((()=>{if(!this._cacheMap.get(l,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT)){const L=this._drawToCache(l,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,!1,void 0);this._cacheMap.set(l,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,L)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const c of this._pages)c.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(R.maxAtlasPages&&this._pages.length>=Math.max(4,R.maxAtlasPages)){const l=this._pages.filter((D=>2*D.canvas.width<=(R.maxTextureSize||4096))).sort(((D,P)=>P.canvas.width!==D.canvas.width?P.canvas.width-D.canvas.width:P.percentageUsed-D.percentageUsed));let L=-1,w=0;for(let D=0;D<l.length;D++)if(l[D].canvas.width!==w)L=D,w=l[D].canvas.width;else if(D-L==3)break;const S=l.slice(L,L+4),g=S.map((D=>D.glyphs[0].texturePage)).sort(((D,P)=>D>P?1:-1)),A=this.pages.length-S.length,U=this._mergePages(S,A);U.version++;for(let D=g.length-1;D>=0;D--)this._deletePage(g[D]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const c=new u(this._document,this._textureSize);return this._pages.push(c),this._activePages.push(c),this._onAddTextureAtlasCanvas.fire(c.canvas),c}_mergePages(c,l){const L=2*c[0].canvas.width,w=new u(this._document,L,c);for(const[S,g]of c.entries()){const A=S*g.canvas.width%L,U=Math.floor(S/2)*g.canvas.height;w.ctx.drawImage(g.canvas,A,U);for(const P of g.glyphs)P.texturePage=l,P.sizeClipSpace.x=P.size.x/L,P.sizeClipSpace.y=P.size.y/L,P.texturePosition.x+=A,P.texturePosition.y+=U,P.texturePositionClipSpace.x=P.texturePosition.x/L,P.texturePositionClipSpace.y=P.texturePosition.y/L;this._onRemoveTextureAtlasCanvas.fire(g.canvas);const D=this._activePages.indexOf(g);D!==-1&&this._activePages.splice(D,1)}return w}_deletePage(c){this._pages.splice(c,1);for(let l=c;l<this._pages.length;l++){const L=this._pages[l];for(const w of L.glyphs)w.texturePage--;L.version++}}getRasterizedGlyphCombinedChar(c,l,L,w,S,g){return this._getFromCacheMap(this._cacheMapCombined,c,l,L,w,S,g)}getRasterizedGlyph(c,l,L,w,S,g){return this._getFromCacheMap(this._cacheMap,c,l,L,w,S,g)}_getFromCacheMap(c,l,L,w,S,g,A){return t=c.get(l,L,w,S),t||(t=this._drawToCache(l,L,w,S,g,A),c.set(l,L,w,S,t)),t}_getColorFromAnsiIndex(c){if(c>=this._config.colors.ansi.length)throw new Error("No color found for idx "+c);return this._config.colors.ansi[c]}_getBackgroundColor(c,l,L,w){if(this._config.allowTransparency)return C.NULL_COLOR;let S;switch(c){case 16777216:case 33554432:S=this._getColorFromAnsiIndex(l);break;case 50331648:const g=o.AttributeData.toColorRGB(l);S=C.channels.toColor(g[0],g[1],g[2]);break;default:S=L?C.color.opaque(this._config.colors.foreground):this._config.colors.background}return this._config.allowTransparency||(S=C.color.opaque(S)),S}_getForegroundColor(c,l,L,w,S,g,A,U,D,P){const B=this._getMinimumContrastColor(c,l,L,w,S,g,A,D,U,P);if(B)return B;let M;switch(S){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&D&&g<8&&(g+=8),M=this._getColorFromAnsiIndex(g);break;case 50331648:const y=o.AttributeData.toColorRGB(g);M=C.channels.toColor(y[0],y[1],y[2]);break;default:M=A?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(M=C.color.opaque(M)),U&&(M=C.color.multiplyOpacity(M,i.DIM_OPACITY)),M}_resolveBackgroundRgba(c,l,L){switch(c){case 16777216:case 33554432:return this._getColorFromAnsiIndex(l).rgba;case 50331648:return l<<8;default:return L?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(c,l,L,w){switch(c){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&w&&l<8&&(l+=8),this._getColorFromAnsiIndex(l).rgba;case 50331648:return l<<8;default:return L?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(c,l,L,w,S,g,A,U,D,P){if(this._config.minimumContrastRatio===1||P)return;const B=this._getContrastCache(D),M=B.getColor(c,w);if(M!==void 0)return M||void 0;const y=this._resolveBackgroundRgba(l,L,A),x=this._resolveForegroundRgba(S,g,A,U),I=C.rgba.ensureContrastRatio(y,x,this._config.minimumContrastRatio/(D?2:1));if(!I)return void B.setColor(c,w,null);const O=C.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return B.setColor(c,w,O),O}_getContrastCache(c){return c?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(c,l,L,w,S,g){const A=typeof c=="number"?String.fromCharCode(c):c;g&&this._tmpCanvas.parentElement!==g&&(this._tmpCanvas.style.display="none",g.append(this._tmpCanvas));const U=Math.min(this._config.deviceCellWidth*Math.max(A.length,2)+4,this._config.deviceMaxTextureSize);this._tmpCanvas.width<U&&(this._tmpCanvas.width=U);const D=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<D&&(this._tmpCanvas.height=D),this._tmpCtx.save(),this._workAttributeData.fg=L,this._workAttributeData.bg=l,this._workAttributeData.extended.ext=w,this._workAttributeData.isInvisible())return E;const P=!!this._workAttributeData.isBold(),B=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),y=!!this._workAttributeData.isItalic(),x=!!this._workAttributeData.isUnderline(),I=!!this._workAttributeData.isStrikethrough(),O=!!this._workAttributeData.isOverline();let N=this._workAttributeData.getFgColor(),W=this._workAttributeData.getFgColorMode(),K=this._workAttributeData.getBgColor(),$=this._workAttributeData.getBgColorMode();if(B){const q=N;N=K,K=q;const ie=W;W=$,$=ie}const X=this._getBackgroundColor($,K,B,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=X.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const Z=P?this._config.fontWeightBold:this._config.fontWeight,re=y?"italic":"";this._tmpCtx.font=`${re} ${Z} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=i.TEXT_BASELINE;const ae=A.length===1&&(0,h.isPowerlineGlyph)(A.charCodeAt(0)),he=A.length===1&&(0,h.isRestrictedPowerlineGlyph)(A.charCodeAt(0)),oe=this._getForegroundColor(l,$,K,L,W,N,B,M,P,(0,h.treatGlyphAsBackgroundColor)(A.charCodeAt(0)));this._tmpCtx.fillStyle=oe.css;const ee=he?0:4;let le=!1;this._config.customGlyphs!==!1&&(le=(0,f.tryDrawCustomChar)(this._tmpCtx,A,ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let _e,be=!ae;if(_e=typeof c=="number"?this._unicodeService.wcwidth(c):this._unicodeService.getStringCellWidth(c),x){this._tmpCtx.save();const q=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=q%2==1?.5:0;if(this._tmpCtx.lineWidth=q,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())be=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{be=!1;let de=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&de<8&&(de+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(de).css}this._tmpCtx.beginPath();const fe=ee,se=Math.ceil(ee+this._config.deviceCharHeight)-ie-(S?2*q:0),Ae=se+q,Re=se+2*q;let we=this._workAttributeData.getUnderlineVariantOffset();for(let de=0;de<_e;de++){this._tmpCtx.save();const ne=fe+de*this._config.deviceCellWidth,ce=fe+(de+1)*this._config.deviceCellWidth,ye=ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ne,se),this._tmpCtx.lineTo(ce,se),this._tmpCtx.moveTo(ne,Re),this._tmpCtx.lineTo(ce,Re);break;case 3:const pe=q<=1?Re:Math.ceil(ee+this._config.deviceCharHeight-q/2)-ie,xe=q<=1?se:Math.ceil(ee+this._config.deviceCharHeight+q/2)-ie,Oe=new Path2D;Oe.rect(ne,se,this._config.deviceCellWidth,Re-se),this._tmpCtx.clip(Oe),this._tmpCtx.moveTo(ne-this._config.deviceCellWidth/2,Ae),this._tmpCtx.bezierCurveTo(ne-this._config.deviceCellWidth/2,xe,ne,xe,ne,Ae),this._tmpCtx.bezierCurveTo(ne,pe,ye,pe,ye,Ae),this._tmpCtx.bezierCurveTo(ye,xe,ce,xe,ce,Ae),this._tmpCtx.bezierCurveTo(ce,pe,ce+this._config.deviceCellWidth/2,pe,ce+this._config.deviceCellWidth/2,Ae);break;case 4:const Le=we===0?0:we>=q?2*q-we:q-we;we>=q||Le===0?(this._tmpCtx.setLineDash([Math.round(q),Math.round(q)]),this._tmpCtx.moveTo(ne+Le,se),this._tmpCtx.lineTo(ce,se)):(this._tmpCtx.setLineDash([Math.round(q),Math.round(q)]),this._tmpCtx.moveTo(ne,se),this._tmpCtx.lineTo(ne+Le,se),this._tmpCtx.moveTo(ne+Le+q,se),this._tmpCtx.lineTo(ce,se)),we=(0,h.computeNextVariantOffset)(ce-ne,q,we);break;case 5:const Ue=.6,Pe=.3,ve=ce-ne,d=Math.floor(Ue*ve),m=Math.floor(Pe*ve),T=ve-d-m;this._tmpCtx.setLineDash([d,m,T]),this._tmpCtx.moveTo(ne,se),this._tmpCtx.lineTo(ce,se);break;default:this._tmpCtx.moveTo(ne,se),this._tmpCtx.lineTo(ce,se)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!le&&this._config.fontSize>=12&&!this._config.allowTransparency&&A!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const de=this._tmpCtx.measureText(A);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in de&&de.actualBoundingBoxDescent>0){this._tmpCtx.save();const ne=new Path2D;ne.rect(fe,se-Math.ceil(q/2),this._config.deviceCellWidth*_e,Re-se+Math.ceil(q/2)),this._tmpCtx.clip(ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=X.css,this._tmpCtx.strokeText(A,ee,ee+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(O){const q=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=q%2==1?.5:0;this._tmpCtx.lineWidth=q,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ee,ee+ie),this._tmpCtx.lineTo(ee+this._config.deviceCharWidth*_e,ee+ie),this._tmpCtx.stroke()}if(le||this._tmpCtx.fillText(A,ee,ee+this._config.deviceCharHeight),A==="_"&&!this._config.allowTransparency){let q=n(this._tmpCtx.getImageData(ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight),X,oe,be);if(q)for(let ie=1;ie<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=X.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(A,ee,ee+this._config.deviceCharHeight-ie),q=n(this._tmpCtx.getImageData(ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight),X,oe,be),q);ie++);}if(I){const q=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ie=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=q,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ee,ee+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.lineTo(ee+this._config.deviceCharWidth*_e,ee+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.stroke()}this._tmpCtx.restore();const me=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Te;if(Te=this._config.allowTransparency?(function(q){for(let ie=0;ie<q.data.length;ie+=4)if(q.data[ie+3]>0)return!1;return!0})(me):n(me,X,oe,be),Te)return E;const te=this._findGlyphBoundingBox(me,this._workBoundingBox,U,he,le,ee);let J,Y;for(;;){if(this._activePages.length===0){const q=this._createNewPage();J=q,Y=q.currentRow,Y.height=te.size.y;break}J=this._activePages[this._activePages.length-1],Y=J.currentRow;for(const q of this._activePages)te.size.y<=q.currentRow.height&&(J=q,Y=q.currentRow);for(let q=this._activePages.length-1;q>=0;q--)for(const ie of this._activePages[q].fixedRows)ie.height<=Y.height&&te.size.y<=ie.height&&(J=this._activePages[q],Y=ie);if(te.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new u(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),J=this._overflowSizePage,Y=this._overflowSizePage.currentRow,Y.x+te.size.x>=J.canvas.width&&(Y.x=0,Y.y+=Y.height,Y.height=0);break}if(Y.y+te.size.y>=J.canvas.height||Y.height>te.size.y+2){let q=!1;if(J.currentRow.y+J.currentRow.height+te.size.y>=J.canvas.height){let ie;for(const fe of this._activePages)if(fe.currentRow.y+fe.currentRow.height+te.size.y<fe.canvas.height){ie=fe;break}if(ie)J=ie;else if(R.maxAtlasPages&&this._pages.length>=R.maxAtlasPages&&Y.y+te.size.y<=J.canvas.height&&Y.height>=te.size.y&&Y.x+te.size.x<=J.canvas.width)q=!0;else{const fe=this._createNewPage();J=fe,Y=fe.currentRow,Y.height=te.size.y,q=!0}}q||(J.currentRow.height>0&&J.fixedRows.push(J.currentRow),Y={x:0,y:J.currentRow.y+J.currentRow.height,height:te.size.y},J.fixedRows.push(Y),J.currentRow={x:0,y:Y.y+Y.height,height:0})}if(Y.x+te.size.x<=J.canvas.width)break;Y===J.currentRow?(Y.x=0,Y.y+=Y.height,Y.height=0):J.fixedRows.splice(J.fixedRows.indexOf(Y),1)}return te.texturePage=this._pages.indexOf(J),te.texturePosition.x=Y.x,te.texturePosition.y=Y.y,te.texturePositionClipSpace.x=Y.x/J.canvas.width,te.texturePositionClipSpace.y=Y.y/J.canvas.height,te.sizeClipSpace.x/=J.canvas.width,te.sizeClipSpace.y/=J.canvas.height,Y.height=Math.max(Y.height,te.size.y),Y.x+=te.size.x,J.ctx.putImageData(me,te.texturePosition.x-this._workBoundingBox.left,te.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,te.size.x,te.size.y),J.addGlyph(te),J.version++,te}_findGlyphBoundingBox(c,l,L,w,S,g){l.top=0;const A=w?this._config.deviceCellHeight:this._tmpCanvas.height,U=w?this._config.deviceCellWidth:L;let D=!1;for(let P=0;P<A;P++){for(let B=0;B<U;B++){const M=P*this._tmpCanvas.width*4+4*B+3;if(c.data[M]!==0){l.top=P,D=!0;break}}if(D)break}l.left=0,D=!1;for(let P=0;P<g+U;P++){for(let B=0;B<A;B++){const M=B*this._tmpCanvas.width*4+4*P+3;if(c.data[M]!==0){l.left=P,D=!0;break}}if(D)break}l.right=U,D=!1;for(let P=g+U-1;P>=g;P--){for(let B=0;B<A;B++){const M=B*this._tmpCanvas.width*4+4*P+3;if(c.data[M]!==0){l.right=P,D=!0;break}}if(D)break}l.bottom=A,D=!1;for(let P=A-1;P>=0;P--){for(let B=0;B<U;B++){const M=P*this._tmpCanvas.width*4+4*B+3;if(c.data[M]!==0){l.bottom=P,D=!0;break}}if(D)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:l.right-l.left+1,y:l.bottom-l.top+1},sizeClipSpace:{x:l.right-l.left+1,y:l.bottom-l.top+1},offset:{x:-l.left+g+(w||S?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-l.top+g+(w||S?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}e.TextureAtlas=R;class u{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(c){this._glyphs.push(c),this._usedPixels+=c.size.x*c.size.y}constructor(c,l,L){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],L)for(const w of L)this._glyphs.push(...w.glyphs),this._usedPixels+=w._usedPixels;this.canvas=s(c,l,l),this.ctx=(0,h.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function n(a,c,l,L){const w=c.rgba>>>24,S=c.rgba>>>16&255,g=c.rgba>>>8&255,A=l.rgba>>>24,U=l.rgba>>>16&255,D=l.rgba>>>8&255,P=Math.floor((Math.abs(w-A)+Math.abs(S-U)+Math.abs(g-D))/12);let B=!0;for(let M=0;M<a.data.length;M+=4)a.data[M]===w&&a.data[M+1]===S&&a.data[M+2]===g||L&&Math.abs(a.data[M]-w)+Math.abs(a.data[M+1]-S)+Math.abs(a.data[M+2]-g)<P?a.data[M+3]=0:B=!1;return B}function s(a,c,l){const L=a.createElement("canvas");return L.width=c,L.height=l,L}},3399:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JoinedCellData=e.WebglRenderer=void 0;const i=v(6864),f=v(5670),h=v(3773),C=v(697),b=v(9917),_=v(5721),o=v(1564),r=v(3028),p=v(6203),E=v(4208),t=v(1306),R=v(5276),u=v(1375),n=v(2540),s=v(4959);class a extends n.Disposable{constructor(w,S,g,A,U,D,P,B,M){super(),this._terminal=w,this._characterJoinerService=S,this._charSizeService=g,this._coreBrowserService=A,this._coreService=U,this._decorationService=D,this._optionsService=P,this._themeService=B,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this._register(new n.MutableDisposable),this._observerDisposable=this._register(new n.MutableDisposable),this._model=new E.RenderModel,this._workCell=new _.CellData,this._workCell2=new _.CellData,this._rectangleRenderer=this._register(new n.MutableDisposable),this._glyphRenderer=this._register(new n.MutableDisposable),this._onChangeTextureAtlas=this._register(new R.Emitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new R.Emitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new R.Emitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new R.Emitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new R.Emitter),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const y={antialias:!1,depth:!1,preserveDrawingBuffer:M};if(this._gl=this._canvas.getContext("webgl2",y),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new i.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new t.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,P,this._themeService)],this.dimensions=(0,s.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(P.onOptionChange((()=>this._handleOptionsChanged()))),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register((0,u.addDisposableListener)(this._canvas,"webglcontextlost",(x=>{console.log("webglcontextlost event received"),x.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(x)}),3e3)}))),this._register((0,u.addDisposableListener)(this._canvas,"webglcontextrestored",(x=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,f.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((x,I)=>this._setCanvasDevicePixelDimensions(x,I))),this._register(this._coreBrowserService.onWindowChange((x=>{this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,x,((I,O)=>this._setCanvasDevicePixelDimensions(I,O)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register((0,n.toDisposable)((()=>{for(const x of this._renderLayers)x.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,f.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(w,S){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const g of this._renderLayers)g.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const w of this._renderLayers)w.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const w of this._renderLayers)w.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(w,S,g){for(const A of this._renderLayers)A.handleSelectionChanged(this._terminal,w,S,g);this._model.selection.update(this._core,w,S,g),this._requestRedrawViewport()}handleCursorMove(){for(const w of this._renderLayers)w.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new p.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new r.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const w=(0,f.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==w&&(this._onChangeTextureAtlas.fire(w.pages[0].canvas),this._charAtlasDisposable.value=(0,n.combinedDisposable)(R.Event.forward(w.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),R.Event.forward(w.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=w,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(w){this._model.clear(),w&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const w of this._renderLayers)w.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(w,S){if(!this._isAttached){if(!(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const g of this._renderLayers)g.handleGridChanged(this._terminal,w,S);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(w,S),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new h.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(w,S){const g=this._core;let A,U,D,P,B,M,y,x,I,O,N,W,K,$,X,Z=this._workCell,re=0,ae=!0;w=l(w,g.rows-1,0),S=l(S,g.rows-1,0);const he=this._coreService.decPrivateModes.cursorStyle??g.options.cursorStyle??"block",oe=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=oe-g.buffer.ydisp,le=Math.min(this._terminal.buffer.active.cursorX,g.cols-1);let _e=-1;const be=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let me=!1;for(U=w;U<=S;U++)for(D=U+g.buffer.ydisp,P=g.buffer.lines.get(D),this._model.lineLengths[U]=0,I=oe===D,re=0,B=this._characterJoinerService.getJoinedCharacters(D),$=0;$<g.cols;$++){if(A=this._cellColorResolver.result.bg,P.loadCell($,Z),$===0&&(A=this._cellColorResolver.result.bg),M=!1,ae=$>=re,y=$,B.length>0&&$===B[0][0]&&ae){x=B.shift();const Te=this._model.selection.isCellSelected(this._terminal,x[0],D);for(K=x[0]+1;K<x[1];K++)ae&&=Te===this._model.selection.isCellSelected(this._terminal,K,D);ae&&=!I||le<x[0]||le>=x[1],ae?(M=!0,Z=new c(Z,P.translateToString(!0,x[0],x[1]),x[1]-x[0]),y=x[1]-1):re=x[1]}if(O=Z.getChars(),N=Z.getCode(),K=(U*g.cols+$)*E.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(Z,$,D,this.dimensions.device.cell.width),be&&D===oe&&($===le&&(this._model.cursor={x:le,y:ee,width:Z.getWidth(),style:this._coreBrowserService.isFocused?he:g.options.cursorInactiveStyle,cursorWidth:g.options.cursorWidth,dpr:this._devicePixelRatio},_e=le+Z.getWidth()-1),$>=le&&$<=_e&&(this._coreBrowserService.isFocused&&he==="block"||this._coreBrowserService.isFocused===!1&&g.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),N!==o.NULL_CELL_CODE&&(this._model.lineLengths[U]=$+1),(this._model.cells[K]!==N||this._model.cells[K+E.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[K+E.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[K+E.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(me=!0,O.length>1&&(N|=E.COMBINED_CHAR_BIT_MASK),this._model.cells[K]=N,this._model.cells[K+E.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[K+E.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[K+E.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,W=Z.getWidth(),this._glyphRenderer.value.updateCell($,U,N,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,O,W,A),M)){for(Z=this._workCell,$++;$<=y;$++)X=(U*g.cols+$)*E.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell($,U,o.NULL_CELL_CODE,0,0,0,o.NULL_CELL_CHAR,0,0),this._model.cells[X]=o.NULL_CELL_CODE,this._model.cells[X+E.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[X+E.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[X+E.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;$--}}me&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(w,S){this._canvas.width===w&&this._canvas.height===S||(this._canvas.width=w,this._canvas.height=S,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const w=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:w,end:w})}}e.WebglRenderer=a;class c extends b.AttributeData{constructor(w,S,g){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=S,this._width=g}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function l(L,w,S=0){return Math.max(Math.min(L,w),S)}e.JoinedCellData=c},5719:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GLTexture=e.PROJECTION_MATRIX=void 0,e.createProgram=function(h,C,b){const _=(0,i.throwIfFalsy)(h.createProgram());if(h.attachShader(_,(0,i.throwIfFalsy)(f(h,h.VERTEX_SHADER,C))),h.attachShader(_,(0,i.throwIfFalsy)(f(h,h.FRAGMENT_SHADER,b))),h.linkProgram(_),h.getProgramParameter(_,h.LINK_STATUS))return _;console.error(h.getProgramInfoLog(_)),h.deleteProgram(_)},e.createShader=f,e.expandFloat32Array=function(h,C){const b=Math.min(2*h.length,C),_=new Float32Array(b);for(let o=0;o<h.length;o++)_[o]=h[o];return _};const i=v(4959);function f(h,C,b){const _=(0,i.throwIfFalsy)(h.createShader(C));if(h.shaderSource(_,b),h.compileShader(_),h.getShaderParameter(_,h.COMPILE_STATUS))return _;console.error(h.getShaderInfoLog(_)),h.deleteShader(_)}e.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),e.GLTexture=class{constructor(h){this.texture=h,this.version=-1}}},3133:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRenderLayer=void 0;const i=v(5670),f=v(2540),h=v(4959),C=v(2e3);class b extends f.Disposable{constructor(o,r,p,E,t,R,u,n){super(),this._container=r,this._alpha=t,this._coreBrowserService=R,this._optionsService=u,this._themeService=n,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${p}-layer`),this._canvas.style.zIndex=E.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors((s=>{this._refreshCharAtlas(o,s),this.reset(o)}))),this._register((0,f.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,h.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(o){}handleFocus(o){}handleCursorMove(o){}handleGridChanged(o,r,p){}handleSelectionChanged(o,r,p,E=!1){}_setTransparency(o,r){if(r===this._alpha)return;const p=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,p),this._refreshCharAtlas(o,this._themeService.colors),this.handleGridChanged(o,0,o.rows-1)}_refreshCharAtlas(o,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,i.acquireTextureAtlas)(o,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(o,r){this._deviceCellWidth=r.device.cell.width,this._deviceCellHeight=r.device.cell.height,this._deviceCharWidth=r.device.char.width,this._deviceCharHeight=r.device.char.height,this._deviceCharLeft=r.device.char.left,this._deviceCharTop=r.device.char.top,this._canvas.width=r.device.canvas.width,this._canvas.height=r.device.canvas.height,this._canvas.style.width=`${r.css.canvas.width}px`,this._canvas.style.height=`${r.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(o,this._themeService.colors)}_fillBottomLineAtCells(o,r,p=1){this._ctx.fillRect(o*this._deviceCellWidth,(r+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,p*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(o,r,p,E){this._alpha?this._ctx.clearRect(o*this._deviceCellWidth,r*this._deviceCellHeight,p*this._deviceCellWidth,E*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(o*this._deviceCellWidth,r*this._deviceCellHeight,p*this._deviceCellWidth,E*this._deviceCellHeight))}_fillCharTrueColor(o,r,p,E){this._ctx.font=this._getFont(o,!1,!1),this._ctx.textBaseline=C.TEXT_BASELINE,this._clipCell(p,E,r.getWidth()),this._ctx.fillText(r.getChars(),p*this._deviceCellWidth+this._deviceCharLeft,E*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(o,r,p){this._ctx.beginPath(),this._ctx.rect(o*this._deviceCellWidth,r*this._deviceCellHeight,p*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(o,r,p){return`${p?"italic":""} ${r?o.options.fontWeightBold:o.options.fontWeight} ${o.options.fontSize*this._coreBrowserService.dpr}px ${o.options.fontFamily}`}}e.BaseRenderLayer=b},1306:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkRenderLayer=void 0;const i=v(3657),f=v(6814),h=v(3133);class C extends h.BaseRenderLayer{constructor(_,o,r,p,E,t,R){super(r,_,"link",o,!0,E,t,R),this._register(p.onShowLinkUnderline((u=>this._handleShowLinkUnderline(u)))),this._register(p.onHideLinkUnderline((u=>this._handleHideLinkUnderline(u))))}resize(_,o){super.resize(_,o),this._state=void 0}reset(_){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const _=this._state.y2-this._state.y1-1;_>0&&this._clearCells(0,this._state.y1+1,this._state.cols,_),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(_){if(_.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:_.fg!==void 0&&(0,i.is256Color)(_.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[_.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,_.y1===_.y2)this._fillBottomLineAtCells(_.x1,_.y1,_.x2-_.x1);else{this._fillBottomLineAtCells(_.x1,_.y1,_.cols-_.x1);for(let o=_.y1+1;o<_.y2;o++)this._fillBottomLineAtCells(0,o,_.cols);this._fillBottomLineAtCells(0,_.y2,_.x2)}this._state=_}_handleHideLinkUnderline(_){this._clearCurrentLink()}}e.LinkRenderLayer=C},6814:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.INVERTED_DEFAULT_COLOR=void 0,e.INVERTED_DEFAULT_COLOR=257},4959:(j,e)=>{function v(f){return 57508<=f&&f<=57558}function i(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},e.isPowerlineGlyph=v,e.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},e.isEmoji=i,e.allowRescaling=function(f,h,C,b){return h===1&&C>Math.ceil(1.5*b)&&f!==void 0&&f>255&&!i(f)&&!v(f)&&!(function(_){return 57344<=_&&_<=63743})(f)},e.treatGlyphAsBackgroundColor=function(f){return v(f)||(function(h){return 9472<=h&&h<=9631})(f)},e.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},e.computeNextVariantOffset=function(f,h,C=0){return(f-(2*Math.round(h)-C))%(2*Math.round(h))}},5948:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createSelectionRenderModel=function(){return new v};class v{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(f,h,C,b=!1){if(this.selectionStart=h,this.selectionEnd=C,!h||!C||h[0]===C[0]&&h[1]===C[1])return void this.clear();const _=f.buffers.active.ydisp,o=h[1]-_,r=C[1]-_,p=Math.max(o,0),E=Math.min(r,f.rows-1);p>=f.rows||E<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=o,this.viewportEndRow=r,this.viewportCappedStartRow=p,this.viewportCappedEndRow=E,this.startCol=h[0],this.endCol=C[0])}isCellSelected(f,h,C){return!!this.hasSelection&&(C-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&C>=this.viewportCappedStartRow&&h<this.endCol&&C<=this.viewportCappedEndRow:h<this.startCol&&C>=this.viewportCappedStartRow&&h>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&h>=this.startCol)}}},7993:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgba=e.rgb=e.css=e.color=e.channels=e.NULL_COLOR=void 0,e.toPaddedHex=p,e.contrastRatio=E;let v=0,i=0,f=0,h=0;var C,b,_,o,r;function p(t){const R=t.toString(16);return R.length<2?"0"+R:R}function E(t,R){return t<R?(R+.05)/(t+.05):(t+.05)/(R+.05)}e.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(R,u,n,s){return s!==void 0?`#${p(R)}${p(u)}${p(n)}${p(s)}`:`#${p(R)}${p(u)}${p(n)}`},t.toRgba=function(R,u,n,s=255){return(R<<24|u<<16|n<<8|s)>>>0},t.toColor=function(R,u,n,s){return{css:t.toCss(R,u,n,s),rgba:t.toRgba(R,u,n,s)}}})(C||(e.channels=C={})),(function(t){function R(u,n){return h=Math.round(255*n),[v,i,f]=r.toChannels(u.rgba),{css:C.toCss(v,i,f,h),rgba:C.toRgba(v,i,f,h)}}t.blend=function(u,n){if(h=(255&n.rgba)/255,h===1)return{css:n.css,rgba:n.rgba};const s=n.rgba>>24&255,a=n.rgba>>16&255,c=n.rgba>>8&255,l=u.rgba>>24&255,L=u.rgba>>16&255,w=u.rgba>>8&255;return v=l+Math.round((s-l)*h),i=L+Math.round((a-L)*h),f=w+Math.round((c-w)*h),{css:C.toCss(v,i,f),rgba:C.toRgba(v,i,f)}},t.isOpaque=function(u){return!(255&~u.rgba)},t.ensureContrastRatio=function(u,n,s){const a=r.ensureContrastRatio(u.rgba,n.rgba,s);if(a)return C.toColor(a>>24&255,a>>16&255,a>>8&255)},t.opaque=function(u){const n=(255|u.rgba)>>>0;return[v,i,f]=r.toChannels(n),{css:C.toCss(v,i,f),rgba:n}},t.opacity=R,t.multiplyOpacity=function(u,n){return h=255&u.rgba,R(u,h*n/255)},t.toColorRGB=function(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}})(b||(e.color=b={})),(function(t){let R,u;try{const n=document.createElement("canvas");n.width=1,n.height=1;const s=n.getContext("2d",{willReadFrequently:!0});s&&(R=s,R.globalCompositeOperation="copy",u=R.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(n){if(n.match(/#[\da-f]{3,8}/i))switch(n.length){case 4:return v=parseInt(n.slice(1,2).repeat(2),16),i=parseInt(n.slice(2,3).repeat(2),16),f=parseInt(n.slice(3,4).repeat(2),16),C.toColor(v,i,f);case 5:return v=parseInt(n.slice(1,2).repeat(2),16),i=parseInt(n.slice(2,3).repeat(2),16),f=parseInt(n.slice(3,4).repeat(2),16),h=parseInt(n.slice(4,5).repeat(2),16),C.toColor(v,i,f,h);case 7:return{css:n,rgba:(parseInt(n.slice(1),16)<<8|255)>>>0};case 9:return{css:n,rgba:parseInt(n.slice(1),16)>>>0}}const s=n.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return v=parseInt(s[1]),i=parseInt(s[2]),f=parseInt(s[3]),h=Math.round(255*(s[5]===void 0?1:parseFloat(s[5]))),C.toColor(v,i,f,h);if(!R||!u)throw new Error("css.toColor: Unsupported css format");if(R.fillStyle=u,R.fillStyle=n,typeof R.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(R.fillRect(0,0,1,1),[v,i,f,h]=R.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(v,i,f,h),css:n}}})(_||(e.css=_={})),(function(t){function R(u,n,s){const a=u/255,c=n/255,l=s/255;return .2126*(a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))+.7152*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.0722*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))}t.relativeLuminance=function(u){return R(u>>16&255,u>>8&255,255&u)},t.relativeLuminance2=R})(o||(e.rgb=o={})),(function(t){function R(n,s,a){const c=n>>24&255,l=n>>16&255,L=n>>8&255;let w=s>>24&255,S=s>>16&255,g=s>>8&255,A=E(o.relativeLuminance2(w,S,g),o.relativeLuminance2(c,l,L));for(;A<a&&(w>0||S>0||g>0);)w-=Math.max(0,Math.ceil(.1*w)),S-=Math.max(0,Math.ceil(.1*S)),g-=Math.max(0,Math.ceil(.1*g)),A=E(o.relativeLuminance2(w,S,g),o.relativeLuminance2(c,l,L));return(w<<24|S<<16|g<<8|255)>>>0}function u(n,s,a){const c=n>>24&255,l=n>>16&255,L=n>>8&255;let w=s>>24&255,S=s>>16&255,g=s>>8&255,A=E(o.relativeLuminance2(w,S,g),o.relativeLuminance2(c,l,L));for(;A<a&&(w<255||S<255||g<255);)w=Math.min(255,w+Math.ceil(.1*(255-w))),S=Math.min(255,S+Math.ceil(.1*(255-S))),g=Math.min(255,g+Math.ceil(.1*(255-g))),A=E(o.relativeLuminance2(w,S,g),o.relativeLuminance2(c,l,L));return(w<<24|S<<16|g<<8|255)>>>0}t.blend=function(n,s){if(h=(255&s)/255,h===1)return s;const a=s>>24&255,c=s>>16&255,l=s>>8&255,L=n>>24&255,w=n>>16&255,S=n>>8&255;return v=L+Math.round((a-L)*h),i=w+Math.round((c-w)*h),f=S+Math.round((l-S)*h),C.toRgba(v,i,f)},t.ensureContrastRatio=function(n,s,a){const c=o.relativeLuminance(n>>8),l=o.relativeLuminance(s>>8);if(E(c,l)<a){if(l<c){const S=R(n,s,a),g=E(c,o.relativeLuminance(S>>8));if(g<a){const A=u(n,s,a);return g>E(c,o.relativeLuminance(A>>8))?S:A}return S}const L=u(n,s,a),w=E(c,o.relativeLuminance(L>>8));if(w<a){const S=R(n,s,a);return w>E(c,o.relativeLuminance(S>>8))?L:S}return L}},t.reduceLuminance=R,t.increaseLuminance=u,t.toChannels=function(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}})(r||(e.rgba=r={}))},1836:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FourKeyMap=e.TwoKeyMap=void 0;class v{constructor(){this._data={}}set(f,h,C){this._data[f]||(this._data[f]={}),this._data[f][h]=C}get(f,h){return this._data[f]?this._data[f][h]:void 0}clear(){this._data={}}}e.TwoKeyMap=v,e.FourKeyMap=class{constructor(){this._data=new v}set(i,f,h,C,b){this._data.get(i,f)||this._data.set(i,f,new v),this._data.get(i,f).set(h,C,b)}get(i,f,h,C){return this._data.get(i,f)?.get(h,C)}clear(){this._data.clear()}}},7095:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isChromeOS=e.isLinux=e.isWindows=e.isIphone=e.isIpad=e.isMac=e.isSafari=e.isLegacyEdge=e.isFirefox=e.isNode=void 0,e.getSafariVersion=function(){if(!e.isSafari)return 0;const f=v.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},e.isNode=typeof process<"u"&&"title"in process;const v=e.isNode?"node":navigator.userAgent,i=e.isNode?"node":navigator.platform;e.isFirefox=v.includes("Firefox"),e.isLegacyEdge=v.includes("Edge"),e.isSafari=/^((?!chrome|android).)*safari/i.test(v),e.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i),e.isIpad=i==="iPad",e.isIphone=i==="iPhone",e.isWindows=["Windows","Win16","Win32","WinCE"].includes(i),e.isLinux=i.indexOf("Linux")>=0,e.isChromeOS=/\bCrOS\b/.test(v)},9930:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DebouncedIdleTask=e.IdleTaskQueue=e.PriorityTaskQueue=void 0;const i=v(7095);class f{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(b){this._idleCallback=void 0;let _=0,o=0,r=b.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(_=performance.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,performance.now()-_),o=Math.max(_,o),p=b.timeRemaining(),1.5*o>p)return r-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-_))}ms`),void this._start();r=p}this.clear()}}class h extends f{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const _=performance.now()+b;return{timeRemaining:()=>Math.max(0,_-performance.now())}}}e.PriorityTaskQueue=h,e.IdleTaskQueue=!i.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:h,e.DebouncedIdleTask=class{constructor(){this._queue=new e.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9917:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedAttrs=e.AttributeData=void 0;class v{constructor(){this.fg=0,this.bg=0,this.extended=new i}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new v;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}e.AttributeData=v;class i{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,C=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=C}clone(){return new i(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}e.ExtendedAttrs=i},5721:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellData=void 0;const i=v(6348),f=v(1564),h=v(9917);class C extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const o=new C;return o.setFromCharData(_),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,i.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(_){this.fg=_[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(_[f.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(_[f.CHAR_DATA_CHAR_INDEX].length===2){const r=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const p=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(r-55296)+p-56320+65536|_[f.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[f.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=_[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.CellData=C},1564:(j,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=0,e.DEFAULT_ATTR=e.DEFAULT_COLOR<<9|256,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},6348:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utf8ToUtf32=e.StringToUtf32=void 0,e.stringFromCodePoint=function(v){return v>65535?(v-=65536,String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):String.fromCharCode(v)},e.utf32ToString=function(v,i=0,f=v.length){let h="";for(let C=i;C<f;++C){let b=v[C];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},e.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(v,i){const f=v.length;if(!f)return 0;let h=0,C=0;if(this._interim){const b=v.charCodeAt(C++);56320<=b&&b<=57343?i[h++]=1024*(this._interim-55296)+b-56320+65536:(i[h++]=this._interim,i[h++]=b),this._interim=0}for(let b=C;b<f;++b){const _=v.charCodeAt(b);if(55296<=_&&_<=56319){if(++b>=f)return this._interim=_,h;const o=v.charCodeAt(b);56320<=o&&o<=57343?i[h++]=1024*(_-55296)+o-56320+65536:(i[h++]=_,i[h++]=o)}else _!==65279&&(i[h++]=_)}return h}},e.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(v,i){const f=v.length;if(!f)return 0;let h,C,b,_,o=0,r=0,p=0;if(this.interim[0]){let R=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let n,s=0;for(;(n=63&this.interim[++s])&&s<4;)u<<=6,u|=n;const a=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,c=a-s;for(;p<c;){if(p>=f)return 0;if(n=v[p++],(192&n)!=128){p--,R=!0;break}this.interim[s++]=n,u<<=6,u|=63&n}R||(a===2?u<128?p--:i[o++]=u:a===3?u<2048||u>=55296&&u<=57343||u===65279||(i[o++]=u):u<65536||u>1114111||(i[o++]=u)),this.interim.fill(0)}const E=f-4;let t=p;for(;t<f;){for(;!(!(t<E)||128&(h=v[t])||128&(C=v[t+1])||128&(b=v[t+2])||128&(_=v[t+3]));)i[o++]=h,i[o++]=C,i[o++]=b,i[o++]=_,t+=4;if(h=v[t++],h<128)i[o++]=h;else if((224&h)==192){if(t>=f)return this.interim[0]=h,o;if(C=v[t++],(192&C)!=128){t--;continue}if(r=(31&h)<<6|63&C,r<128){t--;continue}i[o++]=r}else if((240&h)==224){if(t>=f)return this.interim[0]=h,o;if(C=v[t++],(192&C)!=128){t--;continue}if(t>=f)return this.interim[0]=h,this.interim[1]=C,o;if(b=v[t++],(192&b)!=128){t--;continue}if(r=(15&h)<<12|(63&C)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;i[o++]=r}else if((248&h)==240){if(t>=f)return this.interim[0]=h,o;if(C=v[t++],(192&C)!=128){t--;continue}if(t>=f)return this.interim[0]=h,this.interim[1]=C,o;if(b=v[t++],(192&b)!=128){t--;continue}if(t>=f)return this.interim[0]=h,this.interim[1]=C,this.interim[2]=b,o;if(_=v[t++],(192&_)!=128){t--;continue}if(r=(7&h)<<18|(63&C)<<12|(63&b)<<6|63&_,r<65536||r>1114111)continue;i[o++]=r}}return o}}},6870:function(j,e,v){var i=this&&this.__decorate||function(r,p,E,t){var R,u=arguments.length,n=u<3?p:t===null?t=Object.getOwnPropertyDescriptor(p,E):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,p,E,t);else for(var s=r.length-1;s>=0;s--)(R=r[s])&&(n=(u<3?R(n):u>3?R(p,E,n):R(p,E))||n);return u>3&&n&&Object.defineProperty(p,E,n),n},f=this&&this.__param||function(r,p){return function(E,t){p(E,t,r)}};Object.defineProperty(e,"__esModule",{value:!0}),e.LogService=void 0,e.setTraceLogger=function(r){_=r},e.traceCall=function(r,p,E){if(typeof E.value!="function")throw new Error("not supported");const t=E.value;E.value=function(...R){if(_.logLevel!==C.LogLevelEnum.TRACE)return t.apply(this,R);_.trace(`GlyphRenderer#${t.name}(${R.map((n=>JSON.stringify(n))).join(", ")})`);const u=t.apply(this,R);return _.trace(`GlyphRenderer#${t.name} return`,u),u}};const h=v(2540),C=v(1027),b={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let _,o=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),_=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let p=0;p<r.length;p++)typeof r[p]=="function"&&(r[p]=r[p]())}_log(r,p,E){this._evalLazyOptionalParams(E),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...E)}trace(r,...p){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,r,p)}debug(r,...p){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,r,p)}info(r,...p){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,r,p)}warn(r,...p){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,r,p)}error(r,...p){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,r,p)}};e.LogService=o,e.LogService=o=i([f(0,C.IOptionsService)],o)},3727:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceRegistry=void 0,e.getServiceDependencies=function(f){return f[i]||[]},e.createDecorator=function(f){if(e.serviceRegistry.has(f))return e.serviceRegistry.get(f);const h=function(C,b,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,r,p){r[v]===r?r[i].push({id:o,index:p}):(r[i]=[{id:o,index:p}],r[v]=r)})(h,C,_)};return h._id=f,e.serviceRegistry.set(f,h),h};const v="di$target",i="di$dependencies";e.serviceRegistry=new Map},1027:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IDecorationService=e.IUnicodeService=e.IOscLinkService=e.IOptionsService=e.ILogService=e.LogLevelEnum=e.IInstantiationService=e.ICharsetService=e.ICoreService=e.ICoreMouseService=e.IBufferService=void 0;const i=v(3727);var f;e.IBufferService=(0,i.createDecorator)("BufferService"),e.ICoreMouseService=(0,i.createDecorator)("CoreMouseService"),e.ICoreService=(0,i.createDecorator)("CoreService"),e.ICharsetService=(0,i.createDecorator)("CharsetService"),e.IInstantiationService=(0,i.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(f||(e.LogLevelEnum=f={})),e.ILogService=(0,i.createDecorator)("LogService"),e.IOptionsService=(0,i.createDecorator)("OptionsService"),e.IOscLinkService=(0,i.createDecorator)("OscLinkService"),e.IUnicodeService=(0,i.createDecorator)("UnicodeService"),e.IDecorationService=(0,i.createDecorator)("DecorationService")},6835:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAndroid=e.isElectron=e.isWebkitWebView=e.isSafari=e.isChrome=e.isWebKit=e.isFirefox=e.onDidChangeFullscreen=e.onDidChangeZoomLevel=void 0,e.addMatchMediaChangeListener=C,e.setZoomLevel=function(r,p){h.INSTANCE.setZoomLevel(r,p)},e.getZoomLevel=function(r){return h.INSTANCE.getZoomLevel(r)},e.getZoomFactor=function(r){return h.INSTANCE.getZoomFactor(r)},e.setZoomFactor=function(r,p){h.INSTANCE.setZoomFactor(r,p)},e.setFullscreen=function(r,p){h.INSTANCE.setFullscreen(r,p)},e.isFullscreen=function(r){return h.INSTANCE.isFullscreen(r)},e.isStandalone=function(){return _},e.isWCOEnabled=function(){return navigator?.windowControlsOverlay?.visible},e.getWCOBoundingRect=function(){return navigator?.windowControlsOverlay?.getTitlebarAreaRect()};const i=v(9199),f=v(5276),o=class o{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new f.Emitter,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new f.Emitter,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(p){return this.mapWindowIdToZoomLevel.get(this.getWindowId(p))??0}setZoomLevel(p,E){if(this.getZoomLevel(E)===p)return;const t=this.getWindowId(E);this.mapWindowIdToZoomLevel.set(t,p),this._onDidChangeZoomLevel.fire(t)}getZoomFactor(p){return this.mapWindowIdToZoomFactor.get(this.getWindowId(p))??1}setZoomFactor(p,E){this.mapWindowIdToZoomFactor.set(this.getWindowId(E),p)}setFullscreen(p,E){if(this.isFullscreen(E)===p)return;const t=this.getWindowId(E);this.mapWindowIdToFullScreen.set(t,p),this._onDidChangeFullscreen.fire(t)}isFullscreen(p){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(p))}getWindowId(p){return p.vscodeWindowId}};o.INSTANCE=new o;let h=o;function C(r,p,E){typeof p=="string"&&(p=r.matchMedia(p)),p.addEventListener("change",E)}e.onDidChangeZoomLevel=h.INSTANCE.onDidChangeZoomLevel,e.onDidChangeFullscreen=h.INSTANCE.onDidChangeFullscreen;const b=typeof navigator=="object"?navigator.userAgent:"";e.isFirefox=b.indexOf("Firefox")>=0,e.isWebKit=b.indexOf("AppleWebKit")>=0,e.isChrome=b.indexOf("Chrome")>=0,e.isSafari=!e.isChrome&&b.indexOf("Safari")>=0,e.isWebkitWebView=!e.isChrome&&!e.isSafari&&e.isWebKit,e.isElectron=b.indexOf("Electron/")>=0,e.isAndroid=b.indexOf("Android")>=0;let _=!1;if(typeof i.mainWindow.matchMedia=="function"){const r=i.mainWindow.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),p=i.mainWindow.matchMedia("(display-mode: fullscreen)");_=r.matches,C(i.mainWindow,r,(({matches:E})=>{_&&p.matches||(_=E)}))}},467:function(j,e,v){var i=this&&this.__createBinding||(Object.create?function(p,E,t,R){R===void 0&&(R=t);var u=Object.getOwnPropertyDescriptor(E,t);u&&!("get"in u?!E.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return E[t]}}),Object.defineProperty(p,R,u)}:function(p,E,t,R){R===void 0&&(R=t),p[R]=E[t]}),f=this&&this.__setModuleDefault||(Object.create?function(p,E){Object.defineProperty(p,"default",{enumerable:!0,value:E})}:function(p,E){p.default=E}),h=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var E={};if(p!=null)for(var t in p)t!=="default"&&Object.prototype.hasOwnProperty.call(p,t)&&i(E,p,t);return f(E,p),E};Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserFeatures=e.KeyboardSupport=void 0;const C=h(v(6835)),b=v(9199),_=h(v(8973));var o;(function(p){p[p.Always=0]="Always",p[p.FullScreen=1]="FullScreen",p[p.None=2]="None"})(o||(e.KeyboardSupport=o={}));const r=typeof navigator=="object"?navigator:{};e.BrowserFeatures={clipboard:{writeText:_.isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(r&&r.clipboard&&r.clipboard.writeText),readText:_.isNative||!!(r&&r.clipboard&&r.clipboard.readText)},keyboard:_.isNative||C.isStandalone()?o.Always:r.keyboard||C.isSafari?o.FullScreen:o.None,touch:"ontouchstart"in b.mainWindow||r.maxTouchPoints>0,pointerEvents:b.mainWindow.PointerEvent&&("ontouchstart"in b.mainWindow||navigator.maxTouchPoints>0)}},1375:function(j,e,v){var i,f=this&&this.__createBinding||(Object.create?function(d,m,T,k){k===void 0&&(k=T);var F=Object.getOwnPropertyDescriptor(m,T);F&&!("get"in F?!m.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return m[T]}}),Object.defineProperty(d,k,F)}:function(d,m,T,k){k===void 0&&(k=T),d[k]=m[T]}),h=this&&this.__setModuleDefault||(Object.create?function(d,m){Object.defineProperty(d,"default",{enumerable:!0,value:m})}:function(d,m){d.default=m}),C=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var m={};if(d!=null)for(var T in d)T!=="default"&&Object.prototype.hasOwnProperty.call(d,T)&&f(m,d,T);return h(m,d),m};Object.defineProperty(e,"__esModule",{value:!0}),e.SafeTriangle=e.DragAndDropObserver=e.ModifierKeyEmitter=e.DetectedFullscreenMode=e.Namespace=e.EventHelper=e.EventType=e.sharedMutationObserver=e.Dimension=e.WindowIntervalTimer=e.scheduleAtNextAnimationFrame=e.runAtThisOrScheduleAtNextAnimationFrame=e.WindowIdleValue=e.addStandardDisposableGenericMouseUpListener=e.addStandardDisposableGenericMouseDownListener=e.addStandardDisposableListener=e.onDidUnregisterWindow=e.onWillUnregisterWindow=e.onDidRegisterWindow=e.hasWindow=e.getWindowById=e.getWindowId=e.getWindowsCount=e.getWindows=e.getDocument=e.getWindow=e.registerWindow=void 0,e.clearNode=function(d){for(;d.firstChild;)d.firstChild.remove()},e.clearNodeRecursively=function d(m){for(;m.firstChild;){const T=m.firstChild;T.remove(),d(T)}},e.addDisposableListener=L,e.addDisposableGenericMouseDownListener=S,e.addDisposableGenericMouseMoveListener=function(d,m,T){return L(d,n.isIOS&&_.BrowserFeatures.pointerEvents?e.EventType.POINTER_MOVE:e.EventType.MOUSE_MOVE,m,T)},e.addDisposableGenericMouseUpListener=g,e.runWhenWindowIdle=function(d,m,T){return(0,p._runWhenIdle)(d,m,T)},e.disposableWindowInterval=function(d,m,T,k){let F=0;const H=d.setInterval((()=>{F++,(typeof k=="number"&&F>=k||m()===!0)&&G.dispose()}),T),G=(0,u.toDisposable)((()=>{d.clearInterval(H)}));return G},e.measure=function(d,m){return(0,e.scheduleAtNextAnimationFrame)(d,m,1e4)},e.modify=function(d,m){return(0,e.scheduleAtNextAnimationFrame)(d,m,-1e4)},e.addDisposableThrottledListener=function(d,m,T,k,F){return new B(d,m,T,k,F)},e.getComputedStyle=M,e.getClientArea=function d(m,T){const k=(0,e.getWindow)(m),F=k.document;if(m!==F.body)return new x(m.clientWidth,m.clientHeight);if(n.isIOS&&k?.visualViewport)return new x(k.visualViewport.width,k.visualViewport.height);if(k?.innerWidth&&k.innerHeight)return new x(k.innerWidth,k.innerHeight);if(F.body&&F.body.clientWidth&&F.body.clientHeight)return new x(F.body.clientWidth,F.body.clientHeight);if(F.documentElement&&F.documentElement.clientWidth&&F.documentElement.clientHeight)return new x(F.documentElement.clientWidth,F.documentElement.clientHeight);if(T)return d(T);throw new Error("Unable to figure out browser width and height")},e.getTopLeftOffset=I,e.size=function(d,m,T){typeof m=="number"&&(d.style.width=`${m}px`),typeof T=="number"&&(d.style.height=`${T}px`)},e.position=function(d,m,T,k,F,H="absolute"){typeof m=="number"&&(d.style.top=`${m}px`),typeof T=="number"&&(d.style.right=`${T}px`),typeof k=="number"&&(d.style.bottom=`${k}px`),typeof F=="number"&&(d.style.left=`${F}px`),d.style.position=H},e.getDomNodePagePosition=function(d){const m=d.getBoundingClientRect(),T=(0,e.getWindow)(d);return{left:m.left+T.scrollX,top:m.top+T.scrollY,width:m.width,height:m.height}},e.getDomNodeZoomLevel=function(d){let m=d,T=1;do{const k=M(m).zoom;k!=null&&k!=="1"&&(T*=k),m=m.parentElement}while(m!==null&&m!==m.ownerDocument.documentElement);return T},e.getTotalWidth=O,e.getContentWidth=function(d){const m=y.getBorderLeftWidth(d)+y.getBorderRightWidth(d),T=y.getPaddingLeft(d)+y.getPaddingRight(d);return d.offsetWidth-m-T},e.getTotalScrollWidth=N,e.getContentHeight=function(d){const m=y.getBorderTopWidth(d)+y.getBorderBottomWidth(d),T=y.getPaddingTop(d)+y.getPaddingBottom(d);return d.offsetHeight-m-T},e.getTotalHeight=function(d){const m=y.getMarginTop(d)+y.getMarginBottom(d);return d.offsetHeight+m},e.getLargestChildWidth=function(d,m){const T=m.map((k=>Math.max(N(k),O(k))+(function(F,H){if(F===null)return 0;const G=I(F),z=I(H);return G.left-z.left})(k,d)||0));return Math.max(...T)},e.isAncestor=W,e.setParentFlowTo=function(d,m){d.dataset[K]=m.id},e.isAncestorUsingFlowTo=function(d,m){let T=d;for(;T;){if(T===m)return!0;if(Y(T)){const k=$(T);if(k){T=k;continue}}T=T.parentNode}return!1},e.findParentWithClass=X,e.hasParentWithClass=function(d,m,T){return!!X(d,m,T)},e.isShadowRoot=Z,e.isInShadowDOM=function(d){return!!re(d)},e.getShadowRoot=re,e.getActiveElement=ae,e.isActiveElement=function(d){return ae()===d},e.isAncestorOfActiveElement=function(d){return W(ae(),d)},e.isActiveDocument=function(d){return d.ownerDocument===he()},e.getActiveDocument=he,e.getActiveWindow=function(){return he().defaultView?.window??a.mainWindow},e.isGlobalStylesheet=function(d){return oe.has(d)},e.createStyleSheet2=function(){return new ee},e.createStyleSheet=le,e.cloneGlobalStylesheets=function(d){const m=new u.DisposableStore;for(const[T,k]of oe)m.add(_e(T,k,d));return m},e.createMetaElement=function(d=a.mainWindow.document.head){return be("meta",d)},e.createLinkElement=function(d=a.mainWindow.document.head){return be("link",d)},e.createCSSRule=function d(m,T,k=Te()){if(k&&T){k.sheet?.insertRule(`${m} {${T}}`,0);for(const F of oe.get(k)??[])d(m,T,F)}},e.removeCSSRulesContainingSelector=function d(m,T=Te()){if(!T)return;const k=te(T),F=[];for(let H=0;H<k.length;H++){const G=k[H];J(G)&&G.selectorText.indexOf(m)!==-1&&F.push(H)}for(let H=F.length-1;H>=0;H--)T.sheet?.deleteRule(F[H]);for(const H of oe.get(T)??[])d(m,H)},e.isHTMLElement=Y,e.isHTMLAnchorElement=function(d){return d instanceof HTMLAnchorElement||d instanceof(0,e.getWindow)(d).HTMLAnchorElement},e.isHTMLSpanElement=function(d){return d instanceof HTMLSpanElement||d instanceof(0,e.getWindow)(d).HTMLSpanElement},e.isHTMLTextAreaElement=function(d){return d instanceof HTMLTextAreaElement||d instanceof(0,e.getWindow)(d).HTMLTextAreaElement},e.isHTMLInputElement=function(d){return d instanceof HTMLInputElement||d instanceof(0,e.getWindow)(d).HTMLInputElement},e.isHTMLButtonElement=function(d){return d instanceof HTMLButtonElement||d instanceof(0,e.getWindow)(d).HTMLButtonElement},e.isHTMLDivElement=function(d){return d instanceof HTMLDivElement||d instanceof(0,e.getWindow)(d).HTMLDivElement},e.isSVGElement=function(d){return d instanceof SVGElement||d instanceof(0,e.getWindow)(d).SVGElement},e.isMouseEvent=function(d){return d instanceof MouseEvent||d instanceof(0,e.getWindow)(d).MouseEvent},e.isKeyboardEvent=function(d){return d instanceof KeyboardEvent||d instanceof(0,e.getWindow)(d).KeyboardEvent},e.isPointerEvent=function(d){return d instanceof PointerEvent||d instanceof(0,e.getWindow)(d).PointerEvent},e.isDragEvent=function(d){return d instanceof DragEvent||d instanceof(0,e.getWindow)(d).DragEvent},e.isEventLike=function(d){const m=d;return!(!m||typeof m.preventDefault!="function"||typeof m.stopPropagation!="function")},e.saveParentsScrollTop=function(d){const m=[];for(let T=0;d&&d.nodeType===d.ELEMENT_NODE;T++)m[T]=d.scrollTop,d=d.parentNode;return m},e.restoreParentsScrollTop=function(d,m){for(let T=0;d&&d.nodeType===d.ELEMENT_NODE;T++)d.scrollTop!==m[T]&&(d.scrollTop=m[T]),d=d.parentNode},e.trackFocus=function(d){return new q(d)},e.after=function(d,m){return d.after(m),m},e.append=ie,e.prepend=function(d,m){return d.insertBefore(m,d.firstChild),m},e.reset=function(d,...m){d.innerText="",ie(d,...m)},e.$=Re,e.join=function(d,m){const T=[];return d.forEach(((k,F)=>{F>0&&(m instanceof Node?T.push(m.cloneNode()):T.push(document.createTextNode(m))),T.push(k)})),T},e.setVisibility=function(d,...m){d?we(...m):de(...m)},e.show=we,e.hide=de,e.removeTabIndexAndUpdateFocus=function(d){d&&d.hasAttribute("tabIndex")&&(d.ownerDocument.activeElement===d&&(function(T){for(;T&&T.nodeType===T.ELEMENT_NODE;){if(Y(T)&&T.hasAttribute("tabIndex"))return T;T=T.parentNode}return null})(d.parentElement)?.focus(),d.removeAttribute("tabindex"))},e.finalHandler=function(d){return m=>{m.preventDefault(),m.stopPropagation(),d(m)}},e.domContentLoaded=function(d){return new Promise((m=>{if(d.document.readyState==="complete"||d.document&&d.document.body!==null)m(void 0);else{const T=()=>{d.window.removeEventListener("DOMContentLoaded",T,!1),m()};d.window.addEventListener("DOMContentLoaded",T,!1)}}))},e.computeScreenAwareSize=function(d,m){const T=d.devicePixelRatio*m;return Math.max(1,Math.floor(T))/d.devicePixelRatio},e.windowOpenNoOpener=function(d){a.mainWindow.open(d,"_blank","noopener")},e.windowOpenPopup=function(d){const m=Math.floor(a.mainWindow.screenLeft+a.mainWindow.innerWidth/2-ne/2),T=Math.floor(a.mainWindow.screenTop+a.mainWindow.innerHeight/2-ce/2);a.mainWindow.open(d,"_blank",`width=${ne},height=${ce},top=${T},left=${m}`)},e.windowOpenWithSuccess=function(d,m=!0){const T=a.mainWindow.open();return!!T&&(m&&(T.opener=null),T.location.href=d,!0)},e.animate=function(d,m){const T=()=>{m(),k=(0,e.scheduleAtNextAnimationFrame)(d,T)};let k=(0,e.scheduleAtNextAnimationFrame)(d,T);return(0,u.toDisposable)((()=>k.dispose()))},e.asCSSPropertyValue=function(d){return`'${d.replace(/'/g,"%27")}'`},e.asCssValueWithDefault=function d(m,T){if(m!==void 0){const k=m.match(/^\s*var\((.+)\)$/);if(k){const F=k[1].split(",",2);return F.length===2&&(T=d(F[1].trim(),T)),`var(${F[0]}, ${T})`}return m}return T},e.detectFullscreen=function(d){return d.document.fullscreenElement||d.document.webkitFullscreenElement||d.document.webkitIsFullScreen?{mode:ye.DOCUMENT,guess:!1}:d.innerHeight===d.screen.height?{mode:ye.BROWSER,guess:!1}:(n.isMacintosh||n.isLinux)&&d.outerHeight===d.screen.height&&d.outerWidth===d.screen.width?{mode:ye.BROWSER,guess:!0}:null},e.multibyteAwareBtoa=function(d){return btoa((function(m){const T=new Uint16Array(m.length);for(let H=0;H<T.length;H++)T[H]=m.charCodeAt(H);let k="";const F=new Uint8Array(T.buffer);for(let H=0;H<F.length;H++)k+=String.fromCharCode(F[H]);return k})(d))},e.getCookieValue=function(d){const m=document.cookie.match("(^|[^;]+)\\s*"+d+"\\s*=\\s*([^;]+)");return m?m.pop():void 0},e.h=function(d,...m){let T,k;Array.isArray(m[0])?(T={},k=m[0]):(T=m[0]||{},k=m[1]);const F=Oe.exec(d);if(!F||!F.groups)throw new Error("Bad use of h");const H=F.groups.tag||"div",G=document.createElement(H);F.groups.id&&(G.id=F.groups.id);const z=[];if(F.groups.class)for(const V of F.groups.class.split("."))V!==""&&z.push(V);if(T.className!==void 0)for(const V of T.className.split("."))V!==""&&z.push(V);z.length>0&&(G.className=z.join(" "));const Q={};if(F.groups.name&&(Q[F.groups.name]=G),k)for(const V of k)Y(V)?G.appendChild(V):typeof V=="string"?G.append(V):"root"in V&&(Object.assign(Q,V),G.appendChild(V.root));for(const[V,ue]of Object.entries(T))if(V!=="className")if(V==="style")for(const[Ce,Me]of Object.entries(ue))G.style.setProperty(Le(Ce),typeof Me=="number"?Me+"px":""+Me);else V==="tabIndex"?G.tabIndex=ue:G.setAttribute(Le(V),ue.toString());return Q.root=G,Q},e.svgElem=function(d,...m){let T,k;Array.isArray(m[0])?(T={},k=m[0]):(T=m[0]||{},k=m[1]);const F=Oe.exec(d);if(!F||!F.groups)throw new Error("Bad use of h");const H=F.groups.tag||"div",G=document.createElementNS("http://www.w3.org/2000/svg",H);F.groups.id&&(G.id=F.groups.id);const z=[];if(F.groups.class)for(const V of F.groups.class.split("."))V!==""&&z.push(V);if(T.className!==void 0)for(const V of T.className.split("."))V!==""&&z.push(V);z.length>0&&(G.className=z.join(" "));const Q={};if(F.groups.name&&(Q[F.groups.name]=G),k)for(const V of k)Y(V)?G.appendChild(V):typeof V=="string"?G.append(V):"root"in V&&(Object.assign(Q,V),G.appendChild(V.root));for(const[V,ue]of Object.entries(T))if(V!=="className")if(V==="style")for(const[Ce,Me]of Object.entries(ue))G.style.setProperty(Le(Ce),typeof Me=="number"?Me+"px":""+Me);else V==="tabIndex"?G.tabIndex=ue:G.setAttribute(Le(V),ue.toString());return Q.root=G,Q},e.copyAttributes=Ue,e.trackAttributes=function(d,m,T){Ue(d,m,T);const k=new u.DisposableStore;return k.add(e.sharedMutationObserver.observe(d,k,{attributes:!0,attributeFilter:T})((F=>{for(const H of F)H.type==="attributes"&&H.attributeName&&Pe(d,m,H.attributeName)}))),k};const b=C(v(6835)),_=v(467),o=v(3648),r=v(3838),p=v(2940),E=v(4577),t=C(v(5276)),R=v(1513),u=v(2540),n=C(v(8973)),s=v(6506),a=v(9199),c=v(42);i=(function(){const d=new Map;(0,a.ensureCodeWindow)(a.mainWindow,1);const m={window:a.mainWindow,disposables:new u.DisposableStore};d.set(a.mainWindow.vscodeWindowId,m);const T=new t.Emitter,k=new t.Emitter,F=new t.Emitter;return{onDidRegisterWindow:T.event,onWillUnregisterWindow:F.event,onDidUnregisterWindow:k.event,registerWindow(H){if(d.has(H.vscodeWindowId))return u.Disposable.None;const G=new u.DisposableStore,z={window:H,disposables:G.add(new u.DisposableStore)};return d.set(H.vscodeWindowId,z),G.add((0,u.toDisposable)((()=>{d.delete(H.vscodeWindowId),k.fire(H)}))),G.add(L(H,e.EventType.BEFORE_UNLOAD,(()=>{F.fire(H)}))),T.fire(z),G},getWindows:()=>d.values(),getWindowsCount:()=>d.size,getWindowId:H=>H.vscodeWindowId,hasWindow:H=>d.has(H),getWindowById:function(H,G){return(typeof H=="number"?d.get(H):void 0)??(G?m:void 0)},getWindow(H){const G=H;if(G?.ownerDocument?.defaultView)return G.ownerDocument.defaultView.window;const z=H;return z?.view?z.view.window:a.mainWindow},getDocument(H){const G=H;return(0,e.getWindow)(G).document}}})(),e.registerWindow=i.registerWindow,e.getWindow=i.getWindow,e.getDocument=i.getDocument,e.getWindows=i.getWindows,e.getWindowsCount=i.getWindowsCount,e.getWindowId=i.getWindowId,e.getWindowById=i.getWindowById,e.hasWindow=i.hasWindow,e.onDidRegisterWindow=i.onDidRegisterWindow,e.onWillUnregisterWindow=i.onWillUnregisterWindow,e.onDidUnregisterWindow=i.onDidUnregisterWindow;class l{constructor(m,T,k,F){this._node=m,this._type=T,this._handler=k,this._options=F||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function L(d,m,T,k){return new l(d,m,T,k)}function w(d,m){return function(T){return m(new r.StandardMouseEvent(d,T))}}function S(d,m,T){return L(d,n.isIOS&&_.BrowserFeatures.pointerEvents?e.EventType.POINTER_DOWN:e.EventType.MOUSE_DOWN,m,T)}function g(d,m,T){return L(d,n.isIOS&&_.BrowserFeatures.pointerEvents?e.EventType.POINTER_UP:e.EventType.MOUSE_UP,m,T)}e.addStandardDisposableListener=function(d,m,T,k){let F=T;return m==="click"||m==="mousedown"||m==="contextmenu"?F=w((0,e.getWindow)(d),T):m!=="keydown"&&m!=="keypress"&&m!=="keyup"||(F=(function(H){return function(G){return H(new o.StandardKeyboardEvent(G))}})(T)),L(d,m,F,k)},e.addStandardDisposableGenericMouseDownListener=function(d,m,T){return S(d,w((0,e.getWindow)(d),m),T)},e.addStandardDisposableGenericMouseUpListener=function(d,m,T){return g(d,w((0,e.getWindow)(d),m),T)};class A extends p.AbstractIdleValue{constructor(m,T){super(m,T)}}e.WindowIdleValue=A;class U extends p.IntervalTimer{constructor(m){super(),this.defaultTarget=m&&(0,e.getWindow)(m)}cancelAndSet(m,T,k){return super.cancelAndSet(m,T,k??this.defaultTarget)}}e.WindowIntervalTimer=U;class D{constructor(m,T=0){this._runner=m,this.priority=T,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(m){(0,E.onUnexpectedError)(m)}}static sort(m,T){return T.priority-m.priority}}(function(){const d=new Map,m=new Map,T=new Map,k=new Map;e.scheduleAtNextAnimationFrame=(F,H,G=0)=>{const z=(0,e.getWindowId)(F),Q=new D(H,G);let V=d.get(z);return V||(V=[],d.set(z,V)),V.push(Q),T.get(z)||(T.set(z,!0),F.requestAnimationFrame((()=>(ue=>{T.set(ue,!1);const Ce=d.get(ue)??[];for(m.set(ue,Ce),d.set(ue,[]),k.set(ue,!0);Ce.length>0;)Ce.sort(D.sort),Ce.shift().execute();k.set(ue,!1)})(z)))),Q},e.runAtThisOrScheduleAtNextAnimationFrame=(F,H,G)=>{const z=(0,e.getWindowId)(F);if(k.get(z)){const Q=new D(H,G);let V=m.get(z);return V||(V=[],m.set(z,V)),V.push(Q),Q}return(0,e.scheduleAtNextAnimationFrame)(F,H,G)}})();const P=function(d,m){return m};class B extends u.Disposable{constructor(m,T,k,F=P,H=8){super();let G=null,z=0;const Q=this._register(new p.TimeoutTimer),V=()=>{z=new Date().getTime(),k(G),G=null};this._register(L(m,T,(ue=>{G=F(G,ue);const Ce=new Date().getTime()-z;Ce>=H?(Q.cancel(),V()):Q.setIfNotSet(V,H-Ce)})))}}function M(d){return(0,e.getWindow)(d).getComputedStyle(d,null)}class y{static convertToPixels(m,T){return parseFloat(T)||0}static getDimension(m,T,k){const F=M(m),H=F?F.getPropertyValue(T):"0";return y.convertToPixels(m,H)}static getBorderLeftWidth(m){return y.getDimension(m,"border-left-width","borderLeftWidth")}static getBorderRightWidth(m){return y.getDimension(m,"border-right-width","borderRightWidth")}static getBorderTopWidth(m){return y.getDimension(m,"border-top-width","borderTopWidth")}static getBorderBottomWidth(m){return y.getDimension(m,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(m){return y.getDimension(m,"padding-left","paddingLeft")}static getPaddingRight(m){return y.getDimension(m,"padding-right","paddingRight")}static getPaddingTop(m){return y.getDimension(m,"padding-top","paddingTop")}static getPaddingBottom(m){return y.getDimension(m,"padding-bottom","paddingBottom")}static getMarginLeft(m){return y.getDimension(m,"margin-left","marginLeft")}static getMarginTop(m){return y.getDimension(m,"margin-top","marginTop")}static getMarginRight(m){return y.getDimension(m,"margin-right","marginRight")}static getMarginBottom(m){return y.getDimension(m,"margin-bottom","marginBottom")}}const ve=class ve{constructor(m,T){this.width=m,this.height=T}with(m=this.width,T=this.height){return m!==this.width||T!==this.height?new ve(m,T):this}static is(m){return typeof m=="object"&&typeof m.height=="number"&&typeof m.width=="number"}static lift(m){return m instanceof ve?m:new ve(m.width,m.height)}static equals(m,T){return m===T||!(!m||!T)&&m.width===T.width&&m.height===T.height}};ve.None=new ve(0,0);let x=ve;function I(d){let m=d.offsetParent,T=d.offsetTop,k=d.offsetLeft;for(;(d=d.parentNode)!==null&&d!==d.ownerDocument.body&&d!==d.ownerDocument.documentElement;){T-=d.scrollTop;const F=Z(d)?null:M(d);F&&(k-=F.direction!=="rtl"?d.scrollLeft:-d.scrollLeft),d===m&&(k+=y.getBorderLeftWidth(d),T+=y.getBorderTopWidth(d),T+=d.offsetTop,k+=d.offsetLeft,m=d.offsetParent)}return{left:k,top:T}}function O(d){const m=y.getMarginLeft(d)+y.getMarginRight(d);return d.offsetWidth+m}function N(d){const m=y.getMarginLeft(d)+y.getMarginRight(d);return d.scrollWidth+m}function W(d,m){return!!m?.contains(d)}e.Dimension=x;const K="parentFlowToElementId";function $(d){const m=d.dataset[K];return typeof m=="string"?d.ownerDocument.getElementById(m):null}function X(d,m,T){for(;d&&d.nodeType===d.ELEMENT_NODE;){if(d.classList.contains(m))return d;if(T){if(typeof T=="string"){if(d.classList.contains(T))return null}else if(d===T)return null}d=d.parentNode}return null}function Z(d){return d&&!!d.host&&!!d.mode}function re(d){for(;d.parentNode;){if(d===d.ownerDocument?.body)return null;d=d.parentNode}return Z(d)?d:null}function ae(){let d=he().activeElement;for(;d?.shadowRoot;)d=d.shadowRoot.activeElement;return d}function he(){return(0,e.getWindowsCount)()<=1?a.mainWindow.document:Array.from((0,e.getWindows)()).map((({window:d})=>d.document)).find((d=>d.hasFocus()))??a.mainWindow.document}const oe=new Map;class ee{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(m){m!==this._currentCssStyle&&(this._currentCssStyle=m,this._styleSheet?this._styleSheet.innerText=m:this._styleSheet=le(a.mainWindow.document.head,(T=>T.innerText=m)))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function le(d=a.mainWindow.document.head,m,T){const k=document.createElement("style");if(k.type="text/css",k.media="screen",m?.(k),d.appendChild(k),T&&T.add((0,u.toDisposable)((()=>k.remove()))),d===a.mainWindow.document.head){const F=new Set;oe.set(k,F);for(const{window:H,disposables:G}of(0,e.getWindows)()){if(H===a.mainWindow)continue;const z=G.add(_e(k,F,H));T?.add(z)}}return k}function _e(d,m,T){const k=new u.DisposableStore,F=d.cloneNode(!0);T.document.head.appendChild(F),k.add((0,u.toDisposable)((()=>F.remove())));for(const H of te(d))F.sheet?.insertRule(H.cssText,F.sheet?.cssRules.length);return k.add(e.sharedMutationObserver.observe(d,k,{childList:!0})((()=>{F.textContent=d.textContent}))),m.add(F),k.add((0,u.toDisposable)((()=>m.delete(F)))),k}function be(d,m=a.mainWindow.document.head){const T=document.createElement(d);return m.appendChild(T),T}e.sharedMutationObserver=new class{constructor(){this.mutationObservers=new Map}observe(d,m,T){let k=this.mutationObservers.get(d);k||(k=new Map,this.mutationObservers.set(d,k));const F=(0,s.hash)(T);let H=k.get(F);if(H)H.users+=1;else{const G=new t.Emitter,z=new MutationObserver((V=>G.fire(V)));z.observe(d,T);const Q=H={users:1,observer:z,onDidMutate:G.event};m.add((0,u.toDisposable)((()=>{Q.users-=1,Q.users===0&&(G.dispose(),z.disconnect(),k?.delete(F),k?.size===0&&this.mutationObservers.delete(d))}))),k.set(F,H)}return H.onDidMutate}};let me=null;function Te(){return me||(me=le()),me}function te(d){return d?.sheet?.rules?d.sheet.rules:d?.sheet?.cssRules?d.sheet.cssRules:[]}function J(d){return typeof d.selectorText=="string"}function Y(d){return d instanceof HTMLElement||d instanceof(0,e.getWindow)(d).HTMLElement}e.EventType={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:b.isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:b.isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:b.isWebKit?"webkitAnimationIteration":"animationiteration"},e.EventHelper={stop:(d,m)=>(d.preventDefault(),m&&d.stopPropagation(),d)};class q extends u.Disposable{static hasFocusWithin(m){if(Y(m)){const T=re(m);return W(T?T.activeElement:m.ownerDocument.activeElement,m)}{const T=m;return W(T.document.activeElement,T.document)}}constructor(m){super(),this._onDidFocus=this._register(new t.Emitter),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new t.Emitter),this.onDidBlur=this._onDidBlur.event;let T=q.hasFocusWithin(m),k=!1;const F=()=>{k=!1,T||(T=!0,this._onDidFocus.fire())},H=()=>{T&&(k=!0,(Y(m)?(0,e.getWindow)(m):m).setTimeout((()=>{k&&(k=!1,T=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{q.hasFocusWithin(m)!==T&&(T?H():F())},this._register(L(m,e.EventType.FOCUS,F,!0)),this._register(L(m,e.EventType.BLUR,H,!0)),Y(m)&&(this._register(L(m,e.EventType.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(L(m,e.EventType.FOCUS_OUT,(()=>this._refreshStateHandler()))))}refreshState(){this._refreshStateHandler()}}function ie(d,...m){if(d.append(...m),m.length===1&&typeof m[0]!="string")return m[0]}const fe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var se;function Ae(d,m,T,...k){const F=fe.exec(m);if(!F)throw new Error("Bad use of emmet");const H=F[1]||"div";let G;return G=d!==se.HTML?document.createElementNS(d,H):document.createElement(H),F[3]&&(G.id=F[3]),F[4]&&(G.className=F[4].replace(/\./g," ").trim()),T&&Object.entries(T).forEach((([z,Q])=>{Q!==void 0&&(/^on\w+$/.test(z)?G[z]=Q:z==="selected"?Q&&G.setAttribute(z,"true"):G.setAttribute(z,Q))})),G.append(...k),G}function Re(d,m,...T){return Ae(se.HTML,d,m,...T)}function we(...d){for(const m of d)m.style.display="",m.removeAttribute("aria-hidden")}function de(...d){for(const m of d)m.style.display="none",m.setAttribute("aria-hidden","true")}(function(d){d.HTML="http://www.w3.org/1999/xhtml",d.SVG="http://www.w3.org/2000/svg"})(se||(e.Namespace=se={})),Re.SVG=function(d,m,...T){return Ae(se.SVG,d,m,...T)};const ne=780,ce=640;var ye;(function(d){d[d.DOCUMENT=1]="DOCUMENT",d[d.BROWSER=2]="BROWSER"})(ye||(e.DetectedFullscreenMode=ye={}));class pe extends t.Emitter{constructor(){super(),this._subscriptions=new u.DisposableStore,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(t.Event.runAndSubscribe(e.onDidRegisterWindow,(({window:m,disposables:T})=>this.registerListeners(m,T)),{window:a.mainWindow,disposables:this._subscriptions}))}registerListeners(m,T){T.add(L(m,"keydown",(k=>{if(k.defaultPrevented)return;const F=new o.StandardKeyboardEvent(k);if(F.keyCode!==R.KeyCode.Alt||!k.repeat){if(k.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(k.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(k.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(k.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(F.keyCode===R.KeyCode.Alt)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=k.altKey,this._keyStatus.ctrlKey=k.ctrlKey,this._keyStatus.metaKey=k.metaKey,this._keyStatus.shiftKey=k.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=k,this.fire(this._keyStatus))}}),!0)),T.add(L(m,"keyup",(k=>{k.defaultPrevented||(!k.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!k.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!k.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!k.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=k.altKey,this._keyStatus.ctrlKey=k.ctrlKey,this._keyStatus.metaKey=k.metaKey,this._keyStatus.shiftKey=k.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=k,this.fire(this._keyStatus)))}),!0)),T.add(L(m.document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),T.add(L(m.document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),T.add(L(m.document.body,"mousemove",(k=>{k.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),T.add(L(m,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return pe.instance||(pe.instance=new pe),pe.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}e.ModifierKeyEmitter=pe;class xe extends u.Disposable{constructor(m,T){super(),this.element=m,this.callbacks=T,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(L(this.element,e.EventType.DRAG_START,(m=>{this.callbacks.onDragStart?.(m)}))),this.callbacks.onDrag&&this._register(L(this.element,e.EventType.DRAG,(m=>{this.callbacks.onDrag?.(m)}))),this._register(L(this.element,e.EventType.DRAG_ENTER,(m=>{this.counter++,this.dragStartTime=m.timeStamp,this.callbacks.onDragEnter?.(m)}))),this._register(L(this.element,e.EventType.DRAG_OVER,(m=>{m.preventDefault(),this.callbacks.onDragOver?.(m,m.timeStamp-this.dragStartTime)}))),this._register(L(this.element,e.EventType.DRAG_LEAVE,(m=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(m))}))),this._register(L(this.element,e.EventType.DRAG_END,(m=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(m)}))),this._register(L(this.element,e.EventType.DROP,(m=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(m)})))}}e.DragAndDropObserver=xe;const Oe=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Le(d){return d.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ue(d,m,T){for(const{name:k,value:F}of d.attributes)T&&!T.includes(k)||m.setAttribute(k,F)}function Pe(d,m,T){const k=d.getAttribute(T);k?m.setAttribute(T,k):m.removeAttribute(T)}e.SafeTriangle=class{constructor(d,m,T){this.originX=d,this.originY=m,this.triangles=[];const{top:k,left:F,right:H,bottom:G}=T.getBoundingClientRect(),z=this.triangles;let Q=0;z[Q++]=F,z[Q++]=k,z[Q++]=H,z[Q++]=k,z[Q++]=F,z[Q++]=k,z[Q++]=F,z[Q++]=G,z[Q++]=H,z[Q++]=k,z[Q++]=H,z[Q++]=G,z[Q++]=F,z[Q++]=G,z[Q++]=H,z[Q++]=G}contains(d,m){const{triangles:T,originX:k,originY:F}=this;for(let H=0;H<4;H++)if((0,c.isPointWithinTriangle)(d,m,k,F,T[2*H],T[2*H+1],T[2*H+2],T[2*H+3]))return!0;return!1}}},9275:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IframeUtils=void 0,e.parentOriginHash=async function(f,h){if(!crypto.subtle)throw new Error("'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");const C=JSON.stringify({parentOrigin:f,salt:h}),b=new TextEncoder().encode(C);return(function(_){const o=Array.from(new Uint8Array(_)).map((r=>r.toString(16).padStart(2,"0"))).join("");return BigInt(`0x${o}`).toString(32).padStart(52,"0")})(await crypto.subtle.digest("sha-256",b))};const v=new WeakMap;function i(f){if(!f.parent||f.parent===f)return null;try{const h=f.location,C=f.parent.location;if(h.origin!=="null"&&C.origin!=="null"&&h.origin!==C.origin)return null}catch{return null}return f.parent}e.IframeUtils=class{static getSameOriginWindowChain(f){let h=v.get(f);if(!h){h=[],v.set(f,h);let C,b=f;do C=i(b),C?h.push({window:new WeakRef(b),iframeElement:b.frameElement||null}):h.push({window:new WeakRef(b),iframeElement:null}),b=C;while(b)}return h.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(f,h){if(!h||f===h)return{top:0,left:0};let C=0,b=0;const _=this.getSameOriginWindowChain(f);for(const o of _){const r=o.window.deref();if(C+=r?.scrollY??0,b+=r?.scrollX??0,r===h||!o.iframeElement)break;const p=o.iframeElement.getBoundingClientRect();C+=p.top,b+=p.left}return{top:C,left:b}}}},3648:function(j,e,v){var i=this&&this.__createBinding||(Object.create?function(R,u,n,s){s===void 0&&(s=n);var a=Object.getOwnPropertyDescriptor(u,n);a&&!("get"in a?!u.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return u[n]}}),Object.defineProperty(R,s,a)}:function(R,u,n,s){s===void 0&&(s=n),R[s]=u[n]}),f=this&&this.__setModuleDefault||(Object.create?function(R,u){Object.defineProperty(R,"default",{enumerable:!0,value:u})}:function(R,u){R.default=u}),h=this&&this.__importStar||function(R){if(R&&R.__esModule)return R;var u={};if(R!=null)for(var n in R)n!=="default"&&Object.prototype.hasOwnProperty.call(R,n)&&i(u,R,n);return f(u,R),u};Object.defineProperty(e,"__esModule",{value:!0}),e.StandardKeyboardEvent=void 0,e.printKeyboardEvent=function(R){const u=[];return R.ctrlKey&&u.push("ctrl"),R.shiftKey&&u.push("shift"),R.altKey&&u.push("alt"),R.metaKey&&u.push("meta"),`modifiers: [${u.join(",")}], code: ${R.code}, keyCode: ${R.keyCode}, key: ${R.key}`},e.printStandardKeyboardEvent=function(R){const u=[];return R.ctrlKey&&u.push("ctrl"),R.shiftKey&&u.push("shift"),R.altKey&&u.push("alt"),R.metaKey&&u.push("meta"),`modifiers: [${u.join(",")}], code: ${R.code}, keyCode: ${R.keyCode} ('${b.KeyCodeUtils.toString(R.keyCode)}')`};const C=h(v(6835)),b=v(1513),_=v(7797),o=h(v(8973)),r=o.isMacintosh?b.KeyMod.WinCtrl:b.KeyMod.CtrlCmd,p=b.KeyMod.Alt,E=b.KeyMod.Shift,t=o.isMacintosh?b.KeyMod.CtrlCmd:b.KeyMod.WinCtrl;e.StandardKeyboardEvent=class{constructor(R){this._standardKeyboardEventBrand=!0;const u=R;this.browserEvent=u,this.target=u.target,this.ctrlKey=u.ctrlKey,this.shiftKey=u.shiftKey,this.altKey=u.altKey,this.metaKey=u.metaKey,this.altGraphKey=u.getModifierState?.("AltGraph"),this.keyCode=(function(n){if(n.charCode){const a=String.fromCharCode(n.charCode).toUpperCase();return b.KeyCodeUtils.fromString(a)}const s=n.keyCode;if(s===3)return b.KeyCode.PauseBreak;if(C.isFirefox)switch(s){case 59:return b.KeyCode.Semicolon;case 60:if(o.isLinux)return b.KeyCode.IntlBackslash;break;case 61:return b.KeyCode.Equal;case 107:return b.KeyCode.NumpadAdd;case 109:return b.KeyCode.NumpadSubtract;case 173:return b.KeyCode.Minus;case 224:if(o.isMacintosh)return b.KeyCode.Meta}else if(C.isWebKit&&(o.isMacintosh&&s===93||!o.isMacintosh&&s===92))return b.KeyCode.Meta;return b.EVENT_KEY_CODE_MAP[s]||b.KeyCode.Unknown})(u),this.code=u.code,this.ctrlKey=this.ctrlKey||this.keyCode===b.KeyCode.Ctrl,this.altKey=this.altKey||this.keyCode===b.KeyCode.Alt,this.shiftKey=this.shiftKey||this.keyCode===b.KeyCode.Shift,this.metaKey=this.metaKey||this.keyCode===b.KeyCode.Meta,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(R){return this._asKeybinding===R}_computeKeybinding(){let R=b.KeyCode.Unknown;this.keyCode!==b.KeyCode.Ctrl&&this.keyCode!==b.KeyCode.Shift&&this.keyCode!==b.KeyCode.Alt&&this.keyCode!==b.KeyCode.Meta&&(R=this.keyCode);let u=0;return this.ctrlKey&&(u|=r),this.altKey&&(u|=p),this.shiftKey&&(u|=E),this.metaKey&&(u|=t),u|=R,u}_computeKeyCodeChord(){let R=b.KeyCode.Unknown;return this.keyCode!==b.KeyCode.Ctrl&&this.keyCode!==b.KeyCode.Shift&&this.keyCode!==b.KeyCode.Alt&&this.keyCode!==b.KeyCode.Meta&&(R=this.keyCode),new _.KeyCodeChord(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,R)}}},3838:function(j,e,v){var i=this&&this.__createBinding||(Object.create?function(r,p,E,t){t===void 0&&(t=E);var R=Object.getOwnPropertyDescriptor(p,E);R&&!("get"in R?!p.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return p[E]}}),Object.defineProperty(r,t,R)}:function(r,p,E,t){t===void 0&&(t=E),r[t]=p[E]}),f=this&&this.__setModuleDefault||(Object.create?function(r,p){Object.defineProperty(r,"default",{enumerable:!0,value:p})}:function(r,p){r.default=p}),h=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var p={};if(r!=null)for(var E in r)E!=="default"&&Object.prototype.hasOwnProperty.call(r,E)&&i(p,r,E);return f(p,r),p};Object.defineProperty(e,"__esModule",{value:!0}),e.StandardWheelEvent=e.DragMouseEvent=e.StandardMouseEvent=void 0;const C=h(v(6835)),b=v(9275),_=h(v(8973));class o{constructor(p,E){this.timestamp=Date.now(),this.browserEvent=E,this.leftButton=E.button===0,this.middleButton=E.button===1,this.rightButton=E.button===2,this.buttons=E.buttons,this.target=E.target,this.detail=E.detail||1,E.type==="dblclick"&&(this.detail=2),this.ctrlKey=E.ctrlKey,this.shiftKey=E.shiftKey,this.altKey=E.altKey,this.metaKey=E.metaKey,typeof E.pageX=="number"?(this.posx=E.pageX,this.posy=E.pageY):(this.posx=E.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=E.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=b.IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(p,E.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}e.StandardMouseEvent=o,e.DragMouseEvent=class extends o{constructor(r,p){super(r,p),this.dataTransfer=p.dataTransfer}},e.StandardWheelEvent=class{constructor(r,p=0,E=0){this.browserEvent=r||null,this.target=r?r.target||r.targetNode||r.srcElement:null,this.deltaY=E,this.deltaX=p;let t=!1;if(C.isChrome){const R=navigator.userAgent.match(/Chrome\/(\d+)/);t=(R?parseInt(R[1]):123)<=122}if(r){const R=r,u=r,n=r.view?.devicePixelRatio||1;if(R.wheelDeltaY!==void 0)this.deltaY=t?R.wheelDeltaY/(120*n):R.wheelDeltaY/120;else if(u.VERTICAL_AXIS!==void 0&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(r.type==="wheel"){const s=r;s.deltaMode===s.DOM_DELTA_LINE?C.isFirefox&&!_.isMacintosh?this.deltaY=-r.deltaY/3:this.deltaY=-r.deltaY:this.deltaY=-r.deltaY/40}if(R.wheelDeltaX!==void 0)C.isSafari&&_.isWindows?this.deltaX=-R.wheelDeltaX/120:this.deltaX=t?R.wheelDeltaX/(120*n):R.wheelDeltaX/120;else if(u.HORIZONTAL_AXIS!==void 0&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-r.detail/3;else if(r.type==="wheel"){const s=r;s.deltaMode===s.DOM_DELTA_LINE?C.isFirefox&&!_.isMacintosh?this.deltaX=-r.deltaX/3:this.deltaX=-r.deltaX:this.deltaX=-r.deltaX/40}this.deltaY===0&&this.deltaX===0&&r.wheelDelta&&(this.deltaY=t?r.wheelDelta/(120*n):r.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}},9199:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mainWindow=void 0,e.ensureCodeWindow=function(v,i){},e.mainWindow=typeof window=="object"?window:globalThis},6732:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Permutation=e.CallbackIterable=e.ArrayQueue=e.booleanComparator=e.numberComparator=e.CompareResult=void 0,e.tail=function(u,n=0){return u[u.length-(1+n)]},e.tail2=function(u){if(u.length===0)throw new Error("Invalid tail call");return[u.slice(0,u.length-1),u[u.length-1]]},e.equals=function(u,n,s=(a,c)=>a===c){if(u===n)return!0;if(!u||!n||u.length!==n.length)return!1;for(let a=0,c=u.length;a<c;a++)if(!s(u[a],n[a]))return!1;return!0},e.removeFastWithoutKeepingOrder=function(u,n){const s=u.length-1;n<s&&(u[n]=u[s]),u.pop()},e.binarySearch=function(u,n,s){return h(u.length,(a=>s(u[a],n)))},e.binarySearch2=h,e.quickSelect=function u(n,s,a){if((n|=0)>=s.length)throw new TypeError("invalid index");const c=s[Math.floor(s.length*Math.random())],l=[],L=[],w=[];for(const S of s){const g=a(S,c);g<0?l.push(S):g>0?L.push(S):w.push(S)}return n<l.length?u(n,l,a):n<l.length+w.length?w[0]:u(n-(l.length+w.length),L,a)},e.groupBy=function(u,n){const s=[];let a;for(const c of u.slice(0).sort(n))a&&n(a[0],c)===0?a.push(c):(a=[c],s.push(a));return s},e.groupAdjacentBy=function*(u,n){let s,a;for(const c of u)a!==void 0&&n(a,c)?s.push(c):(s&&(yield s),s=[c]),a=c;s&&(yield s)},e.forEachAdjacent=function(u,n){for(let s=0;s<=u.length;s++)n(s===0?void 0:u[s-1],s===u.length?void 0:u[s])},e.forEachWithNeighbors=function(u,n){for(let s=0;s<u.length;s++)n(s===0?void 0:u[s-1],u[s],s+1===u.length?void 0:u[s+1])},e.sortedDiff=C,e.delta=function(u,n,s){const a=C(u,n,s),c=[],l=[];for(const L of a)c.push(...u.slice(L.start,L.start+L.deleteCount)),l.push(...L.toInsert);return{removed:c,added:l}},e.top=function(u,n,s){if(s===0)return[];const a=u.slice(0,s).sort(n);return b(u,n,a,s,u.length),a},e.topAsync=function(u,n,s,a,c){return s===0?Promise.resolve([]):new Promise(((l,L)=>{(async()=>{const w=u.length,S=u.slice(0,s).sort(n);for(let g=s,A=Math.min(s+a,w);g<w;g=A,A=Math.min(A+a,w)){if(g>s&&await new Promise((U=>setTimeout(U))),c&&c.isCancellationRequested)throw new i.CancellationError;b(u,n,S,g,A)}return S})().then(l,L)}))},e.coalesce=function(u){return u.filter((n=>!!n))},e.coalesceInPlace=function(u){let n=0;for(let s=0;s<u.length;s++)u[s]&&(u[n]=u[s],n+=1);u.length=n},e.move=function(u,n,s){u.splice(s,0,u.splice(n,1)[0])},e.isFalsyOrEmpty=function(u){return!Array.isArray(u)||u.length===0},e.isNonEmptyArray=function(u){return Array.isArray(u)&&u.length>0},e.distinct=function(u,n=s=>s){const s=new Set;return u.filter((a=>{const c=n(a);return!s.has(c)&&(s.add(c),!0)}))},e.uniqueFilter=function(u){const n=new Set;return s=>{const a=u(s);return!n.has(a)&&(n.add(a),!0)}},e.firstOrDefault=function(u,n){return u.length>0?u[0]:n},e.lastOrDefault=function(u,n){return u.length>0?u[u.length-1]:n},e.commonPrefixLength=function(u,n,s=(a,c)=>a===c){let a=0;for(let c=0,l=Math.min(u.length,n.length);c<l&&s(u[c],n[c]);c++)a++;return a},e.range=function(u,n){let s=typeof n=="number"?u:0;typeof n=="number"?s=u:(s=0,n=u);const a=[];if(s<=n)for(let c=s;c<n;c++)a.push(c);else for(let c=s;c>n;c--)a.push(c);return a},e.index=function(u,n,s){return u.reduce(((a,c)=>(a[n(c)]=s?s(c):c,a)),Object.create(null))},e.insert=function(u,n){return u.push(n),()=>_(u,n)},e.remove=_,e.arrayInsert=function(u,n,s){const a=u.slice(0,n),c=u.slice(n);return a.concat(s,c)},e.shuffle=function(u,n){let s;if(typeof n=="number"){let a=n;s=()=>{const c=179426549*Math.sin(a++);return c-Math.floor(c)}}else s=Math.random;for(let a=u.length-1;a>0;a-=1){const c=Math.floor(s()*(a+1)),l=u[a];u[a]=u[c],u[c]=l}},e.pushToStart=function(u,n){const s=u.indexOf(n);s>-1&&(u.splice(s,1),u.unshift(n))},e.pushToEnd=function(u,n){const s=u.indexOf(n);s>-1&&(u.splice(s,1),u.push(n))},e.pushMany=function(u,n){for(const s of n)u.push(s)},e.mapArrayOrNot=function(u,n){return Array.isArray(u)?u.map(n):n(u)},e.asArray=function(u){return Array.isArray(u)?u:[u]},e.getRandomElement=function(u){return u[Math.floor(Math.random()*u.length)]},e.insertInto=o,e.splice=function(u,n,s,a){const c=r(u,n);let l=u.splice(c,s);return l===void 0&&(l=[]),o(u,c,a),l},e.compareBy=function(u,n){return(s,a)=>n(u(s),u(a))},e.tieBreakComparators=function(...u){return(n,s)=>{for(const a of u){const c=a(n,s);if(!p.isNeitherLessOrGreaterThan(c))return c}return p.neitherLessOrGreaterThan}},e.reverseOrder=function(u){return(n,s)=>-u(n,s)};const i=v(4577),f=v(9411);function h(u,n){let s=0,a=u-1;for(;s<=a;){const c=(s+a)/2|0,l=n(c);if(l<0)s=c+1;else{if(!(l>0))return c;a=c-1}}return-(s+1)}function C(u,n,s){const a=[];function c(w,S,g){if(S===0&&g.length===0)return;const A=a[a.length-1];A&&A.start+A.deleteCount===w?(A.deleteCount+=S,A.toInsert.push(...g)):a.push({start:w,deleteCount:S,toInsert:g})}let l=0,L=0;for(;;){if(l===u.length){c(l,0,n.slice(L));break}if(L===n.length){c(l,u.length-l,[]);break}const w=u[l],S=n[L],g=s(w,S);g===0?(l+=1,L+=1):g<0?(c(l,1,[]),l+=1):g>0&&(c(l,0,[S]),L+=1)}return a}function b(u,n,s,a,c){for(const l=s.length;a<c;a++){const L=u[a];if(n(L,s[l-1])<0){s.pop();const w=(0,f.findFirstIdxMonotonousOrArrLen)(s,(S=>n(L,S)<0));s.splice(w,0,L)}}}function _(u,n){const s=u.indexOf(n);if(s>-1)return u.splice(s,1),n}function o(u,n,s){const a=r(u,n),c=u.length,l=s.length;u.length=c+l;for(let L=c-1;L>=a;L--)u[L+l]=u[L];for(let L=0;L<l;L++)u[L+a]=s[L]}function r(u,n){return n<0?Math.max(n+u.length,0):Math.min(n,u.length)}var p;(function(u){u.isLessThan=function(n){return n<0},u.isLessThanOrEqual=function(n){return n<=0},u.isGreaterThan=function(n){return n>0},u.isNeitherLessOrGreaterThan=function(n){return n===0},u.greaterThan=1,u.lessThan=-1,u.neitherLessOrGreaterThan=0})(p||(e.CompareResult=p={})),e.numberComparator=(u,n)=>u-n,e.booleanComparator=(u,n)=>(0,e.numberComparator)(u?1:0,n?1:0),e.ArrayQueue=class{constructor(u){this.items=u,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(u){let n=this.firstIdx;for(;n<this.items.length&&u(this.items[n]);)n++;const s=n===this.firstIdx?null:this.items.slice(this.firstIdx,n);return this.firstIdx=n,s}takeFromEndWhile(u){let n=this.lastIdx;for(;n>=0&&u(this.items[n]);)n--;const s=n===this.lastIdx?null:this.items.slice(n+1,this.lastIdx+1);return this.lastIdx=n,s}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){const u=this.items[this.firstIdx];return this.firstIdx++,u}removeLast(){const u=this.items[this.lastIdx];return this.lastIdx--,u}takeCount(u){const n=this.items.slice(this.firstIdx,this.firstIdx+u);return this.firstIdx+=u,n}};const R=class R{constructor(n){this.iterate=n}forEach(n){this.iterate((s=>(n(s),!0)))}toArray(){const n=[];return this.iterate((s=>(n.push(s),!0))),n}filter(n){return new R((s=>this.iterate((a=>!n(a)||s(a)))))}map(n){return new R((s=>this.iterate((a=>s(n(a))))))}some(n){let s=!1;return this.iterate((a=>(s=n(a),!s))),s}findFirst(n){let s;return this.iterate((a=>!n(a)||(s=a,!1))),s}findLast(n){let s;return this.iterate((a=>(n(a)&&(s=a),!0))),s}findLastMaxBy(n){let s,a=!0;return this.iterate((c=>((a||p.isGreaterThan(n(c,s)))&&(a=!1,s=c),!0))),s}};R.empty=new R((n=>{}));let E=R;e.CallbackIterable=E;class t{constructor(n){this._indexMap=n}static createSortPermutation(n,s){const a=Array.from(n.keys()).sort(((c,l)=>s(n[c],n[l])));return new t(a)}apply(n){return n.map(((s,a)=>n[this._indexMap[a]]))}inverse(){const n=this._indexMap.slice();for(let s=0;s<this._indexMap.length;s++)n[this._indexMap[s]]=s;return new t(n)}}e.Permutation=t},9411:(j,e)=>{function v(_,o,r=_.length-1){for(let p=r;p>=0;p--)if(o(_[p]))return p;return-1}function i(_,o,r=0,p=_.length){let E=r,t=p;for(;E<t;){const R=Math.floor((E+t)/2);o(_[R])?E=R+1:t=R}return E-1}function f(_,o,r=0,p=_.length){let E=r,t=p;for(;E<t;){const R=Math.floor((E+t)/2);o(_[R])?t=R:E=R+1}return E}Object.defineProperty(e,"__esModule",{value:!0}),e.MonotonousArray=void 0,e.findLast=function(_,o){const r=v(_,o);if(r!==-1)return _[r]},e.findLastIdx=v,e.findLastMonotonous=function(_,o){const r=i(_,o);return r===-1?void 0:_[r]},e.findLastIdxMonotonous=i,e.findFirstMonotonous=function(_,o){const r=f(_,o);return r===_.length?void 0:_[r]},e.findFirstIdxMonotonousOrArrLen=f,e.findFirstIdxMonotonous=function(_,o,r=0,p=_.length){const E=f(_,o,r,p);return E===_.length?-1:E},e.findFirstMax=C,e.findLastMax=function(_,o){if(_.length===0)return;let r=_[0];for(let p=1;p<_.length;p++){const E=_[p];o(E,r)>=0&&(r=E)}return r},e.findFirstMin=function(_,o){return C(_,((r,p)=>-o(r,p)))},e.findMaxIdx=function(_,o){if(_.length===0)return-1;let r=0;for(let p=1;p<_.length;p++)o(_[p],_[r])>0&&(r=p);return r},e.mapFindFirst=function(_,o){for(const r of _){const p=o(r);if(p!==void 0)return p}};const b=class b{constructor(o){this._array=o,this._findLastMonotonousLastIdx=0}findLastMonotonous(o){if(b.assertInvariants){if(this._prevFindLastPredicate){for(const p of this._array)if(this._prevFindLastPredicate(p)&&!o(p))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=o}const r=i(this._array,o,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=r+1,r===-1?void 0:this._array[r]}};b.assertInvariants=!1;let h=b;function C(_,o){if(_.length===0)return;let r=_[0];for(let p=1;p<_.length;p++){const E=_[p];o(E,r)>0&&(r=E)}return r}e.MonotonousArray=h},2940:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncIterableSource=e.CancelableAsyncIterableObject=e.AsyncIterableObject=e.LazyStatefulPromise=e.StatefulPromise=e.Promises=e.DeferredPromise=e.IntervalCounter=e.TaskSequentializer=e.GlobalIdleValue=e.AbstractIdleValue=e._runWhenIdle=e.runWhenGlobalIdle=e.ThrottledWorker=e.RunOnceWorker=e.ProcessTimeRunOnceScheduler=e.RunOnceScheduler=e.IntervalTimer=e.TimeoutTimer=e.LimitedQueue=e.Queue=e.Limiter=e.AutoOpenBarrier=e.Barrier=e.ThrottledDelayer=e.Delayer=e.SequencerByKey=e.Sequencer=e.Throttler=void 0,e.isThenable=r,e.createCancelablePromise=p,e.raceCancellation=function(M,y,x){return new Promise(((I,O)=>{const N=y.onCancellationRequested((()=>{N.dispose(),I(x)}));M.then(I,O).finally((()=>N.dispose()))}))},e.raceCancellationError=function(M,y){return new Promise(((x,I)=>{const O=y.onCancellationRequested((()=>{O.dispose(),I(new f.CancellationError)}));M.then(x,I).finally((()=>O.dispose()))}))},e.raceCancellablePromises=async function(M){let y=-1;const x=M.map(((I,O)=>I.then((N=>(y=O,N)))));try{return await Promise.race(x)}finally{M.forEach(((I,O)=>{O!==y&&I.cancel()}))}},e.raceTimeout=function(M,y,x){let I;const O=setTimeout((()=>{I?.(void 0),x?.()}),y);return Promise.race([M.finally((()=>clearTimeout(O))),new Promise((N=>I=N))])},e.asPromise=function(M){return new Promise(((y,x)=>{const I=M();r(I)?I.then(y,x):y(I)}))},e.promiseWithResolvers=E,e.timeout=n,e.disposableTimeout=function(M,y=0,x){const I=setTimeout((()=>{M(),x&&O.dispose()}),y),O=(0,C.toDisposable)((()=>{clearTimeout(I),x?.deleteAndLeak(O)}));return x?.add(O),O},e.sequence=function(M){const y=[];let x=0;const I=M.length;return Promise.resolve(null).then((function O(N){N!=null&&y.push(N);const W=x<I?M[x++]():null;return W?W.then(O):Promise.resolve(y)}))},e.first=function(M,y=I=>!!I,x=null){let I=0;const O=M.length,N=()=>{if(I>=O)return Promise.resolve(x);const W=M[I++];return Promise.resolve(W()).then((K=>y(K)?Promise.resolve(K):N()))};return N()},e.firstParallel=function(M,y=I=>!!I,x=null){if(M.length===0)return Promise.resolve(x);let I=M.length;const O=()=>{I=-1;for(const N of M)N.cancel?.()};return new Promise(((N,W)=>{for(const K of M)K.then(($=>{--I>=0&&y($)?(O(),N($)):I===0&&N(x)})).catch(($=>{--I>=0&&(O(),W($))}))}))},e.retry=async function(M,y,x){let I;for(let O=0;O<x;O++)try{return await M()}catch(N){I=N,await n(y)}throw I},e.createCancelableAsyncIterable=function(M){const y=new i.CancellationTokenSource,x=M(y.token);return new P(y,(async I=>{const O=y.token.onCancellationRequested((()=>{O.dispose(),y.dispose(),I.reject(new f.CancellationError)}));try{for await(const N of x){if(y.token.isCancellationRequested)return;I.emitOne(N)}O.dispose(),y.dispose()}catch(N){O.dispose(),y.dispose(),I.reject(N)}}))};const i=v(9473),f=v(4577),h=v(5276),C=v(2540),b=v(8973),_=v(1329),o=v(9764);function r(M){return!!M&&typeof M.then=="function"}function p(M){const y=new i.CancellationTokenSource,x=M(y.token),I=new Promise(((O,N)=>{const W=y.token.onCancellationRequested((()=>{W.dispose(),N(new f.CancellationError)}));Promise.resolve(x).then((K=>{W.dispose(),y.dispose(),O(K)}),(K=>{W.dispose(),y.dispose(),N(K)}))}));return new class{cancel(){y.cancel(),y.dispose()}then(O,N){return I.then(O,N)}catch(O){return this.then(void 0,O)}finally(O){return I.finally(O)}}}function E(){let M,y;return{promise:new Promise(((x,I)=>{M=x,y=I})),resolve:M,reject:y}}class t{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(y){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=y,!this.queuedPromise){const x=()=>{if(this.queuedPromise=null,this.isDisposed)return;const I=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,I};this.queuedPromise=new Promise((I=>{this.activePromise.then(x,x).then(I)}))}return new Promise(((x,I)=>{this.queuedPromise.then(x,I)}))}return this.activePromise=y(),new Promise(((x,I)=>{this.activePromise.then((O=>{this.activePromise=null,x(O)}),(O=>{this.activePromise=null,I(O)}))}))}dispose(){this.isDisposed=!0}}e.Throttler=t,e.Sequencer=class{constructor(){this.current=Promise.resolve(null)}queue(M){return this.current=this.current.then((()=>M()),(()=>M()))}},e.SequencerByKey=class{constructor(){this.promiseMap=new Map}queue(M,y){const x=(this.promiseMap.get(M)??Promise.resolve()).catch((()=>{})).then(y).finally((()=>{this.promiseMap.get(M)===x&&this.promiseMap.delete(M)}));return this.promiseMap.set(M,x),x}};class R{constructor(y){this.defaultDelay=y,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(y,x=this.defaultDelay){this.task=y,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((O,N)=>{this.doResolve=O,this.doReject=N})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const O=this.task;return this.task=null,O()}})));const I=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=x===_.MicrotaskDelay?(O=>{let N=!0;return queueMicrotask((()=>{N&&(N=!1,O())})),{isTriggered:()=>N,dispose:()=>{N=!1}}})(I):((O,N)=>{let W=!0;const K=setTimeout((()=>{W=!1,N()}),O);return{isTriggered:()=>W,dispose:()=>{clearTimeout(K),W=!1}}})(x,I),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new f.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}e.Delayer=R,e.ThrottledDelayer=class{constructor(M){this.delayer=new R(M),this.throttler=new t}trigger(M,y){return this.delayer.trigger((()=>this.throttler.queue(M)),y)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};class u{constructor(){this._isOpen=!1,this._promise=new Promise(((y,x)=>{this._completePromise=y}))}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}function n(M,y){return y?new Promise(((x,I)=>{const O=setTimeout((()=>{N.dispose(),x()}),M),N=y.onCancellationRequested((()=>{clearTimeout(O),N.dispose(),I(new f.CancellationError)}))})):p((x=>n(M,x)))}e.Barrier=u,e.AutoOpenBarrier=class extends u{constructor(M){super(),this._timeout=setTimeout((()=>this.open()),M)}open(){clearTimeout(this._timeout),super.open()}};class s{constructor(y){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=y,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new h.Emitter}whenIdle(){return this.size>0?h.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(y){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise(((x,I)=>{this.outstandingPromises.push({factory:y,c:x,e:I}),this.consume()}))}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const y=this.outstandingPromises.shift();this.runningPromises++;const x=y.factory();x.then(y.c,y.e),x.then((()=>this.consumed()),(()=>this.consumed()))}}consumed(){this._isDisposed||(this.runningPromises--,--this._size==0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}}e.Limiter=s,e.Queue=class extends s{constructor(){super(1)}},e.LimitedQueue=class{constructor(){this.sequentializer=new L,this.tasks=0}queue(M){return this.sequentializer.isRunning()?this.sequentializer.queue((()=>this.sequentializer.run(this.tasks++,M()))):this.sequentializer.run(this.tasks++,M())}},e.TimeoutTimer=class{constructor(M,y){this._isDisposed=!1,this._token=-1,typeof M=="function"&&typeof y=="number"&&this.setIfNotSet(M,y)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(M,y){if(this._isDisposed)throw new f.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout((()=>{this._token=-1,M()}),y)}setIfNotSet(M,y){if(this._isDisposed)throw new f.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout((()=>{this._token=-1,M()}),y))}},e.IntervalTimer=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(M,y,x=globalThis){if(this.isDisposed)throw new f.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const I=x.setInterval((()=>{M()}),y);this.disposable=(0,C.toDisposable)((()=>{x.clearInterval(I),this.disposable=void 0}))}dispose(){this.cancel(),this.isDisposed=!0}};class a{constructor(y,x){this.timeoutToken=-1,this.runner=y,this.timeout=x,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(y=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,y)}get delay(){return this.timeout}set delay(y){this.timeout=y}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}e.RunOnceScheduler=a,e.ProcessTimeRunOnceScheduler=class{constructor(M,y){y%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${y}ms is not a multiple of 1000ms.`),this.runner=M,this.timeout=y,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(M=this.timeout){M%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${M}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(M/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==-1}onInterval(){this.counter--,this.counter>0||(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner?.())}},e.RunOnceWorker=class extends a{constructor(M,y){super(M,y),this.units=[]}work(M){this.units.push(M),this.isScheduled()||this.schedule()}doRun(){const M=this.units;this.units=[],this.runner?.(M)}dispose(){this.units=[],super.dispose()}};class c extends C.Disposable{constructor(y,x){super(),this.options=y,this.handler=x,this.pendingWork=[],this.throttler=this._register(new C.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(y){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+y.length>this.options.maxBufferedWork)return!1}else if(this.pending+y.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(const x of y)this.pendingWork.push(x);return this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new a((()=>{this.throttler.clear(),this.doWork()}),this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}e.ThrottledWorker=c,typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?e._runWhenIdle=(M,y)=>{(0,b.setTimeout0)((()=>{if(x)return;const I=Date.now()+15;y(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,I-Date.now())}))}));let x=!1;return{dispose(){x||(x=!0)}}}:e._runWhenIdle=(M,y,x)=>{const I=M.requestIdleCallback(y,typeof x=="number"?{timeout:x}:void 0);let O=!1;return{dispose(){O||(O=!0,M.cancelIdleCallback(I))}}},e.runWhenGlobalIdle=M=>(0,e._runWhenIdle)(globalThis,M);class l{constructor(y,x){this._didRun=!1,this._executor=()=>{try{this._value=x()}catch(I){this._error=I}finally{this._didRun=!0}},this._handle=(0,e._runWhenIdle)(y,(()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}e.AbstractIdleValue=l,e.GlobalIdleValue=class extends l{constructor(M){super(globalThis,M)}};class L{isRunning(y){return typeof y=="number"?this._running?.taskId===y:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(y,x,I){return this._running={taskId:y,cancel:()=>I?.(),promise:x},x.then((()=>this.doneRunning(y)),(()=>this.doneRunning(y))),x}doneRunning(y){this._running&&y===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const y=this._queued;this._queued=void 0,y.run().then(y.promiseResolve,y.promiseReject)}}queue(y){if(this._queued)this._queued.run=y;else{const{promise:x,resolve:I,reject:O}=E();this._queued={run:y,promise:x,promiseResolve:I,promiseReject:O}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var w,S,g;e.TaskSequentializer=L,e.IntervalCounter=class{constructor(M,y=()=>Date.now()){this.interval=M,this.nowFn=y,this.lastIncrementTime=0,this.value=0}increment(){const M=this.nowFn();return M-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=M,this.value=0),this.value++,this.value}},(function(M){M[M.Resolved=0]="Resolved",M[M.Rejected=1]="Rejected"})(w||(w={}));class A{get isRejected(){return this.outcome?.outcome===w.Rejected}get isResolved(){return this.outcome?.outcome===w.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===w.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise(((y,x)=>{this.completeCallback=y,this.errorCallback=x}))}complete(y){return new Promise((x=>{this.completeCallback(y),this.outcome={outcome:w.Resolved,value:y},x()}))}error(y){return new Promise((x=>{this.errorCallback(y),this.outcome={outcome:w.Rejected,value:y},x()}))}cancel(){return this.error(new f.CancellationError)}}e.DeferredPromise=A,(function(M){M.settled=async function(y){let x;const I=await Promise.all(y.map((O=>O.then((N=>N),(N=>{x||(x=N)})))));if(x!==void 0)throw x;return I},M.withAsyncBody=function(y){return new Promise((async(x,I)=>{try{await y(x,I)}catch(O){I(O)}}))}})(S||(e.Promises=S={}));class U{get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(y){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=y.then((x=>(this._value=x,this._isResolved=!0,x)),(x=>{throw this._error=x,this._isResolved=!0,x}))}requireValue(){if(!this._isResolved)throw new f.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}e.StatefulPromise=U,e.LazyStatefulPromise=class{constructor(M){this._compute=M,this._promise=new o.Lazy((()=>new U(this._compute())))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}},(function(M){M[M.Initial=0]="Initial",M[M.DoneOK=1]="DoneOK",M[M.DoneError=2]="DoneError"})(g||(g={}));const B=class B{static fromArray(y){return new B((x=>{x.emitMany(y)}))}static fromPromise(y){return new B((async x=>{x.emitMany(await y)}))}static fromPromises(y){return new B((async x=>{await Promise.all(y.map((async I=>x.emitOne(await I))))}))}static merge(y){return new B((async x=>{await Promise.all(y.map((async I=>{for await(const O of I)x.emitOne(O)})))}))}constructor(y,x){this._state=g.Initial,this._results=[],this._error=null,this._onReturn=x,this._onStateChanged=new h.Emitter,queueMicrotask((async()=>{const I={emitOne:O=>this.emitOne(O),emitMany:O=>this.emitMany(O),reject:O=>this.reject(O)};try{await Promise.resolve(y(I)),this.resolve()}catch(O){this.reject(O)}finally{I.emitOne=void 0,I.emitMany=void 0,I.reject=void 0}}))}[Symbol.asyncIterator](){let y=0;return{next:async()=>{for(;;){if(this._state===g.DoneError)throw this._error;if(y<this._results.length)return{done:!1,value:this._results[y++]};if(this._state===g.DoneOK)return{done:!0,value:void 0};await h.Event.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(y,x){return new B((async I=>{for await(const O of y)I.emitOne(x(O))}))}map(y){return B.map(this,y)}static filter(y,x){return new B((async I=>{for await(const O of y)x(O)&&I.emitOne(O)}))}filter(y){return B.filter(this,y)}static coalesce(y){return B.filter(y,(x=>!!x))}coalesce(){return B.coalesce(this)}static async toPromise(y){const x=[];for await(const I of y)x.push(I);return x}toPromise(){return B.toPromise(this)}emitOne(y){this._state===g.Initial&&(this._results.push(y),this._onStateChanged.fire())}emitMany(y){this._state===g.Initial&&(this._results=this._results.concat(y),this._onStateChanged.fire())}resolve(){this._state===g.Initial&&(this._state=g.DoneOK,this._onStateChanged.fire())}reject(y){this._state===g.Initial&&(this._state=g.DoneError,this._error=y,this._onStateChanged.fire())}};B.EMPTY=B.fromArray([]);let D=B;e.AsyncIterableObject=D;class P extends D{constructor(y,x){super(x),this._source=y}cancel(){this._source.cancel()}}e.CancelableAsyncIterableObject=P,e.AsyncIterableSource=class{constructor(M){let y,x;this._deferred=new A,this._asyncIterable=new D((I=>{if(!y)return x&&I.emitMany(x),this._errorFn=O=>I.reject(O),this._emitFn=O=>I.emitOne(O),this._deferred.p;I.reject(y)}),M),this._emitFn=I=>{x||(x=[]),x.push(I)},this._errorFn=I=>{y||(y=I)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(M){this._errorFn(M),this._deferred.complete()}emitOne(M){this._emitFn(M)}}},9473:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0,e.cancelOnDispose=function(_){const o=new b;return _.add({dispose(){o.cancel()}}),o.token};const i=v(5276),f=Object.freeze((function(_,o){const r=setTimeout(_.bind(o),0);return{dispose(){clearTimeout(r)}}}));var h;(function(_){_.isCancellationToken=function(o){return o===_.None||o===_.Cancelled||o instanceof C||!(!o||typeof o!="object")&&typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"},_.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),_.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:f})})(h||(e.CancellationToken=h={}));class C{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?f:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class b{constructor(o){this._token=void 0,this._parentListener=void 0,this._parentListener=o&&o.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new C),this._token}cancel(){this._token?this._token instanceof C&&this._token.cancel():this._token=h.Cancelled}dispose(o=!1){o&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof C&&this._token.dispose():this._token=h.None}}e.CancellationTokenSource=b},2779:(j,e)=>{var v;Object.defineProperty(e,"__esModule",{value:!0}),e.CharCode=void 0,(function(i){i[i.Null=0]="Null",i[i.Backspace=8]="Backspace",i[i.Tab=9]="Tab",i[i.LineFeed=10]="LineFeed",i[i.CarriageReturn=13]="CarriageReturn",i[i.Space=32]="Space",i[i.ExclamationMark=33]="ExclamationMark",i[i.DoubleQuote=34]="DoubleQuote",i[i.Hash=35]="Hash",i[i.DollarSign=36]="DollarSign",i[i.PercentSign=37]="PercentSign",i[i.Ampersand=38]="Ampersand",i[i.SingleQuote=39]="SingleQuote",i[i.OpenParen=40]="OpenParen",i[i.CloseParen=41]="CloseParen",i[i.Asterisk=42]="Asterisk",i[i.Plus=43]="Plus",i[i.Comma=44]="Comma",i[i.Dash=45]="Dash",i[i.Period=46]="Period",i[i.Slash=47]="Slash",i[i.Digit0=48]="Digit0",i[i.Digit1=49]="Digit1",i[i.Digit2=50]="Digit2",i[i.Digit3=51]="Digit3",i[i.Digit4=52]="Digit4",i[i.Digit5=53]="Digit5",i[i.Digit6=54]="Digit6",i[i.Digit7=55]="Digit7",i[i.Digit8=56]="Digit8",i[i.Digit9=57]="Digit9",i[i.Colon=58]="Colon",i[i.Semicolon=59]="Semicolon",i[i.LessThan=60]="LessThan",i[i.Equals=61]="Equals",i[i.GreaterThan=62]="GreaterThan",i[i.QuestionMark=63]="QuestionMark",i[i.AtSign=64]="AtSign",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.OpenSquareBracket=91]="OpenSquareBracket",i[i.Backslash=92]="Backslash",i[i.CloseSquareBracket=93]="CloseSquareBracket",i[i.Caret=94]="Caret",i[i.Underline=95]="Underline",i[i.BackTick=96]="BackTick",i[i.a=97]="a",i[i.b=98]="b",i[i.c=99]="c",i[i.d=100]="d",i[i.e=101]="e",i[i.f=102]="f",i[i.g=103]="g",i[i.h=104]="h",i[i.i=105]="i",i[i.j=106]="j",i[i.k=107]="k",i[i.l=108]="l",i[i.m=109]="m",i[i.n=110]="n",i[i.o=111]="o",i[i.p=112]="p",i[i.q=113]="q",i[i.r=114]="r",i[i.s=115]="s",i[i.t=116]="t",i[i.u=117]="u",i[i.v=118]="v",i[i.w=119]="w",i[i.x=120]="x",i[i.y=121]="y",i[i.z=122]="z",i[i.OpenCurlyBrace=123]="OpenCurlyBrace",i[i.Pipe=124]="Pipe",i[i.CloseCurlyBrace=125]="CloseCurlyBrace",i[i.Tilde=126]="Tilde",i[i.NoBreakSpace=160]="NoBreakSpace",i[i.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",i[i.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",i[i.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",i[i.U_Combining_Tilde=771]="U_Combining_Tilde",i[i.U_Combining_Macron=772]="U_Combining_Macron",i[i.U_Combining_Overline=773]="U_Combining_Overline",i[i.U_Combining_Breve=774]="U_Combining_Breve",i[i.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",i[i.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",i[i.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",i[i.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",i[i.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",i[i.U_Combining_Caron=780]="U_Combining_Caron",i[i.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",i[i.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",i[i.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",i[i.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",i[i.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",i[i.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",i[i.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",i[i.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",i[i.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",i[i.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",i[i.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",i[i.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",i[i.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",i[i.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",i[i.U_Combining_Horn=795]="U_Combining_Horn",i[i.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",i[i.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",i[i.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",i[i.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",i[i.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",i[i.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",i[i.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",i[i.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",i[i.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",i[i.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",i[i.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",i[i.U_Combining_Cedilla=807]="U_Combining_Cedilla",i[i.U_Combining_Ogonek=808]="U_Combining_Ogonek",i[i.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",i[i.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",i[i.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",i[i.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",i[i.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",i[i.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",i[i.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",i[i.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",i[i.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",i[i.U_Combining_Low_Line=818]="U_Combining_Low_Line",i[i.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",i[i.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",i[i.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",i[i.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",i[i.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",i[i.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",i[i.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",i[i.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",i[i.U_Combining_Square_Below=827]="U_Combining_Square_Below",i[i.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",i[i.U_Combining_X_Above=829]="U_Combining_X_Above",i[i.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",i[i.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",i[i.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",i[i.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",i[i.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",i[i.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",i[i.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",i[i.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",i[i.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",i[i.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",i[i.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",i[i.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",i[i.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",i[i.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",i[i.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",i[i.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",i[i.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",i[i.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",i[i.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",i[i.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",i[i.U_Combining_Fermata=850]="U_Combining_Fermata",i[i.U_Combining_X_Below=851]="U_Combining_X_Below",i[i.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",i[i.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",i[i.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",i[i.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",i[i.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",i[i.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",i[i.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",i[i.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",i[i.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",i[i.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",i[i.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",i[i.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",i[i.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",i[i.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",i[i.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",i[i.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",i[i.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",i[i.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",i[i.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",i[i.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",i[i.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",i[i.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",i[i.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",i[i.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",i[i.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",i[i.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",i[i.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",i[i.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",i[i.LINE_SEPARATOR=8232]="LINE_SEPARATOR",i[i.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",i[i.NEXT_LINE=133]="NEXT_LINE",i[i.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",i[i.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",i[i.U_DIAERESIS=168]="U_DIAERESIS",i[i.U_MACRON=175]="U_MACRON",i[i.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",i[i.U_CEDILLA=184]="U_CEDILLA",i[i.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",i[i.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",i[i.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",i[i.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",i[i.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",i[i.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",i[i.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",i[i.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",i[i.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",i[i.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",i[i.U_BREVE=728]="U_BREVE",i[i.U_DOT_ABOVE=729]="U_DOT_ABOVE",i[i.U_RING_ABOVE=730]="U_RING_ABOVE",i[i.U_OGONEK=731]="U_OGONEK",i[i.U_SMALL_TILDE=732]="U_SMALL_TILDE",i[i.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",i[i.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",i[i.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",i[i.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",i[i.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",i[i.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",i[i.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",i[i.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",i[i.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",i[i.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",i[i.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",i[i.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",i[i.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",i[i.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",i[i.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",i[i.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",i[i.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",i[i.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",i[i.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",i[i.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",i[i.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",i[i.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",i[i.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",i[i.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",i[i.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",i[i.U_GREEK_TONOS=900]="U_GREEK_TONOS",i[i.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",i[i.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",i[i.U_GREEK_PSILI=8127]="U_GREEK_PSILI",i[i.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",i[i.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",i[i.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",i[i.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",i[i.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",i[i.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",i[i.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",i[i.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",i[i.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",i[i.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",i[i.U_GREEK_VARIA=8175]="U_GREEK_VARIA",i[i.U_GREEK_OXIA=8189]="U_GREEK_OXIA",i[i.U_GREEK_DASIA=8190]="U_GREEK_DASIA",i[i.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",i[i.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",i[i.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",i[i.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",i[i.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",i[i.U_OVERLINE=8254]="U_OVERLINE",i[i.UTF8_BOM=65279]="UTF8_BOM",i[i.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",i[i.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"})(v||(e.CharCode=v={}))},6033:(j,e)=>{var v;Object.defineProperty(e,"__esModule",{value:!0}),e.SetWithKey=void 0,e.groupBy=function(f,h){const C=Object.create(null);for(const b of f){const _=h(b);let o=C[_];o||(o=C[_]=[]),o.push(b)}return C},e.diffSets=function(f,h){const C=[],b=[];for(const _ of f)h.has(_)||C.push(_);for(const _ of h)f.has(_)||b.push(_);return{removed:C,added:b}},e.diffMaps=function(f,h){const C=[],b=[];for(const[_,o]of f)h.has(_)||C.push(o);for(const[_,o]of h)f.has(_)||b.push(o);return{removed:C,added:b}},e.intersection=function(f,h){const C=new Set;for(const b of h)f.has(b)&&C.add(b);return C};class i{constructor(h,C){this.toKey=C,this._map=new Map,this[v]="SetWithKey";for(const b of h)this.add(b)}get size(){return this._map.size}add(h){const C=this.toKey(h);return this._map.set(C,h),this}delete(h){return this._map.delete(this.toKey(h))}has(h){return this._map.has(this.toKey(h))}*entries(){for(const h of this._map.values())yield[h,h]}keys(){return this.values()}*values(){for(const h of this._map.values())yield h}clear(){this._map.clear()}forEach(h,C){this._map.forEach((b=>h.call(C,b,b,this)))}[Symbol.iterator](){return this.values()}}v=Symbol.toStringTag,e.SetWithKey=i},4577:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BugIndicatingError=e.ErrorNoTelemetry=e.ExpectedError=e.NotSupportedError=e.NotImplementedError=e.ReadonlyError=e.CancellationError=e.errorHandler=e.ErrorHandler=void 0,e.setUnexpectedErrorHandler=function(E){e.errorHandler.setUnexpectedErrorHandler(E)},e.isSigPipeError=function(E){if(!E||typeof E!="object")return!1;const t=E;return t.code==="EPIPE"&&t.syscall?.toUpperCase()==="WRITE"},e.onUnexpectedError=function(E){f(E)||e.errorHandler.onUnexpectedError(E)},e.onUnexpectedExternalError=function(E){f(E)||e.errorHandler.onUnexpectedExternalError(E)},e.transformErrorForSerialization=function(E){if(E instanceof Error){const{name:t,message:R}=E;return{$isError:!0,name:t,message:R,stack:E.stacktrace||E.stack,noTelemetry:r.isErrorNoTelemetry(E)}}return E},e.transformErrorFromSerialization=function(E){let t;return E.noTelemetry?t=new r:(t=new Error,t.name=E.name),t.message=E.message,t.stack=E.stack,t},e.isCancellationError=f,e.canceled=function(){const E=new Error(i);return E.name=E.message,E},e.illegalArgument=function(E){return E?new Error(`Illegal argument: ${E}`):new Error("Illegal argument")},e.illegalState=function(E){return E?new Error(`Illegal state: ${E}`):new Error("Illegal state")},e.getErrorMessage=function(E){return E?E.message?E.message:E.stack?E.stack.split(`
|
|
59
|
+
`)[0]:String(E):"Error"};class v{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout((()=>{throw t.stack?r.isErrorNoTelemetry(t)?new r(t.message+`
|
|
60
|
+
|
|
61
|
+
`+t.stack):new Error(t.message+`
|
|
62
|
+
|
|
63
|
+
`+t.stack):t}),0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach((R=>{R(t)}))}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}e.ErrorHandler=v,e.errorHandler=new v;const i="Canceled";function f(E){return E instanceof h||E instanceof Error&&E.name===i&&E.message===i}class h extends Error{constructor(){super(i),this.name=this.message}}e.CancellationError=h;class C extends TypeError{constructor(t){super(t?`${t} is read-only and cannot be changed`:"Cannot change read-only property")}}e.ReadonlyError=C;class b extends Error{constructor(t){super("NotImplemented"),t&&(this.message=t)}}e.NotImplementedError=b;class _ extends Error{constructor(t){super("NotSupported"),t&&(this.message=t)}}e.NotSupportedError=_;class o extends Error{constructor(){super(...arguments),this.isExpected=!0}}e.ExpectedError=o;class r extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof r)return t;const R=new r;return R.message=t.message,R.stack=t.stack,R}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}}e.ErrorNoTelemetry=r;class p extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,p.prototype)}}e.BugIndicatingError=p},5276:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueWithChangeEvent=e.Relay=e.EventBufferer=e.DynamicListEventMultiplexer=e.EventMultiplexer=e.MicrotaskEmitter=e.DebounceEmitter=e.PauseableEmitter=e.AsyncEmitter=e.createEventDeliveryQueue=e.Emitter=e.ListenerRefusalError=e.ListenerLeakError=e.EventProfiling=e.Event=void 0,e.setGlobalLeakWarningThreshold=function(g){const A=r;return r=g,{dispose(){r=A}}};const i=v(4577),f=v(7355),h=v(2540),C=v(4711),b=v(79);var _;(function(g){function A(I){return(O,N=null,W)=>{let K,$=!1;return K=I((X=>{if(!$)return K?K.dispose():$=!0,O.call(N,X)}),null,W),$&&K.dispose(),K}}function U(I,O,N){return P(((W,K=null,$)=>I((X=>W.call(K,O(X))),null,$)),N)}function D(I,O,N){return P(((W,K=null,$)=>I((X=>O(X)&&W.call(K,X)),null,$)),N)}function P(I,O){let N;const W=new s({onWillAddFirstListener(){N=I(W.fire,W)},onDidRemoveLastListener(){N?.dispose()}});return O?.add(W),W.event}function B(I,O,N=100,W=!1,K=!1,$,X){let Z,re,ae,he,oe=0;const ee=new s({leakWarningThreshold:$,onWillAddFirstListener(){Z=I((le=>{oe++,re=O(re,le),W&&!ae&&(ee.fire(re),re=void 0),he=()=>{const _e=re;re=void 0,ae=void 0,(!W||oe>1)&&ee.fire(_e),oe=0},typeof N=="number"?(clearTimeout(ae),ae=setTimeout(he,N)):ae===void 0&&(ae=0,queueMicrotask(he))}))},onWillRemoveListener(){K&&oe>0&&he?.()},onDidRemoveLastListener(){he=void 0,Z.dispose()}});return X?.add(ee),ee.event}g.None=()=>h.Disposable.None,g.defer=function(I,O){return B(I,(()=>{}),0,void 0,!0,void 0,O)},g.once=A,g.map=U,g.forEach=function(I,O,N){return P(((W,K=null,$)=>I((X=>{O(X),W.call(K,X)}),null,$)),N)},g.filter=D,g.signal=function(I){return I},g.any=function(...I){return(O,N=null,W)=>{return K=(0,h.combinedDisposable)(...I.map((X=>X((Z=>O.call(N,Z)))))),($=W)instanceof Array?$.push(K):$&&$.add(K),K;var K,$}},g.reduce=function(I,O,N,W){let K=N;return U(I,($=>(K=O(K,$),K)),W)},g.debounce=B,g.accumulate=function(I,O=0,N){return g.debounce(I,((W,K)=>W?(W.push(K),W):[K]),O,void 0,!0,void 0,N)},g.latch=function(I,O=(W,K)=>W===K,N){let W,K=!0;return D(I,($=>{const X=K||!O($,W);return K=!1,W=$,X}),N)},g.split=function(I,O,N){return[g.filter(I,O,N),g.filter(I,(W=>!O(W)),N)]},g.buffer=function(I,O=!1,N=[],W){let K=N.slice(),$=I((re=>{K?K.push(re):Z.fire(re)}));W&&W.add($);const X=()=>{K?.forEach((re=>Z.fire(re))),K=null},Z=new s({onWillAddFirstListener(){$||($=I((re=>Z.fire(re))),W&&W.add($))},onDidAddFirstListener(){K&&(O?setTimeout(X):X())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return W&&W.add(Z),Z.event},g.chain=function(I,O){return(N,W,K)=>{const $=O(new y);return I((function(X){const Z=$.evaluate(X);Z!==M&&N.call(W,Z)}),void 0,K)}};const M=Symbol("HaltChainable");class y{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push((N=>(O(N),N))),this}filter(O){return this.steps.push((N=>O(N)?N:M)),this}reduce(O,N){let W=N;return this.steps.push((K=>(W=O(W,K),W))),this}latch(O=(N,W)=>N===W){let N,W=!0;return this.steps.push((K=>{const $=W||!O(K,N);return W=!1,N=K,$?K:M})),this}evaluate(O){for(const N of this.steps)if((O=N(O))===M)break;return O}}g.fromNodeEventEmitter=function(I,O,N=W=>W){const W=(...$)=>K.fire(N(...$)),K=new s({onWillAddFirstListener:()=>I.on(O,W),onDidRemoveLastListener:()=>I.removeListener(O,W)});return K.event},g.fromDOMEventEmitter=function(I,O,N=W=>W){const W=(...$)=>K.fire(N(...$)),K=new s({onWillAddFirstListener:()=>I.addEventListener(O,W),onDidRemoveLastListener:()=>I.removeEventListener(O,W)});return K.event},g.toPromise=function(I){return new Promise((O=>A(I)(O)))},g.fromPromise=function(I){const O=new s;return I.then((N=>{O.fire(N)}),(()=>{O.fire(void 0)})).finally((()=>{O.dispose()})),O.event},g.forward=function(I,O){return I((N=>O.fire(N)))},g.runAndSubscribe=function(I,O,N){return O(N),I((W=>O(W)))};class x{constructor(O,N){this._observable=O,this._counter=0,this._hasChanged=!1;const W={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new s(W),N&&N.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,N){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}g.fromObservable=function(I,O){return new x(I,O).emitter.event},g.fromObservableLight=function(I){return(O,N,W)=>{let K=0,$=!1;const X={beginUpdate(){K++},endUpdate(){K--,K===0&&(I.reportChanges(),$&&($=!1,O.call(N)))},handlePossibleChange(){},handleChange(){$=!0}};I.addObserver(X),I.reportChanges();const Z={dispose(){I.removeObserver(X)}};return W instanceof h.DisposableStore?W.add(Z):Array.isArray(W)&&W.push(Z),Z}}})(_||(e.Event=_={}));const w=class w{constructor(A){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${A}_${w._idPool++}`,w.all.add(this)}start(A){this._stopWatch=new b.StopWatch,this.listenerCount=A}stop(){if(this._stopWatch){const A=this._stopWatch.elapsed();this.durations.push(A),this.elapsedOverall+=A,this.invocationCount+=1,this._stopWatch=void 0}}};w.all=new Set,w._idPool=0;let o=w;e.EventProfiling=o;let r=-1;const S=class S{constructor(A,U,D=(S._idPool++).toString(16).padStart(3,"0")){this._errorHandler=A,this.threshold=U,this.name=D,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(A,U){const D=this.threshold;if(D<=0||U<D)return;this._stacks||(this._stacks=new Map);const P=this._stacks.get(A.value)||0;if(this._stacks.set(A.value,P+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*D;const[B,M]=this.getMostFrequentStack(),y=`[${this.name}] potential listener LEAK detected, having ${U} listeners already. MOST frequent listener (${M}):`;console.warn(y),console.warn(B);const x=new t(y,B);this._errorHandler(x)}return()=>{const B=this._stacks.get(A.value)||0;this._stacks.set(A.value,B-1)}}getMostFrequentStack(){if(!this._stacks)return;let A,U=0;for(const[D,P]of this._stacks)(!A||U<P)&&(A=[D,P],U=P);return A}};S._idPool=1;let p=S;class E{static create(){const A=new Error;return new E(A.stack??"")}constructor(A){this.value=A}print(){console.warn(this.value.split(`
|
|
64
|
+
`).slice(2).join(`
|
|
65
|
+
`))}}class t extends Error{constructor(A,U){super(A),this.name="ListenerLeakError",this.stack=U}}e.ListenerLeakError=t;class R extends Error{constructor(A,U){super(A),this.name="ListenerRefusalError",this.stack=U}}e.ListenerRefusalError=R;let u=0;class n{constructor(A){this.value=A,this.id=u++}}class s{constructor(A){this._size=0,this._options=A,this._leakageMon=r>0||this._options?.leakWarningThreshold?new p(A?.onListenerError??i.onUnexpectedError,this._options?.leakWarningThreshold??r):void 0,this._perfMon=this._options?._profName?new o(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(A,U,D)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const y=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(y);const x=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],I=new R(`${y}. HINT: Stack shows most frequent listener (${x[1]}-times)`,x[0]);return(this._options?.onListenerError||i.onUnexpectedError)(I),h.Disposable.None}if(this._disposed)return h.Disposable.None;U&&(A=A.bind(U));const P=new n(A);let B;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(P.stack=E.create(),B=this._leakageMon.check(P.stack,this._size+1)),this._listeners?this._listeners instanceof n?(this._deliveryQueue??=new a,this._listeners=[this._listeners,P]):this._listeners.push(P):(this._options?.onWillAddFirstListener?.(this),this._listeners=P,this._options?.onDidAddFirstListener?.(this)),this._size++;const M=(0,h.toDisposable)((()=>{B?.(),this._removeListener(P)}));return D instanceof h.DisposableStore?D.add(M):Array.isArray(D)&&D.push(M),M},this._event}_removeListener(A){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1)return this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),void(this._size=0);const U=this._listeners,D=U.indexOf(A);if(D===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,U[D]=void 0;const P=this._deliveryQueue.current===this;if(2*this._size<=U.length){let B=0;for(let M=0;M<U.length;M++)U[M]?U[B++]=U[M]:P&&(this._deliveryQueue.end--,B<this._deliveryQueue.i&&this._deliveryQueue.i--);U.length=B}}_deliver(A,U){if(!A)return;const D=this._options?.onListenerError||i.onUnexpectedError;if(D)try{A.value(U)}catch(P){D(P)}else A.value(U)}_deliverQueue(A){const U=A.current._listeners;for(;A.i<A.end;)this._deliver(U[A.i++],A.value);A.reset()}fire(A){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof n)this._deliver(this._listeners,A);else{const U=this._deliveryQueue;U.enqueue(this,A,this._listeners.length),this._deliverQueue(U)}this._perfMon?.stop()}hasListeners(){return this._size>0}}e.Emitter=s,e.createEventDeliveryQueue=()=>new a;class a{constructor(){this.i=-1,this.end=0}enqueue(A,U,D){this.i=0,this.end=D,this.current=A,this.value=U}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}e.AsyncEmitter=class extends s{async fireAsync(g,A,U){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new C.LinkedList),((D,P)=>{if(D instanceof n)P(D);else for(let B=0;B<D.length;B++){const M=D[B];M&&P(M)}})(this._listeners,(D=>this._asyncDeliveryQueue.push([D.value,g])));this._asyncDeliveryQueue.size>0&&!A.isCancellationRequested;){const[D,P]=this._asyncDeliveryQueue.shift(),B=[],M={...P,token:A,waitUntil:y=>{if(Object.isFrozen(B))throw new Error("waitUntil can NOT be called asynchronous");U&&(y=U(y,D)),B.push(y)}};try{D(M)}catch(y){(0,i.onUnexpectedError)(y);continue}Object.freeze(B),await Promise.allSettled(B).then((y=>{for(const x of y)x.status==="rejected"&&(0,i.onUnexpectedError)(x.reason)}))}}};class c extends s{get isPaused(){return this._isPaused!==0}constructor(A){super(A),this._isPaused=0,this._eventQueue=new C.LinkedList,this._mergeFn=A?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused==0)if(this._mergeFn){if(this._eventQueue.size>0){const A=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(A))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(A){this._size&&(this._isPaused!==0?this._eventQueue.push(A):super.fire(A))}}e.PauseableEmitter=c,e.DebounceEmitter=class extends c{constructor(g){super(g),this._delay=g.delay??100}fire(g){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(g)}},e.MicrotaskEmitter=class extends s{constructor(g){super(g),this._queuedEvents=[],this._mergeFn=g?.merge}fire(g){this.hasListeners()&&(this._queuedEvents.push(g),this._queuedEvents.length===1&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((A=>super.fire(A))),this._queuedEvents=[]})))}};class l{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new s({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(A){const U={event:A,listener:null};return this.events.push(U),this.hasListeners&&this.hook(U),(0,h.toDisposable)((0,f.createSingleCallFunction)((()=>{this.hasListeners&&this.unhook(U);const D=this.events.indexOf(U);this.events.splice(D,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((A=>this.hook(A)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((A=>this.unhook(A)))}hook(A){A.listener=A.event((U=>this.emitter.fire(U)))}unhook(A){A.listener?.dispose(),A.listener=null}dispose(){this.emitter.dispose();for(const A of this.events)A.listener?.dispose();this.events=[]}}e.EventMultiplexer=l,e.DynamicListEventMultiplexer=class{constructor(g,A,U,D){this._store=new h.DisposableStore;const P=this._store.add(new l),B=this._store.add(new h.DisposableMap);function M(y){B.set(y,P.add(D(y)))}for(const y of g)M(y);this._store.add(A((y=>{M(y)}))),this._store.add(U((y=>{B.deleteAndDispose(y)}))),this.event=P.event}dispose(){this._store.dispose()}},e.EventBufferer=class{constructor(){this.data=[]}wrapEvent(g,A,U){return(D,P,B)=>g((M=>{const y=this.data[this.data.length-1];if(!A)return void(y?y.buffers.push((()=>D.call(P,M))):D.call(P,M));const x=y;x?(x.items??=[],x.items.push(M),x.buffers.length===0&&y.buffers.push((()=>{x.reducedResult??=U?x.items.reduce(A,U):x.items.reduce(A),D.call(P,x.reducedResult)}))):D.call(P,A(U,M))}),void 0,B)}bufferEvents(g){const A={buffers:new Array};this.data.push(A);const U=g();return this.data.pop(),A.buffers.forEach((D=>D())),U}},e.Relay=class{constructor(){this.listening=!1,this.inputEvent=_.None,this.inputEventListener=h.Disposable.None,this.emitter=new s({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(g){this.inputEvent=g,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=g(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}},e.ValueWithChangeEvent=class{static const(g){return new L(g)}constructor(g){this._value=g,this._onDidChange=new s,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(g){g!==this._value&&(this._value=g,this._onDidChange.fire(void 0))}};class L{constructor(A){this.value=A,this.onDidChange=_.None}}},7355:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createSingleCallFunction=function(v,i){const f=this;let h,C=!1;return function(){if(C)return h;if(C=!0,i)try{h=v.apply(f,arguments)}finally{i()}else h=v.apply(f,arguments);return h}}},6506:function(j,e,v){var i=this&&this.__createBinding||(Object.create?function(n,s,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(s,a);l&&!("get"in l?!s.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(n,c,l)}:function(n,s,a,c){c===void 0&&(c=a),n[c]=s[a]}),f=this&&this.__setModuleDefault||(Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s}),h=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&i(s,n,a);return f(s,n),s};Object.defineProperty(e,"__esModule",{value:!0}),e.StringSHA1=e.Hasher=void 0,e.hash=function(n){return b(n,0)},e.doHash=b,e.numberHash=_,e.stringHash=o,e.toHexString=t;const C=h(v(1130));function b(n,s){switch(typeof n){case"object":return n===null?_(349,s):Array.isArray(n)?(a=n,c=_(104579,c=s),a.reduce(((l,L)=>b(L,l)),c)):(function(l,L){return L=_(181387,L),Object.keys(l).sort().reduce(((w,S)=>(w=o(S,w),b(l[S],w))),L)})(n,s);case"string":return o(n,s);case"boolean":return(function(l,L){return _(l?433:863,L)})(n,s);case"number":return _(n,s);case"undefined":return _(937,s);default:return _(617,s)}var a,c}function _(n,s){return(s<<5)-s+n|0}function o(n,s){s=_(149417,s);for(let a=0,c=n.length;a<c;a++)s=_(n.charCodeAt(a),s);return s}var r;function p(n,s,a=32){const c=a-s;return(n<<s|(~((1<<c)-1)&n)>>>c)>>>0}function E(n,s=0,a=n.byteLength,c=0){for(let l=0;l<a;l++)n[s+l]=c}function t(n,s=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map((a=>a.toString(16).padStart(2,"0"))).join(""):(function(a,c,l="0"){for(;a.length<c;)a=l+a;return a})((n>>>0).toString(16),s/4)}e.Hasher=class{constructor(){this._value=0}get value(){return this._value}hash(n){return this._value=b(n,this._value),this._value}},(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(r||(r={}));const u=class u{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(r.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(s){const a=s.length;if(a===0)return;const c=this._buff;let l,L,w=this._buffLen,S=this._leftoverHighSurrogate;for(S!==0?(l=S,L=-1,S=0):(l=s.charCodeAt(0),L=0);;){let g=l;if(C.isHighSurrogate(l)){if(!(L+1<a)){S=l;break}{const A=s.charCodeAt(L+1);C.isLowSurrogate(A)?(L++,g=C.computeCodePoint(l,A)):g=r.UNICODE_REPLACEMENT}}else C.isLowSurrogate(l)&&(g=r.UNICODE_REPLACEMENT);if(w=this._push(c,w,g),L++,!(L<a))break;l=s.charCodeAt(L)}this._buffLen=w,this._leftoverHighSurrogate=S}_push(s,a,c){return c<128?s[a++]=c:c<2048?(s[a++]=192|(1984&c)>>>6,s[a++]=128|(63&c)>>>0):c<65536?(s[a++]=224|(61440&c)>>>12,s[a++]=128|(4032&c)>>>6,s[a++]=128|(63&c)>>>0):(s[a++]=240|(1835008&c)>>>18,s[a++]=128|(258048&c)>>>12,s[a++]=128|(4032&c)>>>6,s[a++]=128|(63&c)>>>0),a>=r.BLOCK_SIZE&&(this._step(),a-=r.BLOCK_SIZE,this._totalLen+=r.BLOCK_SIZE,s[0]=s[r.BLOCK_SIZE+0],s[1]=s[r.BLOCK_SIZE+1],s[2]=s[r.BLOCK_SIZE+2]),a}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,r.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),t(this._h0)+t(this._h1)+t(this._h2)+t(this._h3)+t(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,E(this._buff,this._buffLen),this._buffLen>56&&(this._step(),E(this._buff));const s=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(s/4294967296),!1),this._buffDV.setUint32(60,s%4294967296,!1),this._step()}_step(){const s=u._bigBlock32,a=this._buffDV;for(let D=0;D<64;D+=4)s.setUint32(D,a.getUint32(D,!1),!1);for(let D=64;D<320;D+=4)s.setUint32(D,p(s.getUint32(D-12,!1)^s.getUint32(D-32,!1)^s.getUint32(D-56,!1)^s.getUint32(D-64,!1),1),!1);let c,l,L,w=this._h0,S=this._h1,g=this._h2,A=this._h3,U=this._h4;for(let D=0;D<80;D++)D<20?(c=S&g|~S&A,l=1518500249):D<40?(c=S^g^A,l=1859775393):D<60?(c=S&g|S&A|g&A,l=2400959708):(c=S^g^A,l=3395469782),L=p(w,5)+c+U+l+s.getUint32(4*D,!1)&4294967295,U=A,A=g,g=p(S,30),S=w,w=L;this._h0=this._h0+w&4294967295,this._h1=this._h1+S&4294967295,this._h2=this._h2+g&4294967295,this._h3=this._h3+A&4294967295,this._h4=this._h4+U&4294967295}};u._bigBlock32=new DataView(new ArrayBuffer(320));let R=u;e.StringSHA1=R},8956:(j,e)=>{var v;Object.defineProperty(e,"__esModule",{value:!0}),e.Iterable=void 0,(function(i){function f(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}i.is=f;const h=Object.freeze([]);function*C(b){yield b}i.empty=function(){return h},i.single=C,i.wrap=function(b){return f(b)?b:C(b)},i.from=function(b){return b||h},i.reverse=function*(b){for(let _=b.length-1;_>=0;_--)yield b[_]},i.isEmpty=function(b){return!b||b[Symbol.iterator]().next().done===!0},i.first=function(b){return b[Symbol.iterator]().next().value},i.some=function(b,_){let o=0;for(const r of b)if(_(r,o++))return!0;return!1},i.find=function(b,_){for(const o of b)if(_(o))return o},i.filter=function*(b,_){for(const o of b)_(o)&&(yield o)},i.map=function*(b,_){let o=0;for(const r of b)yield _(r,o++)},i.flatMap=function*(b,_){let o=0;for(const r of b)yield*_(r,o++)},i.concat=function*(...b){for(const _ of b)yield*_},i.reduce=function(b,_,o){let r=o;for(const p of b)r=_(r,p);return r},i.slice=function*(b,_,o=b.length){for(_<0&&(_+=b.length),o<0?o+=b.length:o>b.length&&(o=b.length);_<o;_++)yield b[_]},i.consume=function(b,_=Number.POSITIVE_INFINITY){const o=[];if(_===0)return[o,b];const r=b[Symbol.iterator]();for(let p=0;p<_;p++){const E=r.next();if(E.done)return[o,i.empty()];o.push(E.value)}return[o,{[Symbol.iterator]:()=>r}]},i.asyncToArray=async function(b){const _=[];for await(const o of b)_.push(o);return Promise.resolve(_)}})(v||(e.Iterable=v={}))},1513:(j,e)=>{var v,i;Object.defineProperty(e,"__esModule",{value:!0}),e.KeyMod=e.KeyCodeUtils=e.ScanCodeUtils=e.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE=e.EVENT_KEY_CODE_MAP=e.ScanCode=e.KeyCode=void 0,e.KeyChord=function(t,R){return(t|(65535&R)<<16>>>0)>>>0},(function(t){t[t.DependsOnKbLayout=-1]="DependsOnKbLayout",t[t.Unknown=0]="Unknown",t[t.Backspace=1]="Backspace",t[t.Tab=2]="Tab",t[t.Enter=3]="Enter",t[t.Shift=4]="Shift",t[t.Ctrl=5]="Ctrl",t[t.Alt=6]="Alt",t[t.PauseBreak=7]="PauseBreak",t[t.CapsLock=8]="CapsLock",t[t.Escape=9]="Escape",t[t.Space=10]="Space",t[t.PageUp=11]="PageUp",t[t.PageDown=12]="PageDown",t[t.End=13]="End",t[t.Home=14]="Home",t[t.LeftArrow=15]="LeftArrow",t[t.UpArrow=16]="UpArrow",t[t.RightArrow=17]="RightArrow",t[t.DownArrow=18]="DownArrow",t[t.Insert=19]="Insert",t[t.Delete=20]="Delete",t[t.Digit0=21]="Digit0",t[t.Digit1=22]="Digit1",t[t.Digit2=23]="Digit2",t[t.Digit3=24]="Digit3",t[t.Digit4=25]="Digit4",t[t.Digit5=26]="Digit5",t[t.Digit6=27]="Digit6",t[t.Digit7=28]="Digit7",t[t.Digit8=29]="Digit8",t[t.Digit9=30]="Digit9",t[t.KeyA=31]="KeyA",t[t.KeyB=32]="KeyB",t[t.KeyC=33]="KeyC",t[t.KeyD=34]="KeyD",t[t.KeyE=35]="KeyE",t[t.KeyF=36]="KeyF",t[t.KeyG=37]="KeyG",t[t.KeyH=38]="KeyH",t[t.KeyI=39]="KeyI",t[t.KeyJ=40]="KeyJ",t[t.KeyK=41]="KeyK",t[t.KeyL=42]="KeyL",t[t.KeyM=43]="KeyM",t[t.KeyN=44]="KeyN",t[t.KeyO=45]="KeyO",t[t.KeyP=46]="KeyP",t[t.KeyQ=47]="KeyQ",t[t.KeyR=48]="KeyR",t[t.KeyS=49]="KeyS",t[t.KeyT=50]="KeyT",t[t.KeyU=51]="KeyU",t[t.KeyV=52]="KeyV",t[t.KeyW=53]="KeyW",t[t.KeyX=54]="KeyX",t[t.KeyY=55]="KeyY",t[t.KeyZ=56]="KeyZ",t[t.Meta=57]="Meta",t[t.ContextMenu=58]="ContextMenu",t[t.F1=59]="F1",t[t.F2=60]="F2",t[t.F3=61]="F3",t[t.F4=62]="F4",t[t.F5=63]="F5",t[t.F6=64]="F6",t[t.F7=65]="F7",t[t.F8=66]="F8",t[t.F9=67]="F9",t[t.F10=68]="F10",t[t.F11=69]="F11",t[t.F12=70]="F12",t[t.F13=71]="F13",t[t.F14=72]="F14",t[t.F15=73]="F15",t[t.F16=74]="F16",t[t.F17=75]="F17",t[t.F18=76]="F18",t[t.F19=77]="F19",t[t.F20=78]="F20",t[t.F21=79]="F21",t[t.F22=80]="F22",t[t.F23=81]="F23",t[t.F24=82]="F24",t[t.NumLock=83]="NumLock",t[t.ScrollLock=84]="ScrollLock",t[t.Semicolon=85]="Semicolon",t[t.Equal=86]="Equal",t[t.Comma=87]="Comma",t[t.Minus=88]="Minus",t[t.Period=89]="Period",t[t.Slash=90]="Slash",t[t.Backquote=91]="Backquote",t[t.BracketLeft=92]="BracketLeft",t[t.Backslash=93]="Backslash",t[t.BracketRight=94]="BracketRight",t[t.Quote=95]="Quote",t[t.OEM_8=96]="OEM_8",t[t.IntlBackslash=97]="IntlBackslash",t[t.Numpad0=98]="Numpad0",t[t.Numpad1=99]="Numpad1",t[t.Numpad2=100]="Numpad2",t[t.Numpad3=101]="Numpad3",t[t.Numpad4=102]="Numpad4",t[t.Numpad5=103]="Numpad5",t[t.Numpad6=104]="Numpad6",t[t.Numpad7=105]="Numpad7",t[t.Numpad8=106]="Numpad8",t[t.Numpad9=107]="Numpad9",t[t.NumpadMultiply=108]="NumpadMultiply",t[t.NumpadAdd=109]="NumpadAdd",t[t.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",t[t.NumpadSubtract=111]="NumpadSubtract",t[t.NumpadDecimal=112]="NumpadDecimal",t[t.NumpadDivide=113]="NumpadDivide",t[t.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",t[t.ABNT_C1=115]="ABNT_C1",t[t.ABNT_C2=116]="ABNT_C2",t[t.AudioVolumeMute=117]="AudioVolumeMute",t[t.AudioVolumeUp=118]="AudioVolumeUp",t[t.AudioVolumeDown=119]="AudioVolumeDown",t[t.BrowserSearch=120]="BrowserSearch",t[t.BrowserHome=121]="BrowserHome",t[t.BrowserBack=122]="BrowserBack",t[t.BrowserForward=123]="BrowserForward",t[t.MediaTrackNext=124]="MediaTrackNext",t[t.MediaTrackPrevious=125]="MediaTrackPrevious",t[t.MediaStop=126]="MediaStop",t[t.MediaPlayPause=127]="MediaPlayPause",t[t.LaunchMediaPlayer=128]="LaunchMediaPlayer",t[t.LaunchMail=129]="LaunchMail",t[t.LaunchApp2=130]="LaunchApp2",t[t.Clear=131]="Clear",t[t.MAX_VALUE=132]="MAX_VALUE"})(v||(e.KeyCode=v={})),(function(t){t[t.DependsOnKbLayout=-1]="DependsOnKbLayout",t[t.None=0]="None",t[t.Hyper=1]="Hyper",t[t.Super=2]="Super",t[t.Fn=3]="Fn",t[t.FnLock=4]="FnLock",t[t.Suspend=5]="Suspend",t[t.Resume=6]="Resume",t[t.Turbo=7]="Turbo",t[t.Sleep=8]="Sleep",t[t.WakeUp=9]="WakeUp",t[t.KeyA=10]="KeyA",t[t.KeyB=11]="KeyB",t[t.KeyC=12]="KeyC",t[t.KeyD=13]="KeyD",t[t.KeyE=14]="KeyE",t[t.KeyF=15]="KeyF",t[t.KeyG=16]="KeyG",t[t.KeyH=17]="KeyH",t[t.KeyI=18]="KeyI",t[t.KeyJ=19]="KeyJ",t[t.KeyK=20]="KeyK",t[t.KeyL=21]="KeyL",t[t.KeyM=22]="KeyM",t[t.KeyN=23]="KeyN",t[t.KeyO=24]="KeyO",t[t.KeyP=25]="KeyP",t[t.KeyQ=26]="KeyQ",t[t.KeyR=27]="KeyR",t[t.KeyS=28]="KeyS",t[t.KeyT=29]="KeyT",t[t.KeyU=30]="KeyU",t[t.KeyV=31]="KeyV",t[t.KeyW=32]="KeyW",t[t.KeyX=33]="KeyX",t[t.KeyY=34]="KeyY",t[t.KeyZ=35]="KeyZ",t[t.Digit1=36]="Digit1",t[t.Digit2=37]="Digit2",t[t.Digit3=38]="Digit3",t[t.Digit4=39]="Digit4",t[t.Digit5=40]="Digit5",t[t.Digit6=41]="Digit6",t[t.Digit7=42]="Digit7",t[t.Digit8=43]="Digit8",t[t.Digit9=44]="Digit9",t[t.Digit0=45]="Digit0",t[t.Enter=46]="Enter",t[t.Escape=47]="Escape",t[t.Backspace=48]="Backspace",t[t.Tab=49]="Tab",t[t.Space=50]="Space",t[t.Minus=51]="Minus",t[t.Equal=52]="Equal",t[t.BracketLeft=53]="BracketLeft",t[t.BracketRight=54]="BracketRight",t[t.Backslash=55]="Backslash",t[t.IntlHash=56]="IntlHash",t[t.Semicolon=57]="Semicolon",t[t.Quote=58]="Quote",t[t.Backquote=59]="Backquote",t[t.Comma=60]="Comma",t[t.Period=61]="Period",t[t.Slash=62]="Slash",t[t.CapsLock=63]="CapsLock",t[t.F1=64]="F1",t[t.F2=65]="F2",t[t.F3=66]="F3",t[t.F4=67]="F4",t[t.F5=68]="F5",t[t.F6=69]="F6",t[t.F7=70]="F7",t[t.F8=71]="F8",t[t.F9=72]="F9",t[t.F10=73]="F10",t[t.F11=74]="F11",t[t.F12=75]="F12",t[t.PrintScreen=76]="PrintScreen",t[t.ScrollLock=77]="ScrollLock",t[t.Pause=78]="Pause",t[t.Insert=79]="Insert",t[t.Home=80]="Home",t[t.PageUp=81]="PageUp",t[t.Delete=82]="Delete",t[t.End=83]="End",t[t.PageDown=84]="PageDown",t[t.ArrowRight=85]="ArrowRight",t[t.ArrowLeft=86]="ArrowLeft",t[t.ArrowDown=87]="ArrowDown",t[t.ArrowUp=88]="ArrowUp",t[t.NumLock=89]="NumLock",t[t.NumpadDivide=90]="NumpadDivide",t[t.NumpadMultiply=91]="NumpadMultiply",t[t.NumpadSubtract=92]="NumpadSubtract",t[t.NumpadAdd=93]="NumpadAdd",t[t.NumpadEnter=94]="NumpadEnter",t[t.Numpad1=95]="Numpad1",t[t.Numpad2=96]="Numpad2",t[t.Numpad3=97]="Numpad3",t[t.Numpad4=98]="Numpad4",t[t.Numpad5=99]="Numpad5",t[t.Numpad6=100]="Numpad6",t[t.Numpad7=101]="Numpad7",t[t.Numpad8=102]="Numpad8",t[t.Numpad9=103]="Numpad9",t[t.Numpad0=104]="Numpad0",t[t.NumpadDecimal=105]="NumpadDecimal",t[t.IntlBackslash=106]="IntlBackslash",t[t.ContextMenu=107]="ContextMenu",t[t.Power=108]="Power",t[t.NumpadEqual=109]="NumpadEqual",t[t.F13=110]="F13",t[t.F14=111]="F14",t[t.F15=112]="F15",t[t.F16=113]="F16",t[t.F17=114]="F17",t[t.F18=115]="F18",t[t.F19=116]="F19",t[t.F20=117]="F20",t[t.F21=118]="F21",t[t.F22=119]="F22",t[t.F23=120]="F23",t[t.F24=121]="F24",t[t.Open=122]="Open",t[t.Help=123]="Help",t[t.Select=124]="Select",t[t.Again=125]="Again",t[t.Undo=126]="Undo",t[t.Cut=127]="Cut",t[t.Copy=128]="Copy",t[t.Paste=129]="Paste",t[t.Find=130]="Find",t[t.AudioVolumeMute=131]="AudioVolumeMute",t[t.AudioVolumeUp=132]="AudioVolumeUp",t[t.AudioVolumeDown=133]="AudioVolumeDown",t[t.NumpadComma=134]="NumpadComma",t[t.IntlRo=135]="IntlRo",t[t.KanaMode=136]="KanaMode",t[t.IntlYen=137]="IntlYen",t[t.Convert=138]="Convert",t[t.NonConvert=139]="NonConvert",t[t.Lang1=140]="Lang1",t[t.Lang2=141]="Lang2",t[t.Lang3=142]="Lang3",t[t.Lang4=143]="Lang4",t[t.Lang5=144]="Lang5",t[t.Abort=145]="Abort",t[t.Props=146]="Props",t[t.NumpadParenLeft=147]="NumpadParenLeft",t[t.NumpadParenRight=148]="NumpadParenRight",t[t.NumpadBackspace=149]="NumpadBackspace",t[t.NumpadMemoryStore=150]="NumpadMemoryStore",t[t.NumpadMemoryRecall=151]="NumpadMemoryRecall",t[t.NumpadMemoryClear=152]="NumpadMemoryClear",t[t.NumpadMemoryAdd=153]="NumpadMemoryAdd",t[t.NumpadMemorySubtract=154]="NumpadMemorySubtract",t[t.NumpadClear=155]="NumpadClear",t[t.NumpadClearEntry=156]="NumpadClearEntry",t[t.ControlLeft=157]="ControlLeft",t[t.ShiftLeft=158]="ShiftLeft",t[t.AltLeft=159]="AltLeft",t[t.MetaLeft=160]="MetaLeft",t[t.ControlRight=161]="ControlRight",t[t.ShiftRight=162]="ShiftRight",t[t.AltRight=163]="AltRight",t[t.MetaRight=164]="MetaRight",t[t.BrightnessUp=165]="BrightnessUp",t[t.BrightnessDown=166]="BrightnessDown",t[t.MediaPlay=167]="MediaPlay",t[t.MediaRecord=168]="MediaRecord",t[t.MediaFastForward=169]="MediaFastForward",t[t.MediaRewind=170]="MediaRewind",t[t.MediaTrackNext=171]="MediaTrackNext",t[t.MediaTrackPrevious=172]="MediaTrackPrevious",t[t.MediaStop=173]="MediaStop",t[t.Eject=174]="Eject",t[t.MediaPlayPause=175]="MediaPlayPause",t[t.MediaSelect=176]="MediaSelect",t[t.LaunchMail=177]="LaunchMail",t[t.LaunchApp2=178]="LaunchApp2",t[t.LaunchApp1=179]="LaunchApp1",t[t.SelectTask=180]="SelectTask",t[t.LaunchScreenSaver=181]="LaunchScreenSaver",t[t.BrowserSearch=182]="BrowserSearch",t[t.BrowserHome=183]="BrowserHome",t[t.BrowserBack=184]="BrowserBack",t[t.BrowserForward=185]="BrowserForward",t[t.BrowserStop=186]="BrowserStop",t[t.BrowserRefresh=187]="BrowserRefresh",t[t.BrowserFavorites=188]="BrowserFavorites",t[t.ZoomToggle=189]="ZoomToggle",t[t.MailReply=190]="MailReply",t[t.MailForward=191]="MailForward",t[t.MailSend=192]="MailSend",t[t.MAX_VALUE=193]="MAX_VALUE"})(i||(e.ScanCode=i={}));class f{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(R,u){this._keyCodeToStr[R]=u,this._strToKeyCode[u.toLowerCase()]=R}keyCodeToStr(R){return this._keyCodeToStr[R]}strToKeyCode(R){return this._strToKeyCode[R.toLowerCase()]||v.Unknown}}const h=new f,C=new f,b=new f;e.EVENT_KEY_CODE_MAP=new Array(230),e.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE={};const _=[],o=Object.create(null),r=Object.create(null);var p,E;e.ScanCodeUtils={lowerCaseToEnum:t=>r[t]||i.None,toEnum:t=>o[t]||i.None,toString:t=>_[t]||"None"},(function(t){t.toString=function(R){return h.keyCodeToStr(R)},t.fromString=function(R){return h.strToKeyCode(R)},t.toUserSettingsUS=function(R){return C.keyCodeToStr(R)},t.toUserSettingsGeneral=function(R){return b.keyCodeToStr(R)},t.fromUserSettings=function(R){return C.strToKeyCode(R)||b.strToKeyCode(R)},t.toElectronAccelerator=function(R){if(R>=v.Numpad0&&R<=v.NumpadDivide)return null;switch(R){case v.UpArrow:return"Up";case v.DownArrow:return"Down";case v.LeftArrow:return"Left";case v.RightArrow:return"Right"}return h.keyCodeToStr(R)}})(p||(e.KeyCodeUtils=p={})),(function(t){t[t.CtrlCmd=2048]="CtrlCmd",t[t.Shift=1024]="Shift",t[t.Alt=512]="Alt",t[t.WinCtrl=256]="WinCtrl"})(E||(e.KeyMod=E={}))},7797:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ResolvedKeybinding=e.ResolvedChord=e.Keybinding=e.ScanCodeChord=e.KeyCodeChord=void 0,e.decodeKeybinding=function(p,E){if(typeof p=="number"){if(p===0)return null;const t=(65535&p)>>>0,R=(4294901760&p)>>>16;return new r(R!==0?[b(t,E),b(R,E)]:[b(t,E)])}{const t=[];for(let R=0;R<p.length;R++)t.push(b(p[R],E));return new r(t)}},e.createSimpleKeybinding=b;const i=v(4577),f=v(1513),h=v(8973);var C;function b(p,E){const t=!!(p&C.CtrlCmd),R=!!(p&C.WinCtrl),u=E===h.OperatingSystem.Macintosh?R:t,n=!!(p&C.Shift),s=!!(p&C.Alt),a=E===h.OperatingSystem.Macintosh?t:R,c=p&C.KeyCode;return new _(u,n,s,a,c)}(function(p){p[p.CtrlCmd=2048]="CtrlCmd",p[p.Shift=1024]="Shift",p[p.Alt=512]="Alt",p[p.WinCtrl=256]="WinCtrl",p[p.KeyCode=255]="KeyCode"})(C||(C={}));class _{constructor(E,t,R,u,n){this.ctrlKey=E,this.shiftKey=t,this.altKey=R,this.metaKey=u,this.keyCode=n}equals(E){return E instanceof _&&this.ctrlKey===E.ctrlKey&&this.shiftKey===E.shiftKey&&this.altKey===E.altKey&&this.metaKey===E.metaKey&&this.keyCode===E.keyCode}getHashCode(){return`K${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.keyCode}`}isModifierKey(){return this.keyCode===f.KeyCode.Unknown||this.keyCode===f.KeyCode.Ctrl||this.keyCode===f.KeyCode.Meta||this.keyCode===f.KeyCode.Alt||this.keyCode===f.KeyCode.Shift}toKeybinding(){return new r([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===f.KeyCode.Ctrl||this.shiftKey&&this.keyCode===f.KeyCode.Shift||this.altKey&&this.keyCode===f.KeyCode.Alt||this.metaKey&&this.keyCode===f.KeyCode.Meta}}e.KeyCodeChord=_;class o{constructor(E,t,R,u,n){this.ctrlKey=E,this.shiftKey=t,this.altKey=R,this.metaKey=u,this.scanCode=n}equals(E){return E instanceof o&&this.ctrlKey===E.ctrlKey&&this.shiftKey===E.shiftKey&&this.altKey===E.altKey&&this.metaKey===E.metaKey&&this.scanCode===E.scanCode}getHashCode(){return`S${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.scanCode}`}isDuplicateModifierCase(){return this.ctrlKey&&(this.scanCode===f.ScanCode.ControlLeft||this.scanCode===f.ScanCode.ControlRight)||this.shiftKey&&(this.scanCode===f.ScanCode.ShiftLeft||this.scanCode===f.ScanCode.ShiftRight)||this.altKey&&(this.scanCode===f.ScanCode.AltLeft||this.scanCode===f.ScanCode.AltRight)||this.metaKey&&(this.scanCode===f.ScanCode.MetaLeft||this.scanCode===f.ScanCode.MetaRight)}}e.ScanCodeChord=o;class r{constructor(E){if(E.length===0)throw(0,i.illegalArgument)("chords");this.chords=E}getHashCode(){let E="";for(let t=0,R=this.chords.length;t<R;t++)t!==0&&(E+=";"),E+=this.chords[t].getHashCode();return E}equals(E){if(E===null||this.chords.length!==E.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(E.chords[t]))return!1;return!0}}e.Keybinding=r,e.ResolvedChord=class{constructor(p,E,t,R,u,n){this.ctrlKey=p,this.shiftKey=E,this.altKey=t,this.metaKey=R,this.keyLabel=u,this.keyAriaLabel=n}},e.ResolvedKeybinding=class{}},9764:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Lazy=void 0,e.Lazy=class{constructor(v){this.executor=v,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(v){this._error=v}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}},2540:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DisposableMap=e.ImmortalReference=e.AsyncReferenceCollection=e.ReferenceCollection=e.SafeDisposable=e.RefCountedDisposable=e.MandatoryMutableDisposable=e.MutableDisposable=e.Disposable=e.DisposableStore=e.DisposableTracker=void 0,e.setDisposableTracker=function(S){_=S},e.trackDisposable=r,e.markAsDisposed=p,e.markAsSingleton=function(S){return _?.markAsSingleton(S),S},e.isDisposable=t,e.dispose=R,e.disposeIfDisposable=function(S){for(const g of S)t(g)&&g.dispose();return[]},e.combinedDisposable=function(...S){const g=u((()=>R(S)));return(function(A,U){if(_)for(const D of A)_.setParent(D,U)})(S,g),g},e.toDisposable=u,e.disposeOnReturn=function(S){const g=new n;try{S(g)}finally{g.dispose()}};const i=v(6732),f=v(6033),h=v(714),C=v(7355),b=v(8956);let _=null;const l=class l{constructor(){this.livingDisposables=new Map}getDisposableData(g){let A=this.livingDisposables.get(g);return A||(A={parent:null,source:null,isSingleton:!1,value:g,idx:l.idx++},this.livingDisposables.set(g,A)),A}trackDisposable(g){const A=this.getDisposableData(g);A.source||(A.source=new Error().stack)}setParent(g,A){this.getDisposableData(g).parent=A}markAsDisposed(g){this.livingDisposables.delete(g)}markAsSingleton(g){this.getDisposableData(g).isSingleton=!0}getRootParent(g,A){const U=A.get(g);if(U)return U;const D=g.parent?this.getRootParent(this.getDisposableData(g.parent),A):g;return A.set(g,D),D}getTrackedDisposables(){const g=new Map;return[...this.livingDisposables.entries()].filter((([,A])=>A.source!==null&&!this.getRootParent(A,g).isSingleton)).flatMap((([A])=>A))}computeLeakingDisposables(g=10,A){let U;if(A)U=A;else{const y=new Map,x=[...this.livingDisposables.values()].filter((O=>O.source!==null&&!this.getRootParent(O,y).isSingleton));if(x.length===0)return;const I=new Set(x.map((O=>O.value)));if(U=x.filter((O=>!(O.parent&&I.has(O.parent)))),U.length===0)throw new Error("There are cyclic diposable chains!")}if(!U)return;function D(y){const x=y.source.split(`
|
|
66
|
+
`).map((I=>I.trim().replace("at ",""))).filter((I=>I!==""));return(function(I,O){for(;I.length>0&&O.some((N=>typeof N=="string"?N===I[0]:I[0].match(N)));)I.shift()})(x,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),x.reverse()}const P=new h.SetMap;for(const y of U){const x=D(y);for(let I=0;I<=x.length;I++)P.add(x.slice(0,I).join(`
|
|
67
|
+
`),y)}U.sort((0,i.compareBy)((y=>y.idx),i.numberComparator));let B="",M=0;for(const y of U.slice(0,g)){M++;const x=D(y),I=[];for(let O=0;O<x.length;O++){let N=x[O];N=`(shared with ${P.get(x.slice(0,O+1).join(`
|
|
68
|
+
`)).size}/${U.length} leaks) at ${N}`;const W=P.get(x.slice(0,O).join(`
|
|
69
|
+
`)),K=(0,f.groupBy)([...W].map(($=>D($)[O])),($=>$));delete K[x[O]];for(const[$,X]of Object.entries(K))I.unshift(` - stacktraces of ${X.length} other leaks continue with ${$}`);I.unshift(N)}B+=`
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
==================== Leaking disposable ${M}/${U.length}: ${y.value.constructor.name} ====================
|
|
73
|
+
${I.join(`
|
|
74
|
+
`)}
|
|
75
|
+
============================================================
|
|
76
|
+
|
|
77
|
+
`}return U.length>g&&(B+=`
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
... and ${U.length-g} more leaking disposables
|
|
81
|
+
|
|
82
|
+
`),{leaks:U,details:B}}};l.idx=0;let o=l;function r(S){return _?.trackDisposable(S),S}function p(S){_?.markAsDisposed(S)}function E(S,g){_?.setParent(S,g)}function t(S){return typeof S=="object"&&S!==null&&typeof S.dispose=="function"&&S.dispose.length===0}function R(S){if(b.Iterable.is(S)){const g=[];for(const A of S)if(A)try{A.dispose()}catch(U){g.push(U)}if(g.length===1)throw g[0];if(g.length>1)throw new AggregateError(g,"Encountered errors while disposing of store");return Array.isArray(S)?[]:S}if(S)return S.dispose(),S}function u(S){const g=r({dispose:(0,C.createSingleCallFunction)((()=>{p(g),S()}))});return g}e.DisposableTracker=o;const L=class L{constructor(){this._toDispose=new Set,this._isDisposed=!1,r(this)}dispose(){this._isDisposed||(p(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{R(this._toDispose)}finally{this._toDispose.clear()}}add(g){if(!g)return g;if(g===this)throw new Error("Cannot register a disposable on itself!");return E(g,this),this._isDisposed?L.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(g),g}delete(g){if(g){if(g===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(g),g.dispose()}}deleteAndLeak(g){g&&this._toDispose.has(g)&&(this._toDispose.delete(g),E(g,null))}};L.DISABLE_DISPOSED_WARNING=!1;let n=L;e.DisposableStore=n;const w=class w{constructor(){this._store=new n,r(this),E(this._store,this)}dispose(){p(this),this._store.dispose()}_register(g){if(g===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(g)}};w.None=Object.freeze({dispose(){}});let s=w;e.Disposable=s;class a{constructor(){this._isDisposed=!1,r(this)}get value(){return this._isDisposed?void 0:this._value}set value(g){this._isDisposed||g===this._value||(this._value?.dispose(),g&&E(g,this),this._value=g)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,p(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){const g=this._value;return this._value=void 0,g&&E(g,null),g}}e.MutableDisposable=a,e.MandatoryMutableDisposable=class{constructor(S){this._disposable=new a,this._isDisposed=!1,this._disposable.value=S}get value(){return this._disposable.value}set value(S){this._isDisposed||S===this._disposable.value||(this._disposable.value=S)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},e.RefCountedDisposable=class{constructor(S){this._disposable=S,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter==0&&this._disposable.dispose(),this}},e.SafeDisposable=class{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,r(this)}set(S){let g=S;return this.unset=()=>g=void 0,this.isset=()=>g!==void 0,this.dispose=()=>{g&&(g(),g=void 0,p(this))},this}},e.ReferenceCollection=class{constructor(){this.references=new Map}acquire(S,...g){let A=this.references.get(S);A||(A={counter:0,object:this.createReferencedObject(S,...g)},this.references.set(S,A));const{object:U}=A,D=(0,C.createSingleCallFunction)((()=>{--A.counter==0&&(this.destroyReferencedObject(S,A.object),this.references.delete(S))}));return A.counter++,{object:U,dispose:D}}},e.AsyncReferenceCollection=class{constructor(S){this.referenceCollection=S}async acquire(S,...g){const A=this.referenceCollection.acquire(S,...g);try{return{object:await A.object,dispose:()=>A.dispose()}}catch(U){throw A.dispose(),U}}},e.ImmortalReference=class{constructor(S){this.object=S}dispose(){}};class c{constructor(){this._store=new Map,this._isDisposed=!1,r(this)}dispose(){p(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{R(this._store.values())}finally{this._store.clear()}}has(g){return this._store.has(g)}get size(){return this._store.size}get(g){return this._store.get(g)}set(g,A,U=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),U||this._store.get(g)?.dispose(),this._store.set(g,A)}deleteAndDispose(g){this._store.get(g)?.dispose(),this._store.delete(g)}deleteAndLeak(g){const A=this._store.get(g);return this._store.delete(g),A}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}e.DisposableMap=c},4711:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedList=void 0;const f=class f{constructor(C){this.element=C,this.next=f.Undefined,this.prev=f.Undefined}};f.Undefined=new f(void 0);let v=f;class i{constructor(){this._first=v.Undefined,this._last=v.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===v.Undefined}clear(){let C=this._first;for(;C!==v.Undefined;){const b=C.next;C.prev=v.Undefined,C.next=v.Undefined,C=b}this._first=v.Undefined,this._last=v.Undefined,this._size=0}unshift(C){return this._insert(C,!1)}push(C){return this._insert(C,!0)}_insert(C,b){const _=new v(C);if(this._first===v.Undefined)this._first=_,this._last=_;else if(b){const r=this._last;this._last=_,_.prev=r,r.next=_}else{const r=this._first;this._first=_,_.next=r,r.prev=_}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(_))}}shift(){if(this._first!==v.Undefined){const C=this._first.element;return this._remove(this._first),C}}pop(){if(this._last!==v.Undefined){const C=this._last.element;return this._remove(this._last),C}}_remove(C){if(C.prev!==v.Undefined&&C.next!==v.Undefined){const b=C.prev;b.next=C.next,C.next.prev=b}else C.prev===v.Undefined&&C.next===v.Undefined?(this._first=v.Undefined,this._last=v.Undefined):C.next===v.Undefined?(this._last=this._last.prev,this._last.next=v.Undefined):C.prev===v.Undefined&&(this._first=this._first.next,this._first.prev=v.Undefined);this._size-=1}*[Symbol.iterator](){let C=this._first;for(;C!==v.Undefined;)yield C.element,C=C.next}}e.LinkedList=i},714:(j,e)=>{var v;Object.defineProperty(e,"__esModule",{value:!0}),e.SetMap=e.BidirectionalMap=e.CounterSet=e.Touch=void 0,e.getOrSet=function(i,f,h){let C=i.get(f);return C===void 0&&(C=h,i.set(f,C)),C},e.mapToString=function(i){const f=[];return i.forEach(((h,C)=>{f.push(`${C} => ${h}`)})),`Map(${i.size}) {${f.join(", ")}}`},e.setToString=function(i){const f=[];return i.forEach((h=>{f.push(h)})),`Set(${i.size}) {${f.join(", ")}}`},e.mapsStrictEqualIgnoreOrder=function(i,f){if(i===f)return!0;if(i.size!==f.size)return!1;for(const[h,C]of i)if(!f.has(h)||f.get(h)!==C)return!1;for(const[h]of f)if(!i.has(h))return!1;return!0},(function(i){i[i.None=0]="None",i[i.AsOld=1]="AsOld",i[i.AsNew=2]="AsNew"})(v||(e.Touch=v={})),e.CounterSet=class{constructor(){this.map=new Map}add(i){return this.map.set(i,(this.map.get(i)||0)+1),this}delete(i){let f=this.map.get(i)||0;return f!==0&&(f--,f===0?this.map.delete(i):this.map.set(i,f),!0)}has(i){return this.map.has(i)}},e.BidirectionalMap=class{constructor(i){if(this._m1=new Map,this._m2=new Map,i)for(const[f,h]of i)this.set(f,h)}clear(){this._m1.clear(),this._m2.clear()}set(i,f){this._m1.set(i,f),this._m2.set(f,i)}get(i){return this._m1.get(i)}getKey(i){return this._m2.get(i)}delete(i){const f=this._m1.get(i);return f!==void 0&&(this._m1.delete(i),this._m2.delete(f),!0)}forEach(i,f){this._m1.forEach(((h,C)=>{i.call(f,h,C,this)}))}keys(){return this._m1.keys()}values(){return this._m1.values()}},e.SetMap=class{constructor(){this.map=new Map}add(i,f){let h=this.map.get(i);h||(h=new Set,this.map.set(i,h)),h.add(f)}delete(i,f){const h=this.map.get(i);h&&(h.delete(f),h.size===0&&this.map.delete(i))}forEach(i,f){const h=this.map.get(i);h&&h.forEach(f)}get(i){return this.map.get(i)||new Set}}},42:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SlidingWindowAverage=e.MovingAverage=e.Counter=void 0,e.clamp=function(v,i,f){return Math.min(Math.max(v,i),f)},e.rot=function(v,i){return(i+v%i)%i},e.isPointWithinTriangle=function(v,i,f,h,C,b,_,o){const r=_-f,p=o-h,E=C-f,t=b-h,R=v-f,u=i-h,n=r*r+p*p,s=r*E+p*t,a=r*R+p*u,c=E*E+t*t,l=E*R+t*u,L=1/(n*c-s*s),w=(c*a-s*l)*L,S=(n*l-s*a)*L;return w>=0&&S>=0&&w+S<1},e.Counter=class{constructor(){this._next=0}getNext(){return this._next++}},e.MovingAverage=class{constructor(){this._n=1,this._val=0}update(v){return this._val=this._val+(v-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},e.SlidingWindowAverage=class{constructor(v){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(v),this._values.fill(0,0,v)}update(v){const i=this._values[this._index];return this._values[this._index]=v,this._index=(this._index+1)%this._values.length,this._sum-=i,this._sum+=v,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}},8973:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAndroid=e.isEdge=e.isSafari=e.isFirefox=e.isChrome=e.OS=e.OperatingSystem=e.setTimeout0=e.setTimeout0IsFaster=e.translationsConfigFile=e.platformLocale=e.locale=e.Language=e.language=e.userAgent=e.platform=e.isCI=e.isMobile=e.isIOS=e.webWorkerOrigin=e.isWebWorker=e.isWeb=e.isElectron=e.isNative=e.isLinuxSnap=e.isLinux=e.isMacintosh=e.isWindows=e.Platform=e.LANGUAGE_DEFAULT=void 0,e.PlatformToString=function(D){switch(D){case L.Web:return"Web";case L.Mac:return"Mac";case L.Linux:return"Linux";case L.Windows:return"Windows"}},e.isLittleEndian=function(){if(!U){U=!0;const D=new Uint8Array(2);D[0]=1,D[1]=2,A=new Uint16Array(D.buffer)[0]===513}return A},e.isBigSurOrNewer=function(D){return parseFloat(D)>=20},e.LANGUAGE_DEFAULT="en";let v,i,f,h=!1,C=!1,b=!1,_=!1,o=!1,r=!1,p=!1,E=!1,t=!1,R=!1,u=e.LANGUAGE_DEFAULT,n=e.LANGUAGE_DEFAULT;const s=globalThis;let a;s.vscode!==void 0&&s.vscode.process!==void 0?a=s.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(a=process);const c=typeof a?.versions?.electron=="string",l=c&&a?.type==="renderer";if(typeof a=="object"){h=a.platform==="win32",C=a.platform==="darwin",b=a.platform==="linux",_=b&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,p=c,t=!!a.env.CI||!!a.env.BUILD_ARTIFACTSTAGINGDIRECTORY,v=e.LANGUAGE_DEFAULT,u=e.LANGUAGE_DEFAULT;const D=a.env.VSCODE_NLS_CONFIG;if(D)try{const P=JSON.parse(D);v=P.userLocale,n=P.osLocale,u=P.resolvedLanguage||e.LANGUAGE_DEFAULT,i=P.languagePack?.translationsConfigFile}catch{}o=!0}else typeof navigator!="object"||l?console.error("Unable to resolve platform."):(f=navigator.userAgent,h=f.indexOf("Windows")>=0,C=f.indexOf("Macintosh")>=0,E=(f.indexOf("Macintosh")>=0||f.indexOf("iPad")>=0||f.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,b=f.indexOf("Linux")>=0,R=f?.indexOf("Mobi")>=0,r=!0,u=globalThis._VSCODE_NLS_LANGUAGE||e.LANGUAGE_DEFAULT,v=navigator.language.toLowerCase(),n=v);var L;(function(D){D[D.Web=0]="Web",D[D.Mac=1]="Mac",D[D.Linux=2]="Linux",D[D.Windows=3]="Windows"})(L||(e.Platform=L={}));let w=L.Web;var S,g;C?w=L.Mac:h?w=L.Windows:b&&(w=L.Linux),e.isWindows=h,e.isMacintosh=C,e.isLinux=b,e.isLinuxSnap=_,e.isNative=o,e.isElectron=p,e.isWeb=r,e.isWebWorker=r&&typeof s.importScripts=="function",e.webWorkerOrigin=e.isWebWorker?s.origin:void 0,e.isIOS=E,e.isMobile=R,e.isCI=t,e.platform=w,e.userAgent=f,e.language=u,(function(D){D.value=function(){return e.language},D.isDefaultVariant=function(){return e.language.length===2?e.language==="en":e.language.length>=3&&e.language[0]==="e"&&e.language[1]==="n"&&e.language[2]==="-"},D.isDefault=function(){return e.language==="en"}})(S||(e.Language=S={})),e.locale=v,e.platformLocale=n,e.translationsConfigFile=i,e.setTimeout0IsFaster=typeof s.postMessage=="function"&&!s.importScripts,e.setTimeout0=(()=>{if(e.setTimeout0IsFaster){const D=[];s.addEventListener("message",(B=>{if(B.data&&B.data.vscodeScheduleAsyncWork)for(let M=0,y=D.length;M<y;M++){const x=D[M];if(x.id===B.data.vscodeScheduleAsyncWork)return D.splice(M,1),void x.callback()}}));let P=0;return B=>{const M=++P;D.push({id:M,callback:B}),s.postMessage({vscodeScheduleAsyncWork:M},"*")}}return D=>setTimeout(D)})(),(function(D){D[D.Windows=1]="Windows",D[D.Macintosh=2]="Macintosh",D[D.Linux=3]="Linux"})(g||(e.OperatingSystem=g={})),e.OS=C||E?g.Macintosh:h?g.Windows:g.Linux;let A=!0,U=!1;e.isChrome=!!(e.userAgent&&e.userAgent.indexOf("Chrome")>=0),e.isFirefox=!!(e.userAgent&&e.userAgent.indexOf("Firefox")>=0),e.isSafari=!!(!e.isChrome&&e.userAgent&&e.userAgent.indexOf("Safari")>=0),e.isEdge=!!(e.userAgent&&e.userAgent.indexOf("Edg/")>=0),e.isAndroid=!!(e.userAgent&&e.userAgent.indexOf("Android")>=0)},79:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StopWatch=void 0;const v=globalThis.performance&&typeof globalThis.performance.now=="function";class i{static create(h){return new i(h)}constructor(h){this._now=v&&h===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}e.StopWatch=i},1130:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noBreakWhitespace=e.CodePointIterator=void 0,e.isFalsyOrWhitespace=function(s){return!s||typeof s!="string"||s.trim().length===0},e.format=function(s,...a){return a.length===0?s:s.replace(h,(function(c,l){const L=parseInt(l,10);return isNaN(L)||L<0||L>=a.length?c:a[L]}))},e.format2=function(s,a){return Object.keys(a).length===0?s:s.replace(C,((c,l)=>a[l]??c))},e.htmlAttributeEncodeValue=function(s){return s.replace(/[<>"'&]/g,(a=>{switch(a){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return a}))},e.escape=function(s){return s.replace(/[<>&]/g,(function(a){switch(a){case"<":return"<";case">":return">";case"&":return"&";default:return a}}))},e.escapeRegExpCharacters=b,e.count=function(s,a){let c=0,l=s.indexOf(a);for(;l!==-1;)c++,l=s.indexOf(a,l+a.length);return c},e.truncate=function(s,a,c="…"){return s.length<=a?s:`${s.substr(0,a)}${c}`},e.truncateMiddle=function(s,a,c="…"){if(s.length<=a)return s;const l=Math.ceil(a/2)-c.length/2,L=Math.floor(a/2)-c.length/2;return`${s.substr(0,l)}${c}${s.substr(s.length-L)}`},e.trim=function(s,a=" "){return o(_(s,a),a)},e.ltrim=_,e.rtrim=o,e.convertSimple2RegExpPattern=function(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},e.stripWildcards=function(s){return s.replace(/\*/g,"")},e.createRegExp=function(s,a,c={}){if(!s)throw new Error("Cannot create regex from empty string");a||(s=b(s)),c.wholeWord&&(/\B/.test(s.charAt(0))||(s="\\b"+s),/\B/.test(s.charAt(s.length-1))||(s+="\\b"));let l="";return c.global&&(l+="g"),c.matchCase||(l+="i"),c.multiline&&(l+="m"),c.unicode&&(l+="u"),new RegExp(s,l)},e.regExpLeadsToEndlessLoop=function(s){return s.source!=="^"&&s.source!=="^$"&&s.source!=="$"&&s.source!=="^\\s*$"&&!(!s.exec("")||s.lastIndex!==0)},e.splitLines=function(s){return s.split(/\r\n|\r|\n/)},e.splitLinesIncludeSeparators=function(s){const a=[],c=s.split(/(\r\n|\r|\n)/);for(let l=0;l<Math.ceil(c.length/2);l++)a.push(c[2*l]+(c[2*l+1]??""));return a},e.firstNonWhitespaceIndex=function(s){for(let a=0,c=s.length;a<c;a++){const l=s.charCodeAt(a);if(l!==i.CharCode.Space&&l!==i.CharCode.Tab)return a}return-1},e.getLeadingWhitespace=function(s,a=0,c=s.length){for(let l=a;l<c;l++){const L=s.charCodeAt(l);if(L!==i.CharCode.Space&&L!==i.CharCode.Tab)return s.substring(a,l)}return s.substring(a,c)},e.lastNonWhitespaceIndex=function(s,a=s.length-1){for(let c=a;c>=0;c--){const l=s.charCodeAt(c);if(l!==i.CharCode.Space&&l!==i.CharCode.Tab)return c}return-1},e.replaceAsync=function(s,a,c){const l=[];let L=0;for(const w of s.matchAll(a)){if(l.push(s.slice(L,w.index)),w.index===void 0)throw new Error("match.index should be defined");L=w.index+w[0].length,l.push(c(w[0],...w.slice(1),w.index,s,w.groups))}return l.push(s.slice(L)),Promise.all(l).then((w=>w.join("")))},e.compare=function(s,a){return s<a?-1:s>a?1:0},e.compareSubstring=r,e.compareIgnoreCase=function(s,a){return p(s,a,0,s.length,0,a.length)},e.compareSubstringIgnoreCase=p,e.isAsciiDigit=function(s){return s>=i.CharCode.Digit0&&s<=i.CharCode.Digit9},e.isLowerAsciiLetter=E,e.isUpperAsciiLetter=function(s){return s>=i.CharCode.A&&s<=i.CharCode.Z},e.equalsIgnoreCase=function(s,a){return s.length===a.length&&p(s,a)===0},e.startsWithIgnoreCase=function(s,a){const c=a.length;return!(a.length>s.length)&&p(s,a,0,c)===0},e.commonPrefixLength=function(s,a){const c=Math.min(s.length,a.length);let l;for(l=0;l<c;l++)if(s.charCodeAt(l)!==a.charCodeAt(l))return l;return c},e.commonSuffixLength=function(s,a){const c=Math.min(s.length,a.length);let l;const L=s.length-1,w=a.length-1;for(l=0;l<c;l++)if(s.charCodeAt(L-l)!==a.charCodeAt(w-l))return l;return c},e.isHighSurrogate=t,e.isLowSurrogate=R,e.computeCodePoint=u,e.getNextCodePoint=n;const i=v(2779),f=v(4610),h=/{(\d+)}/g,C=/{([^}]+)}/g;function b(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function _(s,a){if(!s||!a)return s;const c=a.length;if(c===0||s.length===0)return s;let l=0;for(;s.indexOf(a,l)===l;)l+=c;return s.substring(l)}function o(s,a){if(!s||!a)return s;const c=a.length,l=s.length;if(c===0||l===0)return s;let L=l,w=-1;for(;w=s.lastIndexOf(a,L-1),w!==-1&&w+c===L;){if(w===0)return"";L=w}return s.substring(0,L)}function r(s,a,c=0,l=s.length,L=0,w=a.length){for(;c<l&&L<w;c++,L++){const A=s.charCodeAt(c),U=a.charCodeAt(L);if(A<U)return-1;if(A>U)return 1}const S=l-c,g=w-L;return S<g?-1:S>g?1:0}function p(s,a,c=0,l=s.length,L=0,w=a.length){for(;c<l&&L<w;c++,L++){let A=s.charCodeAt(c),U=a.charCodeAt(L);if(A===U)continue;if(A>=128||U>=128)return r(s.toLowerCase(),a.toLowerCase(),c,l,L,w);E(A)&&(A-=32),E(U)&&(U-=32);const D=A-U;if(D!==0)return D}const S=l-c,g=w-L;return S<g?-1:S>g?1:0}function E(s){return s>=i.CharCode.a&&s<=i.CharCode.z}function t(s){return 55296<=s&&s<=56319}function R(s){return 56320<=s&&s<=57343}function u(s,a){return a-56320+(s-55296<<10)+65536}function n(s,a,c){const l=s.charCodeAt(c);if(t(l)&&c+1<a){const L=s.charCodeAt(c+1);if(R(L))return u(l,L)}return l}e.CodePointIterator=class{get offset(){return this._offset}constructor(s,a=0){this._str=s,this._len=s.length,this._offset=a}setOffset(s){this._offset=s}prevCodePoint(){const s=(function(a,c){const l=a.charCodeAt(c-1);if(R(l)&&c>1){const L=a.charCodeAt(c-2);if(t(L))return u(L,l)}return l})(this._str,this._offset);return this._offset-=s>=f.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,s}nextCodePoint(){const s=n(this._str,this._len,this._offset);return this._offset+=s>=f.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,s}eol(){return this._offset>=this._len}},e.noBreakWhitespace=" "},1329:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MicrotaskDelay=void 0,e.MicrotaskDelay=Symbol("MicrotaskDelay")},4610:(j,e)=>{var v;Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.toUint8=function(i){return i<0?0:i>v.MAX_UINT_8?v.MAX_UINT_8:0|i},e.toUint32=function(i){return i<0?0:i>v.MAX_UINT_32?v.MAX_UINT_32:0|i},(function(i){i[i.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",i[i.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",i[i.MAX_UINT_8=255]="MAX_UINT_8",i[i.MAX_UINT_16=65535]="MAX_UINT_16",i[i.MAX_UINT_32=4294967295]="MAX_UINT_32",i[i.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"})(v||(e.Constants=v={}))}},Ee={};function ge(j){var e=Ee[j];if(e!==void 0)return e.exports;var v=Ee[j]={exports:{}};return Se[j].call(v.exports,v,v.exports,ge),v.exports}var De={};return(()=>{var j=De;Object.defineProperty(j,"__esModule",{value:!0}),j.WebglAddon=void 0;const e=ge(2540),v=ge(7095),i=ge(3399),f=ge(6870),h=ge(5276);class C extends e.Disposable{constructor(_){if(v.isSafari&&(0,v.getSafariVersion)()<16){const o={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",o))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=_,this._onChangeTextureAtlas=this._register(new h.Emitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new h.Emitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new h.Emitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new h.Emitter),this.onContextLoss=this._onContextLoss.event}activate(_){const o=_._core;if(!_.element)return void this._register(o.onWillOpen((()=>this.activate(_))));this._terminal=_;const r=o.coreService,p=o.optionsService,E=o,t=E._renderService,R=E._characterJoinerService,u=E._charSizeService,n=E._coreBrowserService,s=E._decorationService,a=E._logService,c=E._themeService;(0,f.setTraceLogger)(a),this._renderer=this._register(new i.WebglRenderer(_,R,u,n,r,s,p,c,this._preserveDrawingBuffer)),this._register(h.Event.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(h.Event.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(h.Event.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(h.Event.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),t.setRenderer(this._renderer),this._register((0,e.toDisposable)((()=>{if(this._terminal._core._store._isDisposed)return;const l=this._terminal._core._renderService;l.setRenderer(this._terminal._core._createRenderer()),l.handleResize(_.cols,_.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}j.WebglAddon=C})(),De})()))})(Ne)),Ne.exports}var Be=He();const $e=We(Be),je=Ke({__proto__:null,default:$e},[Be]);export{je as a};
|