All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.static.js.tunnel-f4358a83.js Maven / Gradle / Ivy

There is a newer version: 4.0.4
Show newest version
import{o as ce,c as ke,a as Ee,_ as Be,d as Te,r as le,b as Ie,e as Pe,f as ue,g as G,u as fe,n as ye,w as pe,v as me,h as Ce,i as Le,j as xe,k as Oe,l as He}from"./main-a358cd54.js";var Se={exports:{}};(function(Z,z){(function(ee,Y){Z.exports=Y()})(self,function(){return(()=>{var ee={4567:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=h(9042),d=h(6114),c=h(9924),_=h(3656),l=h(844),a=h(5596),i=h(9631);class e extends l.Disposable{constructor(t,s){super(),this._terminal=t,this._renderService=s,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let f=0;fthis._onBoundaryFocus(f,0),this._bottomBoundaryFocusListener=f=>this._onBoundaryFocus(f,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new c.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize(f=>this._onResize(f.rows))),this.register(this._terminal.onRender(f=>this._refreshRows(f.start,f.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(f=>this._onChar(f))),this.register(this._terminal.onLineFeed(()=>this._onChar(`
`))),this.register(this._terminal.onA11yTab(f=>this._onTab(f))),this.register(this._terminal.onKey(f=>this._onKey(f.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new a.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,_.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions()))}dispose(){super.dispose(),(0,i.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(t,s){const f=t.target,v=this._rowElements[s===0?1:this._rowElements.length-2];if(f.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==v)return;let u,C;if(s===0?(u=f,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(u=this._rowElements.shift(),C=f,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_onResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;st;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_onTab(t){for(let s=0;s0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&(0,i.removeElementFromParent)(this._liveRegion)}_onKey(t){this._clearLiveRegion(),this._charsToConsume.push(t)}_refreshRows(t,s){this._renderRowsDebouncer.refresh(t,s,this._terminal.rows)}_renderRows(t,s){const f=this._terminal.buffer,v=f.lines.length.toString();for(let u=t;u<=s;u++){const C=f.translateBufferLineToString(f.ydisp+u,!0),g=(f.ydisp+u+1).toString(),p=this._rowElements[u];p&&(C.length===0?p.innerText="\xA0":p.textContent=C,p.setAttribute("aria-posinset",g),p.setAttribute("aria-setsize",v))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let t=0;t{function h(_){return _.replace(/\r?\n/g,"\r")}function o(_,l){return l?"\x1B[200~"+_+"\x1B[201~":_}function d(_,l,a){_=o(_=h(_),a.decPrivateModes.bracketedPasteMode),a.triggerDataEvent(_,!0),l.value=""}function c(_,l,a){const i=a.getBoundingClientRect(),e=_.clientX-i.left-10,n=_.clientY-i.top-10;l.style.width="20px",l.style.height="20px",l.style.left=`${e}px`,l.style.top=`${n}px`,l.style.zIndex="1000",l.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=h,r.bracketTextForPaste=o,r.copyHandler=function(_,l){_.clipboardData&&_.clipboardData.setData("text/plain",l.selectionText),_.preventDefault()},r.handlePasteEvent=function(_,l,a){_.stopPropagation(),_.clipboardData&&d(_.clipboardData.getData("text/plain"),l,a)},r.paste=d,r.moveTextAreaUnderMouseCursor=c,r.rightClickHandler=function(_,l,a,i,e){c(_,l,a),e&&i.rightClickSelect(_),l.value=i.selectionText,l.select()}},7239:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const o=h(1505);r.ColorContrastCache=class{constructor(){this._color=new o.TwoKeyMap,this._css=new o.TwoKeyMap}setCss(d,c,_){this._css.set(d,c,_)}getCss(d,c){return this._css.get(d,c)}setColor(d,c,_){this._color.set(d,c,_)}getColor(d,c){return this._color.get(d,c)}clear(){this._color.clear(),this._css.clear()}}},5680:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorManager=r.DEFAULT_ANSI_COLORS=void 0;const o=h(8055),d=h(7239),c=o.css.toColor("#ffffff"),_=o.css.toColor("#000000"),l=o.css.toColor("#ffffff"),a=o.css.toColor("#000000"),i={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[o.css.toColor("#2e3436"),o.css.toColor("#cc0000"),o.css.toColor("#4e9a06"),o.css.toColor("#c4a000"),o.css.toColor("#3465a4"),o.css.toColor("#75507b"),o.css.toColor("#06989a"),o.css.toColor("#d3d7cf"),o.css.toColor("#555753"),o.css.toColor("#ef2929"),o.css.toColor("#8ae234"),o.css.toColor("#fce94f"),o.css.toColor("#729fcf"),o.css.toColor("#ad7fa8"),o.css.toColor("#34e2e2"),o.css.toColor("#eeeeec")],n=[0,95,135,175,215,255];for(let t=0;t<216;t++){const s=n[t/36%6|0],f=n[t/6%6|0],v=n[t%6];e.push({css:o.channels.toCss(s,f,v),rgba:o.channels.toRgba(s,f,v)})}for(let t=0;t<24;t++){const s=8+10*t;e.push({css:o.channels.toCss(s,s,s),rgba:o.channels.toRgba(s,s,s)})}return e})()),r.ColorManager=class{constructor(e,n){this.allowTransparency=n;const t=e.createElement("canvas");t.width=1,t.height=1;const s=t.getContext("2d");if(!s)throw new Error("Could not get rendering context");this._ctx=s,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new d.ColorContrastCache,this.colors={foreground:c,background:_,cursor:l,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:i,selectionBackgroundOpaque:o.color.blend(_,i),selectionInactiveBackgroundTransparent:i,selectionInactiveBackgroundOpaque:o.color.blend(_,i),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,n){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=n}}setTheme(e={}){this.colors.foreground=this._parseColor(e.foreground,c),this.colors.background=this._parseColor(e.background,_),this.colors.cursor=this._parseColor(e.cursor,l,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,a,!0),this.colors.selectionBackgroundTransparent=this._parseColor(e.selectionBackground,i,!0),this.colors.selectionBackgroundOpaque=o.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(e.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=o.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);const n={css:"",rgba:0};if(this.colors.selectionForeground=e.selectionForeground?this._parseColor(e.selectionForeground,n):void 0,this.colors.selectionForeground===n&&(this.colors.selectionForeground=void 0),o.color.isOpaque(this.colors.selectionBackgroundTransparent)&&(this.colors.selectionBackgroundTransparent=o.color.opacity(this.colors.selectionBackgroundTransparent,.3)),o.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent)&&(this.colors.selectionInactiveBackgroundTransparent=o.color.opacity(this.colors.selectionInactiveBackgroundTransparent,.3)),this.colors.ansi=r.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(e.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,r.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const t=Math.min(this.colors.ansi.length-16,e.extendedAnsi.length);for(let s=0;sNumber(p)),g=Math.round(255*C);return{rgba:o.channels.toRgba(f,v,u,g),css:e}}return{css:this._ctx.fillStyle,rgba:o.channels.toRgba(s[0],s[1],s[2],s[3])}}}},9631:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeElementFromParent=void 0,r.removeElementFromParent=function(...h){var o;for(const d of h)(o=d==null?void 0:d.parentElement)===null||o===void 0||o.removeChild(d)}},3656:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(h,o,d,c){h.addEventListener(o,d,c);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(o,d,c))}}}},6465:function(D,r,h){var o=this&&this.__decorate||function(e,n,t,s){var f,v=arguments.length,u=v<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,n,t,s);else for(var C=e.length-1;C>=0;C--)(f=e[C])&&(u=(v<3?f(u):v>3?f(n,t,u):f(n,t))||u);return v>3&&u&&Object.defineProperty(n,t,u),u},d=this&&this.__param||function(e,n){return function(t,s){n(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const c=h(2585),_=h(8460),l=h(844),a=h(3656);let i=class extends l.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this._onHideLinkUnderline=this.register(new _.EventEmitter),this.register((0,l.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const n=this._linkProviders.indexOf(e);n!==-1&&this._linkProviders.splice(n,1)}}}attachToDom(e,n,t){this._element=e,this._mouseService=n,this._renderService=t,this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const n=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!n)return;this._isMouseOut=!1;const t=e.composedPath();for(let s=0;s{v==null||v.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let f=!1;for(const[v,u]of this._linkProviders.entries())n?!((s=this._activeProviderReplies)===null||s===void 0)&&s.get(v)&&(f=this._checkLinkProviderResult(v,e,f)):u.provideLinks(e.y,C=>{var g,p;if(this._isMouseOut)return;const S=C==null?void 0:C.map(L=>({link:L}));(g=this._activeProviderReplies)===null||g===void 0||g.set(v,S),f=this._checkLinkProviderResult(v,e,f),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,n){const t=new Set;for(let s=0;se?this._bufferService.cols:u.link.range.end.x;for(let p=C;p<=g;p++){if(t.has(p)){f.splice(v--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,n,t){var s;if(!this._activeProviderReplies)return t;const f=this._activeProviderReplies.get(e);let v=!1;for(let u=0;uthis._linkAtPosition(C.link,n));u&&(t=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let u=0;uthis._linkAtPosition(g.link,n));if(C){t=!0,this._handleNewLink(C);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const n=this._positionFromMouseEvent(e,this._element,this._mouseService);n&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,n){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!n||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,l.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(e.link,n)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,s;return(s=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||s===void 0?void 0:s.decorations.pointerCursor},set:t=>{var s,f;((s=this._currentLink)===null||s===void 0?void 0:s.state)&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((f=this._element)===null||f===void 0||f.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,s;return(s=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||s===void 0?void 0:s.decorations.underline},set:t=>{var s,f,v;((s=this._currentLink)===null||s===void 0?void 0:s.state)&&((v=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||v===void 0?void 0:v.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{const s=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(s,t.end+1+this._bufferService.buffer.ydisp)})))}_linkHover(e,n,t){var s;!((s=this._currentLink)===null||s===void 0)&&s.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(t,n.text)}_fireUnderlineEvent(e,n){const t=e.range,s=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-s-1,t.end.x,t.end.y-s-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(e,n,t){var s;!((s=this._currentLink)===null||s===void 0)&&s.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(t,n.text)}_linkAtPosition(e,n){const t=e.range.start.y===e.range.end.y,s=e.range.start.yn.y;return(t&&e.range.start.x<=n.x&&e.range.end.x>=n.x||s&&e.range.end.x>=n.x||f&&e.range.start.x<=n.x||s&&f)&&e.range.start.y<=n.y&&e.range.end.y>=n.y}_positionFromMouseEvent(e,n,t){const s=t.getCoords(e,n,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,n,t,s,f){return{x1:e,y1:n,x2:t,y2:s,cols:this._bufferService.cols,fg:f}}};i=o([d(0,c.IBufferService)],i),r.Linkifier2=i},9042:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(D,r,h){var o=this&&this.__decorate||function(i,e,n,t){var s,f=arguments.length,v=f<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,e,n,t);else for(var u=i.length-1;u>=0;u--)(s=i[u])&&(v=(f<3?s(v):f>3?s(e,n,v):s(e,n))||v);return f>3&&v&&Object.defineProperty(e,n,v),v},d=this&&this.__param||function(i,e){return function(n,t){e(n,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const c=h(511),_=h(2585);let l=class{constructor(i,e,n){this._bufferService=i,this._optionsService=e,this._oscLinkService=n}provideLinks(i,e){var n;const t=this._bufferService.buffer.lines.get(i-1);if(!t)return void e(void 0);const s=[],f=this._optionsService.rawOptions.linkHandler,v=new c.CellData,u=t.getTrimmedLength();let C=-1,g=-1,p=!1;for(let S=0;Sf?f.activate(m,b,w):a(0,b),hover:(m,b)=>{var y;return(y=f==null?void 0:f.hover)===null||y===void 0?void 0:y.call(f,m,b,w)},leave:(m,b)=>{var y;return(y=f==null?void 0:f.leave)===null||y===void 0?void 0:y.call(f,m,b,w)}})}p=!1,v.hasExtendedAttrs()&&v.extended.urlId?(g=S,C=v.extended.urlId):(g=-1,C=-1)}}e(s)}};function a(i,e){if(confirm(`Do you want to navigate to ${e}?`)){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=e}}}l=o([d(0,_.IBufferService),d(1,_.IOptionsService),d(2,_.IOscLinkService)],l),r.OscLinkProvider=l},6193:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(h,o){this._parentWindow=h,this._renderCallback=o,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(h,o,d){this._rowCount=d,h=h!==void 0?h:0,o=o!==void 0?o:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,o):o,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const h=Math.max(this._rowStart,0),o=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,o),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},5596:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const o=h(844);class d extends o.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=d},3236:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const o=h(2950),d=h(1680),c=h(3614),_=h(2584),l=h(5435),a=h(9312),i=h(6114),e=h(3656),n=h(9042),t=h(4567),s=h(1296),f=h(7399),v=h(8460),u=h(8437),C=h(5680),g=h(3230),p=h(4725),S=h(428),L=h(8934),w=h(6465),m=h(5114),b=h(8969),y=h(8055),E=h(4269),A=h(5941),k=h(3107),O=h(5744),T=h(9074),H=h(2585),W=h(2962),x=typeof window!="undefined"?window.document:null;class B extends b.CoreTerminal{constructor(R={}){super(R),this.browser=i,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(w.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(W.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(T.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((M,F)=>this.refresh(M,F))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(M=>this._reportWindowsOptions(M))),this.register(this._inputHandler.onColor(M=>this._handleColorEvent(M))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(M=>this._afterResize(M.cols,M.rows)))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(R){var M,F;if(this._colorManager){for(const U of R){let $,I="";switch(U.index){case 256:$="foreground",I="10";break;case 257:$="background",I="11";break;case 258:$="cursor",I="12";break;default:$="ansi",I="4;"+U.index}switch(U.type){case 0:const K=y.color.toColorRGB($==="ansi"?this._colorManager.colors.ansi[U.index]:this._colorManager.colors[$]);this.coreService.triggerDataEvent(`${_.C0.ESC}]${I};${(0,A.toRgbString)(K)}${_.C1_ESCAPED.ST}`);break;case 1:$==="ansi"?this._colorManager.colors.ansi[U.index]=y.rgba.toColor(...U.color):this._colorManager.colors[$]=y.rgba.toColor(...U.color);break;case 2:this._colorManager.restoreColor(U.index)}}(M=this._renderService)===null||M===void 0||M.setColors(this._colorManager.colors),(F=this.viewport)===null||F===void 0||F.onThemeChange(this._colorManager.colors)}}dispose(){var R,M,F;this._isDisposed||(super.dispose(),(R=this._renderService)===null||R===void 0||R.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},(F=(M=this.element)===null||M===void 0?void 0:M.parentNode)===null||F===void 0||F.removeChild(this.element))}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(R){var M,F,U,$;switch(super._updateOptions(R),R){case"fontFamily":case"fontSize":(M=this._renderService)===null||M===void 0||M.clear(),(F=this._charSizeService)===null||F===void 0||F.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":(U=this.viewport)===null||U===void 0||U.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new t.AccessibilityManager(this,this._renderService)):(($=this._accessibilityManager)===null||$===void 0||$.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(R){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.C0.ESC+"[I"),this.updateCursorStyle(R),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var R;return(R=this.textarea)===null||R===void 0?void 0:R.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const R=this.buffer.ybase+this.buffer.y,M=this.buffer.lines.get(R);if(!M)return;const F=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.actualCellHeight,$=M.getWidth(F),I=this._renderService.dimensions.actualCellWidth*$,K=this.buffer.y*this._renderService.dimensions.actualCellHeight,N=F*this._renderService.dimensions.actualCellWidth;this.textarea.style.left=N+"px",this.textarea.style.top=K+"px",this.textarea.style.width=I+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,e.addDisposableDomListener)(this.element,"copy",M=>{this.hasSelection()&&(0,c.copyHandler)(M,this._selectionService)}));const R=M=>(0,c.handlePasteEvent)(M,this.textarea,this.coreService);this.register((0,e.addDisposableDomListener)(this.textarea,"paste",R)),this.register((0,e.addDisposableDomListener)(this.element,"paste",R)),i.isFirefox?this.register((0,e.addDisposableDomListener)(this.element,"mousedown",M=>{M.button===2&&(0,c.rightClickHandler)(M,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,e.addDisposableDomListener)(this.element,"contextmenu",M=>{(0,c.rightClickHandler)(M,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),i.isLinux&&this.register((0,e.addDisposableDomListener)(this.element,"auxclick",M=>{M.button===1&&(0,c.moveTextAreaUnderMouseCursor)(M,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,e.addDisposableDomListener)(this.textarea,"keyup",R=>this._keyUp(R),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keydown",R=>this._keyDown(R),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keypress",R=>this._keyPress(R),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionupdate",R=>this._compositionHelper.compositionupdate(R))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,e.addDisposableDomListener)(this.textarea,"input",R=>this._inputEvent(R),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(R){var M;if(!R)throw new Error("Terminal requires a parent element.");R.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=R.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),R.appendChild(this.element);const F=x.createDocumentFragment();this._viewportElement=x.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.appendChild(this._viewportElement),this._viewportScrollArea=x.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=x.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=x.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),F.appendChild(this.screenElement),this.textarea=x.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",n.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,e.addDisposableDomListener)(this.textarea,"focus",$=>this._onTextAreaFocus($))),this.register((0,e.addDisposableDomListener)(this.textarea,"blur",()=>this._onTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(m.CoreBrowserService,this.textarea,(M=this._document.defaultView)!==null&&M!==void 0?M:window),this._instantiationService.setService(p.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(p.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(x,this.options.allowTransparency),this.register(this.optionsService.onOptionChange($=>this._colorManager.onOptionsChange($,this.optionsService.rawOptions[$]))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(p.ICharacterJoinerService,this._characterJoinerService);const U=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,U,this.rows,this.screenElement)),this._instantiationService.setService(p.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange($=>this._onRender.fire($))),this.onResize($=>this._renderService.resize($.cols,$.rows)),this._compositionView=x.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(F),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(p.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(d.Viewport,$=>this.scrollLines($,!0,1),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.onCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.onResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.onBlur())),this.register(this.onFocus(()=>this._renderService.onFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(a.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(p.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines($=>this.scrollLines($.amount,$.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw($=>this._renderService.onSelectionChanged($.start,$.end,$.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event($=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,e.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,e.addDisposableDomListener)(this.element,"mousedown",$=>this._selectionService.onMouseDown($))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new t.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(O.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange(()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(O.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(R){var M,F,U;this._theme=R,(M=this._colorManager)===null||M===void 0||M.setTheme(R),(F=this._renderService)===null||F===void 0||F.setColors(this._colorManager.colors),(U=this.viewport)===null||U===void 0||U.onThemeChange(this._colorManager.colors)}bindMouse(){const R=this,M=this.element;function F(I){const K=R._mouseService.getMouseReportCoords(I,R.screenElement);if(!K)return!1;let N,J;switch(I.overrideType||I.type){case"mousemove":J=32,I.buttons===void 0?(N=3,I.button!==void 0&&(N=I.button<3?I.button:3)):N=1&I.buttons?0:4&I.buttons?1:2&I.buttons?2:3;break;case"mouseup":J=0,N=I.button<3?I.button:3;break;case"mousedown":J=1,N=I.button<3?I.button:3;break;case"wheel":if(R.viewport.getLinesScrolled(I)===0)return!1;J=I.deltaY<0?0:1,N=4;break;default:return!1}return!(J===void 0||N===void 0||N>4)&&R.coreMouseService.triggerMouseEvent({col:K.col,row:K.row,x:K.x,y:K.y,button:N,action:J,ctrl:I.ctrlKey,alt:I.altKey,shift:I.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:I=>(F(I),I.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(I)),wheel:I=>(F(I),this.cancel(I,!0)),mousedrag:I=>{I.buttons&&F(I)},mousemove:I=>{I.buttons||F(I)}};this.register(this.coreMouseService.onProtocolChange(I=>{I?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(I)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&I?U.mousemove||(M.addEventListener("mousemove",$.mousemove),U.mousemove=$.mousemove):(M.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&I?U.wheel||(M.addEventListener("wheel",$.wheel,{passive:!1}),U.wheel=$.wheel):(M.removeEventListener("wheel",U.wheel),U.wheel=null),2&I?U.mouseup||(U.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&I?U.mousedrag||(U.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,e.addDisposableDomListener)(M,"mousedown",I=>{if(I.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(I))return F(I),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(I)})),this.register((0,e.addDisposableDomListener)(M,"wheel",I=>{if(!U.wheel){if(!this.buffer.hasScrollback){const K=this.viewport.getLinesScrolled(I);if(K===0)return;const N=_.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(I.deltaY<0?"A":"B");let J="";for(let oe=0;oe{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(I),this.cancel(I)},{passive:!0})),this.register((0,e.addDisposableDomListener)(M,"touchmove",I=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchMove(I)?void 0:this.cancel(I)},{passive:!1}))}refresh(R,M){var F;(F=this._renderService)===null||F===void 0||F.refreshRows(R,M)}updateCursorStyle(R){var M;!((M=this._selectionService)===null||M===void 0)&&M.shouldColumnSelect(R)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(R,M,F=0){super.scrollLines(R,M,F),this.refresh(0,this.rows-1)}paste(R){(0,c.paste)(R,this.textarea,this.coreService)}attachCustomKeyEventHandler(R){this._customKeyEventHandler=R}registerLinkProvider(R){return this.linkifier2.registerLinkProvider(R)}registerCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const M=this._characterJoinerService.register(R);return this.refresh(0,this.rows-1),M}deregisterCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(R)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(R){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+R)}registerDecoration(R){return this._decorationService.registerDecoration(R)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(R,M,F){this._selectionService.setSelection(R,M,F)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var R;(R=this._selectionService)===null||R===void 0||R.clearSelection()}selectAll(){var R;(R=this._selectionService)===null||R===void 0||R.selectAll()}selectLines(R,M){var F;(F=this._selectionService)===null||F===void 0||F.selectLines(R,M)}_keyDown(R){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;const M=this.browser.isMac&&this.options.macOptionIsMeta&&R.altKey;if(!M&&!this._compositionHelper.keydown(R))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;M||R.key!=="Dead"&&R.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const F=(0,f.evaluateKeyboardEvent)(R,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(R),F.type===3||F.type===2){const U=this.rows-1;return this.scrollLines(F.type===2?-U:U),this.cancel(R,!0)}return F.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,R)||(F.cancel&&this.cancel(R,!0),!F.key||!!(R.key&&!R.ctrlKey&&!R.altKey&&!R.metaKey&&R.key.length===1&&R.key.charCodeAt(0)>=65&&R.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(F.key!==_.C0.ETX&&F.key!==_.C0.CR||(this.textarea.value=""),this._onKey.fire({key:F.key,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(F.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(R,!0))))}_isThirdLevelShift(R,M){const F=R.isMac&&!this.options.macOptionIsMeta&&M.altKey&&!M.ctrlKey&&!M.metaKey||R.isWindows&&M.altKey&&M.ctrlKey&&!M.metaKey||R.isWindows&&M.getModifierState("AltGraph");return M.type==="keypress"?F:F&&(!M.keyCode||M.keyCode>47)}_keyUp(R){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1||(function(M){return M.keyCode===16||M.keyCode===17||M.keyCode===18}(R)||this.focus(),this.updateCursorStyle(R),this._keyPressHandled=!1)}_keyPress(R){let M;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;if(this.cancel(R),R.charCode)M=R.charCode;else if(R.which===null||R.which===void 0)M=R.keyCode;else{if(R.which===0||R.charCode===0)return!1;M=R.which}return!(!M||(R.altKey||R.ctrlKey||R.metaKey)&&!this._isThirdLevelShift(this.browser,R)||(M=String.fromCharCode(M),this._onKey.fire({key:M,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(M,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(R){if(R.data&&R.inputType==="insertText"&&(!R.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const M=R.data;return this.coreService.triggerDataEvent(M,!0),this.cancel(R),!0}return!1}resize(R,M){R!==this.cols||M!==this.rows?super.resize(R,M):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(R,M){var F,U;(F=this._charSizeService)===null||F===void 0||F.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let R=1;R{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(h,o=1e3){this._renderCallback=h,this._debounceThresholdMS=o,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,o,d){this._rowCount=d,h=h!==void 0?h:0,o=o!==void 0?o:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,o):o;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=c-this._lastRefreshMs,l=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),o=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,o)}}},1680:function(D,r,h){var o=this&&this.__decorate||function(e,n,t,s){var f,v=arguments.length,u=v<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,n,t,s);else for(var C=e.length-1;C>=0;C--)(f=e[C])&&(u=(v<3?f(u):v>3?f(n,t,u):f(n,t))||u);return v>3&&u&&Object.defineProperty(n,t,u),u},d=this&&this.__param||function(e,n){return function(t,s){n(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const c=h(844),_=h(3656),l=h(4725),a=h(2585);let i=class extends c.Disposable{constructor(e,n,t,s,f,v,u,C,g){super(),this._scrollLines=e,this._viewportElement=n,this._scrollArea=t,this._element=s,this._bufferService=f,this._optionsService=v,this._charSizeService=u,this._renderService=C,this._coreBrowserService=g,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(p=>this._renderDimensions=p)),setTimeout(()=>this.syncScrollArea(),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(n)}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,n){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&t0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(e,n){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&n.altKey||t==="ctrl"&&n.ctrlKey||t==="shift"&&n.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){const n=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(e,n))}};i=o([d(4,a.IBufferService),d(5,a.IOptionsService),d(6,l.ICharSizeService),d(7,l.IRenderService),d(8,l.ICoreBrowserService)],i),r.Viewport=i},3107:function(D,r,h){var o=this&&this.__decorate||function(e,n,t,s){var f,v=arguments.length,u=v<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,n,t,s);else for(var C=e.length-1;C>=0;C--)(f=e[C])&&(u=(v<3?f(u):v>3?f(n,t,u):f(n,t))||u);return v>3&&u&&Object.defineProperty(n,t,u),u},d=this&&this.__param||function(e,n){return function(t,s){n(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const c=h(3656),_=h(4725),l=h(844),a=h(2585);let i=class extends l.Disposable{constructor(e,n,t,s){super(),this._screenElement=e,this._bufferService=n,this._decorationService=t,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,c.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(f=>this._removeDecoration(f)))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this.refreshDecorations(),this._animationFrame=void 0}))}refreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var n;const t=document.createElement("div");t.classList.add("xterm-decoration"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",t.style.lineHeight=`${this._renderService.dimensions.actualCellHeight}px`;const s=(n=e.options.x)!==null&&n!==void 0?n:0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const n=e.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let t=this._decorationElements.get(e);t||(e.onDispose(()=>this._removeDecoration(e)),t=this._createElement(e),e.element=t,this._decorationElements.set(e,t),this._container.appendChild(t)),t.style.top=n*this._renderService.dimensions.actualCellHeight+"px",t.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(t)}}_refreshXPosition(e,n=e.element){var t;if(!n)return;const s=(t=e.options.x)!==null&&t!==void 0?t:0;(e.options.anchor||"left")==="right"?n.style.right=s?s*this._renderService.dimensions.actualCellWidth+"px":"":n.style.left=s?s*this._renderService.dimensions.actualCellWidth+"px":""}_removeDecoration(e){var n;(n=this._decorationElements.get(e))===null||n===void 0||n.remove(),this._decorationElements.delete(e)}};i=o([d(1,a.IBufferService),d(2,a.IDecorationService),d(3,_.IRenderService)],i),r.BufferDecorationRenderer=i},5871:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(h){if(h.options.overviewRulerOptions){for(const o of this._zones)if(o.color===h.options.overviewRulerOptions.color&&o.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(o,h.marker.line))return;if(this._lineAdjacentToZone(o,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(o,h.marker.line)}if(this._zonePoolIndex=h.startBufferLine&&o<=h.endBufferLine}_lineAdjacentToZone(h,o,d){return o>=h.startBufferLine-this._linePadding[d||"full"]&&o<=h.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(h,o){h.startBufferLine=Math.min(h.startBufferLine,o),h.endBufferLine=Math.max(h.endBufferLine,o)}}},5744:function(D,r,h){var o=this&&this.__decorate||function(f,v,u,C){var g,p=arguments.length,S=p<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,u):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,v,u,C);else for(var L=f.length-1;L>=0;L--)(g=f[L])&&(S=(p<3?g(S):p>3?g(v,u,S):g(v,u))||S);return p>3&&S&&Object.defineProperty(v,u,S),S},d=this&&this.__param||function(f,v){return function(u,C){v(u,C,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const c=h(5871),_=h(3656),l=h(4725),a=h(844),i=h(2585),e={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0};let s=class extends a.Disposable{constructor(f,v,u,C,g,p,S){var L;super(),this._viewportElement=f,this._screenElement=v,this._bufferService=u,this._decorationService=C,this._renderService=g,this._optionsService=p,this._coreBrowseService=S,this._colorZoneStore=new c.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)===null||L===void 0||L.insertBefore(this._canvas,this._viewportElement);const w=this._canvas.getContext("2d");if(!w)throw new Error("Ctx cannot be null");this._ctx=w,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(f=>{f==="overviewRulerWidth"&&this._queueRefresh(!0)})),this.register((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>{this._queueRefresh(!0)})),this._queueRefresh(!0)}dispose(){var f;(f=this._canvas)===null||f===void 0||f.remove(),super.dispose()}_refreshDrawConstants(){const f=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=f,n.center=v,n.right=f,this._refreshDrawHeightConstants(),t.full=0,t.left=0,t.center=n.left,t.right=n.left+n.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowseService.dpr);e.left=v,e.center=v,e.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const v of f)v.position!=="full"&&this._renderColorZone(v);for(const v of f)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(t[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-e[f.position||"full"]/2),n[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[f.position||"full"]))}_queueRefresh(f,v){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s=o([d(2,i.IBufferService),d(3,i.IDecorationService),d(4,l.IRenderService),d(5,i.IOptionsService),d(6,l.ICoreBrowserService)],s),r.OverviewRulerRenderer=s},2950:function(D,r,h){var o=this&&this.__decorate||function(i,e,n,t){var s,f=arguments.length,v=f<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,e,n,t);else for(var u=i.length-1;u>=0;u--)(s=i[u])&&(v=(f<3?s(v):f>3?s(e,n,v):s(e,n))||v);return f>3&&v&&Object.defineProperty(e,n,v),v},d=this&&this.__param||function(i,e){return function(n,t){e(n,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const c=h(4725),_=h(2585),l=h(2584);let a=class{constructor(i,e,n,t,s,f){this._textarea=i,this._compositionView=e,this._bufferService=n,this._optionsService=t,this._coreService=s,this._renderService=f,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(i){this._compositionView.textContent=i.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(i){if(this._isComposing||this._isSendingComposition){if(i.keyCode===229||i.keyCode===16||i.keyCode===17||i.keyCode===18)return!1;this._finalizeComposition(!1)}return i.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(i){if(this._compositionView.classList.remove("active"),this._isComposing=!1,i){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let n;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,n=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const i=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,n=e.replace(i,"");this._dataAlreadySent=n,e.length>i.length?this._coreService.triggerDataEvent(n,!0):e.lengththis.updateCompositionElements(!0),0)}}};a=o([d(2,_.IBufferService),d(3,_.IOptionsService),d(4,_.ICoreService),d(5,c.IRenderService)],a),r.CompositionHelper=a},9806:(D,r)=>{function h(o,d,c){const _=c.getBoundingClientRect(),l=o.getComputedStyle(c),a=parseInt(l.getPropertyValue("padding-left")),i=parseInt(l.getPropertyValue("padding-top"));return[d.clientX-_.left-a,d.clientY-_.top-i]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=h,r.getCoords=function(o,d,c,_,l,a,i,e,n){if(!a)return;const t=h(o,d,c);return t?(t[0]=Math.ceil((t[0]+(n?i/2:0))/i),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),_+(n?1:0)),t[1]=Math.min(Math.max(t[1],1),l),t):void 0}},9504:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const o=h(2584);function d(e,n,t,s){const f=e-c(t,e),v=n-c(t,n),u=Math.abs(f-v)-function(C,g,p){let S=0;const L=C-c(p,C),w=g-c(p,g);for(let m=0;m=0&&nn?"A":"B"}function l(e,n,t,s,f,v){let u=e,C=n,g="";for(;u!==t||C!==s;)u+=f?1:-1,f&&u>v.cols-1?(g+=v.buffer.translateBufferLineToString(C,!1,e,u),u=0,e=0,C++):!f&&u<0&&(g+=v.buffer.translateBufferLineToString(C,!1,0,e+1),u=v.cols-1,e=u,C--);return g+v.buffer.translateBufferLineToString(C,!1,e,u)}function a(e,n){const t=n?"O":"[";return o.C0.ESC+t+e}function i(e,n){e=Math.floor(e);let t="";for(let s=0;s0?L-c(w,L):p;const y=L,E=function(A,k,O,T,H,W){let x;return x=d(O,T,H,W).length>0?T-c(H,T):k,A=O&&xe?"D":"C",i(Math.abs(f-e),a(u,s));u=v>n?"D":"C";const C=Math.abs(v-n);return i(function(g,p){return p.cols-g}(v>n?e:f,t)+(C-1)*t.cols+1+((v>n?f:e)-1),a(u,s))}},8036:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const o=h(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=o.isFirefox||o.isLegacyEdge?"bottom":"ideographic"},1752:(D,r)=>{function h(o){return 57508<=o&&o<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(o){if(!o)throw new Error("value must not be falsy");return o},r.isPowerlineGlyph=h,r.isRestrictedPowerlineGlyph=function(o){return 57520<=o&&o<=57527},r.excludeFromContrastRatioDemands=function(o){return h(o)||function(d){return 9472<=d&&d<=9631}(o)}},1296:function(D,r,h){var o=this&&this.__decorate||function(C,g,p,S){var L,w=arguments.length,m=w<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(C,g,p,S);else for(var b=C.length-1;b>=0;b--)(L=C[b])&&(m=(w<3?L(m):w>3?L(g,p,m):L(g,p))||m);return w>3&&m&&Object.defineProperty(g,p,m),m},d=this&&this.__param||function(C,g){return function(p,S){g(p,S,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const c=h(3787),_=h(8036),l=h(844),a=h(4725),i=h(2585),e=h(8460),n=h(8055),t=h(9631),s="xterm-dom-renderer-owner-",f="xterm-focus";let v=1,u=class extends l.Disposable{constructor(C,g,p,S,L,w,m,b,y,E){super(),this._colors=C,this._element=g,this._screenElement=p,this._viewportElement=S,this._linkifier2=L,this._charSizeService=m,this._optionsService=b,this._bufferService=y,this._coreBrowserService=E,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=w.createInstance(c.DomRendererRowFactory,document,this._colors),this._element.classList.add(s+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(A=>this._onLinkHover(A))),this.register(this._linkifier2.onHideLinkUnderline(A=>this._onLinkLeave(A)))}get onRequestRedraw(){return new e.EventEmitter().event}dispose(){this._element.classList.remove(s+this._terminalClass),(0,t.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){const C=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*C,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*C),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/C),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/C),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(const p of this._rowElements)p.style.width=`${this.dimensions.canvasWidth}px`,p.style.height=`${this.dimensions.actualCellHeight}px`,p.style.lineHeight=`${this.dimensions.actualCellHeight}px`,p.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const g=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=g,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.canvasWidth}px`,this._screenElement.style.height=`${this.dimensions.canvasHeight}px`}setColors(C){this._colors=C,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let C=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;C+=`${this._terminalSelector} span:not(.${c.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${c.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${c.ITALIC_CLASS} { font-style: italic;}`,C+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% {  box-shadow: none; }}",C+="@keyframes blink_block_"+this._terminalClass+` { 0% {  background-color: ${this._colors.cursor.css};  color: ${this._colors.cursorAccent.css}; } 50% {  background-color: ${this._colors.cursorAccent.css};  color: ${this._colors.cursor.css}; }}`,C+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}:not(.${c.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`,C+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach((g,p)=>{C+=`${this._terminalSelector} .xterm-fg-${p} { color: ${g.css}; }${this._terminalSelector} .xterm-bg-${p} { background-color: ${g.css}; }`}),C+=`${this._terminalSelector} .xterm-fg-${_.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${_.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=C}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(C,g){for(let p=this._rowElements.length;p<=g;p++){const S=document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(C,g){this._refreshRowElements(C,g),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(C,g,p){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(C,g,p),this.renderRows(0,this._bufferService.rows-1),!C||!g)return;const S=C[1]-this._bufferService.buffer.ydisp,L=g[1]-this._bufferService.buffer.ydisp,w=Math.max(S,0),m=Math.min(L,this._bufferService.rows-1);if(w>=this._bufferService.rows||m<0)return;const b=document.createDocumentFragment();if(p){const y=C[0]>g[0];b.appendChild(this._createSelectionElement(w,y?g[0]:C[0],y?C[0]:g[0],m-w+1))}else{const y=S===w?C[0]:0,E=w===L?g[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(w,y,E));const A=m-w-1;if(b.appendChild(this._createSelectionElement(w+1,0,this._bufferService.cols,A)),w!==m){const k=L===m?g[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(m,0,k))}}this._selectionContainer.appendChild(b)}_createSelectionElement(C,g,p,S=1){const L=document.createElement("div");return L.style.height=S*this.dimensions.actualCellHeight+"px",L.style.top=C*this.dimensions.actualCellHeight+"px",L.style.left=g*this.dimensions.actualCellWidth+"px",L.style.width=this.dimensions.actualCellWidth*(p-g)+"px",L}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(const C of this._rowElements)C.innerText=""}renderRows(C,g){const p=this._bufferService.buffer.ybase+this._bufferService.buffer.y,S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),L=this._optionsService.rawOptions.cursorBlink;for(let w=C;w<=g;w++){const m=this._rowElements[w];m.innerText="";const b=w+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.lines.get(b),E=this._optionsService.rawOptions.cursorStyle;m.appendChild(this._rowFactory.createRow(y,b,b===p,E,S,L,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return`.${s}${this._terminalClass}`}_onLinkHover(C){this._setCellUnderline(C.x1,C.x2,C.y1,C.y2,C.cols,!0)}_onLinkLeave(C){this._setCellUnderline(C.x1,C.x2,C.y1,C.y2,C.cols,!1)}_setCellUnderline(C,g,p,S,L,w){for(;C!==g||p!==S;){const m=this._rowElements[p];if(!m)return;const b=m.children[C];b&&(b.style.textDecoration=w?"underline":"none"),++C>=L&&(C=0,p++)}}};u=o([d(5,i.IInstantiationService),d(6,a.ICharSizeService),d(7,i.IOptionsService),d(8,i.IBufferService),d(9,a.ICoreBrowserService)],u),r.DomRenderer=u},3787:function(D,r,h){var o=this&&this.__decorate||function(u,C,g,p){var S,L=arguments.length,w=L<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,C,g,p);else for(var m=u.length-1;m>=0;m--)(S=u[m])&&(w=(L<3?S(w):L>3?S(C,g,w):S(C,g))||w);return L>3&&w&&Object.defineProperty(C,g,w),w},d=this&&this.__param||function(u,C){return function(g,p){C(g,p,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=r.CURSOR_STYLE_UNDERLINE_CLASS=r.CURSOR_STYLE_BAR_CLASS=r.CURSOR_STYLE_BLOCK_CLASS=r.CURSOR_BLINK_CLASS=r.CURSOR_CLASS=r.STRIKETHROUGH_CLASS=r.UNDERLINE_CLASS=r.ITALIC_CLASS=r.DIM_CLASS=r.BOLD_CLASS=void 0;const c=h(8036),_=h(643),l=h(511),a=h(2585),i=h(8055),e=h(4725),n=h(4269),t=h(1752),s=h(3734);r.BOLD_CLASS="xterm-bold",r.DIM_CLASS="xterm-dim",r.ITALIC_CLASS="xterm-italic",r.UNDERLINE_CLASS="xterm-underline",r.STRIKETHROUGH_CLASS="xterm-strikethrough",r.CURSOR_CLASS="xterm-cursor",r.CURSOR_BLINK_CLASS="xterm-cursor-blink",r.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",r.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",r.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let f=class{constructor(u,C,g,p,S,L,w){this._document=u,this._colors=C,this._characterJoinerService=g,this._optionsService=p,this._coreBrowserService=S,this._coreService=L,this._decorationService=w,this._workCell=new l.CellData,this._columnSelectMode=!1}setColors(u){this._colors=u}onSelectionChanged(u,C,g){this._selectionStart=u,this._selectionEnd=C,this._columnSelectMode=g}createRow(u,C,g,p,S,L,w,m){const b=this._document.createDocumentFragment(),y=this._characterJoinerService.getJoinedCharacters(C);let E=0;for(let A=Math.min(u.length,m)-1;A>=0;A--)if(u.loadCell(A,this._workCell).getCode()!==_.NULL_CELL_CODE||g&&A===S){E=A+1;break}for(let A=0;A0&&A===y[0][0]){O=!0;const N=y.shift();H=new n.JoinedCellData(this._workCell,u.translateToString(!0,N[0],N[1]),N[1]-N[0]),T=N[1]-1,k=H.getWidth()}const W=this._document.createElement("span");if(k>1&&(W.style.width=w*k+"px"),O&&(W.style.display="inline",S>=A&&S<=T&&(S=A)),!this._coreService.isCursorHidden&&g&&A===S)switch(W.classList.add(r.CURSOR_CLASS),L&&W.classList.add(r.CURSOR_BLINK_CLASS),p){case"bar":W.classList.add(r.CURSOR_STYLE_BAR_CLASS);break;case"underline":W.classList.add(r.CURSOR_STYLE_UNDERLINE_CLASS);break;default:W.classList.add(r.CURSOR_STYLE_BLOCK_CLASS)}if(H.isBold()&&W.classList.add(r.BOLD_CLASS),H.isItalic()&&W.classList.add(r.ITALIC_CLASS),H.isDim()&&W.classList.add(r.DIM_CLASS),H.isInvisible()?W.textContent=_.WHITESPACE_CELL_CHAR:W.textContent=H.getChars()||_.WHITESPACE_CELL_CHAR,H.isUnderline()&&(W.classList.add(`${r.UNDERLINE_CLASS}-${H.extended.underlineStyle}`),W.textContent===" "&&(W.innerHTML=" "),!H.isUnderlineColorDefault()))if(H.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(H.getUnderlineColor()).join(",")})`;else{let N=H.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&H.isBold()&&N<8&&(N+=8),W.style.textDecorationColor=this._colors.ansi[N].css}H.isStrikethrough()&&W.classList.add(r.STRIKETHROUGH_CLASS);let x=H.getFgColor(),B=H.getFgColorMode(),P=H.getBgColor(),R=H.getBgColorMode();const M=!!H.isInverse();if(M){const N=x;x=P,P=N;const J=B;B=R,R=J}let F,U,$=!1;this._decorationService.forEachDecorationAtCell(A,C,void 0,N=>{N.options.layer!=="top"&&$||(N.backgroundColorRGB&&(R=50331648,P=N.backgroundColorRGB.rgba>>8&16777215,F=N.backgroundColorRGB),N.foregroundColorRGB&&(B=50331648,x=N.foregroundColorRGB.rgba>>8&16777215,U=N.foregroundColorRGB),$=N.options.layer==="top")});const I=this._isCellInSelection(A,C);let K;switch($||this._colors.selectionForeground&&I&&(B=50331648,x=this._colors.selectionForeground.rgba>>8&16777215,U=this._colors.selectionForeground),I&&(F=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,$=!0),$&&W.classList.add("xterm-decoration-top"),R){case 16777216:case 33554432:K=this._colors.ansi[P],W.classList.add(`xterm-bg-${P}`);break;case 50331648:K=i.rgba.toColor(P>>16,P>>8&255,255&P),this._addStyle(W,`background-color:#${v((P>>>0).toString(16),"0",6)}`);break;default:M?(K=this._colors.foreground,W.classList.add(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):K=this._colors.background}switch(F||H.isDim()&&(F=i.color.multiplyOpacity(K,.5)),B){case 16777216:case 33554432:H.isBold()&&x<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(x+=8),this._applyMinimumContrast(W,K,this._colors.ansi[x],H,F,void 0)||W.classList.add(`xterm-fg-${x}`);break;case 50331648:const N=i.rgba.toColor(x>>16&255,x>>8&255,255&x);this._applyMinimumContrast(W,K,N,H,F,U)||this._addStyle(W,`color:#${v(x.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,K,this._colors.foreground,H,F,void 0)||M&&W.classList.add(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}b.appendChild(W),A=T}return b}_applyMinimumContrast(u,C,g,p,S,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.excludeFromContrastRatioDemands)(p.getCode()))return!1;let w;return S||L||(w=this._colors.contrastCache.getColor(C.rgba,g.rgba)),w===void 0&&(w=i.color.ensureContrastRatio(S||C,L||g,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((S||C).rgba,(L||g).rgba,w!=null?w:null)),!!w&&(this._addStyle(u,`color:${w.css}`),!0)}_addStyle(u,C){u.setAttribute("style",`${u.getAttribute("style")||""}${C};`)}_isCellInSelection(u,C){const g=this._selectionStart,p=this._selectionEnd;return!(!g||!p)&&(this._columnSelectMode?g[0]<=p[0]?u>=g[0]&&C>=g[1]&&u=g[1]&&u>=p[0]&&C<=p[1]:C>g[1]&&C=g[0]&&u=g[0])}};function v(u,C,g){for(;u.length{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(h){this._bufferService=h,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,o=this.selectionEnd;return!(!h||!o)&&(h[1]>o[1]||h[1]===o[1]&&h[0]>o[0])}onTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(D,r,h){var o=this&&this.__decorate||function(i,e,n,t){var s,f=arguments.length,v=f<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,e,n,t);else for(var u=i.length-1;u>=0;u--)(s=i[u])&&(v=(f<3?s(v):f>3?s(e,n,v):s(e,n))||v);return f>3&&v&&Object.defineProperty(e,n,v),v},d=this&&this.__param||function(i,e){return function(n,t){e(n,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const c=h(2585),_=h(8460);let l=class{constructor(i,e,n){this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=new _.EventEmitter,this._measureStrategy=new a(i,e,this._optionsService)}get hasValidSize(){return this.width>0&&this.height>0}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};l=o([d(2,c.IOptionsService)],l),r.CharSizeService=l;class a{constructor(e,n,t){this._document=e,this._parentElement=n,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const e=this._measureElement.getBoundingClientRect();return e.width!==0&&e.height!==0&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(D,r,h){var o=this&&this.__decorate||function(n,t,s,f){var v,u=arguments.length,C=u<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,s):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(n,t,s,f);else for(var g=n.length-1;g>=0;g--)(v=n[g])&&(C=(u<3?v(C):u>3?v(t,s,C):v(t,s))||C);return u>3&&C&&Object.defineProperty(t,s,C),C},d=this&&this.__param||function(n,t){return function(s,f){t(s,f,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const c=h(3734),_=h(643),l=h(511),a=h(2585);class i extends c.AttributeData{constructor(t,s,f){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=s,this._width=f}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=i;let e=class Re{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new l.CellData}register(t){const s={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(s),s.id}deregister(t){for(let s=0;s1){const w=this._getJoinedRanges(v,g,C,s,u);for(let m=0;m1){const L=this._getJoinedRanges(v,g,C,s,u);for(let w=0;w{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(h,o){this._textarea=h,this.window=o}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(D,r,h){var o=this&&this.__decorate||function(a,i,e,n){var t,s=arguments.length,f=s<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(a,i,e,n);else for(var v=a.length-1;v>=0;v--)(t=a[v])&&(f=(s<3?t(f):s>3?t(i,e,f):t(i,e))||f);return s>3&&f&&Object.defineProperty(i,e,f),f},d=this&&this.__param||function(a,i){return function(e,n){i(e,n,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const c=h(4725),_=h(9806);let l=class{constructor(a,i){this._renderService=a,this._charSizeService=i}getCoords(a,i,e,n,t){return(0,_.getCoords)(window,a,i,e,n,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,t)}getMouseReportCoords(a,i){const e=(0,_.getCoordsRelativeToElement)(window,a,i);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=this._renderService.dimensions.canvasWidth||e[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(e[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(e[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(e[0]),y:Math.floor(e[1])}}};l=o([d(0,c.IRenderService),d(1,c.ICharSizeService)],l),r.MouseService=l},3230:function(D,r,h){var o=this&&this.__decorate||function(s,f,v,u){var C,g=arguments.length,p=g<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,f,v,u);else for(var S=s.length-1;S>=0;S--)(C=s[S])&&(p=(g<3?C(p):g>3?C(f,v,p):C(f,v))||p);return g>3&&p&&Object.defineProperty(f,v,p),p},d=this&&this.__param||function(s,f){return function(v,u){f(v,u,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const c=h(6193),_=h(8460),l=h(844),a=h(5596),i=h(3656),e=h(2585),n=h(4725);let t=class extends l.Disposable{constructor(s,f,v,u,C,g,p,S){if(super(),this._renderer=s,this._rowCount=f,this._charSizeService=C,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=new _.EventEmitter,this._onRenderedViewportChange=new _.EventEmitter,this._onRender=new _.EventEmitter,this._onRefreshRequest=new _.EventEmitter,this.register({dispose:()=>this._renderer.dispose()}),this._renderDebouncer=new c.RenderDebouncer(S.window,(L,w)=>this._renderRows(L,w)),this.register(this._renderDebouncer),this._screenDprMonitor=new a.ScreenDprMonitor(S.window),this._screenDprMonitor.setListener(()=>this.onDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>{var L;return(L=this._renderer)===null||L===void 0?void 0:L.clear()})),this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.onCharSizeChanged())),this.register(g.onDecorationRegistered(()=>this._fullRefresh())),this.register(g.onDecorationRemoved(()=>this._fullRefresh())),this._renderer.onRequestRedraw(L=>this.refreshRows(L.start,L.end,!0)),this.register((0,i.addDisposableDomListener)(S.window,"resize",()=>this.onDevicePixelRatioChange())),"IntersectionObserver"in S.window){const L=new S.window.IntersectionObserver(w=>this._onIntersectionChange(w[w.length-1]),{threshold:0});L.observe(v),this.register({dispose:()=>L.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,f,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,f,this._rowCount))}_renderRows(s,f){this._renderer.renderRows(s,f),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:f}),this._onRender.fire({start:s,end:f}),this._isNextRenderRedrawOnly=!0}resize(s,f){this._rowCount=f,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(s){this._renderer.dispose(),this._renderer=s,this._renderer.onRequestRedraw(f=>this.refreshRows(f.start,f.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,f;(f=(s=this._renderer)===null||s===void 0?void 0:s.clearTextureAtlas)===null||f===void 0||f.call(s),this._fullRefresh()}setColors(s){this._renderer.setColors(s),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(s,f){this._renderer.onResize(s,f),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(s,f,v){this._selectionState.start=s,this._selectionState.end=f,this._selectionState.columnSelectMode=v,this._renderer.onSelectionChanged(s,f,v)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}};t=o([d(3,e.IOptionsService),d(4,n.ICharSizeService),d(5,e.IDecorationService),d(6,e.IBufferService),d(7,n.ICoreBrowserService)],t),r.RenderService=t},9312:function(D,r,h){var o=this&&this.__decorate||function(g,p,S,L){var w,m=arguments.length,b=m<3?p:L===null?L=Object.getOwnPropertyDescriptor(p,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(g,p,S,L);else for(var y=g.length-1;y>=0;y--)(w=g[y])&&(b=(m<3?w(b):m>3?w(p,S,b):w(p,S))||b);return m>3&&b&&Object.defineProperty(p,S,b),b},d=this&&this.__param||function(g,p){return function(S,L){p(S,L,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const c=h(6114),_=h(456),l=h(511),a=h(8460),i=h(4725),e=h(2585),n=h(9806),t=h(9504),s=h(844),f=h(4841),v=String.fromCharCode(160),u=new RegExp(v,"g");let C=class extends s.Disposable{constructor(g,p,S,L,w,m,b,y,E){super(),this._element=g,this._screenElement=p,this._linkifier=S,this._bufferService=L,this._coreService=w,this._mouseService=m,this._optionsService=b,this._renderService=y,this._coreBrowserService=E,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new a.EventEmitter),this._onRedrawRequest=this.register(new a.EventEmitter),this._onSelectionChange=this.register(new a.EventEmitter),this._onRequestScrollLines=this.register(new a.EventEmitter),this._mouseMoveListener=A=>this._onMouseMove(A),this._mouseUpListener=A=>this._onMouseUp(A),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(A=>this._onTrim(A)),this.register(this._bufferService.buffers.onBufferActivate(A=>this._onBufferActivate(A))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const g=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;return!(!g||!p||g[0]===p[0]&&g[1]===p[1])}get selectionText(){const g=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;if(!g||!p)return"";const S=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(g[0]===p[0])return"";const w=g[0]w.replace(u," ")).join(c.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),c.isLinux&&g&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(g){const p=this._getMouseBufferCoords(g),S=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(S&&L&&p)&&this._areCoordsInSelection(p,S,L)}isCellInSelection(g,p){const S=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!S||!L)&&this._areCoordsInSelection([g,p],S,L)}_areCoordsInSelection(g,p,S){return g[1]>p[1]&&g[1]=p[0]&&g[0]=p[0]}_selectWordAtCursor(g,p){var S,L;const w=(L=(S=this._linkifier.currentLink)===null||S===void 0?void 0:S.link)===null||L===void 0?void 0:L.range;if(w)return this._model.selectionStart=[w.start.x-1,w.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(w,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const m=this._getMouseBufferCoords(g);return!!m&&(this._selectWordAt(m,p),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,p){this._model.clearSelection(),g=Math.max(g,0),p=Math.min(p,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,p],this.refresh(),this._onSelectionChange.fire()}_onTrim(g){this._model.onTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const p=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(p)return p[0]--,p[1]--,p[1]+=this._bufferService.buffer.ydisp,p}_getMouseEventScrollAmount(g){let p=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const S=this._renderService.dimensions.canvasHeight;return p>=0&&p<=S?0:(p>S&&(p-=S),p=Math.min(Math.max(p,-50),50),p/=50,p/Math.abs(p)+Math.round(14*p))}shouldForceSelection(g){return c.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}onMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._onIncrementalClick(g):g.detail===1?this._onSingleClick(g):g.detail===2?this._onDoubleClick(g):g.detail===3&&this._onTripleClick(g),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_onIncrementalClick(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_onSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const p=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);p&&p.length!==this._model.selectionStart[0]&&p.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_onDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_onTripleClick(g){const p=this._getMouseBufferCoords(g);p&&(this._activeSelectionMode=2,this._selectLineAt(p[1]))}shouldColumnSelect(g){return g.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const p=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const S=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_onMouseUp(g){const p=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&p<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const S=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(S&&S[0]!==void 0&&S[1]!==void 0){const L=(0,t.moveToCellSequence)(S[0]-1,S[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,p=this._model.finalSelectionEnd,S=!(!g||!p||g[0]===p[0]&&g[1]===p[1]);S?g&&p&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&p[0]===this._oldSelectionEnd[0]&&p[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,p,S)):this._oldHasSelection&&this._fireOnSelectionChange(g,p,S)}_fireOnSelectionChange(g,p,S){this._oldSelectionStart=g,this._oldSelectionEnd=p,this._oldHasSelection=S,this._onSelectionChange.fire()}_onBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(p=>this._onTrim(p))}_convertViewportColToCharacterIndex(g,p){let S=p[0];for(let L=0;p[0]>=L;L++){const w=g.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?S--:w>1&&p[0]!==L&&(S+=w-1)}return S}setSelection(g,p,S){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,p],this._model.selectionStartLength=S,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,p,S=!0,L=!0){if(g[0]>=this._bufferService.cols)return;const w=this._bufferService.buffer,m=w.lines.get(g[1]);if(!m)return;const b=w.translateBufferLineToString(g[1],!1);let y=this._convertViewportColToCharacterIndex(m,g),E=y;const A=g[0]-y;let k=0,O=0,T=0,H=0;if(b.charAt(y)===" "){for(;y>0&&b.charAt(y-1)===" ";)y--;for(;E1&&(H+=R-1,E+=R-1);B>0&&y>0&&!this._isCharWordSeparator(m.loadCell(B-1,this._workCell));){m.loadCell(B-1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===0?(k++,B--):M>1&&(T+=M-1,y-=M-1),y--,B--}for(;P1&&(H+=M-1,E+=M-1),E++,P++}}E++;let W=y+A-k+T,x=Math.min(this._bufferService.cols,E-y+k+O-T-H);if(p||b.slice(y,E).trim()!==""){if(S&&W===0&&m.getCodePoint(0)!==32){const B=w.lines.get(g[1]-1);if(B&&m.isWrapped&&B.getCodePoint(this._bufferService.cols-1)!==32){const P=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(P){const R=this._bufferService.cols-P.start;W-=R,x+=R}}}if(L&&W+x===this._bufferService.cols&&m.getCodePoint(this._bufferService.cols-1)!==32){const B=w.lines.get(g[1]+1);if((B==null?void 0:B.isWrapped)&&B.getCodePoint(0)!==32){const P=this._getWordAt([0,g[1]+1],!1,!1,!0);P&&(x+=P.length)}}return{start:W,length:x}}}_selectWordAt(g,p){const S=this._getWordAt(g,p);if(S){for(;S.start<0;)S.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[S.start,g[1]],this._model.selectionStartLength=S.length}}_selectToWordAt(g){const p=this._getWordAt(g,!0);if(p){let S=g[1];for(;p.start<0;)p.start+=this._bufferService.cols,S--;if(!this._model.areSelectionValuesReversed())for(;p.start+p.length>this._bufferService.cols;)p.length-=this._bufferService.cols,S++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?p.start:p.start+p.length,S]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const p=this._bufferService.buffer.getWrappedRangeForLine(g),S={start:{x:0,y:p.first},end:{x:this._bufferService.cols-1,y:p.last}};this._model.selectionStart=[0,p.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(S,this._bufferService.cols)}};C=o([d(3,e.IBufferService),d(4,e.ICoreService),d(5,i.IMouseService),d(6,e.IOptionsService),d(7,i.IRenderService),d(8,i.ICoreBrowserService)],C),r.SelectionService=C},4725:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const o=h(8343);r.ICharSizeService=(0,o.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,o.createDecorator)("CoreBrowserService"),r.IMouseService=(0,o.createDecorator)("MouseService"),r.IRenderService=(0,o.createDecorator)("RenderService"),r.ISelectionService=(0,o.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,o.createDecorator)("CharacterJoinerService")},6349:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const o=h(8460);r.CircularList=class{constructor(d){this._maxLength=d,this.onDeleteEmitter=new o.EventEmitter,this.onInsertEmitter=new o.EventEmitter,this.onTrimEmitter=new o.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;const c=new Array(d);for(let _=0;_this._length)for(let c=this._length;c=d;l--)this._array[this._getCyclicIndex(l+_.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<_.length;l++)this._array[this._getCyclicIndex(d+l)]=_[l];if(_.length&&this.onInsertEmitter.fire({index:d,amount:_.length}),this._length+_.length>this._maxLength){const l=this._length+_.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=_.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,c,_){if(!(c<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let a=c-1;a>=0;a--)this.set(d+a+_,this.get(d+a));const l=d+c+_-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function h(o,d=5){if(typeof o!="object")return o;const c=Array.isArray(o)?[]:{};for(const _ in o)c[_]=d<=1?o[_]:o[_]&&h(o[_],d-1);return c}},8055:(D,r)=>{var h,o,d;function c(l){const a=l.toString(16);return a.length<2?"0"+a:a}function _(l,a){return l>>0}}(h=r.channels||(r.channels={})),function(l){function a(i,e){const n=Math.round(255*e),[t,s,f]=d.toChannels(i.rgba);return{css:h.toCss(t,s,f,n),rgba:h.toRgba(t,s,f,n)}}l.blend=function(i,e){const n=(255&e.rgba)/255;if(n===1)return{css:e.css,rgba:e.rgba};const t=e.rgba>>24&255,s=e.rgba>>16&255,f=e.rgba>>8&255,v=i.rgba>>24&255,u=i.rgba>>16&255,C=i.rgba>>8&255,g=v+Math.round((t-v)*n),p=u+Math.round((s-u)*n),S=C+Math.round((f-C)*n);return{css:h.toCss(g,p,S),rgba:h.toRgba(g,p,S)}},l.isOpaque=function(i){return(255&i.rgba)==255},l.ensureContrastRatio=function(i,e,n){const t=d.ensureContrastRatio(i.rgba,e.rgba,n);if(t)return d.toColor(t>>24&255,t>>16&255,t>>8&255)},l.opaque=function(i){const e=(255|i.rgba)>>>0,[n,t,s]=d.toChannels(e);return{css:h.toCss(n,t,s),rgba:e}},l.opacity=a,l.multiplyOpacity=function(i,e){return a(i,(255&i.rgba)*e/255)},l.toColorRGB=function(i){return[i.rgba>>24&255,i.rgba>>16&255,i.rgba>>8&255]}}(r.color||(r.color={})),(r.css||(r.css={})).toColor=function(l){if(l.match(/#[0-9a-f]{3,8}/i))switch(l.length){case 4:{const i=parseInt(l.slice(1,2).repeat(2),16),e=parseInt(l.slice(2,3).repeat(2),16),n=parseInt(l.slice(3,4).repeat(2),16);return d.toColor(i,e,n)}case 5:{const i=parseInt(l.slice(1,2).repeat(2),16),e=parseInt(l.slice(2,3).repeat(2),16),n=parseInt(l.slice(3,4).repeat(2),16),t=parseInt(l.slice(4,5).repeat(2),16);return d.toColor(i,e,n,t)}case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}const a=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a){const i=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),t=Math.round(255*(a[5]===void 0?1:parseFloat(a[5])));return d.toColor(i,e,n,t)}throw new Error("css.toColor: Unsupported css format")},function(l){function a(i,e,n){const t=i/255,s=e/255,f=n/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.0722*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))}l.relativeLuminance=function(i){return a(i>>16&255,i>>8&255,255&i)},l.relativeLuminance2=a}(o=r.rgb||(r.rgb={})),function(l){function a(e,n,t){const s=e>>24&255,f=e>>16&255,v=e>>8&255;let u=n>>24&255,C=n>>16&255,g=n>>8&255,p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));for(;p0||C>0||g>0);)u-=Math.max(0,Math.ceil(.1*u)),C-=Math.max(0,Math.ceil(.1*C)),g-=Math.max(0,Math.ceil(.1*g)),p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));return(u<<24|C<<16|g<<8|255)>>>0}function i(e,n,t){const s=e>>24&255,f=e>>16&255,v=e>>8&255;let u=n>>24&255,C=n>>16&255,g=n>>8&255,p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));for(;p>>0}l.ensureContrastRatio=function(e,n,t){const s=o.relativeLuminance(e>>8),f=o.relativeLuminance(n>>8);if(_(s,f)>8));if(g_(s,o.relativeLuminance(p>>8))?C:p}return C}const v=i(e,n,t),u=_(s,o.relativeLuminance(v>>8));if(u_(s,o.relativeLuminance(C>>8))?v:C}return v}},l.reduceLuminance=a,l.increaseLuminance=i,l.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.toColor=function(e,n,t,s){return{css:h.toCss(e,n,t,s),rgba:h.toRgba(e,n,t,s)}}}(d=r.rgba||(r.rgba={})),r.toPaddedHex=c,r.contrastRatio=_},8969:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const o=h(844),d=h(2585),c=h(4348),_=h(7866),l=h(744),a=h(7302),i=h(6975),e=h(8460),n=h(1753),t=h(3730),s=h(1480),f=h(7994),v=h(9282),u=h(5435),C=h(5981),g=h(2660);let p=!1;class S extends o.Disposable{constructor(w){super(),this._onBinary=new e.EventEmitter,this._onData=new e.EventEmitter,this._onLineFeed=new e.EventEmitter,this._onResize=new e.EventEmitter,this._onScroll=new e.EventEmitter,this._onWriteParsed=new e.EventEmitter,this._instantiationService=new c.InstantiationService,this.optionsService=new a.OptionsService(w),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(l.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(_.LogService),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(i.CoreService,()=>this.scrollToBottom())),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(n.CoreMouseService),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(t.DirtyRowService),this._instantiationService.setService(d.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(s.UnicodeService),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=new u.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange(m=>this._updateOptions(m))),this.register(this._bufferService.onScroll(m=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(m=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=new C.WriteBuffer((m,b)=>this._inputHandler.parse(m,b)),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new e.EventEmitter,this.register(this._onScroll.event(w=>{var m;(m=this._onScrollApi)===null||m===void 0||m.fire(w.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(w){for(const m in w)this.optionsService.options[m]=w[m]}dispose(){var w;this._isDisposed||(super.dispose(),(w=this._windowsMode)===null||w===void 0||w.dispose(),this._windowsMode=void 0)}write(w,m){this._writeBuffer.write(w,m)}writeSync(w,m){this._logService.logLevel<=d.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(w,m)}resize(w,m){isNaN(w)||isNaN(m)||(w=Math.max(w,l.MINIMUM_COLS),m=Math.max(m,l.MINIMUM_ROWS),this._bufferService.resize(w,m))}scroll(w,m=!1){this._bufferService.scroll(w,m)}scrollLines(w,m,b){this._bufferService.scrollLines(w,m,b)}scrollPages(w){this._bufferService.scrollPages(w)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(w){this._bufferService.scrollToLine(w)}registerEscHandler(w,m){return this._inputHandler.registerEscHandler(w,m)}registerDcsHandler(w,m){return this._inputHandler.registerDcsHandler(w,m)}registerCsiHandler(w,m){return this._inputHandler.registerCsiHandler(w,m)}registerOscHandler(w,m){return this._inputHandler.registerOscHandler(w,m)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(w){var m;switch(w){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():((m=this._windowsMode)===null||m===void 0||m.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){const w=[];w.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsMode={dispose:()=>{for(const m of w)m.dispose()}}}}}r.CoreTerminal=S},8460:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let o=0;oo.fire(d))}},5435:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const o=h(2584),d=h(7116),c=h(2015),_=h(844),l=h(482),a=h(8437),i=h(8460),e=h(643),n=h(511),t=h(3734),s=h(2585),f=h(6242),v=h(6351),u=h(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},g=131072;function p(w,m){if(w>24)return m.setWinLines||!1;switch(w){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var S;(function(w){w[w.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",w[w.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(S=r.WindowsOptionsReportType||(r.WindowsOptionsReportType={}));class L extends _.Disposable{constructor(m,b,y,E,A,k,O,T,H,W=new c.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=y,this._dirtyRowService=E,this._logService=A,this._optionsService=k,this._oscLinkService=O,this._coreMouseService=T,this._unicodeService=H,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new i.EventEmitter,this._onRequestRefreshRows=new i.EventEmitter,this._onRequestReset=new i.EventEmitter,this._onRequestSendFocus=new i.EventEmitter,this._onRequestSyncScrollBar=new i.EventEmitter,this._onRequestWindowsOptionsReport=new i.EventEmitter,this._onA11yChar=new i.EventEmitter,this._onA11yTab=new i.EventEmitter,this._onCursorMove=new i.EventEmitter,this._onLineFeed=new i.EventEmitter,this._onScroll=new i.EventEmitter,this._onTitleChange=new i.EventEmitter,this._onColor=new i.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(x=>this._activeBuffer=x.activeBuffer)),this._parser.setCsiHandlerFallback((x,B)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(x),params:B.toArray()})}),this._parser.setEscHandlerFallback(x=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(x)})}),this._parser.setExecuteHandlerFallback(x=>{this._logService.debug("Unknown EXECUTE code: ",{code:x})}),this._parser.setOscHandlerFallback((x,B,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:x,action:B,data:P})}),this._parser.setDcsHandlerFallback((x,B,P)=>{B==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(x),action:B,payload:P})}),this._parser.setPrintHandler((x,B,P)=>this.print(x,B,P)),this._parser.registerCsiHandler({final:"@"},x=>this.insertChars(x)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},x=>this.scrollLeft(x)),this._parser.registerCsiHandler({final:"A"},x=>this.cursorUp(x)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},x=>this.scrollRight(x)),this._parser.registerCsiHandler({final:"B"},x=>this.cursorDown(x)),this._parser.registerCsiHandler({final:"C"},x=>this.cursorForward(x)),this._parser.registerCsiHandler({final:"D"},x=>this.cursorBackward(x)),this._parser.registerCsiHandler({final:"E"},x=>this.cursorNextLine(x)),this._parser.registerCsiHandler({final:"F"},x=>this.cursorPrecedingLine(x)),this._parser.registerCsiHandler({final:"G"},x=>this.cursorCharAbsolute(x)),this._parser.registerCsiHandler({final:"H"},x=>this.cursorPosition(x)),this._parser.registerCsiHandler({final:"I"},x=>this.cursorForwardTab(x)),this._parser.registerCsiHandler({final:"J"},x=>this.eraseInDisplay(x,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},x=>this.eraseInDisplay(x,!0)),this._parser.registerCsiHandler({final:"K"},x=>this.eraseInLine(x,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},x=>this.eraseInLine(x,!0)),this._parser.registerCsiHandler({final:"L"},x=>this.insertLines(x)),this._parser.registerCsiHandler({final:"M"},x=>this.deleteLines(x)),this._parser.registerCsiHandler({final:"P"},x=>this.deleteChars(x)),this._parser.registerCsiHandler({final:"S"},x=>this.scrollUp(x)),this._parser.registerCsiHandler({final:"T"},x=>this.scrollDown(x)),this._parser.registerCsiHandler({final:"X"},x=>this.eraseChars(x)),this._parser.registerCsiHandler({final:"Z"},x=>this.cursorBackwardTab(x)),this._parser.registerCsiHandler({final:"`"},x=>this.charPosAbsolute(x)),this._parser.registerCsiHandler({final:"a"},x=>this.hPositionRelative(x)),this._parser.registerCsiHandler({final:"b"},x=>this.repeatPrecedingCharacter(x)),this._parser.registerCsiHandler({final:"c"},x=>this.sendDeviceAttributesPrimary(x)),this._parser.registerCsiHandler({prefix:">",final:"c"},x=>this.sendDeviceAttributesSecondary(x)),this._parser.registerCsiHandler({final:"d"},x=>this.linePosAbsolute(x)),this._parser.registerCsiHandler({final:"e"},x=>this.vPositionRelative(x)),this._parser.registerCsiHandler({final:"f"},x=>this.hVPosition(x)),this._parser.registerCsiHandler({final:"g"},x=>this.tabClear(x)),this._parser.registerCsiHandler({final:"h"},x=>this.setMode(x)),this._parser.registerCsiHandler({prefix:"?",final:"h"},x=>this.setModePrivate(x)),this._parser.registerCsiHandler({final:"l"},x=>this.resetMode(x)),this._parser.registerCsiHandler({prefix:"?",final:"l"},x=>this.resetModePrivate(x)),this._parser.registerCsiHandler({final:"m"},x=>this.charAttributes(x)),this._parser.registerCsiHandler({final:"n"},x=>this.deviceStatus(x)),this._parser.registerCsiHandler({prefix:"?",final:"n"},x=>this.deviceStatusPrivate(x)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},x=>this.softReset(x)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},x=>this.setCursorStyle(x)),this._parser.registerCsiHandler({final:"r"},x=>this.setScrollRegion(x)),this._parser.registerCsiHandler({final:"s"},x=>this.saveCursor(x)),this._parser.registerCsiHandler({final:"t"},x=>this.windowOptions(x)),this._parser.registerCsiHandler({final:"u"},x=>this.restoreCursor(x)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},x=>this.insertColumns(x)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},x=>this.deleteColumns(x)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},x=>this.selectProtected(x)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},x=>this.requestMode(x,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},x=>this.requestMode(x,!1)),this._parser.setExecuteHandler(o.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(o.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(o.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(o.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(o.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(o.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(o.C1.IND,()=>this.index()),this._parser.setExecuteHandler(o.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(o.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new f.OscHandler(x=>(this.setTitle(x),this.setIconName(x),!0))),this._parser.registerOscHandler(1,new f.OscHandler(x=>this.setIconName(x))),this._parser.registerOscHandler(2,new f.OscHandler(x=>this.setTitle(x))),this._parser.registerOscHandler(4,new f.OscHandler(x=>this.setOrReportIndexedColor(x))),this._parser.registerOscHandler(8,new f.OscHandler(x=>this.setHyperlink(x))),this._parser.registerOscHandler(10,new f.OscHandler(x=>this.setOrReportFgColor(x))),this._parser.registerOscHandler(11,new f.OscHandler(x=>this.setOrReportBgColor(x))),this._parser.registerOscHandler(12,new f.OscHandler(x=>this.setOrReportCursorColor(x))),this._parser.registerOscHandler(104,new f.OscHandler(x=>this.restoreIndexedColor(x))),this._parser.registerOscHandler(110,new f.OscHandler(x=>this.restoreFgColor(x))),this._parser.registerOscHandler(111,new f.OscHandler(x=>this.restoreBgColor(x))),this._parser.registerOscHandler(112,new f.OscHandler(x=>this.restoreCursorColor(x))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const x in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:x},()=>this.selectCharset("("+x)),this._parser.registerEscHandler({intermediates:")",final:x},()=>this.selectCharset(")"+x)),this._parser.registerEscHandler({intermediates:"*",final:x},()=>this.selectCharset("*"+x)),this._parser.registerEscHandler({intermediates:"+",final:x},()=>this.selectCharset("+"+x)),this._parser.registerEscHandler({intermediates:"-",final:x},()=>this.selectCharset("-"+x)),this._parser.registerEscHandler({intermediates:".",final:x},()=>this.selectCharset("."+x)),this._parser.registerEscHandler({intermediates:"/",final:x},()=>this.selectCharset("/"+x));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(x=>(this._logService.error("Parsing error: ",x),x)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler((x,B)=>this.requestStatusString(x,B)))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(m,b,y,E){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=y,this._parseStack.position=E}_logSlowResolvingAsync(m){this._logService.logLevel<=s.LogLevelEnum.WARN&&Promise.race([m,new Promise((b,y)=>setTimeout(()=>y("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b})}parse(m,b){let y,E=this._activeBuffer.x,A=this._activeBuffer.y,k=0;const O=this._parseStack.paused;if(O){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(y),y;E=this._parseStack.cursorStartX,A=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>g&&(k=this._parseStack.position+g)}if(this._logService.logLevel<=s.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,T=>String.fromCharCode(T)).join("")}"`),typeof m=="string"?m.split("").map(T=>T.charCodeAt(0)):m),this._parseBuffer.lengthg)for(let T=k;T0&&B.getWidth(this._activeBuffer.x-1)===2&&B.setCellFromCodePoint(this._activeBuffer.x-1,0,1,x.fg,x.bg,x.extended);for(let P=b;P=T){if(H){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=T-1,A===2)continue}if(W&&(B.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(x),x),B.getWidth(T-1)===2&&B.setCellFromCodePoint(T-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,x.fg,x.bg,x.extended)),B.setCellFromCodePoint(this._activeBuffer.x++,E,A,x.fg,x.bg,x.extended),A>0)for(;--A;)B.setCellFromCodePoint(this._activeBuffer.x++,0,0,x.fg,x.bg,x.extended)}else B.getWidth(this._activeBuffer.x-1)?B.addCodepointToCell(this._activeBuffer.x-1,E):B.addCodepointToCell(this._activeBuffer.x-2,E)}y-b>0&&(B.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&B.getWidth(this._activeBuffer.x)===0&&!B.hasContent(this._activeBuffer.x)&&B.setCellFromCodePoint(this._activeBuffer.x,0,1,x.fg,x.bg,x.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,y=>!p(y.params[0],this._optionsService.rawOptions.windowOptions)||b(y))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new v.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new f.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var m;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||m===void 0?void 0:m.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(m,b){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,y,E=!1,A=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);k.replaceCells(b,y,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),A),E&&(k.isWrapped=!1)}_resetBufferLine(m,b=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),y.isWrapped=!1}eraseInDisplay(m,b=!1){let y;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowService.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);y=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,b);this._dirtyRowService.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowService.markDirty(y-1);y--;)this._resetBufferLine(y,b);this._dirtyRowService.markDirty(0);break;case 3:const E=this._activeBuffer.lines.length-this._bufferService.rows;E>0&&(this._activeBuffer.lines.trimStart(E),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-E,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-E,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;bF?1:2,P=m.params[0];return R=P,M=b?P===2?3:P===4?B(k.modes.insertMode):P===12?4:P===20?B(x.convertEol):0:P===1?B(y.applicationCursorKeys):P===3?x.windowOptions.setWinLines?T===80?2:T===132?1:0:0:P===6?B(y.origin):P===7?B(y.wraparound):P===8?3:P===9?B(E==="X10"):P===12?B(x.cursorBlink):P===25?B(!k.isCursorHidden):P===45?B(y.reverseWraparound):P===66?B(y.applicationKeypad):P===1e3?B(E==="VT200"):P===1002?B(E==="DRAG"):P===1003?B(E==="ANY"):P===1004?B(y.sendFocus):P===1005?4:P===1006?B(A==="SGR"):P===1015?4:P===1016?B(A==="SGR_PIXELS"):P===1048?1:P===47||P===1047||P===1049?B(H===W):P===2004?B(y.bracketedPasteMode):0,k.triggerDataEvent(`${o.C0.ESC}[${b?"":"?"}${R};${M}$y`),!0;var R,M}_updateAttrColor(m,b,y,E,A){return b===2?(m|=50331648,m&=-16777216,m|=t.AttributeData.fromColorRGB([y,E,A])):b===5&&(m&=-50331904,m|=33554432|255&y),m}_extractColor(m,b,y){const E=[0,0,-1,0,0,0];let A=0,k=0;do{if(E[k+A]=m.params[b+k],m.hasSubParams(b+k)){const O=m.getSubParams(b+k);let T=0;do E[1]===5&&(A=1),E[k+T+1+A]=O[T];while(++T=2||E[1]===2&&k+A>=5)break;E[1]&&(A=1)}while(++k+b5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._curAttrData.fg=a.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=a.DEFAULT_ATTR_DATA.bg,!0;const b=m.length;let y;const E=this._curAttrData;for(let A=0;A=30&&y<=37?(E.fg&=-50331904,E.fg|=16777216|y-30):y>=40&&y<=47?(E.bg&=-50331904,E.bg|=16777216|y-40):y>=90&&y<=97?(E.fg&=-50331904,E.fg|=16777224|y-90):y>=100&&y<=107?(E.bg&=-50331904,E.bg|=16777224|y-100):y===0?(E.fg=a.DEFAULT_ATTR_DATA.fg,E.bg=a.DEFAULT_ATTR_DATA.bg):y===1?E.fg|=134217728:y===3?E.bg|=67108864:y===4?(E.fg|=268435456,this._processUnderline(m.hasSubParams(A)?m.getSubParams(A)[0]:1,E)):y===5?E.fg|=536870912:y===7?E.fg|=67108864:y===8?E.fg|=1073741824:y===9?E.fg|=2147483648:y===2?E.bg|=134217728:y===21?this._processUnderline(2,E):y===22?(E.fg&=-134217729,E.bg&=-134217729):y===23?E.bg&=-67108865:y===24?(E.fg&=-268435457,this._processUnderline(0,E)):y===25?E.fg&=-536870913:y===27?E.fg&=-67108865:y===28?E.fg&=-1073741825:y===29?E.fg&=2147483647:y===39?(E.fg&=-67108864,E.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):y===49?(E.bg&=-67108864,E.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?A+=this._extractColor(m,A,E):y===59?(E.extended=E.extended.clone(),E.extended.underlineColor=-1,E.updateExtended()):y===100?(E.fg&=-67108864,E.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,E.bg&=-67108864,E.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${b};${y}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${b};${y}R`)}return!0}softReset(m){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(m){const b=m.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=b%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(m){const b=m.params[0]||1;let y;return(m.length<2||(y=m.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(m){if(!p(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(S.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(S.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(m){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],y=m.split(";");for(;y.length>1;){const E=y.shift(),A=y.shift();if(/^\d+$/.exec(E)){const k=parseInt(E);if(0<=k&&k<256)if(A==="?")b.push({type:0,index:k});else{const O=(0,u.parseColor)(A);O&&b.push({type:1,index:k,color:O})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._currentLinkId!==void 0&&this._finishHyperlink();const y=m.split(":");let E;const A=y.findIndex(k=>k.startsWith("id="));return A!==-1&&(E=y[A].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:E,uri:b}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(m,b){const y=m.split(";");for(let E=0;E=this._specialColors.length);++E,++b)if(y[E]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const A=(0,u.parseColor)(y[E]);A&&this._onColor.fire([{type:1,index:this._specialColors[b],color:A}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],y=m.split(";");for(let E=0;E=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new n.CellData;m.content=4194304|"E".charCodeAt(0),m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b(this._coreService.triggerDataEvent(`${o.C0.ESC}${A}${o.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[E.cursorStyle]-(E.cursorBlink?1:0)} q`:"P0$r")}}r.InputHandler=L},844:(D,r)=>{function h(o){for(const d of o)d.dispose();o.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const o of this._disposables)o.dispose();this._disposables.length=0}register(o){return this._disposables.push(o),o}unregister(o){const d=this._disposables.indexOf(o);d!==-1&&this._disposables.splice(d,1)}},r.toDisposable=function(o){return{dispose:o}},r.disposeArray=h,r.getDisposeArrayDisposable=function(o){return{dispose:()=>h(o)}}},1505:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(d,c,_){this._data[d]||(this._data[d]={}),this._data[d][c]=_}get(d,c){return this._data[d]?this._data[d][c]:void 0}clear(){this._data={}}}r.TwoKeyMap=h,r.FourKeyMap=class{constructor(){this._data=new h}set(o,d,c,_,l){this._data.get(o,d)||this._data.set(o,d,new h),this._data.get(o,d).set(c,_,l)}get(o,d,c,_){var l;return(l=this._data.get(o,d))===null||l===void 0?void 0:l.get(c,_)}clear(){this._data.clear()}}},6114:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.isSafari=r.isLegacyEdge=r.isFirefox=void 0;const h=typeof navigator=="undefined",o=h?"node":navigator.userAgent,d=h?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0},6106:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let h=0;r.SortedList=class{constructor(o){this._getKey=o,this._array=[]}clear(){this._array.length=0}insert(o){this._array.length!==0?(h=this._search(this._getKey(o),0,this._array.length-1),this._array.splice(h,0,o)):this._array.push(o)}delete(o){if(this._array.length===0)return!1;const d=this._getKey(o);if(d===void 0||(h=this._search(d,0,this._array.length-1),h===-1)||this._getKey(this._array[h])!==d)return!1;do if(this._array[h]===o)return this._array.splice(h,1),!0;while(++h=this._array.length)&&this._getKey(this._array[h])===o))do yield this._array[h];while(++h=this._array.length)&&this._getKey(this._array[h])===o))do d(this._array[h]);while(++ho)return this._search(o,d,_-1);if(l0&&this._getKey(this._array[_-1])===o;)_--;return _}}},8273:(D,r)=>{function h(o,d,c=0,_=o.length){if(c>=o.length)return o;c=(o.length+c)%o.length,_=_>=o.length?o.length:(o.length+_)%o.length;for(let l=c;l<_;++l)o[l]=d;return o}Object.defineProperty(r,"__esModule",{value:!0}),r.concat=r.fillFallback=r.fill=void 0,r.fill=function(o,d,c,_){return o.fill?o.fill(d,c,_):h(o,d,c,_)},r.fillFallback=h,r.concat=function(o,d){const c=new o.constructor(o.length+d.length);return c.set(o),c.set(d,o.length),c}},9282:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const o=h(643);r.updateWindowsModeWrappedState=function(d){const c=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),_=c==null?void 0:c.get(d.cols-1),l=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);l&&_&&(l.isWrapped=_[o.CHAR_DATA_CODE_INDEX]!==o.NULL_CELL_CODE&&_[o.CHAR_DATA_CODE_INDEX]!==o.WHITESPACE_CELL_CODE)}},3734:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new o}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new h;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=h;class o{constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}clone(){return new o(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=o},9092:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferStringIterator=r.Buffer=r.MAX_BUFFER_SIZE=void 0;const o=h(6349),d=h(8437),c=h(511),_=h(643),l=h(4634),a=h(4863),i=h(7116),e=h(3734);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,s,f){this._hasScrollback=t,this._optionsService=s,this._bufferService=f,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new o.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new e.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new e.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,s){return new d.BufferLine(this._bufferService.cols,this.getNullCell(t),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&tr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:s}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=d.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new o.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,s){const f=this.getNullCell(d.DEFAULT_ATTR_DATA),v=this._getCorrectBufferLength(s);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+u+1?(this.ybase--,u++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(t,f)));else for(let C=this._rows;C>s;C--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v0&&(this.lines.trimStart(C),this.ybase=Math.max(this.ybase-C,0),this.ydisp=Math.max(this.ydisp-C,0),this.savedY=Math.max(this.savedY-C,0)),this.lines.maxLength=v}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,s-1),u&&(this.y+=u),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(t,s),this._cols>t))for(let u=0;uthis._cols?this._reflowLarger(t,s):this._reflowSmaller(t,s))}_reflowLarger(t,s){const f=(0,l.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(f.length>0){const v=(0,l.reflowLargerCreateNewLayout)(this.lines,f);(0,l.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(t,s,v.countRemoved)}}_reflowLargerAdjustViewport(t,s,f){const v=this.getNullCell(d.DEFAULT_ATTR_DATA);let u=f;for(;u-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;C--){let g=this.lines.get(C);if(!g||!g.isWrapped&&g.getTrimmedLength()<=t)continue;const p=[g];for(;g.isWrapped&&C>0;)g=this.lines.get(--C),p.unshift(g);const S=this.ybase+this.y;if(S>=C&&S0&&(v.push({start:C+p.length+u,newLines:y}),u+=y.length),p.push(...y);let E=w.length-1,A=w[E];A===0&&(E--,A=w[E]);let k=p.length-m-1,O=L;for(;k>=0;){const H=Math.min(O,A);if(p[E]===void 0)break;if(p[E].copyCellsFrom(p[k],O-H,A-H,H,!0),A-=H,A===0&&(E--,A=w[E]),O-=H,O===0){k--;const W=Math.max(k,0);O=(0,l.getWrappedLineTrimmedLength)(p,W,this._cols)}}for(let H=0;H0;)this.ybase===0?this.y0){const C=[],g=[];for(let E=0;E=0;E--)if(w&&w.start>S+m){for(let A=w.newLines.length-1;A>=0;A--)this.lines.set(E--,w.newLines[A]);E++,C.push({index:S+1,amount:w.newLines.length}),m+=w.newLines.length,w=v[++L]}else this.lines.set(E,g[S--]);let b=0;for(let E=C.length-1;E>=0;E--)C[E].index+=b,this.lines.onInsertEmitter.fire(C[E]),b+=C[E].amount;const y=Math.max(0,p+u-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}stringIndexToBufferIndex(t,s,f=!1){for(;s;){const v=this.lines.get(t);if(!v)return[-1,-1];const u=f?v.getTrimmedLength():v.length;for(let C=0;C0&&this.lines.get(s).isWrapped;)s--;for(;f+10;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let s=0;s{s.line-=f,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(f=>{s.line>=f.index&&(s.line+=f.amount)})),s.register(this.lines.onDelete(f=>{s.line>=f.index&&s.linef.index&&(s.line-=f.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}iterator(t,s,f,v,u){return new n(this,t,s,f,v,u)}};class n{constructor(s,f,v=0,u=s.lines.length,C=0,g=0){this._buffer=s,this._trimRight=f,this._startIndex=v,this._endIndex=u,this._startOverscan=C,this._endOverscan=g,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._currentthis._endIndex+this._endOverscan&&(s.last=this._endIndex+this._endOverscan),s.first=Math.max(s.first,0),s.last=Math.min(s.last,this._buffer.lines.length);let f="";for(let v=s.first;v<=s.last;++v)f+=this._buffer.translateBufferLineToString(v,this._trimRight);return this._current=s.last+1,{range:s,content:f}}}r.BufferStringIterator=n},8437:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const o=h(482),d=h(643),c=h(511),_=h(3734);r.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);const l={startIndex:0};class a{constructor(e,n,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=n||c.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let f=0;f>22,2097152&n?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,n){this._data[3*e+1]=n[d.CHAR_DATA_ATTR_INDEX],n[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=n[1],this._data[3*e+0]=2097152|e|n[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=n[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const n=this._data[3*e+0];return 2097152&n?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&n}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const n=this._data[3*e+0];return 2097152&n?this._combined[e]:2097151&n?(0,o.stringFromCodePoint)(2097151&n):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,n){return l.startIndex=3*e,n.content=this._data[l.startIndex+0],n.fg=this._data[l.startIndex+1],n.bg=this._data[l.startIndex+2],2097152&n.content&&(n.combinedData=this._combined[e]),268435456&n.bg&&(n.extended=this._extendedAttrs[e]),n}setCell(e,n){2097152&n.content&&(this._combined[e]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[e]=n.extended),this._data[3*e+0]=n.content,this._data[3*e+1]=n.fg,this._data[3*e+2]=n.bg}setCellFromCodePoint(e,n,t,s,f,v){268435456&f&&(this._extendedAttrs[e]=v),this._data[3*e+0]=n|t<<22,this._data[3*e+1]=s,this._data[3*e+2]=f}addCodepointToCell(e,n){let t=this._data[3*e+0];2097152&t?this._combined[e]+=(0,o.stringFromCodePoint)(n):(2097151&t?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&t)+(0,o.stringFromCodePoint)(n),t&=-2097152,t|=2097152):t=n|4194304,this._data[3*e+0]=t)}insertCells(e,n,t,s){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new _.ExtendedAttrs),n=0;--v)this.setCell(e+n+v,this.loadCell(e+v,f));for(let v=0;vthis.length){const t=new Uint32Array(3*e);this.length&&(3*e=e&&delete this._combined[v]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}}fill(e,n=!1){if(n)for(let t=0;t=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,n,t,s,f){const v=e._data;if(f)for(let C=s-1;C>=0;C--){for(let g=0;g<3;g++)this._data[3*(t+C)+g]=v[3*(n+C)+g];268435456&v[3*(n+C)+2]&&(this._extendedAttrs[t+C]=e._extendedAttrs[n+C])}else for(let C=0;C=n&&(this._combined[g-n+t]=e._combined[g])}}translateToString(e=!1,n=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let s="";for(;n>22||1}return s}}r.BufferLine=a},4841:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(h,o){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return o*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(D,r)=>{function h(o,d,c){if(d===o.length-1)return o[d].getTrimmedLength();const _=!o[d].hasContent(c-1)&&o[d].getWidth(c-1)===1,l=o[d+1].getWidth(0)===2;return _&&l?c-1:c}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(o,d,c,_,l){const a=[];for(let i=0;i=i&&_0&&(g>s||t[g].getTrimmedLength()===0);g--)C++;C>0&&(a.push(i+t.length-C),a.push(C)),i+=t.length-1}return a},r.reflowLargerCreateNewLayout=function(o,d){const c=[];let _=0,l=d[_],a=0;for(let i=0;ih(o,t,d)).reduce((n,t)=>n+t);let a=0,i=0,e=0;for(;en&&(a-=n,i++);const t=o[i].getWidth(a-1)===2;t&&a--;const s=t?c-1:c;_.push(s),e+=s}return _},r.getWrappedLineTrimmedLength=h},5295:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const o=h(9092),d=h(8460),c=h(844);class _ extends c.Disposable{constructor(a,i){super(),this._optionsService=a,this._bufferService=i,this._onBufferActivate=this.register(new d.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(a){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(a),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(a,i){this._normal.resize(a,i),this._alt.resize(a,i)}setupTabStops(a){this._normal.setupTabStops(a),this._alt.setupTabStops(a)}}r.BufferSet=_},511:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const o=h(482),d=h(643),c=h(3734);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(a){const i=new _;return i.setFromCharData(a),i}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,o.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(a){this.fg=a[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let i=!1;if(a[d.CHAR_DATA_CHAR_INDEX].length>2)i=!0;else if(a[d.CHAR_DATA_CHAR_INDEX].length===2){const e=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const n=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(e-55296)+n-56320+65536|a[d.CHAR_DATA_WIDTH_INDEX]<<22:i=!0}else i=!0}else this.content=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[d.CHAR_DATA_WIDTH_INDEX]<<22;i&&(this.combinedData=a[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=_},643:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=256,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const o=h(8460),d=h(844);class c extends d.Disposable{constructor(l){super(),this.line=l,this._id=c._nextId++,this.isDisposed=!1,this._onDispose=new o.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}r.Marker=c,c._nextId=1},7116:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},r.CHARSETS.A={"#":"\xA3"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},r.CHARSETS.C=r.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},r.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},r.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},r.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},r.CHARSETS.E=r.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},r.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},r.CHARSETS.H=r.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(D,r)=>{var h,o;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT="	",d.LF=`
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL="\x7F"}(h=r.C0||(r.C0={})),(o=r.C1||(r.C1={})).PAD="\x80",o.HOP="\x81",o.BPH="\x82",o.NBH="\x83",o.IND="\x84",o.NEL="\x85",o.SSA="\x86",o.ESA="\x87",o.HTS="\x88",o.HTJ="\x89",o.VTS="\x8A",o.PLD="\x8B",o.PLU="\x8C",o.RI="\x8D",o.SS2="\x8E",o.SS3="\x8F",o.DCS="\x90",o.PU1="\x91",o.PU2="\x92",o.STS="\x93",o.CCH="\x94",o.MW="\x95",o.SPA="\x96",o.EPA="\x97",o.SOS="\x98",o.SGCI="\x99",o.SCI="\x9A",o.CSI="\x9B",o.ST="\x9C",o.OSC="\x9D",o.PM="\x9E",o.APC="\x9F",(r.C1_ESCAPED||(r.C1_ESCAPED={})).ST=`${h.ESC}\\`},7399:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const o=h(2584),d={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(c,_,l,a){const i={type:0,cancel:!1,key:void 0},e=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?i.key=_?o.C0.ESC+"OA":o.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?i.key=_?o.C0.ESC+"OD":o.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?i.key=_?o.C0.ESC+"OC":o.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(i.key=_?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 8:if(c.altKey){i.key=o.C0.ESC+o.C0.DEL;break}i.key=o.C0.DEL;break;case 9:if(c.shiftKey){i.key=o.C0.ESC+"[Z";break}i.key=o.C0.HT,i.cancel=!0;break;case 13:i.key=c.altKey?o.C0.ESC+o.C0.CR:o.C0.CR,i.cancel=!0;break;case 27:i.key=o.C0.ESC,c.altKey&&(i.key=o.C0.ESC+o.C0.ESC),i.cancel=!0;break;case 37:if(c.metaKey)break;e?(i.key=o.C0.ESC+"[1;"+(e+1)+"D",i.key===o.C0.ESC+"[1;3D"&&(i.key=o.C0.ESC+(l?"b":"[1;5D"))):i.key=_?o.C0.ESC+"OD":o.C0.ESC+"[D";break;case 39:if(c.metaKey)break;e?(i.key=o.C0.ESC+"[1;"+(e+1)+"C",i.key===o.C0.ESC+"[1;3C"&&(i.key=o.C0.ESC+(l?"f":"[1;5C"))):i.key=_?o.C0.ESC+"OC":o.C0.ESC+"[C";break;case 38:if(c.metaKey)break;e?(i.key=o.C0.ESC+"[1;"+(e+1)+"A",l||i.key!==o.C0.ESC+"[1;3A"||(i.key=o.C0.ESC+"[1;5A")):i.key=_?o.C0.ESC+"OA":o.C0.ESC+"[A";break;case 40:if(c.metaKey)break;e?(i.key=o.C0.ESC+"[1;"+(e+1)+"B",l||i.key!==o.C0.ESC+"[1;3B"||(i.key=o.C0.ESC+"[1;5B")):i.key=_?o.C0.ESC+"OB":o.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(i.key=o.C0.ESC+"[2~");break;case 46:i.key=e?o.C0.ESC+"[3;"+(e+1)+"~":o.C0.ESC+"[3~";break;case 36:i.key=e?o.C0.ESC+"[1;"+(e+1)+"H":_?o.C0.ESC+"OH":o.C0.ESC+"[H";break;case 35:i.key=e?o.C0.ESC+"[1;"+(e+1)+"F":_?o.C0.ESC+"OF":o.C0.ESC+"[F";break;case 33:c.shiftKey?i.type=2:c.ctrlKey?i.key=o.C0.ESC+"[5;"+(e+1)+"~":i.key=o.C0.ESC+"[5~";break;case 34:c.shiftKey?i.type=3:c.ctrlKey?i.key=o.C0.ESC+"[6;"+(e+1)+"~":i.key=o.C0.ESC+"[6~";break;case 112:i.key=e?o.C0.ESC+"[1;"+(e+1)+"P":o.C0.ESC+"OP";break;case 113:i.key=e?o.C0.ESC+"[1;"+(e+1)+"Q":o.C0.ESC+"OQ";break;case 114:i.key=e?o.C0.ESC+"[1;"+(e+1)+"R":o.C0.ESC+"OR";break;case 115:i.key=e?o.C0.ESC+"[1;"+(e+1)+"S":o.C0.ESC+"OS";break;case 116:i.key=e?o.C0.ESC+"[15;"+(e+1)+"~":o.C0.ESC+"[15~";break;case 117:i.key=e?o.C0.ESC+"[17;"+(e+1)+"~":o.C0.ESC+"[17~";break;case 118:i.key=e?o.C0.ESC+"[18;"+(e+1)+"~":o.C0.ESC+"[18~";break;case 119:i.key=e?o.C0.ESC+"[19;"+(e+1)+"~":o.C0.ESC+"[19~";break;case 120:i.key=e?o.C0.ESC+"[20;"+(e+1)+"~":o.C0.ESC+"[20~";break;case 121:i.key=e?o.C0.ESC+"[21;"+(e+1)+"~":o.C0.ESC+"[21~";break;case 122:i.key=e?o.C0.ESC+"[23;"+(e+1)+"~":o.C0.ESC+"[23~";break;case 123:i.key=e?o.C0.ESC+"[24;"+(e+1)+"~":o.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(l&&!a||!c.altKey||c.metaKey)!l||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?i.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(i.key=o.C0.US),c.key==="@"&&(i.key=o.C0.NUL)):c.keyCode===65&&(i.type=1);else{const n=d[c.keyCode],t=n==null?void 0:n[c.shiftKey?1:0];if(t)i.key=o.C0.ESC+t;else if(c.keyCode>=65&&c.keyCode<=90){const s=c.ctrlKey?c.keyCode-64:c.keyCode+32;let f=String.fromCharCode(s);c.shiftKey&&(f=f.toUpperCase()),i.key=o.C0.ESC+f}else if(c.key==="Dead"&&c.code.startsWith("Key")){let s=c.code.slice(3,4);c.shiftKey||(s=s.toLowerCase()),i.key=o.C0.ESC+s,i.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?i.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?i.key=o.C0.NUL:c.keyCode>=51&&c.keyCode<=55?i.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?i.key=o.C0.DEL:c.keyCode===219?i.key=o.C0.ESC:c.keyCode===220?i.key=o.C0.FS:c.keyCode===221&&(i.key=o.C0.GS)}return i}},482:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},r.utf32ToString=function(h,o=0,d=h.length){let c="";for(let _=o;_65535?(l-=65536,c+=String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):c+=String.fromCharCode(l)}return c},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,o){const d=h.length;if(!d)return 0;let c=0,_=0;if(this._interim){const l=h.charCodeAt(_++);56320<=l&&l<=57343?o[c++]=1024*(this._interim-55296)+l-56320+65536:(o[c++]=this._interim,o[c++]=l),this._interim=0}for(let l=_;l=d)return this._interim=a,c;const i=h.charCodeAt(l);56320<=i&&i<=57343?o[c++]=1024*(a-55296)+i-56320+65536:(o[c++]=a,o[c++]=i)}else a!==65279&&(o[c++]=a)}return c}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,o){const d=h.length;if(!d)return 0;let c,_,l,a,i=0,e=0,n=0;if(this.interim[0]){let f=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let u,C=0;for(;(u=63&this.interim[++C])&&C<4;)v<<=6,v|=u;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=g-C;for(;n=d)return 0;if(u=h[n++],(192&u)!=128){n--,f=!0;break}this.interim[C++]=u,v<<=6,v|=63&u}f||(g===2?v<128?n--:o[i++]=v:g===3?v<2048||v>=55296&&v<=57343||v===65279||(o[i++]=v):v<65536||v>1114111||(o[i++]=v)),this.interim.fill(0)}const t=d-4;let s=n;for(;s=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(e=(31&c)<<6|63&_,e<128){s--;continue}o[i++]=e}else if((240&c)==224){if(s>=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,i;if(l=h[s++],(192&l)!=128){s--;continue}if(e=(15&c)<<12|(63&_)<<6|63&l,e<2048||e>=55296&&e<=57343||e===65279)continue;o[i++]=e}else if((248&c)==240){if(s>=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,i;if(l=h[s++],(192&l)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=l,i;if(a=h[s++],(192&a)!=128){s--;continue}if(e=(7&c)<<18|(63&_)<<12|(63&l)<<6|63&a,e<65536||e>1114111)continue;o[i++]=e}}return i}}},225:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=h(8273),d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;r.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),(0,o.fill)(_,1),_[0]=0,(0,o.fill)(_,0,1,32),(0,o.fill)(_,0,127,160),(0,o.fill)(_,2,4352,4448),_[9001]=2,_[9002]=2,(0,o.fill)(_,2,11904,42192),_[12351]=1,(0,o.fill)(_,2,44032,55204),(0,o.fill)(_,2,63744,64256),(0,o.fill)(_,2,65040,65050),(0,o.fill)(_,2,65072,65136),(0,o.fill)(_,2,65280,65377),(0,o.fill)(_,2,65504,65511);for(let l=0;li[t][1])return!1;for(;t>=n;)if(e=n+t>>1,a>i[e][1])n=e+1;else{if(!(a=131072&&l<=196605||l>=196608&&l<=262141?2:1}}},5981:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const o=h(8460),d=typeof queueMicrotask=="undefined"?c=>{Promise.resolve().then(c)}:queueMicrotask;r.WriteBuffer=class{constructor(c){this._action=c,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new o.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(c,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=c.length,this._writeBuffer.push(c),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let l;for(this._isSyncWriting=!0;l=this._writeBuffer.shift();){this._action(l);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(c,_){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(()=>this._innerWrite())),this._pendingData+=c.length,this._writeBuffer.push(c),this._callbacks.push(_)}_innerWrite(c=0,_=!0){const l=c||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],i=this._action(a,_);if(i){const n=t=>Date.now()-l>=12?setTimeout(()=>this._innerWrite(0,t)):this._innerWrite(l,t);return void i.catch(t=>(d(()=>{throw t}),Promise.resolve(!1))).then(n)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-l>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const h=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,o=/^[\da-f]+$/;function d(c,_){const l=c.toString(16),a=l.length<2?"0"+l:l;switch(_){case 4:return l[0];case 8:return a;case 12:return(a+a).slice(0,3);default:return a+a}}r.parseColor=function(c){if(!c)return;let _=c.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const l=h.exec(_);if(l){const a=l[1]?15:l[4]?255:l[7]?4095:65535;return[Math.round(parseInt(l[1]||l[4]||l[7]||l[10],16)/a*255),Math.round(parseInt(l[2]||l[5]||l[8]||l[11],16)/a*255),Math.round(parseInt(l[3]||l[6]||l[9]||l[12],16)/a*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),o.exec(_)&&[3,6,9,12].includes(_.length))){const l=_.length/3,a=[0,0,0];for(let i=0;i<3;++i){const e=parseInt(_.slice(l*i,l*i+l),16);a[i]=l===1?e<<4:l===2?e:l===3?e>>4:e>>8}return a}},r.toRgbString=function(c,_=16){const[l,a,i]=c;return`rgb:${d(l,_)}/${d(a,_)}/${d(i,_)}`}},5770:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const o=h(482),d=h(8742),c=h(5770),_=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(a,i){this._handlers[a]===void 0&&(this._handlers[a]=[]);const e=this._handlers[a];return e.push(i),{dispose:()=>{const n=e.indexOf(i);n!==-1&&e.splice(n,1)}}}clearHandler(a){this._handlers[a]&&delete this._handlers[a]}setHandlerFallback(a){this._handlerFb=a}reset(){if(this._active.length)for(let a=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;a>=0;--a)this._active[a].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(a,i){if(this.reset(),this._ident=a,this._active=this._handlers[a]||_,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(i);else this._handlerFb(this._ident,"HOOK",i)}put(a,i,e){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(a,i,e);else this._handlerFb(this._ident,"PUT",(0,o.utf32ToString)(a,i,e))}unhook(a,i=!0){if(this._active.length){let e=!1,n=this._active.length-1,t=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,e=i,t=this._stack.fallThrough,this._stack.paused=!1),!t&&e===!1){for(;n>=0&&(e=this._active[n].unhook(a),e!==!0);n--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,e;n--}for(;n>=0;n--)if(e=this._active[n].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",a);this._active=_,this._ident=0}};const l=new d.Params;l.addParam(0),r.DcsHandler=class{constructor(a){this._handler=a,this._data="",this._params=l,this._hitLimit=!1}hook(a){this._params=a.length>1||a.params[0]?a.clone():l,this._data="",this._hitLimit=!1}put(a,i,e){this._hitLimit||(this._data+=(0,o.utf32ToString)(a,i,e),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(a){let i=!1;if(this._hitLimit)i=!1;else if(a&&(i=this._handler(this._data,this._params),i instanceof Promise))return i.then(e=>(this._params=l,this._data="",this._hitLimit=!1,e));return this._params=l,this._data="",this._hitLimit=!1,i}}},2015:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const o=h(844),d=h(8273),c=h(8742),_=h(6242),l=h(6351);class a{constructor(t){this.table=new Uint8Array(t)}setDefault(t,s){(0,d.fill)(this.table,t<<4|s)}add(t,s,f,v){this.table[s<<8|t]=f<<4|v}addMany(t,s,f,v){for(let u=0;up),s=(g,p)=>t.slice(g,p),f=s(32,127),v=s(0,24);v.push(25),v.push.apply(v,s(28,32));const u=s(0,14);let C;for(C in n.setDefault(1,0),n.addMany(f,0,2,0),u)n.addMany([24,26,153,154],C,3,0),n.addMany(s(128,144),C,3,0),n.addMany(s(144,152),C,3,0),n.add(156,C,0,0),n.add(27,C,11,1),n.add(157,C,4,8),n.addMany([152,158,159],C,0,7),n.add(155,C,11,3),n.add(144,C,11,9);return n.addMany(v,0,3,0),n.addMany(v,1,3,1),n.add(127,1,0,1),n.addMany(v,8,0,8),n.addMany(v,3,3,3),n.add(127,3,0,3),n.addMany(v,4,3,4),n.add(127,4,0,4),n.addMany(v,6,3,6),n.addMany(v,5,3,5),n.add(127,5,0,5),n.addMany(v,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(f,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(s(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(f,7,0,7),n.addMany(v,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(s(64,127),3,7,0),n.addMany(s(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(s(48,60),4,8,4),n.addMany(s(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(s(32,64),6,0,6),n.add(127,6,0,6),n.addMany(s(64,127),6,0,0),n.addMany(s(32,48),3,9,5),n.addMany(s(32,48),5,9,5),n.addMany(s(48,64),5,0,6),n.addMany(s(64,127),5,7,0),n.addMany(s(32,48),4,9,5),n.addMany(s(32,48),1,9,2),n.addMany(s(32,48),2,9,2),n.addMany(s(48,127),2,10,0),n.addMany(s(48,80),1,10,0),n.addMany(s(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(s(96,127),1,10,0),n.add(80,1,11,9),n.addMany(v,9,0,9),n.add(127,9,0,9),n.addMany(s(28,32),9,0,9),n.addMany(s(32,48),9,9,12),n.addMany(s(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(v,11,0,11),n.addMany(s(32,128),11,0,11),n.addMany(s(28,32),11,0,11),n.addMany(v,10,0,10),n.add(127,10,0,10),n.addMany(s(28,32),10,0,10),n.addMany(s(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(s(32,48),10,9,12),n.addMany(v,12,0,12),n.add(127,12,0,12),n.addMany(s(28,32),12,0,12),n.addMany(s(32,48),12,9,12),n.addMany(s(48,64),12,0,11),n.addMany(s(64,127),12,12,13),n.addMany(s(64,127),10,12,13),n.addMany(s(64,127),9,12,13),n.addMany(v,13,13,13),n.addMany(f,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(i,0,2,0),n.add(i,8,5,8),n.add(i,6,0,6),n.add(i,11,0,11),n.add(i,13,13,13),n}();class e extends o.Disposable{constructor(t=r.VT500_TRANSITION_TABLE){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new c.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(s,f,v)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,f)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new _.OscParser,this._dcsParser=new l.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(t,s=[64,126]){let f=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=t.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let u=0;uC||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=C}}if(t.final.length!==1)throw new Error("final must be a single byte");const v=t.final.charCodeAt(0);if(s[0]>v||v>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return f<<=8,f|=v,f}identToString(t){const s=[];for(;t;)s.push(String.fromCharCode(255&t)),t>>=8;return s.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,s){const f=this._identifier(t,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const v=this._escHandlers[f];return v.push(s),{dispose:()=>{const u=v.indexOf(s);u!==-1&&v.splice(u,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,s){this._executeHandlers[t.charCodeAt(0)]=s}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,s){const f=this._identifier(t);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const v=this._csiHandlers[f];return v.push(s),{dispose:()=>{const u=v.indexOf(s);u!==-1&&v.splice(u,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,s){return this._dcsParser.registerHandler(this._identifier(t),s)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,s){return this._oscParser.registerHandler(t,s)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(t,s,f,v,u){this._parseStack.state=t,this._parseStack.handlers=s,this._parseStack.handlerPos=f,this._parseStack.transition=v,this._parseStack.chunkPos=u}parse(t,s,f){let v,u=0,C=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&S>-1){for(;S>=0&&(v=p[S](this._params),v!==!0);S--)if(v instanceof Promise)return this._parseStack.handlerPos=S,v}this._parseStack.handlers=[];break;case 4:if(f===!1&&S>-1){for(;S>=0&&(v=p[S](),v!==!0);S--)if(v instanceof Promise)return this._parseStack.handlerPos=S,v}this._parseStack.handlers=[];break;case 6:if(u=t[this._parseStack.chunkPos],v=this._dcsParser.unhook(u!==24&&u!==26,f),v)return v;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(u=t[this._parseStack.chunkPos],v=this._oscParser.end(u!==24&&u!==26,f),v)return v;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let p=g;p>4){case 2:for(let b=p+1;;++b){if(b>=s||(u=t[b])<32||u>126&&u=s||(u=t[b])<32||u>126&&u=s||(u=t[b])<32||u>126&&u=s||(u=t[b])<32||u>126&&u=0&&(v=S[L](this._params),v!==!0);L--)if(v instanceof Promise)return this._preserveStack(3,S,L,C,p),v;L<0&&this._csiHandlerFb(this._collect<<8|u,this._params),this.precedingCodepoint=0;break;case 8:do switch(u){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(u-48)}while(++p47&&u<60);p--;break;case 9:this._collect<<=8,this._collect|=u;break;case 10:const w=this._escHandlers[this._collect<<8|u];let m=w?w.length-1:-1;for(;m>=0&&(v=w[m](),v!==!0);m--)if(v instanceof Promise)return this._preserveStack(4,w,m,C,p),v;m<0&&this._escHandlerFb(this._collect<<8|u),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|u,this._params);break;case 13:for(let b=p+1;;++b)if(b>=s||(u=t[b])===24||u===26||u===27||u>127&&u=s||(u=t[b])<32||u>127&&u{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const o=h(5770),d=h(482),c=[];r.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,l){this._handlers[_]===void 0&&(this._handlers[_]=[]);const a=this._handlers[_];return a.push(l),{dispose:()=>{const i=a.indexOf(l);i!==-1&&a.splice(i,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,l,a){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(_,l,a);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(_,l,a))}start(){this.reset(),this._state=1}put(_,l,a){if(this._state!==3){if(this._state===1)for(;l0&&this._put(_,l,a)}}end(_,l=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let a=!1,i=this._active.length-1,e=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,a=l,e=this._stack.fallThrough,this._stack.paused=!1),!e&&a===!1){for(;i>=0&&(a=this._active[i].end(_),a!==!0);i--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,a;i--}for(;i>=0;i--)if(a=this._active[i].end(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,a}else this._handlerFb(this._id,"END",_);this._active=c,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,l,a){this._hitLimit||(this._data+=(0,d.utf32ToString)(_,l,a),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let l=!1;if(this._hitLimit)l=!1;else if(_&&(l=this._handler(this._data),l instanceof Promise))return l.then(a=>(this._data="",this._hitLimit=!1,a));return this._data="",this._hitLimit=!1,l}}},8742:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const h=2147483647;class o{constructor(c=32,_=32){if(this.maxLength=c,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(c){const _=new o;if(!c.length)return _;for(let l=Array.isArray(c[0])?1:0;l>8,a=255&this._subParamsIdx[_];a-l>0&&c.push(Array.prototype.slice.call(this._subParams,l,a))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>h?h:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>h?h:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const _=this._subParamsIdx[c]>>8,l=255&this._subParamsIdx[c];return l-_>0?this._subParams.subarray(_,l):null}getSubParamsAll(){const c={};for(let _=0;_>8,a=255&this._subParamsIdx[_];a-l>0&&(c[_]=this._subParams.slice(l,a))}return c}addDigit(c){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const l=this._digitIsSub?this._subParams:this.params,a=l[_-1];l[_-1]=~a?Math.min(10*a+c,h):c}}r.Params=o},5741:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,o){const d={instance:o,dispose:o.dispose,isDisposed:!1};this._addons.push(d),o.dispose=()=>this._wrappedAddonDispose(d),o.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let o=-1;for(let d=0;d{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const o=h(3785),d=h(511);r.BufferApiView=class{constructor(c,_){this._buffer=c,this.type=_}init(c){return this._buffer=c,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(c){const _=this._buffer.lines.get(c);if(_)return new o.BufferLineApiView(_)}getNullCell(){return new d.CellData}}},3785:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const o=h(511);r.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,c){if(!(d<0||d>=this._line.length))return c?(this._line.loadCell(d,c),c):this._line.loadCell(d,new o.CellData)}translateToString(d,c,_){return this._line.translateToString(d,c,_)}}},8285:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const o=h(8771),d=h(8460);r.BufferNamespaceApi=class{constructor(c){this._core=c,this._onBufferChange=new d.EventEmitter,this._normal=new o.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new o.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get onBufferChange(){return this._onBufferChange.event}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,o){return this._core.registerCsiHandler(h,d=>o(d.toArray()))}addCsiHandler(h,o){return this.registerCsiHandler(h,o)}registerDcsHandler(h,o){return this._core.registerDcsHandler(h,(d,c)=>o(d,c.toArray()))}addDcsHandler(h,o){return this.registerDcsHandler(h,o)}registerEscHandler(h,o){return this._core.registerEscHandler(h,o)}addEscHandler(h,o){return this.registerEscHandler(h,o)}registerOscHandler(h,o){return this._core.registerOscHandler(h,o)}addOscHandler(h,o){return this.registerOscHandler(h,o)}}},7090:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(D,r,h){var o=this&&this.__decorate||function(e,n,t,s){var f,v=arguments.length,u=v<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,n,t,s);else for(var C=e.length-1;C>=0;C--)(f=e[C])&&(u=(v<3?f(u):v>3?f(n,t,u):f(n,t))||u);return v>3&&u&&Object.defineProperty(n,t,u),u},d=this&&this.__param||function(e,n){return function(t,s){n(t,s,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const c=h(2585),_=h(5295),l=h(8460),a=h(844);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let i=class extends a.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new l.EventEmitter,this._onScroll=new l.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=new _.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,n){this.cols=e,this.rows=n,this.buffers.resize(e,n),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,n=!1){const t=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=t.getBlankLine(e,n),this._cachedBlankLine=s),s.isWrapped=n;const f=t.ybase+t.scrollTop,v=t.ybase+t.scrollBottom;if(t.scrollTop===0){const u=t.lines.isFull;v===t.lines.length-1?u?t.lines.recycle().copyFrom(s):t.lines.push(s.clone()):t.lines.splice(v+1,0,s.clone()),u?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const u=v-f+1;t.lines.shiftElements(f+1,u-1,-1),t.lines.set(v,s.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(e,n,t){const s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const f=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),f!==s.ydisp&&(n||this._onScroll.fire(s.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const n=e-this.buffer.ydisp;n!==0&&this.scrollLines(n)}};i=o([d(0,c.IOptionsService)],i),r.BufferService=i},7994:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,o){this._charsets[h]=o,this.glevel===h&&(this.charset=o)}}},1753:function(D,r,h){var o=this&&this.__decorate||function(t,s,f,v){var u,C=arguments.length,g=C<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,s,f,v);else for(var p=t.length-1;p>=0;p--)(u=t[p])&&(g=(C<3?u(g):C>3?u(s,f,g):u(s,f))||g);return C>3&&g&&Object.defineProperty(s,f,g),g},d=this&&this.__param||function(t,s){return function(f,v){s(f,v,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const c=h(2585),_=h(8460),l={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function a(t,s){let f=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(f|=64,f|=t.action):(f|=3&t.button,4&t.button&&(f|=64),8&t.button&&(f|=128),t.action===32?f|=32:t.action!==0||s||(f|=3)),f}const i=String.fromCharCode,e={DEFAULT:t=>{const s=[a(t,!1)+32,t.col+32,t.row+32];return s[0]>255||s[1]>255||s[2]>255?"":`\x1B[M${i(s[0])}${i(s[1])}${i(s[2])}`},SGR:t=>{const s=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${a(t,!0)};${t.col};${t.row}${s}`},SGR_PIXELS:t=>{const s=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${a(t,!0)};${t.x};${t.y}${s}`}};let n=class{constructor(t,s){this._bufferService=t,this._coreService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new _.EventEmitter,this._lastEvent=null;for(const f of Object.keys(l))this.addProtocol(f,l[f]);for(const f of Object.keys(e))this.addEncoding(f,e[f]);this.reset()}addProtocol(t,s){this._protocols[t]=s}addEncoding(t,s){this._encodings[t]=s}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const s=this._encodings[this._activeEncoding](t);return s&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(s):this._coreService.triggerDataEvent(s,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,s,f){if(f){if(t.x!==s.x||t.y!==s.y)return!1}else if(t.col!==s.col||t.row!==s.row)return!1;return t.button===s.button&&t.action===s.action&&t.ctrl===s.ctrl&&t.alt===s.alt&&t.shift===s.shift}};n=o([d(0,c.IBufferService),d(1,c.ICoreService)],n),r.CoreMouseService=n},6975:function(D,r,h){var o=this&&this.__decorate||function(t,s,f,v){var u,C=arguments.length,g=C<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,s,f,v);else for(var p=t.length-1;p>=0;p--)(u=t[p])&&(g=(C<3?u(g):C>3?u(s,f,g):u(s,f))||g);return C>3&&g&&Object.defineProperty(s,f,g),g},d=this&&this.__param||function(t,s){return function(f,v){s(f,v,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const c=h(2585),_=h(8460),l=h(1439),a=h(844),i=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let n=class extends a.Disposable{constructor(t,s,f,v){super(),this._bufferService=s,this._logService=f,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this._onUserInput=this.register(new _.EventEmitter),this._onBinary=this.register(new _.EventEmitter),this._scrollToBottom=t,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,l.clone)(i),this.decPrivateModes=(0,l.clone)(e)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,l.clone)(i),this.decPrivateModes=(0,l.clone)(e)}triggerDataEvent(t,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const f=this._bufferService.buffer;f.ybase!==f.ydisp&&this._scrollToBottom(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,()=>t.split("").map(v=>v.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,()=>t.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(t))}};n=o([d(1,c.IBufferService),d(2,c.ILogService),d(3,c.IOptionsService)],n),r.CoreService=n},9074:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const o=h(8055),d=h(8460),c=h(844),_=h(6106),l={xmin:0,xmax:0};class a extends c.Disposable{constructor(){super(...arguments),this._decorations=new _.SortedList(n=>n==null?void 0:n.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this._onDecorationRemoved=this.register(new d.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(n){if(n.marker.isDisposed)return;const t=new i(n);if(t){const s=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const n of this._decorations.values())n.dispose();this._decorations.clear()}*getDecorationsAtCell(n,t,s){var f,v,u;let C=0,g=0;for(const p of this._decorations.getKeyIterator(t))C=(f=p.options.x)!==null&&f!==void 0?f:0,g=C+((v=p.options.width)!==null&&v!==void 0?v:1),n>=C&&n{var u,C,g;l.xmin=(u=v.options.x)!==null&&u!==void 0?u:0,l.xmax=l.xmin+((C=v.options.width)!==null&&C!==void 0?C:1),n>=l.xmin&&n=0;f--)(n=l[f])&&(s=(t<3?n(s):t>3?n(a,i,s):n(a,i))||s);return t>3&&s&&Object.defineProperty(a,i,s),s},d=this&&this.__param||function(l,a){return function(i,e){a(i,e,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DirtyRowService=void 0;const c=h(2585);let _=class{constructor(l){this._bufferService=l,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(l){lthis._end&&(this._end=l)}markRangeDirty(l,a){if(l>a){const i=l;l=a,a=i}lthis._end&&(this._end=a)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};_=o([d(0,c.IBufferService)],_),r.DirtyRowService=_},4348:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const o=h(2585),d=h(8343);class c{constructor(...l){this._entries=new Map;for(const[a,i]of l)this.set(a,i)}set(l,a){const i=this._entries.get(l);return this._entries.set(l,a),i}forEach(l){this._entries.forEach((a,i)=>l(i,a))}has(l){return this._entries.has(l)}get(l){return this._entries.get(l)}}r.ServiceCollection=c,r.InstantiationService=class{constructor(){this._services=new c,this._services.set(o.IInstantiationService,this)}setService(_,l){this._services.set(_,l)}getService(_){return this._services.get(_)}createInstance(_,...l){const a=(0,d.getServiceDependencies)(_).sort((n,t)=>n.index-t.index),i=[];for(const n of a){const t=this._services.get(n.id);if(!t)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${n.id}.`);i.push(t)}const e=a.length>0?a[0].index:l.length;if(l.length!==e)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${e+1} conflicts with ${l.length} static arguments`);return new _(...l,...i)}}},7866:function(D,r,h){var o=this&&this.__decorate||function(a,i,e,n){var t,s=arguments.length,f=s<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(a,i,e,n);else for(var v=a.length-1;v>=0;v--)(t=a[v])&&(f=(s<3?t(f):s>3?t(i,e,f):t(i,e))||f);return s>3&&f&&Object.defineProperty(i,e,f),f},d=this&&this.__param||function(a,i){return function(e,n){i(e,n,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.LogService=void 0;const c=h(2585),_={debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF};let l=class{constructor(a){this._optionsService=a,this.logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange(i=>{i==="logLevel"&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let i=0;i{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const o=h(8460),d=h(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const c=["normal","bold","100","200","300","400","500","600","700","800","900"];r.OptionsService=class{constructor(_){this._onOptionChange=new o.EventEmitter;const l=Object.assign({},r.DEFAULT_OPTIONS);for(const a in _)if(a in l)try{const i=_[a];l[a]=this._sanitizeAndValidateOption(a,i)}catch{}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){const _=a=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},l=(a,i)=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);i=this._sanitizeAndValidateOption(a,i),this.rawOptions[a]!==i&&(this.rawOptions[a]=i,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const i={get:_.bind(this,a),set:l.bind(this,a)};Object.defineProperty(this.options,a,i)}}_sanitizeAndValidateOption(_,l){switch(_){case"cursorStyle":if(l||(l=r.DEFAULT_OPTIONS[_]),!function(a){return a==="block"||a==="underline"||a==="bar"}(l))throw new Error(`"${l}" is not a valid value for ${_}`);break;case"wordSeparator":l||(l=r.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=c.includes(l)?l:r.DEFAULT_OPTIONS[_];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${_} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${l}`);case"rows":case"cols":if(!l&&l!==0)throw new Error(`${_} must be numeric, value: ${l}`)}return l}}},2660:function(D,r,h){var o=this&&this.__decorate||function(l,a,i,e){var n,t=arguments.length,s=t<3?a:e===null?e=Object.getOwnPropertyDescriptor(a,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(l,a,i,e);else for(var f=l.length-1;f>=0;f--)(n=l[f])&&(s=(t<3?n(s):t>3?n(a,i,s):n(a,i))||s);return t>3&&s&&Object.defineProperty(a,i,s),s},d=this&&this.__param||function(l,a){return function(i,e){a(i,e,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const c=h(2585);let _=class{constructor(l){this._bufferService=l,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(l){const a=this._bufferService.buffer;if(l.id===void 0){const f=a.addMarker(a.ybase+a.y),v={data:l,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(v,f)),this._dataByLinkId.set(v.id,v),v.id}const i=l,e=this._getEntryIdKey(i),n=this._entriesWithId.get(e);if(n)return this.addLineToLink(n.id,a.ybase+a.y),n.id;const t=a.addMarker(a.ybase+a.y),s={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[t]};return t.onDispose(()=>this._removeMarkerFromLink(s,t)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(l,a){const i=this._dataByLinkId.get(l);if(i&&i.lines.every(e=>e.line!==a)){const e=this._bufferService.buffer.addMarker(a);i.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(i,e))}}getLinkData(l){var a;return(a=this._dataByLinkId.get(l))===null||a===void 0?void 0:a.data}_getEntryIdKey(l){return`${l.id};;${l.uri}`}_removeMarkerFromLink(l,a){const i=l.lines.indexOf(a);i!==-1&&(l.lines.splice(i,1),l.lines.length===0&&(l.data.id!==void 0&&this._entriesWithId.delete(l.key),this._dataByLinkId.delete(l.id)))}};_=o([d(0,c.IBufferService)],_),r.OscLinkService=_},8343:(D,r)=>{function h(o,d,c){d.di$target===d?d.di$dependencies.push({id:o,index:c}):(d.di$dependencies=[{id:o,index:c}],d.di$target=d)}Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0,r.serviceRegistry=new Map,r.getServiceDependencies=function(o){return o.di$dependencies||[]},r.createDecorator=function(o){if(r.serviceRegistry.has(o))return r.serviceRegistry.get(o);const d=function(c,_,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");h(d,c,l)};return d.toString=()=>o,r.serviceRegistry.set(o,d),d}},2585:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.IDirtyRowService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const o=h(8343);var d;r.IBufferService=(0,o.createDecorator)("BufferService"),r.ICoreMouseService=(0,o.createDecorator)("CoreMouseService"),r.ICoreService=(0,o.createDecorator)("CoreService"),r.ICharsetService=(0,o.createDecorator)("CharsetService"),r.IDirtyRowService=(0,o.createDecorator)("DirtyRowService"),r.IInstantiationService=(0,o.createDecorator)("InstantiationService"),(d=r.LogLevelEnum||(r.LogLevelEnum={}))[d.DEBUG=0]="DEBUG",d[d.INFO=1]="INFO",d[d.WARN=2]="WARN",d[d.ERROR=3]="ERROR",d[d.OFF=4]="OFF",r.ILogService=(0,o.createDecorator)("LogService"),r.IOptionsService=(0,o.createDecorator)("OptionsService"),r.IOscLinkService=(0,o.createDecorator)("OscLinkService"),r.IUnicodeService=(0,o.createDecorator)("UnicodeService"),r.IDecorationService=(0,o.createDecorator)("DecorationService")},1480:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const o=h(8460),d=h(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new o.EventEmitter;const c=new d.UnicodeV6;this.register(c),this._active=c.version,this._activeProvider=c}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(c){if(!this._providers[c])throw new Error(`unknown Unicode version "${c}"`);this._active=c,this._activeProvider=this._providers[c],this._onChange.fire(c)}register(c){this._providers[c.version]=c}wcwidth(c){return this._activeProvider.wcwidth(c)}getStringCellWidth(c){let _=0;const l=c.length;for(let a=0;a=l)return _+this.wcwidth(i);const e=c.charCodeAt(a);56320<=e&&e<=57343?i=1024*(i-55296)+e-56320+65536:_+=this.wcwidth(e)}_+=this.wcwidth(i)}return _}}}},Y={};function j(D){var r=Y[D];if(r!==void 0)return r.exports;var h=Y[D]={exports:{}};return ee[D].call(h.exports,h,h.exports,j),h.exports}var se={};return(()=>{var D=se;Object.defineProperty(D,"__esModule",{value:!0}),D.Terminal=void 0;const r=j(3236),h=j(9042),o=j(7975),d=j(7090),c=j(5741),_=j(8285),l=["cols","rows"];D.Terminal=class{constructor(a){this._core=new r.Terminal(a),this._addonManager=new c.AddonManager,this._publicOptions=Object.assign({},this._core.options);const i=n=>this._core.options[n],e=(n,t)=>{this._checkReadonlyOptions(n),this._core.options[n]=t};for(const n in this._core.options){const t={get:i.bind(this,n),set:e.bind(this,n)};Object.defineProperty(this._publicOptions,n,t)}}_checkReadonlyOptions(a){if(l.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new o.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new _.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const i in a)this._publicOptions[i]=a[i]}blur(){this._core.blur()}focus(){this._core.focus()}resize(a,i){this._verifyIntegers(a,i),this._core.resize(a,i)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}registerLinkProvider(a){return this._checkProposedApi(),this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.addMarker(a)}registerDecoration(a){var i,e,n;return this._checkProposedApi(),this._verifyPositiveIntegers((i=a.x)!==null&&i!==void 0?i:0,(e=a.width)!==null&&e!==void 0?e:0,(n=a.height)!==null&&n!==void 0?n:0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,i,e){this._verifyIntegers(a,i,e),this._core.select(a,i,e)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,i){this._verifyIntegers(a,i),this._core.selectLines(a,i)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,i){this._core.write(a,i)}writeln(a,i){this._core.write(a),this._core.write(`\r
`,i)}paste(a){this._core.paste(a)}refresh(a,i){this._verifyIntegers(a,i),this._core.refresh(a,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){return this._addonManager.loadAddon(this,a)}static get strings(){return h}_verifyIntegers(...a){for(const i of a)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const i of a)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}})(),se})()})})(Se);var Ae={exports:{}};(function(Z,z){(function(ee,Y){Z.exports=Y()})(self,function(){return(()=>{var ee={};return(()=>{var Y=ee;Object.defineProperty(Y,"__esModule",{value:!0}),Y.FitAddon=void 0,Y.FitAddon=class{constructor(){}activate(j){this._terminal=j}dispose(){}fit(){const j=this.proposeDimensions();if(!j||!this._terminal||isNaN(j.cols)||isNaN(j.rows))return;const se=this._terminal._core;this._terminal.rows===j.rows&&this._terminal.cols===j.cols||(se._renderService.clear(),this._terminal.resize(j.cols,j.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const j=this._terminal._core;if(j._renderService.dimensions.actualCellWidth===0||j._renderService.dimensions.actualCellHeight===0)return;const se=this._terminal.options.scrollback===0?0:j.viewport.scrollBarWidth,D=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(D.getPropertyValue("height")),h=Math.max(0,parseInt(D.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),d=r-(parseInt(o.getPropertyValue("padding-top"))+parseInt(o.getPropertyValue("padding-bottom"))),c=h-(parseInt(o.getPropertyValue("padding-right"))+parseInt(o.getPropertyValue("padding-left")))-se;return{cols:Math.max(2,Math.floor(c/j._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(d/j._renderService.dimensions.actualCellHeight))}}}})(),ee})()})})(Ae);var De={exports:{}};(function(Z,z){(function(ee,Y){Z.exports=Y()})(self,function(){return(()=>{var ee={965:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const o=h(381),d=h(455),c=h(855),_=h(859),l=10,a=l*Float32Array.BYTES_PER_ELEMENT,i={i:0,glyph:void 0,leftCellPadding:0,clippedPixels:0};class e extends _.Disposable{constructor(t,s,f,v){super(),this._terminal=t,this._colors=s,this._gl=f,this._dimensions=v,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const u=this._gl;this._program=(0,o.throwIfFalsy)((0,o.createProgram)(u,`#version 300 es
layout (location = 0) in vec2 a_unitquad;
layout (location = 1) in vec2 a_cellpos;
layout (location = 2) in vec2 a_offset;
layout (location = 3) in vec2 a_size;
layout (location = 4) in vec2 a_texcoord;
layout (location = 5) in vec2 a_texsize;

uniform mat4 u_projection;
uniform vec2 u_resolution;

out vec2 v_texcoord;

void main() {
  vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
  gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
  v_texcoord = a_texcoord + a_unitquad * a_texsize;
}`,`#version 300 es
precision lowp float;

in vec2 v_texcoord;

uniform sampler2D u_texture;

out vec4 outColor;

void main() {
  outColor = texture(u_texture, v_texcoord);
}`)),this.register((0,_.toDisposable)(()=>u.deleteProgram(this._program))),this._projectionLocation=(0,o.throwIfFalsy)(u.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,o.throwIfFalsy)(u.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,o.throwIfFalsy)(u.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=u.createVertexArray(),u.bindVertexArray(this._vertexArrayObject);const C=new Float32Array([0,0,1,0,0,1,1,1]),g=u.createBuffer();this.register((0,_.toDisposable)(()=>u.deleteBuffer(g))),u.bindBuffer(u.ARRAY_BUFFER,g),u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const p=new Uint8Array([0,1,3,0,2,3]),S=u.createBuffer();this.register((0,_.toDisposable)(()=>u.deleteBuffer(S))),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,S),u.bufferData(u.ELEMENT_ARRAY_BUFFER,p,u.STATIC_DRAW),this._attributesBuffer=(0,o.throwIfFalsy)(u.createBuffer()),this.register((0,_.toDisposable)(()=>u.deleteBuffer(this._attributesBuffer))),u.bindBuffer(u.ARRAY_BUFFER,this._attributesBuffer),u.enableVertexAttribArray(2),u.vertexAttribPointer(2,2,u.FLOAT,!1,a,0),u.vertexAttribDivisor(2,1),u.enableVertexAttribArray(3),u.vertexAttribPointer(3,2,u.FLOAT,!1,a,2*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(3,1),u.enableVertexAttribArray(4),u.vertexAttribPointer(4,2,u.FLOAT,!1,a,4*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(4,1),u.enableVertexAttribArray(5),u.vertexAttribPointer(5,2,u.FLOAT,!1,a,6*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(5,1),u.enableVertexAttribArray(1),u.vertexAttribPointer(1,2,u.FLOAT,!1,a,8*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(1,1),this._atlasTexture=(0,o.throwIfFalsy)(u.createTexture()),this.register((0,_.toDisposable)(()=>u.deleteTexture(this._atlasTexture))),u.bindTexture(u.TEXTURE_2D,this._atlasTexture),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,1,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.enable(u.BLEND),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),this.onResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(t,s,f,v,u,C,g,p){this._updateCell(this._vertices.attributes,t,s,f,v,u,C,g,p)}_updateCell(t,s,f,v,u,C,g,p,S){i.i=(f*this._terminal.cols+s)*l,v!==c.NULL_CELL_CODE&&v!==void 0?this._atlas&&(p&&p.length>1?i.glyph=this._atlas.getRasterizedGlyphCombinedChar(p,u,C,g):i.glyph=this._atlas.getRasterizedGlyph(v,u,C,g),i.leftCellPadding=Math.floor((this._dimensions.scaledCellWidth-this._dimensions.scaledCharWidth)/2),u!==S&&i.glyph.offset.x>i.leftCellPadding?(i.clippedPixels=i.glyph.offset.x-i.leftCellPadding,t[i.i]=-(i.glyph.offset.x-i.clippedPixels)+this._dimensions.scaledCharLeft,t[i.i+1]=-i.glyph.offset.y+this._dimensions.scaledCharTop,t[i.i+2]=(i.glyph.size.x-i.clippedPixels)/this._dimensions.scaledCanvasWidth,t[i.i+3]=i.glyph.size.y/this._dimensions.scaledCanvasHeight,t[i.i+4]=i.glyph.texturePositionClipSpace.x+i.clippedPixels/this._atlas.cacheCanvas.width,t[i.i+5]=i.glyph.texturePositionClipSpace.y,t[i.i+6]=i.glyph.sizeClipSpace.x-i.clippedPixels/this._atlas.cacheCanvas.width,t[i.i+7]=i.glyph.sizeClipSpace.y):(t[i.i]=-i.glyph.offset.x+this._dimensions.scaledCharLeft,t[i.i+1]=-i.glyph.offset.y+this._dimensions.scaledCharTop,t[i.i+2]=i.glyph.size.x/this._dimensions.scaledCanvasWidth,t[i.i+3]=i.glyph.size.y/this._dimensions.scaledCanvasHeight,t[i.i+4]=i.glyph.texturePositionClipSpace.x,t[i.i+5]=i.glyph.texturePositionClipSpace.y,t[i.i+6]=i.glyph.sizeClipSpace.x,t[i.i+7]=i.glyph.sizeClipSpace.y)):(0,d.fill)(t,0,i.i,i.i+l-1-2)}clear(){const t=this._terminal,s=t.cols*t.rows*l;this._vertices.count!==s?this._vertices.attributes=new Float32Array(s):this._vertices.attributes.fill(0);for(let v=0;v{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const o=h(381),d=h(310),c=h(859),_=h(302),l=8*Float32Array.BYTES_PER_ELEMENT,a={rgba:0,isDefault:!1,x1:0,y1:0,r:0,g:0,b:0,a:0};class i extends c.Disposable{constructor(n,t,s,f){super(),this._terminal=n,this._colors=t,this._gl=s,this._dimensions=f,this._vertices={count:0,attributes:new Float32Array(160)};const v=this._gl;this._program=(0,o.throwIfFalsy)((0,o.createProgram)(v,`#version 300 es
layout (location = 0) in vec2 a_position;
layout (location = 1) in vec2 a_size;
layout (location = 2) in vec4 a_color;
layout (location = 3) in vec2 a_unitquad;

uniform mat4 u_projection;

out vec4 v_color;

void main() {
  vec2 zeroToOne = a_position + (a_unitquad * a_size);
  gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
  v_color = a_color;
}`,`#version 300 es
precision lowp float;

in vec4 v_color;

out vec4 outColor;

void main() {
  outColor = v_color;
}`)),this.register((0,c.toDisposable)(()=>v.deleteProgram(this._program))),this._projectionLocation=(0,o.throwIfFalsy)(v.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=v.createVertexArray(),v.bindVertexArray(this._vertexArrayObject);const u=new Float32Array([0,0,1,0,0,1,1,1]),C=v.createBuffer();this.register((0,c.toDisposable)(()=>v.deleteBuffer(C))),v.bindBuffer(v.ARRAY_BUFFER,C),v.bufferData(v.ARRAY_BUFFER,u,v.STATIC_DRAW),v.enableVertexAttribArray(3),v.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const g=new Uint8Array([0,1,3,0,2,3]),p=v.createBuffer();this.register((0,c.toDisposable)(()=>v.deleteBuffer(p))),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,p),v.bufferData(v.ELEMENT_ARRAY_BUFFER,g,v.STATIC_DRAW),this._attributesBuffer=(0,o.throwIfFalsy)(v.createBuffer()),this.register((0,c.toDisposable)(()=>v.deleteBuffer(this._attributesBuffer))),v.bindBuffer(v.ARRAY_BUFFER,this._attributesBuffer),v.enableVertexAttribArray(0),v.vertexAttribPointer(0,2,v.FLOAT,!1,l,0),v.vertexAttribDivisor(0,1),v.enableVertexAttribArray(1),v.vertexAttribPointer(1,2,v.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),v.vertexAttribDivisor(1,1),v.enableVertexAttribArray(2),v.vertexAttribPointer(2,4,v.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),v.vertexAttribDivisor(2,1),this._updateCachedColors()}render(){const n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,o.PROJECTION_MATRIX),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,this._vertices.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLES,6,n.UNSIGNED_BYTE,0,this._vertices.count)}onResize(){this._updateViewportRectangle()}setColors(){this._updateCachedColors(),this._updateViewportRectangle()}setDimensions(n){this._dimensions=n}_updateCachedColors(){this._bgFloat=this._colorToFloat32Array(this._colors.background)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.scaledCellWidth,this._terminal.rows*this._dimensions.scaledCellHeight,this._bgFloat)}updateBackgrounds(n){const t=this._terminal,s=this._vertices;let f,v,u,C,g,p,S,L,w,m,b,y=1;for(f=0;f>24&255)/255,a.g=(a.rgba>>16&255)/255,a.b=(a.rgba>>8&255)/255,a.a=!a.isDefault&&134217728&f?_.DIM_OPACITY:1,this._addRectangle(n.attributes,t,a.x1,a.y1,(u-v)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,a.r,a.g,a.b,a.a)}_addRectangle(n,t,s,f,v,u,C,g,p,S){n[t]=s/this._dimensions.scaledCanvasWidth,n[t+1]=f/this._dimensions.scaledCanvasHeight,n[t+2]=v/this._dimensions.scaledCanvasWidth,n[t+3]=u/this._dimensions.scaledCanvasHeight,n[t+4]=C,n[t+5]=g,n[t+6]=p,n[t+7]=S}_addRectangleFloat(n,t,s,f,v,u,C){n[t]=s/this._dimensions.scaledCanvasWidth,n[t+1]=f/this._dimensions.scaledCanvasHeight,n[t+2]=v/this._dimensions.scaledCanvasWidth,n[t+3]=u/this._dimensions.scaledCanvasHeight,n[t+4]=C[0],n[t+5]=C[1],n[t+6]=C[2],n[t+7]=C[3]}_colorToFloat32Array(n){return new Float32Array([(n.rgba>>24&255)/255,(n.rgba>>16&255)/255,(n.rgba>>8&255)/255,(255&n.rgba)/255])}}r.RectangleRenderer=i},310:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const o=h(455);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection={hasSelection:!1,columnSelectMode:!1,viewportStartRow:0,viewportEndRow:0,viewportCappedStartRow:0,viewportCappedEndRow:0,startCol:0,endCol:0}}resize(d,c){const _=d*c*r.RENDER_MODEL_INDICIES_PER_CELL;_!==this.cells.length&&(this.cells=new Uint32Array(_),this.lineLengths=new Uint32Array(c))}clear(){(0,o.fill)(this.cells,0,0),(0,o.fill)(this.lineLengths,0,0)}clearSelection(){this.selection.hasSelection=!1,this.selection.viewportStartRow=0,this.selection.viewportEndRow=0,this.selection.viewportCappedStartRow=0,this.selection.viewportCappedEndRow=0,this.selection.startCol=0,this.selection.endCol=0}}},666:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const o=h(965),d=h(733),c=h(461),_=h(713),l=h(742),a=h(310),i=h(859),e=h(855),n=h(476),t=h(345),s=h(782),f=h(820),v=h(147),u={fg:0,bg:0,hasFg:!1,hasBg:!1,isSelected:!1};class C extends i.Disposable{constructor(S,L,w,m,b,y,E){super(),this._terminal=S,this._colors=L,this._characterJoinerService=w,this._coreBrowserService=m,this._decorationService=y,this._model=new a.RenderModel,this._workCell=new s.CellData,this._workColors={fg:0,bg:0,ext:0},this._onChangeTextureAtlas=new t.EventEmitter,this._onRequestRedraw=new t.EventEmitter,this._onContextLoss=new t.EventEmitter,this._core=this._terminal._core,this._renderLayers=[new d.LinkRenderLayer(this._core.screenElement,2,this._colors,this._core,this._coreBrowserService),new c.CursorRenderLayer(S,this._core.screenElement,3,this._colors,this._onRequestRedraw,this._coreBrowserService,b)],this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._canvas=document.createElement("canvas");const A={antialias:!1,depth:!1,preserveDrawingBuffer:E};if(this._gl=this._canvas.getContext("webgl2",A),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextlost",k=>{k.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,this._onContextLoss.fire(k)},3e3)})),this.register((0,f.addDisposableDomListener)(this._canvas,"webglcontextrestored",k=>{clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,_.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,n.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(k,O)=>this._setCanvasDevicePixelDimensions(k,O))),this._core.screenElement.appendChild(this._canvas),this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement)}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onRequestRedraw(){return this._onRequestRedraw.event}get onContextLoss(){return this._onContextLoss.event}dispose(){var S;for(const L of this._renderLayers)L.dispose();(S=this._canvas.parentElement)===null||S===void 0||S.removeChild(this._canvas),(0,_.removeTerminalFromCache)(this._terminal),super.dispose()}get textureAtlas(){var S;return(S=this._charAtlas)===null||S===void 0?void 0:S.cacheCanvas}setColors(S){this._colors=S;for(const L of this._renderLayers)L.setColors(this._terminal,this._colors),L.reset(this._terminal);this._rectangleRenderer.setColors(),this._refreshCharAtlas(),this._clearModel(!0)}onDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.onResize(this._terminal.cols,this._terminal.rows))}onResize(S,L){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const w of this._renderLayers)w.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.scaledCanvasWidth,this._canvas.height=this.dimensions.scaledCanvasHeight,this._canvas.style.width=`${this.dimensions.canvasWidth}px`,this._canvas.style.height=`${this.dimensions.canvasHeight}px`,this._core.screenElement.style.width=`${this.dimensions.canvasWidth}px`,this._core.screenElement.style.height=`${this.dimensions.canvasHeight}px`,this._rectangleRenderer.setDimensions(this.dimensions),this._rectangleRenderer.onResize(),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.onResize(),this._refreshCharAtlas(),this._clearModel(!1)}onCharSizeChanged(){this.onResize(this._terminal.cols,this._terminal.rows)}onBlur(){for(const S of this._renderLayers)S.onBlur(this._terminal);this._requestRedrawViewport()}onFocus(){for(const S of this._renderLayers)S.onFocus(this._terminal);this._requestRedrawViewport()}onSelectionChanged(S,L,w){for(const m of this._renderLayers)m.onSelectionChanged(this._terminal,S,L,w);this._updateSelectionModel(S,L,w),this._requestRedrawViewport()}onCursorMove(){for(const S of this._renderLayers)S.onCursorMove(this._terminal)}onOptionsChanged(){for(const S of this._renderLayers)S.onOptionsChanged(this._terminal);this._updateDimensions(),this._refreshCharAtlas()}_initializeWebGLState(){var S,L;(S=this._rectangleRenderer)===null||S===void 0||S.dispose(),(L=this._glyphRenderer)===null||L===void 0||L.dispose(),this._rectangleRenderer=new l.RectangleRenderer(this._terminal,this._colors,this._gl,this.dimensions),this._glyphRenderer=new o.GlyphRenderer(this._terminal,this._colors,this._gl,this.dimensions),this.onCharSizeChanged()}_refreshCharAtlas(){if(this.dimensions.scaledCharWidth<=0&&this.dimensions.scaledCharHeight<=0)return void(this._isAttached=!1);const S=(0,_.acquireCharAtlas)(this._terminal,this._colors,this.dimensions.scaledCellWidth,this.dimensions.scaledCellHeight,this.dimensions.scaledCharWidth,this.dimensions.scaledCharHeight,this._coreBrowserService.dpr);if(!("getRasterizedGlyph"in S))throw new Error("The webgl renderer only works with the webgl char atlas");this._charAtlas!==S&&this._onChangeTextureAtlas.fire(S.cacheCanvas),this._charAtlas=S,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}_clearModel(S){this._model.clear(),S&&this._glyphRenderer.clear()}clearCharAtlas(){var S;(S=this._charAtlas)===null||S===void 0||S.clearTexture(),this._clearModel(!0),this._updateModel(0,this._terminal.rows-1),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const S of this._renderLayers)S.reset(this._terminal)}registerCharacterJoiner(S){return-1}deregisterCharacterJoiner(S){return!1}renderRows(S,L){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._core._charSizeService.width&&this._core._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const w of this._renderLayers)w.onGridChanged(this._terminal,S,L);this._glyphRenderer.beginFrame()&&(this._clearModel(!0),this._updateSelectionModel(void 0,void 0)),this._updateModel(S,L),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model)}_updateModel(S,L){const w=this._core;let m,b,y,E,A,k,O,T,H,W,x,B,P,R=this._workCell;for(b=S;b<=L;b++)for(y=b+w.buffer.ydisp,E=w.buffer.lines.get(y),this._model.lineLengths[b]=0,A=this._characterJoinerService.getJoinedCharacters(y),B=0;B0&&B===A[0][0]&&(k=!0,T=A.shift(),R=new g(R,E.translateToString(!0,T[0],T[1]),T[1]-T[0]),O=T[1]-1),H=R.getChars(),W=R.getCode(),x=(b*w.cols+B)*a.RENDER_MODEL_INDICIES_PER_CELL,this._loadColorsForCell(B,y),W!==e.NULL_CELL_CODE&&(this._model.lineLengths[b]=B+1),(this._model.cells[x]!==W||this._model.cells[x+a.RENDER_MODEL_BG_OFFSET]!==this._workColors.bg||this._model.cells[x+a.RENDER_MODEL_FG_OFFSET]!==this._workColors.fg||this._model.cells[x+a.RENDER_MODEL_EXT_OFFSET]!==this._workColors.ext)&&(H.length>1&&(W|=a.COMBINED_CHAR_BIT_MASK),this._model.cells[x]=W,this._model.cells[x+a.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[x+a.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[x+a.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext,this._glyphRenderer.updateCell(B,b,W,this._workColors.bg,this._workColors.fg,this._workColors.ext,H,m),k))for(R=this._workCell,B++;B{w.backgroundColorRGB&&(u.bg=w.backgroundColorRGB.rgba>>8&16777215,u.hasBg=!0),w.foregroundColorRGB&&(u.fg=w.foregroundColorRGB.rgba>>8&16777215,u.hasFg=!0)}),u.isSelected=this._isCellSelected(S,L),u.isSelected&&(u.bg=(this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque).rgba>>8&16777215,u.hasBg=!0,this._colors.selectionForeground&&(u.fg=this._colors.selectionForeground.rgba>>8&16777215,u.hasFg=!0)),this._decorationService.forEachDecorationAtCell(S,L,"top",w=>{w.backgroundColorRGB&&(u.bg=w.backgroundColorRGB.rgba>>8&16777215,u.hasBg=!0),w.foregroundColorRGB&&(u.fg=w.foregroundColorRGB.rgba>>8&16777215,u.hasFg=!0)}),u.hasBg&&(u.isSelected?u.bg=-16777216&this._workCell.bg&-134217729|u.bg|50331648:u.bg=-16777216&this._workCell.bg|u.bg|50331648),u.hasFg&&(u.fg=-16777216&this._workCell.fg&-67108865|u.fg|50331648),67108864&this._workColors.fg&&(u.hasBg&&!u.hasFg&&((50331648&this._workColors.bg)==0?u.fg=-134217728&this._workColors.fg|16777215&this._colors.background.rgba>>8|50331648:u.fg=-134217728&this._workColors.fg|67108863&this._workColors.bg,u.hasFg=!0),!u.hasBg&&u.hasFg&&((50331648&this._workColors.fg)==0?u.bg=-67108864&this._workColors.bg|16777215&this._colors.foreground.rgba>>8|50331648:u.bg=-67108864&this._workColors.bg|67108863&this._workColors.fg,u.hasBg=!0)),this._workColors.bg=u.hasBg?u.bg:this._workColors.bg,this._workColors.fg=u.hasFg?u.fg:this._workColors.fg}_isCellSelected(S,L){return!!this._model.selection.hasSelection&&(L-=this._terminal.buffer.active.viewportY,this._model.selection.columnSelectMode?this._model.selection.startCol<=this._model.selection.endCol?S>=this._model.selection.startCol&&L>=this._model.selection.viewportCappedStartRow&&S=this._model.selection.viewportCappedStartRow&&S>=this._model.selection.endCol&&L<=this._model.selection.viewportCappedEndRow:L>this._model.selection.viewportStartRow&&L=this._model.selection.startCol&&S=this._model.selection.startCol)}_updateSelectionModel(S,L,w=!1){const m=this._terminal;if(!S||!L||S[0]===L[0]&&S[1]===L[1])return void this._model.clearSelection();const b=S[1]-m.buffer.active.viewportY,y=L[1]-m.buffer.active.viewportY,E=Math.max(b,0),A=Math.min(y,m.rows-1);E>=m.rows||A<0?this._model.clearSelection():(this._model.selection.hasSelection=!0,this._model.selection.columnSelectMode=w,this._model.selection.viewportStartRow=b,this._model.selection.viewportEndRow=y,this._model.selection.viewportCappedStartRow=E,this._model.selection.viewportCappedEndRow=A,this._model.selection.startCol=S[0],this._model.selection.endCol=L[0])}_updateDimensions(){this._core._charSizeService.width&&this._core._charSizeService.height&&(this.dimensions.scaledCharWidth=Math.floor(this._core._charSizeService.width*this._devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._core._charSizeService.height*this._devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=this._terminal.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/this._devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/this._devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.scaledCellHeight/this._devicePixelRatio,this.dimensions.actualCellWidth=this.dimensions.scaledCellWidth/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(S,L){this._canvas.width===S&&this._canvas.height===L||(this._canvas.width=S,this._canvas.height=L,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}}r.WebglRenderer=C;class g extends v.AttributeData{constructor(S,L,w){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=L,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=g},381:(D,r)=>{function h(d,c,_){const l=o(d.createShader(c));if(d.shaderSource(l,_),d.compileShader(l),d.getShaderParameter(l,d.COMPILE_STATUS))return l;d.deleteShader(l)}function o(d){if(!d)throw new Error("value must not be falsy");return d}Object.defineProperty(r,"__esModule",{value:!0}),r.throwIfFalsy=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0,r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(d,c,_){const l=o(d.createProgram());if(d.attachShader(l,o(h(d,d.VERTEX_SHADER,c))),d.attachShader(l,o(h(d,d.FRAGMENT_SHADER,_))),d.linkProgram(l),d.getProgramParameter(l,d.LINK_STATUS))return l;d.deleteProgram(l)},r.createShader=h,r.expandFloat32Array=function(d,c){const _=Math.min(2*d.length,c),l=new Float32Array(_);for(let a=0;a{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireCharAtlas=void 0;const o=h(433),d=h(167),c=[];r.acquireCharAtlas=function(_,l,a,i,e,n,t){const s=(0,o.generateConfig)(a,i,e,n,_,l,t);for(let u=0;u=0){if((0,o.configEquals)(C.config,s))return C.atlas;C.ownedBy.length===1?(C.atlas.dispose(),c.splice(u,1)):C.ownedBy.splice(g,1);break}}for(let u=0;u{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const h={css:"",rgba:0};r.generateConfig=function(o,d,c,_,l,a,i){const e={foreground:a.foreground,background:a.background,cursor:h,cursorAccent:h,selectionForeground:h,selectionBackgroundTransparent:h,selectionBackgroundOpaque:h,selectionInactiveBackgroundTransparent:h,selectionInactiveBackgroundOpaque:h,ansi:a.ansi.slice(),contrastCache:a.contrastCache};return{customGlyphs:l.options.customGlyphs,devicePixelRatio:i,letterSpacing:l.options.letterSpacing,lineHeight:l.options.lineHeight,scaledCellWidth:o,scaledCellHeight:d,scaledCharWidth:c,scaledCharHeight:_,fontFamily:l.options.fontFamily,fontSize:l.options.fontSize,fontWeight:l.options.fontWeight,fontWeightBold:l.options.fontWeightBold,allowTransparency:l.options.allowTransparency,drawBoldTextInBrightColors:l.options.drawBoldTextInBrightColors,minimumContrastRatio:l.options.minimumContrastRatio,colors:e}},r.configEquals=function(o,d){for(let c=0;c{Object.defineProperty(r,"__esModule",{value:!0}),r.WebglCharAtlas=void 0;const o=h(302),d=h(855),c=h(381),_=h(147),l=h(160),a=h(14),i=h(634),e=h(485),n=1024,t=1024,s=Math.floor(819.2),f={css:"rgba(0, 0, 0, 0)",rgba:0},v={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},u={glyph:void 0};function C(g,p,S,L){const w=p.rgba>>>24,m=p.rgba>>>16&255,b=p.rgba>>>8&255,y=S.rgba>>>24,E=S.rgba>>>16&255,A=S.rgba>>>8&255,k=Math.floor((Math.abs(w-y)+Math.abs(m-E)+Math.abs(b-A))/12);let O=!0;for(let T=0;Ts&&(this.clearTexture(),this.warmUp(),!0)}clearTexture(){this._currentRow.x===0&&this._currentRow.y===0||(this._cacheCtx.clearRect(0,0,n,t),this._cacheMap.clear(),this._cacheMapCombined.clear(),this._currentRow.x=0,this._currentRow.y=0,this._currentRow.height=0,this._fixedRows.length=0,this._didWarmUp=!1)}getRasterizedGlyphCombinedChar(g,p,S,L){return this._getFromCacheMap(this._cacheMapCombined,g,p,S,L)}getRasterizedGlyph(g,p,S,L){return this._getFromCacheMap(this._cacheMap,g,p,S,L)}_getFromCacheMap(g,p,S,L,w){return u.glyph=g.get(p,S,L,w),u.glyph||(u.glyph=this._drawToCache(p,S,L,w),g.set(p,S,L,w,u.glyph)),u.glyph}_getColorFromAnsiIndex(g){if(g>=this._config.colors.ansi.length)throw new Error("No color found for idx "+g);return this._config.colors.ansi[g]}_getBackgroundColor(g,p,S,L){if(this._config.allowTransparency)return f;let w;switch(g){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(p);break;case 50331648:const m=_.AttributeData.toColorRGB(p);w=l.rgba.toColor(m[0],m[1],m[2]);break;default:w=S?this._config.colors.foreground:this._config.colors.background}return L&&(w=l.color.blend(this._config.colors.background,l.color.multiplyOpacity(w,o.DIM_OPACITY))),w}_getForegroundColor(g,p,S,L,w,m,b,y,E,A){const k=this._getMinimumContrastColor(g,p,S,L,w,m,!1,E,A);if(k)return k;let O;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&E&&m<8&&(m+=8),O=this._getColorFromAnsiIndex(m);break;case 50331648:const T=_.AttributeData.toColorRGB(m);O=l.rgba.toColor(T[0],T[1],T[2]);break;default:O=b?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=l.color.opaque(O)),y&&(O=l.color.multiplyOpacity(O,o.DIM_OPACITY)),O}_resolveBackgroundRgba(g,p,S){switch(g){case 16777216:case 33554432:return this._getColorFromAnsiIndex(p).rgba;case 50331648:return p<<8;default:return S?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(g,p,S,L){switch(g){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&L&&p<8&&(p+=8),this._getColorFromAnsiIndex(p).rgba;case 50331648:return p<<8;default:return S?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(g,p,S,L,w,m,b,y,E){if(this._config.minimumContrastRatio===1||E)return;const A=this._config.colors.contrastCache.getColor(g,L);if(A!==void 0)return A||void 0;const k=this._resolveBackgroundRgba(p,S,b),O=this._resolveForegroundRgba(w,m,b,y),T=l.rgba.ensureContrastRatio(k,O,this._config.minimumContrastRatio);if(!T)return void this._config.colors.contrastCache.setColor(g,L,null);const H=l.rgba.toColor(T>>24&255,T>>16&255,T>>8&255);return this._config.colors.contrastCache.setColor(g,L,H),H}_drawToCache(g,p,S,L){const w=typeof g=="number"?String.fromCharCode(g):g;this.hasCanvasChanged=!0;const m=this._config.scaledCellWidth*Math.max(w.length,2)+4;this._tmpCanvas.width=12&&!this._config.allowTransparency&&w!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const re=this._tmpCtx.measureText(w);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in re&&re.actualBoundingBoxDescent>0){this._tmpCtx.save();const Q=new Path2D;Q.rect(ge,ie-Math.ceil(q/2),this._config.scaledCellWidth,he-ie+Math.ceil(q/2)),this._tmpCtx.clip(Q),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=P.css,this._tmpCtx.strokeText(w,I,I+this._config.scaledCharHeight),this._tmpCtx.restore()}}}if(K||this._tmpCtx.fillText(w,I,I+this._config.scaledCharHeight),w==="_"&&!this._config.allowTransparency){let q=C(this._tmpCtx.getImageData(I,I,this._config.scaledCellWidth,this._config.scaledCellHeight),P,$,J);if(q)for(let X=1;X<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(w,I,I+this._config.scaledCharHeight-X),q=C(this._tmpCtx.getImageData(I,I,this._config.scaledCellWidth,this._config.scaledCellHeight),P,$,J),q);X++);}if(T){const q=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),X=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=q,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(I,I+Math.floor(this._config.scaledCharHeight/2)-X),this._tmpCtx.lineTo(I+this._config.scaledCharWidth*N,I+Math.floor(this._config.scaledCharHeight/2)-X),this._tmpCtx.stroke()}this._tmpCtx.restore();const oe=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let be;if(be=this._config.allowTransparency?function(q){for(let X=0;X0)return!1;return!0}(oe):C(oe,P,$,J),be)return v;const te=this._findGlyphBoundingBox(oe,this._workBoundingBox,m,U,K,I),Me=this._clipImageData(oe,this._workBoundingBox);let V;for(;;){V=this._currentRow;for(const q of this._fixedRows)(V===this._currentRow||q.height2*te.size.y&&(this._currentRow.height>0&&this._fixedRows.push(this._currentRow),V={x:0,y:this._currentRow.y+this._currentRow.height,height:te.size.y},this._fixedRows.push(V),this._currentRow={x:0,y:V.y+V.height,height:0}),V.x+te.size.x<=n)break;V===this._currentRow?(V.x=0,V.y+=V.height,V.height=0):this._fixedRows.splice(this._fixedRows.indexOf(V),1)}return te.texturePosition.x=V.x,te.texturePosition.y=V.y,te.texturePositionClipSpace.x=V.x/n,te.texturePositionClipSpace.y=V.y/t,V.height=Math.max(V.height,te.size.y),V.x+=te.size.x,this._cacheCtx.putImageData(Me,te.texturePosition.x,te.texturePosition.y),te}_findGlyphBoundingBox(g,p,S,L,w,m){p.top=0;const b=L?this._config.scaledCellHeight:this._tmpCanvas.height,y=L?this._config.scaledCellWidth:S;let E=!1;for(let A=0;A=0;A--){for(let k=0;k=0;A--){for(let k=0;k{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const o=h(713),d=h(302),c=h(381);r.BaseRenderLayer=class{constructor(_,l,a,i,e,n){this._container=_,this._alpha=i,this._colors=e,this._coreBrowserService=n,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${l}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}dispose(){this._canvas.remove(),this._charAtlas&&this._charAtlas.dispose()}_initCanvas(){this._ctx=(0,c.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}onOptionsChanged(_){}onBlur(_){}onFocus(_){}onCursorMove(_){}onGridChanged(_,l,a){}onSelectionChanged(_,l,a,i=!1){}setColors(_,l){this._refreshCharAtlas(_,l)}_setTransparency(_,l){if(l===this._alpha)return;const a=this._canvas;this._alpha=l,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,a),this._refreshCharAtlas(_,this._colors),this.onGridChanged(_,0,_.rows-1)}_refreshCharAtlas(_,l){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,o.acquireCharAtlas)(_,l,this._scaledCellWidth,this._scaledCellHeight,this._scaledCharWidth,this._scaledCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(_,l){this._scaledCellWidth=l.scaledCellWidth,this._scaledCellHeight=l.scaledCellHeight,this._scaledCharWidth=l.scaledCharWidth,this._scaledCharHeight=l.scaledCharHeight,this._scaledCharLeft=l.scaledCharLeft,this._scaledCharTop=l.scaledCharTop,this._canvas.width=l.scaledCanvasWidth,this._canvas.height=l.scaledCanvasHeight,this._canvas.style.width=`${l.canvasWidth}px`,this._canvas.style.height=`${l.canvasHeight}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(_,this._colors)}_fillCells(_,l,a,i){this._ctx.fillRect(_*this._scaledCellWidth,l*this._scaledCellHeight,a*this._scaledCellWidth,i*this._scaledCellHeight)}_fillBottomLineAtCells(_,l,a=1){this._ctx.fillRect(_*this._scaledCellWidth,(l+1)*this._scaledCellHeight-this._coreBrowserService.dpr-1,a*this._scaledCellWidth,this._coreBrowserService.dpr)}_fillLeftLineAtCell(_,l,a){this._ctx.fillRect(_*this._scaledCellWidth,l*this._scaledCellHeight,this._coreBrowserService.dpr*a,this._scaledCellHeight)}_strokeRectAtCell(_,l,a,i){this._ctx.lineWidth=this._coreBrowserService.dpr,this._ctx.strokeRect(_*this._scaledCellWidth+this._coreBrowserService.dpr/2,l*this._scaledCellHeight+this._coreBrowserService.dpr/2,a*this._scaledCellWidth-this._coreBrowserService.dpr,i*this._scaledCellHeight-this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(_,l,a,i){this._alpha?this._ctx.clearRect(_*this._scaledCellWidth,l*this._scaledCellHeight,a*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(_*this._scaledCellWidth,l*this._scaledCellHeight,a*this._scaledCellWidth,i*this._scaledCellHeight))}_fillCharTrueColor(_,l,a,i){this._ctx.font=this._getFont(_,!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipCell(a,i,l.getWidth()),this._ctx.fillText(l.getChars(),a*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)}_clipCell(_,l,a){this._ctx.beginPath(),this._ctx.rect(_*this._scaledCellWidth,l*this._scaledCellHeight,a*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()}_getFont(_,l,a){return`${a?"italic":""} ${l?_.options.fontWeightBold:_.options.fontWeight} ${_.options.fontSize*this._coreBrowserService.dpr}px ${_.options.fontFamily}`}}},461:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorRenderLayer=void 0;const o=h(592),d=h(782);class c extends o.BaseRenderLayer{constructor(a,i,e,n,t,s,f){super(i,"cursor",e,!0,n,s),this._onRequestRefreshRowsEvent=t,this._coreService=f,this._cell=new d.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this.onOptionsChanged(a)}dispose(){var a;(a=this._cursorBlinkStateManager)===null||a===void 0||a.dispose(),this._cursorBlinkStateManager=void 0,super.dispose()}resize(a,i){super.resize(a,i),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(a){var i;this._clearCursor(),(i=this._cursorBlinkStateManager)===null||i===void 0||i.restartBlinkAnimation(a),this.onOptionsChanged(a)}onBlur(a){var i;(i=this._cursorBlinkStateManager)===null||i===void 0||i.pause(),this._onRequestRefreshRowsEvent.fire({start:a.buffer.active.cursorY,end:a.buffer.active.cursorY})}onFocus(a){var i;(i=this._cursorBlinkStateManager)===null||i===void 0||i.resume(a),this._onRequestRefreshRowsEvent.fire({start:a.buffer.active.cursorY,end:a.buffer.active.cursorY})}onOptionsChanged(a){var i;a.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new _(()=>{this._render(a,!0)},this._coreBrowserService)):((i=this._cursorBlinkStateManager)===null||i===void 0||i.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:a.buffer.active.cursorY,end:a.buffer.active.cursorY})}onCursorMove(a){var i;(i=this._cursorBlinkStateManager)===null||i===void 0||i.restartBlinkAnimation(a)}onGridChanged(a,i,e){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(a,!1):this._cursorBlinkStateManager.restartBlinkAnimation(a)}_render(a,i){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const e=a.buffer.active.baseY+a.buffer.active.cursorY,n=e-a.buffer.active.viewportY,t=Math.min(a.buffer.active.cursorX,a.cols-1);if(n<0||n>=a.rows)this._clearCursor();else if(a._core.buffer.lines.get(e).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;const s=a.options.cursorStyle;return s&&s!=="block"?this._cursorRenderers[s](a,t,n,this._cell):this._renderBlurCursor(a,t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=s,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===a.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[a.options.cursorStyle||"block"](a,t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=a.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(a,i,e,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(i,e,a.options.cursorWidth),this._ctx.restore()}_renderBlockCursor(a,i,e,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(i,e,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(a,n,i,e),this._ctx.restore()}_renderUnderlineCursor(a,i,e,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(i,e),this._ctx.restore()}_renderBlurCursor(a,i,e,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(i,e,n.getWidth(),1),this._ctx.restore()}}r.CursorRenderLayer=c;class _{constructor(a,i){this._renderCallback=a,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(a){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const 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)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(a){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation(a)}}},733:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const o=h(592),d=h(302),c=h(433);class _ extends o.BaseRenderLayer{constructor(a,i,e,n,t){super(a,"link",i,!0,e,t),n.linkifier2.onShowLinkUnderline(s=>this._onShowLinkUnderline(s)),n.linkifier2.onHideLinkUnderline(s=>this._onHideLinkUnderline(s))}resize(a,i){super.resize(a,i),this._state=void 0}reset(a){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const a=this._state.y2-this._state.y1-1;a>0&&this._clearCells(0,this._state.y1+1,this._state.cols,a),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_onShowLinkUnderline(a){if(a.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.fg!==void 0&&(0,c.is256Color)(a.fg)?this._ctx.fillStyle=this._colors.ansi[a.fg].css:this._ctx.fillStyle=this._colors.foreground.css,a.y1===a.y2)this._fillBottomLineAtCells(a.x1,a.y1,a.x2-a.x1);else{this._fillBottomLineAtCells(a.x1,a.y1,a.cols-a.x1);for(let i=a.y1+1;i{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(h,o,d,c){h.addEventListener(o,d,c);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(o,d,c))}}}},302:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const o=h(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=o.isFirefox||o.isLegacyEdge?"bottom":"ideographic"},14:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const o=h(634);r.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:9,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const d={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(i,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2551":{1:(i,e)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"\u2552":{1:(i,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u2553":{1:(i,e)=>`M${.5-i},1 L${.5-i},.5 L1,.5 M${.5+i},.5 L${.5+i},1`},"\u2554":{1:(i,e)=>`M1,${.5-e} L${.5-i},${.5-e} L${.5-i},1 M1,${.5+e} L${.5+i},${.5+e} L${.5+i},1`},"\u2555":{1:(i,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"\u2556":{1:(i,e)=>`M${.5+i},1 L${.5+i},.5 L0,.5 M${.5-i},.5 L${.5-i},1`},"\u2557":{1:(i,e)=>`M0,${.5+e} L${.5-i},${.5+e} L${.5-i},1 M0,${.5-e} L${.5+i},${.5-e} L${.5+i},1`},"\u2558":{1:(i,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"\u2559":{1:(i,e)=>`M1,.5 L${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"\u255A":{1:(i,e)=>`M1,${.5-e} L${.5+i},${.5-e} L${.5+i},0 M1,${.5+e} L${.5-i},${.5+e} L${.5-i},0`},"\u255B":{1:(i,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"\u255C":{1:(i,e)=>`M0,.5 L${.5+i},.5 L${.5+i},0 M${.5-i},.5 L${.5-i},0`},"\u255D":{1:(i,e)=>`M0,${.5-e} L${.5-i},${.5-e} L${.5-i},0 M0,${.5+e} L${.5+i},${.5+e} L${.5+i},0`},"\u255E":{1:(i,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u255F":{1:(i,e)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1 M${.5+i},.5 L1,.5`},"\u2560":{1:(i,e)=>`M${.5-i},0 L${.5-i},1 M1,${.5+e} L${.5+i},${.5+e} L${.5+i},1 M1,${.5-e} L${.5+i},${.5-e} L${.5+i},0`},"\u2561":{1:(i,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"\u2562":{1:(i,e)=>`M0,.5 L${.5-i},.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"\u2563":{1:(i,e)=>`M${.5+i},0 L${.5+i},1 M0,${.5+e} L${.5-i},${.5+e} L${.5-i},1 M0,${.5-e} L${.5-i},${.5-e} L${.5-i},0`},"\u2564":{1:(i,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"\u2565":{1:(i,e)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},1 M${.5+i},.5 L${.5+i},1`},"\u2566":{1:(i,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-i},${.5+e} L${.5-i},1 M1,${.5+e} L${.5+i},${.5+e} L${.5+i},1`},"\u2567":{1:(i,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2568":{1:(i,e)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"\u2569":{1:(i,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-i},${.5-e} L${.5-i},0 M1,${.5-e} L${.5+i},${.5-e} L${.5+i},0`},"\u256A":{1:(i,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u256B":{1:(i,e)=>`M0,.5 L1,.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"\u256C":{1:(i,e)=>`M0,${.5+e} L${.5-i},${.5+e} L${.5-i},1 M1,${.5+e} L${.5+i},${.5+e} L${.5+i},1 M0,${.5-e} L${.5-i},${.5-e} L${.5-i},0 M1,${.5-e} L${.5+i},${.5-e} L${.5+i},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u2509":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(i,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"\u256E":{1:(i,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"\u256F":{1:(i,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"\u2570":{1:(i,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"\uE0B5":{d:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:1,rightPadding:1},"\uE0B6":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"\uE0B7":{d:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1}},r.tryDrawCustomChar=function(i,e,n,t,s,f,v,u){const C=r.blockElementDefinitions[e];if(C)return function(L,w,m,b,y,E){for(let A=0;A7&&parseInt(k.slice(7,9),16)||1;else{if(!k.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${k}" when drawing pattern glyph`);[P,R,M,F]=k.substring(5,k.length-1).split(",").map(U=>parseFloat(U))}for(let U=0;Ui.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(i,e)=>i.lineTo(e[0],e[1]),M:(i,e)=>i.moveTo(e[0],e[1])};function a(i,e,n,t,s,f,v,u=0,C=0){const g=i.map(p=>parseFloat(p)||parseInt(p));if(g.length<2)throw new Error("Too few arguments for instruction");for(let p=0;p{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const o=h(859);r.observeDevicePixelDimensions=function(d,c,_){let l=new c.ResizeObserver(a=>{const i=a.find(t=>t.target===d);if(!i)return;if(!("devicePixelContentBoxSize"in i))return l==null||l.disconnect(),void(l=void 0);const e=i.devicePixelContentBoxSize[0].inlineSize,n=i.devicePixelContentBoxSize[0].blockSize;e>0&&n>0&&_(e,n)});try{l.observe(d,{box:["device-pixel-content-box"]})}catch{l.disconnect(),l=void 0}return(0,o.toDisposable)(()=>l==null?void 0:l.disconnect())}},634:(D,r)=>{function h(o){return 57508<=o&&o<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(o){if(!o)throw new Error("value must not be falsy");return o},r.isPowerlineGlyph=h,r.isRestrictedPowerlineGlyph=function(o){return 57520<=o&&o<=57527},r.excludeFromContrastRatioDemands=function(o){return h(o)||function(d){return 9472<=d&&d<=9631}(o)}},160:(D,r)=>{var h,o,d;function c(l){const a=l.toString(16);return a.length<2?"0"+a:a}function _(l,a){return l>>0}}(h=r.channels||(r.channels={})),function(l){function a(i,e){const n=Math.round(255*e),[t,s,f]=d.toChannels(i.rgba);return{css:h.toCss(t,s,f,n),rgba:h.toRgba(t,s,f,n)}}l.blend=function(i,e){const n=(255&e.rgba)/255;if(n===1)return{css:e.css,rgba:e.rgba};const t=e.rgba>>24&255,s=e.rgba>>16&255,f=e.rgba>>8&255,v=i.rgba>>24&255,u=i.rgba>>16&255,C=i.rgba>>8&255,g=v+Math.round((t-v)*n),p=u+Math.round((s-u)*n),S=C+Math.round((f-C)*n);return{css:h.toCss(g,p,S),rgba:h.toRgba(g,p,S)}},l.isOpaque=function(i){return(255&i.rgba)==255},l.ensureContrastRatio=function(i,e,n){const t=d.ensureContrastRatio(i.rgba,e.rgba,n);if(t)return d.toColor(t>>24&255,t>>16&255,t>>8&255)},l.opaque=function(i){const e=(255|i.rgba)>>>0,[n,t,s]=d.toChannels(e);return{css:h.toCss(n,t,s),rgba:e}},l.opacity=a,l.multiplyOpacity=function(i,e){return a(i,(255&i.rgba)*e/255)},l.toColorRGB=function(i){return[i.rgba>>24&255,i.rgba>>16&255,i.rgba>>8&255]}}(r.color||(r.color={})),(r.css||(r.css={})).toColor=function(l){if(l.match(/#[0-9a-f]{3,8}/i))switch(l.length){case 4:{const i=parseInt(l.slice(1,2).repeat(2),16),e=parseInt(l.slice(2,3).repeat(2),16),n=parseInt(l.slice(3,4).repeat(2),16);return d.toColor(i,e,n)}case 5:{const i=parseInt(l.slice(1,2).repeat(2),16),e=parseInt(l.slice(2,3).repeat(2),16),n=parseInt(l.slice(3,4).repeat(2),16),t=parseInt(l.slice(4,5).repeat(2),16);return d.toColor(i,e,n,t)}case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}const a=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a){const i=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),t=Math.round(255*(a[5]===void 0?1:parseFloat(a[5])));return d.toColor(i,e,n,t)}throw new Error("css.toColor: Unsupported css format")},function(l){function a(i,e,n){const t=i/255,s=e/255,f=n/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.0722*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))}l.relativeLuminance=function(i){return a(i>>16&255,i>>8&255,255&i)},l.relativeLuminance2=a}(o=r.rgb||(r.rgb={})),function(l){function a(e,n,t){const s=e>>24&255,f=e>>16&255,v=e>>8&255;let u=n>>24&255,C=n>>16&255,g=n>>8&255,p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));for(;p0||C>0||g>0);)u-=Math.max(0,Math.ceil(.1*u)),C-=Math.max(0,Math.ceil(.1*C)),g-=Math.max(0,Math.ceil(.1*g)),p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));return(u<<24|C<<16|g<<8|255)>>>0}function i(e,n,t){const s=e>>24&255,f=e>>16&255,v=e>>8&255;let u=n>>24&255,C=n>>16&255,g=n>>8&255,p=_(o.relativeLuminance2(u,C,g),o.relativeLuminance2(s,f,v));for(;p>>0}l.ensureContrastRatio=function(e,n,t){const s=o.relativeLuminance(e>>8),f=o.relativeLuminance(n>>8);if(_(s,f)>8));if(g_(s,o.relativeLuminance(p>>8))?C:p}return C}const v=i(e,n,t),u=_(s,o.relativeLuminance(v>>8));if(u_(s,o.relativeLuminance(C>>8))?v:C}return v}},l.reduceLuminance=a,l.increaseLuminance=i,l.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.toColor=function(e,n,t,s){return{css:h.toCss(e,n,t,s),rgba:h.toRgba(e,n,t,s)}}}(d=r.rgba||(r.rgba={})),r.toPaddedHex=c,r.contrastRatio=_},345:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let o=0;oo.fire(d))}},859:(D,r)=>{function h(o){for(const d of o)d.dispose();o.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const o of this._disposables)o.dispose();this._disposables.length=0}register(o){return this._disposables.push(o),o}unregister(o){const d=this._disposables.indexOf(o);d!==-1&&this._disposables.splice(d,1)}},r.toDisposable=function(o){return{dispose:o}},r.disposeArray=h,r.getDisposeArrayDisposable=function(o){return{dispose:()=>h(o)}}},485:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(d,c,_){this._data[d]||(this._data[d]={}),this._data[d][c]=_}get(d,c){return this._data[d]?this._data[d][c]:void 0}clear(){this._data={}}}r.TwoKeyMap=h,r.FourKeyMap=class{constructor(){this._data=new h}set(o,d,c,_,l){this._data.get(o,d)||this._data.set(o,d,new h),this._data.get(o,d).set(c,_,l)}get(o,d,c,_){var l;return(l=this._data.get(o,d))===null||l===void 0?void 0:l.get(c,_)}clear(){this._data.clear()}}},399:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.isSafari=r.isLegacyEdge=r.isFirefox=void 0;const h=typeof navigator=="undefined",o=h?"node":navigator.userAgent,d=h?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0},455:(D,r)=>{function h(o,d,c=0,_=o.length){if(c>=o.length)return o;c=(o.length+c)%o.length,_=_>=o.length?o.length:(o.length+_)%o.length;for(let l=c;l<_;++l)o[l]=d;return o}Object.defineProperty(r,"__esModule",{value:!0}),r.concat=r.fillFallback=r.fill=void 0,r.fill=function(o,d,c,_){return o.fill?o.fill(d,c,_):h(o,d,c,_)},r.fillFallback=h,r.concat=function(o,d){const c=new o.constructor(o.length+d.length);return c.set(o),c.set(d,o.length),c}},147:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new o}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new h;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=h;class o{constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}clone(){return new o(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=o},782:(D,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const o=h(133),d=h(855),c=h(147);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(a){const i=new _;return i.setFromCharData(a),i}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,o.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(a){this.fg=a[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let i=!1;if(a[d.CHAR_DATA_CHAR_INDEX].length>2)i=!0;else if(a[d.CHAR_DATA_CHAR_INDEX].length===2){const e=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const n=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(e-55296)+n-56320+65536|a[d.CHAR_DATA_WIDTH_INDEX]<<22:i=!0}else i=!0}else this.content=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[d.CHAR_DATA_WIDTH_INDEX]<<22;i&&(this.combinedData=a[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=_},855:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=256,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(D,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},r.utf32ToString=function(h,o=0,d=h.length){let c="";for(let _=o;_65535?(l-=65536,c+=String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):c+=String.fromCharCode(l)}return c},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,o){const d=h.length;if(!d)return 0;let c=0,_=0;if(this._interim){const l=h.charCodeAt(_++);56320<=l&&l<=57343?o[c++]=1024*(this._interim-55296)+l-56320+65536:(o[c++]=this._interim,o[c++]=l),this._interim=0}for(let l=_;l=d)return this._interim=a,c;const i=h.charCodeAt(l);56320<=i&&i<=57343?o[c++]=1024*(a-55296)+i-56320+65536:(o[c++]=a,o[c++]=i)}else a!==65279&&(o[c++]=a)}return c}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,o){const d=h.length;if(!d)return 0;let c,_,l,a,i=0,e=0,n=0;if(this.interim[0]){let f=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let u,C=0;for(;(u=63&this.interim[++C])&&C<4;)v<<=6,v|=u;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=g-C;for(;n=d)return 0;if(u=h[n++],(192&u)!=128){n--,f=!0;break}this.interim[C++]=u,v<<=6,v|=63&u}f||(g===2?v<128?n--:o[i++]=v:g===3?v<2048||v>=55296&&v<=57343||v===65279||(o[i++]=v):v<65536||v>1114111||(o[i++]=v)),this.interim.fill(0)}const t=d-4;let s=n;for(;s=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(e=(31&c)<<6|63&_,e<128){s--;continue}o[i++]=e}else if((240&c)==224){if(s>=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,i;if(l=h[s++],(192&l)!=128){s--;continue}if(e=(15&c)<<12|(63&_)<<6|63&l,e<2048||e>=55296&&e<=57343||e===65279)continue;o[i++]=e}else if((248&c)==240){if(s>=d)return this.interim[0]=c,i;if(_=h[s++],(192&_)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,i;if(l=h[s++],(192&l)!=128){s--;continue}if(s>=d)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=l,i;if(a=h[s++],(192&a)!=128){s--;continue}if(e=(7&c)<<18|(63&_)<<12|(63&l)<<6|63&a,e<65536||e>1114111)continue;o[i++]=e}}return i}}}},Y={};function j(D){var r=Y[D];if(r!==void 0)return r.exports;var h=Y[D]={exports:{}};return ee[D](h,h.exports,j),h.exports}var se={};return(()=>{var D=se;Object.defineProperty(D,"__esModule",{value:!0}),D.WebglAddon=void 0;const r=j(666),h=j(345),o=j(399);D.WebglAddon=class{constructor(d){this._preserveDrawingBuffer=d,this._onChangeTextureAtlas=new h.EventEmitter,this._onContextLoss=new h.EventEmitter}get onChangeTextureAtlas(){return this._onChangeTextureAtlas.event}get onContextLoss(){return this._onContextLoss.event}activate(d){if(!d.element)throw new Error("Cannot activate WebglAddon before Terminal.open");if(o.isSafari)throw new Error("Webgl is not currently supported on Safari");this._terminal=d;const c=d._core._renderService,_=d._core._characterJoinerService,l=d._core._coreBrowserService,a=d._core.coreService,i=d._core._decorationService,e=d._core._colorManager.colors;this._renderer=new r.WebglRenderer(d,e,_,l,a,i,this._preserveDrawingBuffer),(0,h.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss),(0,h.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas),c.setRenderer(this._renderer)}dispose(){var d;if(!this._terminal)throw new Error("Cannot dispose WebglAddon because it is activated");const c=this._terminal._core._renderService;c.setRenderer(this._terminal._core._createRenderer()),c.onResize(this._terminal.cols,this._terminal.rows),(d=this._renderer)===null||d===void 0||d.dispose(),this._renderer=void 0}get textureAtlas(){var d;return(d=this._renderer)===null||d===void 0?void 0:d.textureAtlas}clearTextureAtlas(){var d;(d=this._renderer)===null||d===void 0||d.clearCharAtlas()}}})(),se})()})})(De);function Fe(Z,z){return ce(),ke("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h7"})])}var We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB5UlEQVRYR+2XQU8TURSFz2lLCHa6QJopbExcmHSmaogbd8oPENeucW1YWxcCCbAnbA2/AfEHwM7EBYmGRxP2hj6MLphaDWWu6ZQhdBjo9IURSPq28+49X857b+69xDUvhvp/fzxwjo5z0wLeSZOJkN9D2dbGcHFvt60TAHi6MgnIdprC0dwEnuRttR0ANLRbFWBRIFsQbqYKQpki+JzAu7ytlgKAw7o7R+K9COYLJTWXJkBU6+YCeHXnM8inXW6I/GGWr/JFtR7n0qF2Ntv2XhaT2AFPu3JOxASgk2TZslU17rgvPIIQwLLV6VPt926El3sAYOZA3d1vW26V1Hi/1of7G9qdEeCDALMFW630eQcqgbBl7wQgJksEbPwqP8yP1nZI+H0BmAgmiUn8DJMkM9kzABg4cHsc8LTzqfMf2H1hctuDRuegPO37XMtk+TqsoIkdGBSjG+NA0KieLIJNAtV2NxvbEdWdBRDPTvcL7oG8b14NiVJUSOC/Kdi11TgATzvfAU6cjzGshsLj8tlkWWaaI2PqS1jZokKeroz3ikn8CkyfXq+4WABPu28BLP3PwQRA1bLVcmc0+1l+hFbmay/6K/2e8x9bd2vfuodTP/dShCNXKhRJRkpzKNP62DWcpinYK/c/z0ExP3rClK8AAAAASUVORK5CYII=",Ue="./static/png/arthas-bcfffb2d.png";const $e={class:"flex flex-col h-[100vh] w-[100vw] resize-none"},Ne={key:0,class:"navbar bg-base-100 md:flex-row flex-col w-[100vw]"},ze={class:"navbar-start"},je={class:"dropdown dropdown-start 2xl:hidden"},Ke={tabindex:"0",class:"btn btn-ghost btn-sm"},qe=xe('',1),Ge={href:"https://github.com/alibaba/arthas",target:"_blank",title:"",class:"mr-2 w-20"},Ve=["src"],Xe=xe('',1),Ye={class:"navbar-center"},Je={class:"input-group input-group-sm mr-2"},Ze=G("span",null,"IP",-1),Qe={class:"input-group input-group-sm mr-2"},et=G("span",null,"Port",-1),tt={key:0,class:"input-group input-group-sm mr-2"},it=G("span",null,"AgentId",-1),st={class:"navbar-end"},rt=["onClick"],nt=["href"],ot=G("div",{class:"w-full h-0 flex-auto bg-black overscroll-auto",id:"terminal-card"},[G("div",{id:"terminal",class:"w-full h-full"})],-1),at={key:1,title:"fullscreen",id:"fullSc",class:"fullSc"},ht=["src"],lt=Te({__name:"Console",props:{isTunnel:{type:Boolean,required:!1,default:!1}},setup(Z){let z,ee=-1;const Y=1e3,j=9999999,se=1,D=Z.isTunnel?"7777":"8563",r=le(""),h=le(""),o=le(!0),d=le(!0),c=le(""),_=Ie(()=>Z.isTunnel?`proxy/${c.value}/arthas-output/`:"/arthas-output/"),l=new Ae.exports.FitAddon,a=new De.exports.WebglAddon;let i=new Se.exports.Terminal({allowProposedApi:!0});Pe(()=>{var L,w,m;r.value=(L=e("ip"))!=null?L:window.location.hostname,h.value=(w=e("port"))!=null?w:D,Z.isTunnel&&(c.value=(m=e("agentId"))!=null?m:"");let S=e("iframe");S&&S.trim()!=="false"&&(o.value=!1),u(!0),window.addEventListener("resize",function(){if(z!=null){const{cols:b,rows:y}=l.proposeDimensions();z.send(JSON.stringify({action:"resize",cols:b,rows:y})),l.fit()}})});function e(S){return new URLSearchParams(window.location.search).get(S)}function n(){var y;const S=`${r.value}:${h.value}`;if(!Z.isTunnel)return`ws://${S}/ws`;const L=(y=e("path"))!=null?y:"ws",w=e("targetServer"),b=`${location.protocol==="https:"?"wss://":"ws://"}${S}/${encodeURIComponent(L)}?method=connectArthas&id=${c.value}`;return w!=null?b+"&targetServer="+encodeURIComponent(w):b}function t(S){let L=n();z=new WebSocket(L),z.onerror=function(){z!=null||z.close(),z=void 0,!S&&alert("Connect error")},z.onopen=function(){var y;d.value=!0;let w=(y=e("scrollback"))!=null?y:"0";const{cols:m,rows:b}=s(w);i.onData(function(E){z==null||z.send(JSON.stringify({action:"read",data:E}))}),z.onmessage=function(E){if(E.type==="message"){var A=E.data;i.write(A)}},z==null||z.send(JSON.stringify({action:"resize",cols:m,rows:b})),ee=window.setInterval(function(){z!=null&&z.readyState===1&&z.send(JSON.stringify({action:"read",data:""}))},3e4)},z.onclose=function(w){ee!=-1&&(window.clearInterval(ee),ee=-1),w.code===2e3&&alert(w.reason)}}function s(S){let L=parseInt(S,10);return i=new Se.exports.Terminal({screenReaderMode:!1,convertEol:!0,allowProposedApi:!0,scrollback:f(L)?L:Y}),i.loadAddon(l),i.open(document.getElementById("terminal")),i.loadAddon(a),l.fit(),{cols:i.cols,rows:i.rows}}function f(S){return S>=se&&S<=j}const v=S=>r.value.trim()===""||h.value.trim()===""?(alert("Ip or port can not be empty"),!1):Z.isTunnel&&c.value==""?(S||alert("AgentId can not be empty"),!1):z?(alert("Already connected"),!1):!0;function u(S=!1){v(S)&&t(S)}function C(){try{z.close(),z.onmessage=null,z.onclose=null,z=void 0,i.dispose(),l.dispose(),a.dispose(),d.value=!1,alert("Connection was closed successfully!")}catch{alert("No connection, please start connect first.")}}function g(){var S=document.getElementById("terminal-card");p(S),S.onfullscreenchange=L=>{l.fit()}}function p(S){let L=S.requestFullscreen;if(L)L.call(S);else if(window.ActiveXObject){var w=new ActiveXObject("WScript.Shell");w!==null&&w.SendKeys("{F11}")}}return(S,L)=>(ce(),ue("div",$e,[o.value?(ce(),ue("nav",Ne,[G("div",ze,[G("div",je,[G("label",Ke,[Ee(fe(Fe),{class:"w-6 h-6"})]),qe]),G("a",Ge,[G("img",{src:fe(Ue),alt:"Arthas",title:"Welcome to Arthas web console"},null,8,Ve)]),Xe]),G("div",Ye,[G("div",{class:ye(["xl:flex-row form-control",{"xl:flex-row":Z.isTunnel,"lg:flex-row":!Z.isTunnel}])},[G("label",Je,[Ze,pe(G("input",{type:"text",placeholder:"please enter ip address",class:"input input-bordered input-sm","onUpdate:modelValue":L[0]||(L[0]=w=>r.value=w)},null,512),[[me,r.value]])]),G("label",Qe,[et,pe(G("input",{type:"text",placeholder:"please enter port",class:"input input-sm input-bordered","onUpdate:modelValue":L[1]||(L[1]=w=>h.value=w)},null,512),[[me,h.value]])]),Z.isTunnel?(ce(),ue("label",tt,[it,pe(G("input",{type:"text",placeholder:"please enter AgentId",class:"input input-sm input-bordered","onUpdate:modelValue":L[2]||(L[2]=w=>c.value=w)},null,512),[[me,c.value]])])):Ce("v-if",!0)],2)]),G("div",st,[G("div",{class:ye(["btn-group 2xl:btn-group-horizontal btn-group-horizontal",{"md:btn-group-vertical":Z.isTunnel}])},[G("button",{class:"btn btn-sm bg-secondary hover:bg-secondary-focus border-none text-secondary-content focus:bg-secondary-focus normal-case",onClick:L[3]||(L[3]=Le(w=>u(!0),["prevent"]))},"Connect"),G("button",{class:"btn btn-sm bg-secondary hover:bg-secondary-focus border-none text-secondary-content focus:bg-secondary-focus normal-case",onClick:Le(C,["prevent"])},"Disconnect",8,rt),G("a",{class:"btn btn-sm bg-secondary hover:bg-secondary-focus border-none text-secondary-content focus:bg-secondary-focus normal-case",href:fe(_),target:"_blank"},"Arthas Output",8,nt)],2)])])):Ce("v-if",!0),ot,d.value?(ce(),ue("div",at,[G("button",{id:"fullScBtn",onClick:g},[G("img",{src:fe(We)},null,8,ht)])])):Ce("v-if",!0)]))}});var ct=Be(lt,[["__file","/Users/hengyunabc/code/java/arthas-doc/web-ui/arthasWebConsole/all/share/component/Console.vue"]]);const dt=Oe(He(ct,{isTunnel:!0}));dt.mount("#app");




© 2015 - 2025 Weber Informatics LLC | Privacy Policy