mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-25 00:50:32 +00:00
66 lines
477 KiB
JavaScript
66 lines
477 KiB
JavaScript
var Re={exports:{}};(function(he,Ce){(function(ce,ne){he.exports=ne()})(globalThis,()=>(()=>{var ce={4567:function(O,t,a){var l=this&&this.__decorate||function(s,i,u,p){var h,m=arguments.length,_=m<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(s,i,u,p);else for(var f=s.length-1;f>=0;f--)(h=s[f])&&(_=(m<3?h(_):m>3?h(i,u,_):h(i,u))||_);return m>3&&_&&Object.defineProperty(i,u,_),_},c=this&&this.__param||function(s,i){return function(u,p){i(u,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=a(9042),d=a(9924),v=a(844),g=a(4725),r=a(2585),e=a(3656);let o=t.AccessibilityManager=class extends v.Disposable{constructor(s,i,u,p){super(),this._terminal=s,this._coreBrowserService=u,this._renderService=p,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let h=0;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);if(this._topBoundaryFocusListener=h=>this._handleBoundaryFocus(h,0),this._bottomBoundaryFocusListener=h=>this._handleBoundaryFocus(h,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(h=>this._handleResize(h.rows))),this.register(this._terminal.onRender(h=>this._refreshRows(h.start,h.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(h=>this._handleChar(h))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
||
`))),this.register(this._terminal.onA11yTab(h=>this._handleTab(h))),this.register(this._terminal.onKey(h=>this._handleKey(h.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,e.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,v.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let i=0;i<s;i++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
|
||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),/\p{Control}/u.test(s)||this._charsToConsume.push(s)}_refreshRows(s,i){this._liveRegionDebouncer.refresh(s,i,this._terminal.rows)}_renderRows(s,i){const u=this._terminal.buffer,p=u.lines.length.toString();for(let h=s;h<=i;h++){const m=u.lines.get(u.ydisp+h),_=[],f=(m==null?void 0:m.translateToString(!0,void 0,void 0,_))||"",C=(u.ydisp+h+1).toString(),b=this._rowElements[h];b&&(f.length===0?(b.innerText=" ",this._rowColumns.set(b,[0,1])):(b.textContent=f,this._rowColumns.set(b,_)),b.setAttribute("aria-posinset",C),b.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,i){const u=s.target,p=this._rowElements[i===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==p)return;let h,m;if(i===0?(h=u,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(h=this._rowElements.shift(),m=u,this._rowContainer.removeChild(h)),h.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{const _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var f;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:s.anchorNode,offset:s.anchorOffset},u={node:s.focusNode,offset:s.focusOffset};if((i.node.compareDocumentPosition(u.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===u.node&&i.offset>u.offset)&&([i,u]=[u,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const p=this._rowElements.slice(-1)[0];if(u.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(u={node:p,offset:((f=p.textContent)==null?void 0:f.length)??0}),!this._rowContainer.contains(u.node))return;const h=({node:C,offset:b})=>{const S=C instanceof Text?C.parentNode:C;let w=parseInt(S==null?void 0:S.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const L=this._rowColumns.get(S);if(!L)return console.warn("columns is null. Race condition?"),null;let D=b<L.length?L[b]:L.slice(-1)[0]+1;return D>=this._terminal.cols&&(++w,D=0),{row:w,column:D}},m=h(i),_=h(u);if(m&&_){if(m.row>_.row||m.row===_.row&&m.column>=_.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(_.row-m.row)*this._terminal.cols-m.column+_.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=o=l([c(1,r.IInstantiationService),c(2,g.ICoreBrowserService),c(3,g.IRenderService)],o)},3614:(O,t)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function c(d,v,g,r){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function n(d,v,g){const r=g.getBoundingClientRect(),e=d.clientX-r.left-10,o=d.clientY-r.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${e}px`,v.style.top=`${o}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=a,t.bracketTextForPaste=l,t.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},t.handlePasteEvent=function(d,v,g,r){d.stopPropagation(),d.clipboardData&&c(d.clipboardData.getData("text/plain"),v,g,r)},t.paste=c,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(d,v,g,r,e){n(d,v,g),e&&r.rightClickSelect(d),v.value=r.selectionText,v.select()}},7239:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const l=a(1505);t.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(c,n,d){this._css.set(c,n,d)}getCss(c,n){return this._css.get(c,n)}setColor(c,n,d){this._color.set(c,n,d)}getColor(c,n){return this._color.get(c,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,l,c,n){a.addEventListener(l,c,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,c,n))}}}},3551:function(O,t,a){var l=this&&this.__decorate||function(o,s,i,u){var p,h=arguments.length,m=h<3?s:u===null?u=Object.getOwnPropertyDescriptor(s,i):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,s,i,u);else for(var _=o.length-1;_>=0;_--)(p=o[_])&&(m=(h<3?p(m):h>3?p(s,i,m):p(s,i))||m);return h>3&&m&&Object.defineProperty(s,i,m),m},c=this&&this.__param||function(o,s){return function(i,u){s(i,u,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=a(3656),d=a(8460),v=a(844),g=a(2585),r=a(4725);let e=t.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(o,s,i,u,p){super(),this._element=o,this._mouseService=s,this._renderService=i,this._bufferService=u,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{var h;this._lastMouseEvent=void 0,(h=this._activeProviderReplies)==null||h.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(o){this._lastMouseEvent=o;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const i=o.composedPath();for(let u=0;u<i.length;u++){const p=i[u];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,s){var u,p;this._activeProviderReplies&&s||((u=this._activeProviderReplies)==null||u.forEach(h=>{h==null||h.forEach(m=>{m.link.dispose&&m.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=o.y);let i=!1;for(const[h,m]of this._linkProviderService.linkProviders.entries())s?(p=this._activeProviderReplies)!=null&&p.get(h)&&(i=this._checkLinkProviderResult(h,o,i)):m.provideLinks(o.y,_=>{var C,b;if(this._isMouseOut)return;const f=_==null?void 0:_.map(S=>({link:S}));(C=this._activeProviderReplies)==null||C.set(h,f),i=this._checkLinkProviderResult(h,o,i),((b=this._activeProviderReplies)==null?void 0:b.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)})}_removeIntersectingLinks(o,s){const i=new Set;for(let u=0;u<s.size;u++){const p=s.get(u);if(p)for(let h=0;h<p.length;h++){const m=p[h],_=m.link.range.start.y<o?0:m.link.range.start.x,f=m.link.range.end.y>o?this._bufferService.cols:m.link.range.end.x;for(let C=_;C<=f;C++){if(i.has(C)){p.splice(h--,1);break}i.add(C)}}}}_checkLinkProviderResult(o,s,i){var h;if(!this._activeProviderReplies)return i;const u=this._activeProviderReplies.get(o);let p=!1;for(let m=0;m<o;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(p=!0);if(!p&&u){const m=u.find(_=>this._linkAtPosition(_.link,s));m&&(i=!0,this._handleNewLink(m))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let m=0;m<this._activeProviderReplies.size;m++){const _=(h=this._activeProviderReplies.get(m))==null?void 0:h.find(f=>this._linkAtPosition(f.link,s));if(_){i=!0,this._handleNewLink(_);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._currentLink)return;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,s){this._currentLink&&this._lastMouseEvent&&(!o||!s||this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(o){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(o.link,s)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>{var i,u;return(u=(i=this._currentLink)==null?void 0:i.state)==null?void 0:u.decorations.pointerCursor},set:i=>{var u;(u=this._currentLink)!=null&&u.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,u;return(u=(i=this._currentLink)==null?void 0:i.state)==null?void 0:u.decorations.underline},set:i=>{var u,p,h;(u=this._currentLink)!=null&&u.state&&((h=(p=this._currentLink)==null?void 0:p.state)==null?void 0:h.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const u=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(u,p),this._lastMouseEvent)){const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._askForLink(h,!1)}})))}_linkHover(o,s,i){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(i,s.text)}_fireUnderlineEvent(o,s){const i=o.range,u=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-u-1,i.end.x,i.end.y-u-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(o,s,i){var u;(u=this._currentLink)!=null&&u.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(i,s.text)}_linkAtPosition(o,s){const i=o.range.start.y*this._bufferService.cols+o.range.start.x,u=o.range.end.y*this._bufferService.cols+o.range.end.x,p=s.y*this._bufferService.cols+s.x;return i<=p&&p<=u}_positionFromMouseEvent(o,s,i){const u=i.getCoords(o,s,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,s,i,u,p){return{x1:o,y1:s,x2:i,y2:u,cols:this._bufferService.cols,fg:p}}};t.Linkifier=e=l([c(1,r.IMouseService),c(2,r.IRenderService),c(3,g.IBufferService),c(4,r.ILinkProviderService)],e)},9042:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,s){var i,u=arguments.length,p=u<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,s);else for(var h=r.length-1;h>=0;h--)(i=r[h])&&(p=(u<3?i(p):u>3?i(e,o,p):i(e,o))||p);return u>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,s){e(o,s,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=a(511),d=a(2585);let v=t.OscLinkProvider=class{constructor(r,e,o){this._bufferService=r,this._optionsService=e,this._oscLinkService=o}provideLinks(r,e){var f;const o=this._bufferService.buffer.lines.get(r-1);if(!o)return void e(void 0);const s=[],i=this._optionsService.rawOptions.linkHandler,u=new n.CellData,p=o.getTrimmedLength();let h=-1,m=-1,_=!1;for(let C=0;C<p;C++)if(m!==-1||o.hasContent(C)){if(o.loadCell(C,u),u.hasExtendedAttrs()&&u.extended.urlId){if(m===-1){m=C,h=u.extended.urlId;continue}_=u.extended.urlId!==h}else m!==-1&&(_=!0);if(_||m!==-1&&C===p-1){const b=(f=this._oscLinkService.getLinkData(h))==null?void 0:f.uri;if(b){const S={start:{x:m+1,y:r},end:{x:C+(_||C!==p-1?0:1),y:r}};let w=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{const L=new URL(b);["http:","https:"].includes(L.protocol)||(w=!0)}catch{w=!0}w||s.push({text:b,range:S,activate:(L,D)=>i?i.activate(L,D,S):g(0,D),hover:(L,D)=>{var B;return(B=i==null?void 0:i.hover)==null?void 0:B.call(i,L,D,S)},leave:(L,D)=>{var B;return(B=i==null?void 0:i.leave)==null?void 0:B.call(i,L,D,S)}})}_=!1,u.hasExtendedAttrs()&&u.extended.urlId?(m=C,h=u.extended.urlId):(m=-1,h=-1)}}e(s)}};function g(r,e){if(confirm(`Do you want to navigate to ${e}?
|
||
|
||
WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=v=l([c(0,d.IBufferService),c(1,d.IOptionsService),c(2,d.IOscLinkService)],v)},6193:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,l,c){this._rowCount=c,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.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 a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const l=a(3614),c=a(3656),n=a(3551),d=a(9042),v=a(3730),g=a(1680),r=a(3107),e=a(5744),o=a(2950),s=a(1296),i=a(428),u=a(4269),p=a(5114),h=a(8934),m=a(3230),_=a(9312),f=a(4725),C=a(6731),b=a(8055),S=a(8969),w=a(8460),L=a(844),D=a(6114),B=a(8437),k=a(2584),M=a(7399),y=a(5941),x=a(9074),R=a(2585),A=a(5435),I=a(4567),H=a(779);class j extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(T={}){super(T),this.browser=D,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new L.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(f.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((E,F)=>this.refresh(E,F))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(E=>this._reportWindowsOptions(E))),this.register(this._inputHandler.onColor(E=>this._handleColorEvent(E))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(E=>this._afterResize(E.cols,E.rows))),this.register((0,L.toDisposable)(()=>{var E,F;this._customKeyEventHandler=void 0,(F=(E=this.element)==null?void 0:E.parentNode)==null||F.removeChild(this.element)}))}_handleColorEvent(T){if(this._themeService)for(const E of T){let F,P="";switch(E.index){case 256:F="foreground",P="10";break;case 257:F="background",P="11";break;case 258:F="cursor",P="12";break;default:F="ansi",P="4;"+E.index}switch(E.type){case 0:const z=b.color.toColorRGB(F==="ansi"?this._themeService.colors.ansi[E.index]:this._themeService.colors[F]);this.coreService.triggerDataEvent(`${k.C0.ESC}]${P};${(0,y.toRgbString)(z)}${k.C1_ESCAPED.ST}`);break;case 1:if(F==="ansi")this._themeService.modifyColors(W=>W.ansi[E.index]=b.channels.toColor(...E.color));else{const W=F;this._themeService.modifyColors(Y=>Y[W]=b.channels.toColor(...E.color))}break;case 2:this._themeService.restoreColor(E.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(k.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)==null?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(k.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 T=this.buffer.ybase+this.buffer.y,E=this.buffer.lines.get(T);if(!E)return;const F=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,z=E.getWidth(F),W=this._renderService.dimensions.css.cell.width*z,Y=this.buffer.y*this._renderService.dimensions.css.cell.height,U=F*this._renderService.dimensions.css.cell.width;this.textarea.style.left=U+"px",this.textarea.style.top=Y+"px",this.textarea.style.width=W+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,c.addDisposableDomListener)(this.element,"copy",E=>{this.hasSelection()&&(0,l.copyHandler)(E,this._selectionService)}));const T=E=>(0,l.handlePasteEvent)(E,this.textarea,this.coreService,this.optionsService);this.register((0,c.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,c.addDisposableDomListener)(this.element,"paste",T)),D.isFirefox?this.register((0,c.addDisposableDomListener)(this.element,"mousedown",E=>{E.button===2&&(0,l.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,c.addDisposableDomListener)(this.element,"contextmenu",E=>{(0,l.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),D.isLinux&&this.register((0,c.addDisposableDomListener)(this.element,"auxclick",E=>{E.button===1&&(0,l.moveTextAreaUnderMouseCursor)(E,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,c.addDisposableDomListener)(this.textarea,"keyup",T=>this._keyUp(T),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keydown",T=>this._keyDown(T),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keypress",T=>this._keyPress(T),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionupdate",T=>this._compositionHelper.compositionupdate(T))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,c.addDisposableDomListener)(this.textarea,"input",T=>this._inputEvent(T),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(T){var F;if(!T)throw new Error("Terminal requires a parent element.");if(T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((F=this.element)==null?void 0:F.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=T.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),T.appendChild(this.element);const E=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),E.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,c.addDisposableDomListener)(this.screenElement,"mousemove",P=>this.updateCursorStyle(P))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),E.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),D.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(p.CoreBrowserService,this.textarea,T.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(f.ICoreBrowserService,this._coreBrowserService),this.register((0,c.addDisposableDomListener)(this.textarea,"focus",P=>this._handleTextAreaFocus(P))),this.register((0,c.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(f.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(f.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(u.CharacterJoinerService),this._instantiationService.setService(f.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(f.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(P=>this._onRender.fire(P))),this.onResize(P=>this._renderService.resize(P.cols,P.rows)),this._compositionView=this._document.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._mouseService=this._instantiationService.createInstance(h.MouseService),this._instantiationService.setService(f.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(E);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(P=>this.scrollLines(P.amount,P.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(_.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(f.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(P=>this.scrollLines(P.amount,P.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(P=>this._renderService.handleSelectionChanged(P.start,P.end,P.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(P=>{this.textarea.value=P,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(P=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(r.BufferDecorationRenderer,this.screenElement)),this.register((0,c.addDisposableDomListener)(this.element,"mousedown",P=>this._selectionService.handleMouseDown(P))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",P=>this._handleScreenReaderModeOptionChange(P))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.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,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const T=this,E=this.element;function F(W){const Y=T._mouseService.getMouseReportCoords(W,T.screenElement);if(!Y)return!1;let U,te;switch(W.overrideType||W.type){case"mousemove":te=32,W.buttons===void 0?(U=3,W.button!==void 0&&(U=W.button<3?W.button:3)):U=1&W.buttons?0:4&W.buttons?1:2&W.buttons?2:3;break;case"mouseup":te=0,U=W.button<3?W.button:3;break;case"mousedown":te=1,U=W.button<3?W.button:3;break;case"wheel":if(T._customWheelEventHandler&&T._customWheelEventHandler(W)===!1||T.viewport.getLinesScrolled(W)===0)return!1;te=W.deltaY<0?0:1,U=4;break;default:return!1}return!(te===void 0||U===void 0||U>4)&&T.coreMouseService.triggerMouseEvent({col:Y.col,row:Y.row,x:Y.x,y:Y.y,button:U,action:te,ctrl:W.ctrlKey,alt:W.altKey,shift:W.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:W=>(F(W),W.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(W)),wheel:W=>(F(W),this.cancel(W,!0)),mousedrag:W=>{W.buttons&&F(W)},mousemove:W=>{W.buttons||F(W)}};this.register(this.coreMouseService.onProtocolChange(W=>{W?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(W)),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&W?P.mousemove||(E.addEventListener("mousemove",z.mousemove),P.mousemove=z.mousemove):(E.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&W?P.wheel||(E.addEventListener("wheel",z.wheel,{passive:!1}),P.wheel=z.wheel):(E.removeEventListener("wheel",P.wheel),P.wheel=null),2&W?P.mouseup||(P.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&W?P.mousedrag||(P.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,c.addDisposableDomListener)(E,"mousedown",W=>{if(W.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(W))return F(W),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(W)})),this.register((0,c.addDisposableDomListener)(E,"wheel",W=>{if(!P.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(W)===!1)return!1;if(!this.buffer.hasScrollback){const Y=this.viewport.getLinesScrolled(W);if(Y===0)return;const U=k.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(W.deltaY<0?"A":"B");let te="";for(let re=0;re<Math.abs(Y);re++)te+=U;return this.coreService.triggerDataEvent(te,!0),this.cancel(W,!0)}return this.viewport.handleWheel(W)?this.cancel(W):void 0}},{passive:!1})),this.register((0,c.addDisposableDomListener)(E,"touchstart",W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(W),this.cancel(W)},{passive:!0})),this.register((0,c.addDisposableDomListener)(E,"touchmove",W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(W)?void 0:this.cancel(W)},{passive:!1}))}refresh(T,E){var F;(F=this._renderService)==null||F.refreshRows(T,E)}updateCursorStyle(T){var E;(E=this._selectionService)!=null&&E.shouldColumnSelect(T)?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(T,E,F=0){var P;F===1?(super.scrollLines(T,E,F),this.refresh(0,this.rows-1)):(P=this.viewport)==null||P.scrollLines(T)}paste(T){(0,l.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}attachCustomWheelEventHandler(T){this._customWheelEventHandler=T}registerLinkProvider(T){return this._linkProviderService.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const E=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),E}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,E,F){this._selectionService.setSelection(T,E,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 T;(T=this._selectionService)==null||T.clearSelection()}selectAll(){var T;(T=this._selectionService)==null||T.selectAll()}selectLines(T,E){var F;(F=this._selectionService)==null||F.selectLines(T,E)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const E=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!E&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;E||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const F=(0,M.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),F.type===3||F.type===2){const P=this.rows-1;return this.scrollLines(F.type===2?-P:P),this.cancel(T,!0)}return F.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(F.cancel&&this.cancel(T,!0),!F.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(F.key!==k.C0.ETX&&F.key!==k.C0.CR||(this.textarea.value=""),this._onKey.fire({key:F.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(F.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,E){const F=T.isMac&&!this.options.macOptionIsMeta&&E.altKey&&!E.ctrlKey&&!E.metaKey||T.isWindows&&E.altKey&&E.ctrlKey&&!E.metaKey||T.isWindows&&E.getModifierState("AltGraph");return E.type==="keypress"?F:F&&(!E.keyCode||E.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||(function(E){return E.keyCode===16||E.keyCode===17||E.keyCode===18}(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let E;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)E=T.charCode;else if(T.which===null||T.which===void 0)E=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;E=T.which}return!(!E||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(E=String.fromCharCode(E),this._onKey.fire({key:E,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(E,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const E=T.data;return this.coreService.triggerDataEvent(E,!0),this.cancel(T),!0}return!1}resize(T,E){T!==this.cols||E!==this.rows?super.resize(T,E):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,E){var F,P;(F=this._charSizeService)==null||F.measure(),(P=this.viewport)==null||P.syncScrollArea(!0)}clear(){var T;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 E=1;E<this.rows;E++)this.buffer.lines.push(this.buffer.getBlankLine(B.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)==null||T.reset(),this.refresh(0,this.rows-1)}}reset(){var E,F;this.options.rows=this.rows,this.options.cols=this.cols;const T=this._customKeyEventHandler;this._setup(),super.reset(),(E=this._selectionService)==null||E.reset(),this._decorationService.reset(),(F=this.viewport)==null||F.reset(),this._customKeyEventHandler=T,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)==null||T.clearTextureAtlas()}_reportFocus(){var T;(T=this.element)!=null&&T.classList.contains("focus")?this.coreService.triggerDataEvent(k.C0.ESC+"[I"):this.coreService.triggerDataEvent(k.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case A.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const E=this._renderService.dimensions.css.canvas.width.toFixed(0),F=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${k.C0.ESC}[4;${F};${E}t`);break;case A.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const P=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${k.C0.ESC}[6;${z};${P}t`)}}cancel(T,E){if(this.options.cancelEvents||E)return T.preventDefault(),T.stopPropagation(),!1}}t.Terminal=j},9924:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(a,l=1e3){this._renderCallback=a,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,l,c){this._rowCount=c,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,v=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l)}}},1680:function(O,t,a){var l=this&&this.__decorate||function(o,s,i,u){var p,h=arguments.length,m=h<3?s:u===null?u=Object.getOwnPropertyDescriptor(s,i):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,s,i,u);else for(var _=o.length-1;_>=0;_--)(p=o[_])&&(m=(h<3?p(m):h>3?p(s,i,m):p(s,i))||m);return h>3&&m&&Object.defineProperty(s,i,m),m},c=this&&this.__param||function(o,s){return function(i,u){s(i,u,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=a(3656),d=a(4725),v=a(8460),g=a(844),r=a(2585);let e=t.Viewport=class extends g.Disposable{constructor(o,s,i,u,p,h,m,_){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=i,this._optionsService=u,this._charSizeService=p,this._renderService=h,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=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._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(f=>this._renderDimensions=f)),this._handleThemeChange(_.colors),this.register(_.onChangeColors(f=>this._handleThemeChange(f))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(o){if(o)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._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&i<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var _;let i,u="";const p=[],h=s??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let f=o;f<h;f++){const C=m.get(f);if(!C)continue;const b=(_=m.get(f+1))==null?void 0:_.isWrapped;if(u+=C.translateToString(!b),!b||f===m.length-1){const S=document.createElement("div");S.textContent=u,p.push(S),u.length>0&&(i=S),u=""}}return{bufferElements:p,cursorElement:i}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&s.altKey||i==="ctrl"&&s.ctrlKey||i==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};t.Viewport=e=l([c(2,r.IBufferService),c(3,r.IOptionsService),c(4,d.ICharSizeService),c(5,d.IRenderService),c(6,d.ICoreBrowserService),c(7,d.IThemeService)],e)},3107:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,s){var i,u=arguments.length,p=u<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,s);else for(var h=r.length-1;h>=0;h--)(i=r[h])&&(p=(u<3?i(p):u>3?i(e,o,p):i(e,o))||p);return u>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,s){e(o,s,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=a(4725),d=a(844),v=a(2585);let g=t.BufferDecorationRenderer=class extends d.Disposable{constructor(r,e,o,s,i){super(),this._screenElement=r,this._bufferService=e,this._coreBrowserService=o,this._decorationService=s,this._renderService=i,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._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>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(u=>this._removeDecoration(u))),this.register((0,d.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const r of this._decorationService.decorations)this._renderDecoration(r);this._dimensionsChanged=!1}_renderDecoration(r){this._refreshStyle(r),this._dimensionsChanged&&this._refreshXPosition(r)}_createElement(r){var s;const e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",((s=r==null?void 0:r.options)==null?void 0:s.layer)==="top"),e.style.width=`${Math.round((r.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,e.style.height=(r.options.height||1)*this._renderService.dimensions.css.cell.height+"px",e.style.top=(r.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",e.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=r.options.x??0;return o&&o>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(r,e),e}_refreshStyle(r){const e=r.marker.line-this._bufferService.buffers.active.ydisp;if(e<0||e>=this._bufferService.rows)r.element&&(r.element.style.display="none",r.onRenderEmitter.fire(r.element));else{let o=this._decorationElements.get(r);o||(o=this._createElement(r),r.element=o,this._decorationElements.set(r,o),this._container.appendChild(o),r.onDispose(()=>{this._decorationElements.delete(r),o.remove()})),o.style.top=e*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",r.onRenderEmitter.fire(o)}}_refreshXPosition(r,e=r.element){if(!e)return;const o=r.options.x??0;(r.options.anchor||"left")==="right"?e.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":e.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(r){var e;(e=this._decorationElements.get(r))==null||e.remove(),this._decorationElements.delete(r),r.dispose()}};t.BufferDecorationRenderer=g=l([c(1,v.IBufferService),c(2,n.ICoreBrowserService),c(3,v.IDecorationService),c(4,n.IRenderService)],g)},5871:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.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(a){if(a.options.overviewRulerOptions){for(const l of this._zones)if(l.color===a.options.overviewRulerOptions.color&&l.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,a.marker.line))return;if(this._lineAdjacentToZone(l,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(l,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,l){return l>=a.startBufferLine&&l<=a.endBufferLine}_lineAdjacentToZone(a,l,c){return l>=a.startBufferLine-this._linePadding[c||"full"]&&l<=a.endBufferLine+this._linePadding[c||"full"]}_addLineToZone(a,l){a.startBufferLine=Math.min(a.startBufferLine,l),a.endBufferLine=Math.max(a.endBufferLine,l)}}},5744:function(O,t,a){var l=this&&this.__decorate||function(i,u,p,h){var m,_=arguments.length,f=_<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(i,u,p,h);else for(var C=i.length-1;C>=0;C--)(m=i[C])&&(f=(_<3?m(f):_>3?m(u,p,f):m(u,p))||f);return _>3&&f&&Object.defineProperty(u,p,f),f},c=this&&this.__param||function(i,u){return function(p,h){u(p,h,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=a(5871),d=a(4725),v=a(844),g=a(2585),r={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let s=t.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(i,u,p,h,m,_,f){var b;super(),this._viewportElement=i,this._screenElement=u,this._bufferService=p,this._decorationService=h,this._renderService=m,this._optionsService=_,this._coreBrowserService=f,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(b=this._viewportElement.parentElement)==null||b.insertBefore(this._canvas,this._viewportElement);const C=this._canvas.getContext("2d");if(!C)throw new Error("Ctx cannot be null");this._ctx=C,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)(()=>{var S;(S=this._canvas)==null||S.remove()}))}_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.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const i=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);e.full=this._canvas.width,e.left=i,e.center=u,e.right=i,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=e.left,o.right=e.left+e.center}_refreshDrawHeightConstants(){r.full=Math.round(2*this._coreBrowserService.dpr);const i=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(i,12),6)*this._coreBrowserService.dpr);r.left=u,r.center=u,r.right=u}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const i=this._colorZoneStore.zones;for(const u of i)u.position!=="full"&&this._renderColorZone(u);for(const u of i)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(i){this._ctx.fillStyle=i.color,this._ctx.fillRect(o[i.position||"full"],Math.round((this._canvas.height-1)*(i.startBufferLine/this._bufferService.buffers.active.lines.length)-r[i.position||"full"]/2),e[i.position||"full"],Math.round((this._canvas.height-1)*((i.endBufferLine-i.startBufferLine)/this._bufferService.buffers.active.lines.length)+r[i.position||"full"]))}_queueRefresh(i,u){this._shouldUpdateDimensions=i||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t.OverviewRulerRenderer=s=l([c(2,g.IBufferService),c(3,g.IDecorationService),c(4,d.IRenderService),c(5,g.IOptionsService),c(6,d.ICoreBrowserService)],s)},2950:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,s){var i,u=arguments.length,p=u<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,s);else for(var h=r.length-1;h>=0;h--)(i=r[h])&&(p=(u<3?i(p):u>3?i(e,o,p):i(e,o))||p);return u>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,s){e(o,s,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=a(4725),d=a(2585),v=a(2584);let g=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(r,e,o,s,i,u){this._textarea=r,this._compositionView=e,this._bufferService=o,this._optionsService=s,this._coreService=i,this._renderService=u,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(r){this._compositionView.textContent=r.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(r){if(this._isComposing||this._isSendingComposition){if(r.keyCode===229||r.keyCode===16||r.keyCode===17||r.keyCode===18)return!1;this._finalizeComposition(!1)}return r.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(r){if(this._compositionView.classList.remove("active"),this._isComposing=!1,r){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),o.length>0&&this._coreService.triggerDataEvent(o,!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 r=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,o=e.replace(r,"");this._dataAlreadySent=o,e.length>r.length?this._coreService.triggerDataEvent(o,!0):e.length<r.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):e.length===r.length&&e!==r&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(r){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const u=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}r||setTimeout(()=>this.updateCompositionElements(!0),0)}}};t.CompositionHelper=g=l([c(2,d.IBufferService),c(3,d.IOptionsService),c(4,d.ICoreService),c(5,n.IRenderService)],g)},9806:(O,t)=>{function a(l,c,n){const d=n.getBoundingClientRect(),v=l.getComputedStyle(n),g=parseInt(v.getPropertyValue("padding-left")),r=parseInt(v.getPropertyValue("padding-top"));return[c.clientX-d.left-g,c.clientY-d.top-r]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=a,t.getCoords=function(l,c,n,d,v,g,r,e,o){if(!g)return;const s=a(l,c,n);return s?(s[0]=Math.ceil((s[0]+(o?r/2:0))/r),s[1]=Math.ceil(s[1]/e),s[0]=Math.min(Math.max(s[0],1),d+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),v),s):void 0}},9504:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const l=a(2584);function c(e,o,s,i){const u=e-n(e,s),p=o-n(o,s),h=Math.abs(u-p)-function(m,_,f){let C=0;const b=m-n(m,f),S=_-n(_,f);for(let w=0;w<Math.abs(b-S);w++){const L=d(m,_)==="A"?-1:1,D=f.buffer.lines.get(b+L*w);D!=null&&D.isWrapped&&C++}return C}(e,o,s);return r(h,g(d(e,o),i))}function n(e,o){let s=0,i=o.buffer.lines.get(e),u=i==null?void 0:i.isWrapped;for(;u&&e>=0&&e<o.rows;)s++,i=o.buffer.lines.get(--e),u=i==null?void 0:i.isWrapped;return s}function d(e,o){return e>o?"A":"B"}function v(e,o,s,i,u,p){let h=e,m=o,_="";for(;h!==s||m!==i;)h+=u?1:-1,u&&h>p.cols-1?(_+=p.buffer.translateBufferLineToString(m,!1,e,h),h=0,e=0,m++):!u&&h<0&&(_+=p.buffer.translateBufferLineToString(m,!1,0,e+1),h=p.cols-1,e=h,m--);return _+p.buffer.translateBufferLineToString(m,!1,e,h)}function g(e,o){const s=o?"O":"[";return l.C0.ESC+s+e}function r(e,o){e=Math.floor(e);let s="";for(let i=0;i<e;i++)s+=o;return s}t.moveToCellSequence=function(e,o,s,i){const u=s.buffer.x,p=s.buffer.y;if(!s.buffer.hasScrollback)return function(_,f,C,b,S,w){return c(f,b,S,w).length===0?"":r(v(_,f,_,f-n(f,S),!1,S).length,g("D",w))}(u,p,0,o,s,i)+c(p,o,s,i)+function(_,f,C,b,S,w){let L;L=c(f,b,S,w).length>0?b-n(b,S):f;const D=b,B=function(k,M,y,x,R,A){let I;return I=c(y,x,R,A).length>0?x-n(x,R):M,k<y&&I<=x||k>=y&&I<x?"C":"D"}(_,f,C,b,S,w);return r(v(_,L,C,D,B==="C",S).length,g(B,w))}(u,p,e,o,s,i);let h;if(p===o)return h=u>e?"D":"C",r(Math.abs(u-e),g(h,i));h=p>o?"D":"C";const m=Math.abs(p-o);return r(function(_,f){return f.cols-_}(p>o?e:u,s)+(m-1)*s.cols+1+((p>o?u:e)-1),g(h,i))}},1296:function(O,t,a){var l=this&&this.__decorate||function(w,L,D,B){var k,M=arguments.length,y=M<3?L:B===null?B=Object.getOwnPropertyDescriptor(L,D):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,L,D,B);else for(var x=w.length-1;x>=0;x--)(k=w[x])&&(y=(M<3?k(y):M>3?k(L,D,y):k(L,D))||y);return M>3&&y&&Object.defineProperty(L,D,y),y},c=this&&this.__param||function(w,L){return function(D,B){L(D,B,w)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=a(3787),d=a(2550),v=a(2223),g=a(6171),r=a(6052),e=a(4725),o=a(8055),s=a(8460),i=a(844),u=a(2585),p="xterm-dom-renderer-owner-",h="xterm-rows",m="xterm-fg-",_="xterm-bg-",f="xterm-focus",C="xterm-selection";let b=1,S=t.DomRenderer=class extends i.Disposable{constructor(w,L,D,B,k,M,y,x,R,A,I,H,j){super(),this._terminal=w,this._document=L,this._element=D,this._screenElement=B,this._viewportElement=k,this._helperContainer=M,this._linkifier2=y,this._charSizeService=R,this._optionsService=A,this._bufferService=I,this._coreBrowserService=H,this._themeService=j,this._terminalClass=b++,this._rowElements=[],this._selectionRenderModel=(0,r.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(h),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(N=>this._injectCss(N))),this._injectCss(this._themeService.colors),this._rowFactory=x.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(N=>this._handleLinkHover(N))),this.register(this._linkifier2.onHideLinkUnderline(N=>this._handleLinkLeave(N))),this.register((0,i.toDisposable)(()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const D of this._rowElements)D.style.width=`${this.dimensions.css.canvas.width}px`,D.style.height=`${this.dimensions.css.cell.height}px`,D.style.lineHeight=`${this.dimensions.css.cell.height}px`,D.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${h} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${h} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${h} .xterm-dim { color: ${o.color.multiplyOpacity(w.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const D=`blink_underline_${this._terminalClass}`,B=`blink_bar_${this._terminalClass}`,k=`blink_block_${this._terminalClass}`;L+=`@keyframes ${D} { 50% { border-bottom-style: hidden; }}`,L+=`@keyframes ${B} { 50% { box-shadow: none; }}`,L+=`@keyframes ${k} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,L+=`${this._terminalSelector} .${h}.${f} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${D} 1s step-end infinite;}${this._terminalSelector} .${h}.${f} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${h}.${f} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${k} 1s step-end infinite;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[M,y]of w.ansi.entries())L+=`${this._terminalSelector} .${m}${M} { color: ${y.css}; }${this._terminalSelector} .${m}${M}.xterm-dim { color: ${o.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${_}${M} { background-color: ${y.css}; }`;L+=`${this._terminalSelector} .${m}${v.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(w.background).css}; }${this._terminalSelector} .${m}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${_}${v.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,L){for(let D=this._rowElements.length;D<=L;D++){const B=this._document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,L){this._refreshRowElements(w,L),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(f),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(f),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,L,D){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,L,D),this.renderRows(0,this._bufferService.rows-1),!w||!L)return;this._selectionRenderModel.update(this._terminal,w,L,D);const B=this._selectionRenderModel.viewportStartRow,k=this._selectionRenderModel.viewportEndRow,M=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(M>=this._bufferService.rows||y<0)return;const x=this._document.createDocumentFragment();if(D){const R=w[0]>L[0];x.appendChild(this._createSelectionElement(M,R?L[0]:w[0],R?w[0]:L[0],y-M+1))}else{const R=B===M?w[0]:0,A=M===k?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(M,R,A));const I=y-M-1;if(x.appendChild(this._createSelectionElement(M+1,0,this._bufferService.cols,I)),M!==y){const H=k===y?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(y,0,H))}}this._selectionContainer.appendChild(x)}_createSelectionElement(w,L,D,B=1){const k=this._document.createElement("div"),M=L*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(D-L);return M+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-M),k.style.height=B*this.dimensions.css.cell.height+"px",k.style.top=w*this.dimensions.css.cell.height+"px",k.style.left=`${M}px`,k.style.width=`${y}px`,k}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,L){const D=this._bufferService.buffer,B=D.ybase+D.y,k=Math.min(D.x,this._bufferService.cols-1),M=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=w;R<=L;R++){const A=R+D.ydisp,I=this._rowElements[R],H=D.lines.get(A);if(!I||!H)break;I.replaceChildren(...this._rowFactory.createRow(H,A,A===B,y,x,k,M,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,L,D,B,k,M){D<0&&(w=0),B<0&&(L=0);const y=this._bufferService.rows-1;D=Math.max(Math.min(D,y),0),B=Math.max(Math.min(B,y),0),k=Math.min(k,this._bufferService.cols);const x=this._bufferService.buffer,R=x.ybase+x.y,A=Math.min(x.x,k-1),I=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=D;N<=B;++N){const T=N+x.ydisp,E=this._rowElements[N],F=x.lines.get(T);if(!E||!F)break;E.replaceChildren(...this._rowFactory.createRow(F,T,T===R,H,j,A,I,this.dimensions.css.cell.width,this._widthCache,M?N===D?w:0:-1,M?(N===B?L:k)-1:-1))}}};t.DomRenderer=S=l([c(7,u.IInstantiationService),c(8,e.ICharSizeService),c(9,u.IOptionsService),c(10,u.IBufferService),c(11,e.ICoreBrowserService),c(12,e.IThemeService)],S)},3787:function(O,t,a){var l=this&&this.__decorate||function(h,m,_,f){var C,b=arguments.length,S=b<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,_):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,m,_,f);else for(var w=h.length-1;w>=0;w--)(C=h[w])&&(S=(b<3?C(S):b>3?C(m,_,S):C(m,_))||S);return b>3&&S&&Object.defineProperty(m,_,S),S},c=this&&this.__param||function(h,m){return function(_,f){m(_,f,h)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),v=a(511),g=a(2585),r=a(8055),e=a(4725),o=a(4269),s=a(6171),i=a(3734);let u=t.DomRendererRowFactory=class{constructor(h,m,_,f,C,b,S){this._document=h,this._characterJoinerService=m,this._optionsService=_,this._coreBrowserService=f,this._coreService=C,this._decorationService=b,this._themeService=S,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(h,m,_){this._selectionStart=h,this._selectionEnd=m,this._columnSelectMode=_}createRow(h,m,_,f,C,b,S,w,L,D,B){const k=[],M=this._characterJoinerService.getJoinedCharacters(m),y=this._themeService.colors;let x,R=h.getNoBgTrimmedLength();_&&R<b+1&&(R=b+1);let A=0,I="",H=0,j=0,N=0,T=!1,E=0,F=!1,P=0;const z=[],W=D!==-1&&B!==-1;for(let Y=0;Y<R;Y++){h.loadCell(Y,this._workCell);let U=this._workCell.getWidth();if(U===0)continue;let te=!1,re=Y,X=this._workCell;if(M.length>0&&Y===M[0][0]){te=!0;const J=M.shift();X=new o.JoinedCellData(this._workCell,h.translateToString(!0,J[0],J[1]),J[1]-J[0]),re=J[1]-1,U=X.getWidth()}const de=this._isCellInSelection(Y,m),ue=_&&Y===b,V=W&&Y>=D&&Y<=B;let q=!1;this._decorationService.forEachDecorationAtCell(Y,m,void 0,J=>{q=!0});let G=X.getChars()||d.WHITESPACE_CELL_CHAR;if(G===" "&&(X.isUnderline()||X.isOverline())&&(G=" "),P=U*w-L.get(G,X.isBold(),X.isItalic()),x){if(A&&(de&&F||!de&&!F&&X.bg===H)&&(de&&F&&y.selectionForeground||X.fg===j)&&X.extended.ext===N&&V===T&&P===E&&!ue&&!te&&!q){X.isInvisible()?I+=d.WHITESPACE_CELL_CHAR:I+=G,A++;continue}A&&(x.textContent=I),x=this._document.createElement("span"),A=0,I=""}else x=this._document.createElement("span");if(H=X.bg,j=X.fg,N=X.extended.ext,T=V,E=P,F=de,te&&b>=Y&&b<=re&&(b=Y),!this._coreService.isCursorHidden&&ue&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)S&&z.push("xterm-cursor-blink"),z.push(f==="bar"?"xterm-cursor-bar":f==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(X.isBold()&&z.push("xterm-bold"),X.isItalic()&&z.push("xterm-italic"),X.isDim()&&z.push("xterm-dim"),I=X.isInvisible()?d.WHITESPACE_CELL_CHAR:X.getChars()||d.WHITESPACE_CELL_CHAR,X.isUnderline()&&(z.push(`xterm-underline-${X.extended.underlineStyle}`),I===" "&&(I=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let J=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&J<8&&(J+=8),x.style.textDecorationColor=y.ansi[J].css}X.isOverline()&&(z.push("xterm-overline"),I===" "&&(I=" ")),X.isStrikethrough()&&z.push("xterm-strikethrough"),V&&(x.style.textDecoration="underline");let $=X.getFgColor(),K=X.getFgColorMode(),ie=X.getBgColor(),Q=X.getBgColorMode();const _e=!!X.isInverse();if(_e){const J=$;$=ie,ie=J;const fe=K;K=Q,Q=fe}let oe,ae,se,Z=!1;switch(this._decorationService.forEachDecorationAtCell(Y,m,void 0,J=>{J.options.layer!=="top"&&Z||(J.backgroundColorRGB&&(Q=50331648,ie=J.backgroundColorRGB.rgba>>8&16777215,oe=J.backgroundColorRGB),J.foregroundColorRGB&&(K=50331648,$=J.foregroundColorRGB.rgba>>8&16777215,ae=J.foregroundColorRGB),Z=J.options.layer==="top")}),!Z&&de&&(oe=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ie=oe.rgba>>8&16777215,Q=50331648,Z=!0,y.selectionForeground&&(K=50331648,$=y.selectionForeground.rgba>>8&16777215,ae=y.selectionForeground)),Z&&z.push("xterm-decoration-top"),Q){case 16777216:case 33554432:se=y.ansi[ie],z.push(`xterm-bg-${ie}`);break;case 50331648:se=r.channels.toColor(ie>>16,ie>>8&255,255&ie),this._addStyle(x,`background-color:#${p((ie>>>0).toString(16),"0",6)}`);break;default:_e?(se=y.foreground,z.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):se=y.background}switch(oe||X.isDim()&&(oe=r.color.multiplyOpacity(se,.5)),K){case 16777216:case 33554432:X.isBold()&&$<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($+=8),this._applyMinimumContrast(x,se,y.ansi[$],X,oe,void 0)||z.push(`xterm-fg-${$}`);break;case 50331648:const J=r.channels.toColor($>>16&255,$>>8&255,255&$);this._applyMinimumContrast(x,se,J,X,oe,ae)||this._addStyle(x,`color:#${p($.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,se,y.foreground,X,oe,ae)||_e&&z.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}z.length&&(x.className=z.join(" "),z.length=0),ue||te||q?x.textContent=I:A++,P!==this.defaultSpacing&&(x.style.letterSpacing=`${P}px`),k.push(x),Y=re}return x&&A&&(x.textContent=I),k}_applyMinimumContrast(h,m,_,f,C,b){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(f.getCode()))return!1;const S=this._getContrastCache(f);let w;if(C||b||(w=S.getColor(m.rgba,_.rgba)),w===void 0){const L=this._optionsService.rawOptions.minimumContrastRatio/(f.isDim()?2:1);w=r.color.ensureContrastRatio(C||m,b||_,L),S.setColor((C||m).rgba,(b||_).rgba,w??null)}return!!w&&(this._addStyle(h,`color:${w.css}`),!0)}_getContrastCache(h){return h.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(h,m){h.setAttribute("style",`${h.getAttribute("style")||""}${m};`)}_isCellInSelection(h,m){const _=this._selectionStart,f=this._selectionEnd;return!(!_||!f)&&(this._columnSelectMode?_[0]<=f[0]?h>=_[0]&&m>=_[1]&&h<f[0]&&m<=f[1]:h<_[0]&&m>=_[1]&&h>=f[0]&&m<=f[1]:m>_[1]&&m<f[1]||_[1]===f[1]&&m===_[1]&&h>=_[0]&&h<f[0]||_[1]<f[1]&&m===f[1]&&h<f[0]||_[1]<f[1]&&m===_[1]&&h>=_[0])}};function p(h,m,_){for(;h.length<_;)h=m+h;return h}t.DomRendererRowFactory=u=l([c(1,e.ICharacterJoinerService),c(2,g.IOptionsService),c(3,e.ICoreBrowserService),c(4,g.ICoreService),c(5,g.IDecorationService),c(6,e.IThemeService)],u)},2550:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(a,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const c=a.createElement("span");c.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=a.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const v=a.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[c,n,d,v],this._container.appendChild(c),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(v),l.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,l,c,n){a===this._font&&l===this._fontSize&&c===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=l,this._weight=c,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${c}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${c}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,l,c){let n=0;if(!l&&!c&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const g=this._measure(a,0);return g>0&&(this._flat[n]=g),g}let d=a;l&&(d+="B"),c&&(d+="I");let v=this._holey.get(d);if(v===void 0){let g=0;l&&(g|=1),c&&(g|=2),v=this._measure(a,g),v>0&&this._holey.set(d,v)}return v}_measure(a,l){const c=this._measureElements[l];return c.textContent=a.repeat(32),c.offsetWidth/32}}},2223:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,v){return n===1&&d>Math.ceil(1.5*v)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!function(g){return 57344<=g&&g<=63743}(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||function(n){return 9472<=n&&n<=9631}(c)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,v=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),s=Math.min(e,c.rows-1);o>=c.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},456:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,l=this.selectionEnd;return!(!a||!l)&&(a[1]>l[1]||a[1]===l[1]&&a[0]>l[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,t,a){var l=this&&this.__decorate||function(s,i,u,p){var h,m=arguments.length,_=m<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(s,i,u,p);else for(var f=s.length-1;f>=0;f--)(h=s[f])&&(_=(m<3?h(_):m>3?h(i,u,_):h(i,u))||_);return m>3&&_&&Object.defineProperty(i,u,_),_},c=this&&this.__param||function(s,i){return function(u,p){i(u,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=a(2585),d=a(8460),v=a(844);let g=t.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,i,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new e(s,i,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};t.CharSizeService=g=l([c(2,n.IOptionsService)],g);class r extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(i,u){i!==void 0&&i>0&&u!==void 0&&u>0&&(this._result.width=i,this._result.height=u)}}class e extends r{constructor(i,u,p){super(),this._document=i,this._parentElement=u,this._optionsService=p,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class o extends r{constructor(i){super(),this._optionsService=i,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const u=this._ctx.measureText("W");if(!("width"in u&&"fontBoundingBoxAscent"in u&&"fontBoundingBoxDescent"in u))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const i=this._ctx.measureText("W");return this._validateAndSet(i.width,i.fontBoundingBoxAscent+i.fontBoundingBoxDescent),this._result}}},4269:function(O,t,a){var l=this&&this.__decorate||function(o,s,i,u){var p,h=arguments.length,m=h<3?s:u===null?u=Object.getOwnPropertyDescriptor(s,i):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,s,i,u);else for(var _=o.length-1;_>=0;_--)(p=o[_])&&(m=(h<3?p(m):h>3?p(s,i,m):p(s,i))||m);return h>3&&m&&Object.defineProperty(s,i,m),m},c=this&&this.__param||function(o,s){return function(i,u){s(i,u,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(3734),d=a(643),v=a(511),g=a(2585);class r extends n.AttributeData{constructor(s,i,u){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=i,this._width=u}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()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class Me{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(s){const i={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(i),i.id}deregister(s){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===s)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(s);if(!i||i.length===0)return[];const u=[],p=i.translateToString(!0);let h=0,m=0,_=0,f=i.getFg(0),C=i.getBg(0);for(let b=0;b<i.getTrimmedLength();b++)if(i.loadCell(b,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==C){if(b-h>1){const S=this._getJoinedRanges(p,_,m,i,h);for(let w=0;w<S.length;w++)u.push(S[w])}h=b,_=m,f=this._workCell.fg,C=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-h>1){const b=this._getJoinedRanges(p,_,m,i,h);for(let S=0;S<b.length;S++)u.push(b[S])}return u}_getJoinedRanges(s,i,u,p,h){const m=s.substring(i,u);let _=[];try{_=this._characterJoiners[0].handler(m)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{const C=this._characterJoiners[f].handler(m);for(let b=0;b<C.length;b++)Me._mergeRanges(_,C[b])}catch(C){console.error(C)}return this._stringRangesToCellRanges(_,p,h),_}_stringRangesToCellRanges(s,i,u){let p=0,h=!1,m=0,_=s[p];if(_){for(let f=u;f<this._bufferService.cols;f++){const C=i.getWidth(f),b=i.getString(f).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!h&&_[0]<=m&&(_[0]=f,h=!0),_[1]<=m){if(_[1]=f,_=s[++p],!_)break;_[0]<=m?(_[0]=f,h=!0):h=!1}m+=b}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(s,i){let u=!1;for(let p=0;p<s.length;p++){const h=s[p];if(u){if(i[1]<=h[0])return s[p-1][1]=i[1],s;if(i[1]<=h[1])return s[p-1][1]=Math.max(i[1],h[1]),s.splice(p,1),s;s.splice(p,1),p--}else{if(i[1]<=h[0])return s.splice(p,0,i),s;if(i[1]<=h[1])return h[0]=Math.min(i[0],h[0]),s;i[0]<h[1]&&(h[0]=Math.min(i[0],h[0]),u=!0)}}return u?s[s.length-1][1]=i[1]:s.push(i),s}};t.CharacterJoinerService=e=l([c(0,g.IBufferService)],e)},5114:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const l=a(844),c=a(8460),n=a(3656);class d extends l.Disposable{constructor(r,e,o){super(),this._textarea=r,this._window=e,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new c.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new c.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,c.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(r){this._window!==r&&(this._window=r,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}t.CoreBrowserService=d;class v extends l.Disposable{constructor(r){super(),this._parentWindow=r,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new c.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)(()=>this.clearListener()))}setWindow(r){this._parentWindow=r,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var r;this._outerListener&&((r=this._resolutionMediaMatchList)==null||r.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._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const l=a(844);class c extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const v=this.linkProviders.indexOf(d);v!==-1&&this.linkProviders.splice(v,1)}}}}t.LinkProviderService=c},8934:function(O,t,a){var l=this&&this.__decorate||function(g,r,e,o){var s,i=arguments.length,u=i<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,e):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(g,r,e,o);else for(var p=g.length-1;p>=0;p--)(s=g[p])&&(u=(i<3?s(u):i>3?s(r,e,u):s(r,e))||u);return i>3&&u&&Object.defineProperty(r,e,u),u},c=this&&this.__param||function(g,r){return function(e,o){r(e,o,g)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=a(4725),d=a(9806);let v=t.MouseService=class{constructor(g,r){this._renderService=g,this._charSizeService=r}getCoords(g,r,e,o,s){return(0,d.getCoords)(window,g,r,e,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(g,r){const e=(0,d.getCoordsRelativeToElement)(window,g,r);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};t.MouseService=v=l([c(0,n.IRenderService),c(1,n.ICharSizeService)],v)},3230:function(O,t,a){var l=this&&this.__decorate||function(s,i,u,p){var h,m=arguments.length,_=m<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(s,i,u,p);else for(var f=s.length-1;f>=0;f--)(h=s[f])&&(_=(m<3?h(_):m>3?h(i,u,_):h(i,u))||_);return m>3&&_&&Object.defineProperty(i,u,_),_},c=this&&this.__param||function(s,i){return function(u,p){i(u,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=a(6193),d=a(4725),v=a(8460),g=a(844),r=a(7226),e=a(2585);let o=t.RenderService=class extends g.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,i,u,p,h,m,_,f){super(),this._rowCount=s,this._charSizeService=p,this._renderer=this.register(new g.MutableDisposable),this._pausedResizeTask=new r.DebouncedIdleTask,this._observerDisposable=this.register(new g.MutableDisposable),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=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer((C,b)=>this._renderRows(C,b),_),this.register(this._renderDebouncer),this.register(_.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(m.onResize(()=>this._fullRefresh())),this.register(m.buffers.onBufferActivate(()=>{var C;return(C=this._renderer.value)==null?void 0:C.clear()})),this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(h.onDecorationRegistered(()=>this._fullRefresh())),this.register(h.onDecorationRemoved(()=>this._fullRefresh())),this.register(u.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()})),this.register(u.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(m.buffer.y,m.buffer.y,!0))),this.register(f.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(_.window,i),this.register(_.onWindowChange(C=>this._registerIntersectionObserver(C,i)))}_registerIntersectionObserver(s,i){if("IntersectionObserver"in s){const u=new s.IntersectionObserver(p=>this._handleIntersectionChange(p[p.length-1]),{threshold:0});u.observe(i),this._observerDisposable.value=(0,g.toDisposable)(()=>u.disconnect())}}_handleIntersectionChange(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._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,i,u=!1){this._isPaused?this._needsFullRefresh=!0:(u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,i,this._rowCount))}_renderRows(s,i){this._renderer.value&&(s=Math.min(s,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(s,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:i}),this._onRender.fire({start:s,end:i}),this._isNextRenderRedrawOnly=!0)}resize(s,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.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,i;this._renderer.value&&((i=(s=this._renderer.value).clearTextureAtlas)==null||i.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var u;return(u=this._renderer.value)==null?void 0:u.handleResize(s,i)}):this._renderer.value.handleResize(s,i),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,i,u){var p;this._selectionState.start=s,this._selectionState.end=i,this._selectionState.columnSelectMode=u,(p=this._renderer.value)==null||p.handleSelectionChanged(s,i,u)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};t.RenderService=o=l([c(2,e.IOptionsService),c(3,d.ICharSizeService),c(4,e.IDecorationService),c(5,e.IBufferService),c(6,d.ICoreBrowserService),c(7,d.IThemeService)],o)},9312:function(O,t,a){var l=this&&this.__decorate||function(_,f,C,b){var S,w=arguments.length,L=w<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,f,C,b);else for(var D=_.length-1;D>=0;D--)(S=_[D])&&(L=(w<3?S(L):w>3?S(f,C,L):S(f,C))||L);return w>3&&L&&Object.defineProperty(f,C,L),L},c=this&&this.__param||function(_,f){return function(C,b){f(C,b,_)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=a(9806),d=a(9504),v=a(456),g=a(4725),r=a(8460),e=a(844),o=a(6114),s=a(4841),i=a(511),u=a(2585),p=String.fromCharCode(160),h=new RegExp(p,"g");let m=t.SelectionService=class extends e.Disposable{constructor(_,f,C,b,S,w,L,D,B){super(),this._element=_,this._screenElement=f,this._linkifier=C,this._bufferService=b,this._coreService=S,this._mouseService=w,this._optionsService=L,this._renderService=D,this._coreBrowserService=B,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new r.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new r.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new r.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new r.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=k=>this._handleMouseMove(k),this._mouseUpListener=k=>this._handleMouseUp(k),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(k=>this._handleTrim(k)),this.register(this._bufferService.buffers.onBufferActivate(k=>this._handleBufferActivate(k))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)(()=>{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 _=this._model.finalSelectionStart,f=this._model.finalSelectionEnd;return!(!_||!f||_[0]===f[0]&&_[1]===f[1])}get selectionText(){const _=this._model.finalSelectionStart,f=this._model.finalSelectionEnd;if(!_||!f)return"";const C=this._bufferService.buffer,b=[];if(this._activeSelectionMode===3){if(_[0]===f[0])return"";const S=_[0]<f[0]?_[0]:f[0],w=_[0]<f[0]?f[0]:_[0];for(let L=_[1];L<=f[1];L++){const D=C.translateBufferLineToString(L,!0,S,w);b.push(D)}}else{const S=_[1]===f[1]?f[0]:void 0;b.push(C.translateBufferLineToString(_[1],!0,_[0],S));for(let w=_[1]+1;w<=f[1]-1;w++){const L=C.lines.get(w),D=C.translateBufferLineToString(w,!0);L!=null&&L.isWrapped?b[b.length-1]+=D:b.push(D)}if(_[1]!==f[1]){const w=C.lines.get(f[1]),L=C.translateBufferLineToString(f[1],!0,0,f[0]);w&&w.isWrapped?b[b.length-1]+=L:b.push(L)}}return b.map(S=>S.replace(h," ")).join(o.isWindows?`\r
|
||
`:`
|
||
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(_){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&_&&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(_){const f=this._getMouseBufferCoords(_),C=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!!(C&&b&&f)&&this._areCoordsInSelection(f,C,b)}isCellInSelection(_,f){const C=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!C||!b)&&this._areCoordsInSelection([_,f],C,b)}_areCoordsInSelection(_,f,C){return _[1]>f[1]&&_[1]<C[1]||f[1]===C[1]&&_[1]===f[1]&&_[0]>=f[0]&&_[0]<C[0]||f[1]<C[1]&&_[1]===C[1]&&_[0]<C[0]||f[1]<C[1]&&_[1]===f[1]&&_[0]>=f[0]}_selectWordAtCursor(_,f){var S,w;const C=(w=(S=this._linkifier.currentLink)==null?void 0:S.link)==null?void 0:w.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const b=this._getMouseBufferCoords(_);return!!b&&(this._selectWordAt(b,f),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(_,f){this._model.clearSelection(),_=Math.max(_,0),f=Math.min(f,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,_],this._model.selectionEnd=[this._bufferService.cols,f],this.refresh(),this._onSelectionChange.fire()}_handleTrim(_){this._model.handleTrim(_)&&this.refresh()}_getMouseBufferCoords(_){const f=this._mouseService.getCoords(_,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(f)return f[0]--,f[1]--,f[1]+=this._bufferService.buffer.ydisp,f}_getMouseEventScrollAmount(_){let f=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,_,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return f>=0&&f<=C?0:(f>C&&(f-=C),f=Math.min(Math.max(f,-50),50),f/=50,f/Math.abs(f)+Math.round(14*f))}shouldForceSelection(_){return o.isMac?_.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:_.shiftKey}handleMouseDown(_){if(this._mouseDownTimeStamp=_.timeStamp,(_.button!==2||!this.hasSelection)&&_.button===0){if(!this._enabled){if(!this.shouldForceSelection(_))return;_.stopPropagation()}_.preventDefault(),this._dragScrollAmount=0,this._enabled&&_.shiftKey?this._handleIncrementalClick(_):_.detail===1?this._handleSingleClick(_):_.detail===2?this._handleDoubleClick(_):_.detail===3&&this._handleTripleClick(_),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}_handleIncrementalClick(_){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(_))}_handleSingleClick(_){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(_)?3:0,this._model.selectionStart=this._getMouseBufferCoords(_),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const f=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);f&&f.length!==this._model.selectionStart[0]&&f.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(_){this._selectWordAtCursor(_,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(_){const f=this._getMouseBufferCoords(_);f&&(this._activeSelectionMode=2,this._selectLineAt(f[1]))}shouldColumnSelect(_){return _.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(_){if(_.stopImmediatePropagation(),!this._model.selectionStart)return;const f=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(_),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(_),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const b=C.lines.get(this._model.selectionEnd[1]);b&&b.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}f&&f[0]===this._model.selectionEnd[0]&&f[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const _=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(_.ydisp+this._bufferService.rows,_.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=_.ydisp),this.refresh()}}_handleMouseUp(_){const f=_.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&f<500&&_.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(_,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const b=(0,d.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(b,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const _=this._model.finalSelectionStart,f=this._model.finalSelectionEnd,C=!(!_||!f||_[0]===f[0]&&_[1]===f[1]);C?_&&f&&(this._oldSelectionStart&&this._oldSelectionEnd&&_[0]===this._oldSelectionStart[0]&&_[1]===this._oldSelectionStart[1]&&f[0]===this._oldSelectionEnd[0]&&f[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(_,f,C)):this._oldHasSelection&&this._fireOnSelectionChange(_,f,C)}_fireOnSelectionChange(_,f,C){this._oldSelectionStart=_,this._oldSelectionEnd=f,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(_){this.clearSelection(),this._trimListener.dispose(),this._trimListener=_.activeBuffer.lines.onTrim(f=>this._handleTrim(f))}_convertViewportColToCharacterIndex(_,f){let C=f;for(let b=0;f>=b;b++){const S=_.loadCell(b,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:S>1&&f!==b&&(C+=S-1)}return C}setSelection(_,f,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[_,f],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(_){this._isClickInSelection(_)||(this._selectWordAtCursor(_,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(_,f,C=!0,b=!0){if(_[0]>=this._bufferService.cols)return;const S=this._bufferService.buffer,w=S.lines.get(_[1]);if(!w)return;const L=S.translateBufferLineToString(_[1],!1);let D=this._convertViewportColToCharacterIndex(w,_[0]),B=D;const k=_[0]-D;let M=0,y=0,x=0,R=0;if(L.charAt(D)===" "){for(;D>0&&L.charAt(D-1)===" ";)D--;for(;B<L.length&&L.charAt(B+1)===" ";)B++}else{let H=_[0],j=_[0];w.getWidth(H)===0&&(M++,H--),w.getWidth(j)===2&&(y++,j++);const N=w.getString(j).length;for(N>1&&(R+=N-1,B+=N-1);H>0&&D>0&&!this._isCharWordSeparator(w.loadCell(H-1,this._workCell));){w.loadCell(H-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(M++,H--):T>1&&(x+=T-1,D-=T-1),D--,H--}for(;j<w.length&&B+1<L.length&&!this._isCharWordSeparator(w.loadCell(j+1,this._workCell));){w.loadCell(j+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,j++):T>1&&(R+=T-1,B+=T-1),B++,j++}}B++;let A=D+k-M+x,I=Math.min(this._bufferService.cols,B-D+M+y-x-R);if(f||L.slice(D,B).trim()!==""){if(C&&A===0&&w.getCodePoint(0)!==32){const H=S.lines.get(_[1]-1);if(H&&w.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const j=this._getWordAt([this._bufferService.cols-1,_[1]-1],!1,!0,!1);if(j){const N=this._bufferService.cols-j.start;A-=N,I+=N}}}if(b&&A+I===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const H=S.lines.get(_[1]+1);if(H!=null&&H.isWrapped&&H.getCodePoint(0)!==32){const j=this._getWordAt([0,_[1]+1],!1,!1,!0);j&&(I+=j.length)}}return{start:A,length:I}}}_selectWordAt(_,f){const C=this._getWordAt(_,f);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,_[1]--;this._model.selectionStart=[C.start,_[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(_){const f=this._getWordAt(_,!0);if(f){let C=_[1];for(;f.start<0;)f.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;f.start+f.length>this._bufferService.cols;)f.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?f.start:f.start+f.length,C]}}_isCharWordSeparator(_){return _.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(_.getChars())>=0}_selectLineAt(_){const f=this._bufferService.buffer.getWrappedRangeForLine(_),C={start:{x:0,y:f.first},end:{x:this._bufferService.cols-1,y:f.last}};this._model.selectionStart=[0,f.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(C,this._bufferService.cols)}};t.SelectionService=m=l([c(3,u.IBufferService),c(4,u.ICoreService),c(5,g.IMouseService),c(6,u.IOptionsService),c(7,g.IRenderService),c(8,g.ICoreBrowserService)],m)},4725:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const l=a(8343);t.ICharSizeService=(0,l.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),t.IMouseService=(0,l.createDecorator)("MouseService"),t.IRenderService=(0,l.createDecorator)("RenderService"),t.ISelectionService=(0,l.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,l.createDecorator)("ThemeService"),t.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(O,t,a){var l=this&&this.__decorate||function(m,_,f,C){var b,S=arguments.length,w=S<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,f):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,_,f,C);else for(var L=m.length-1;L>=0;L--)(b=m[L])&&(w=(S<3?b(w):S>3?b(_,f,w):b(_,f))||w);return S>3&&w&&Object.defineProperty(_,f,w),w},c=this&&this.__param||function(m,_){return function(f,C){_(f,C,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),v=a(8460),g=a(844),r=a(2585),e=d.css.toColor("#ffffff"),o=d.css.toColor("#000000"),s=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],_=[0,95,135,175,215,255];for(let f=0;f<216;f++){const C=_[f/36%6|0],b=_[f/6%6|0],S=_[f%6];m.push({css:d.channels.toCss(C,b,S),rgba:d.channels.toRgba(C,b,S)})}for(let f=0;f<24;f++){const C=8+10*f;m.push({css:d.channels.toCss(C,C,C),rgba:d.channels.toRgba(C,C,C)})}return m})());let p=t.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:o,cursor:s,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:u,selectionBackgroundOpaque:d.color.blend(o,u),selectionInactiveBackgroundTransparent:u,selectionInactiveBackgroundOpaque:d.color.blend(o,u),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(m={}){const _=this._colors;if(_.foreground=h(m.foreground,e),_.background=h(m.background,o),_.cursor=h(m.cursor,s),_.cursorAccent=h(m.cursorAccent,i),_.selectionBackgroundTransparent=h(m.selectionBackground,u),_.selectionBackgroundOpaque=d.color.blend(_.background,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundTransparent=h(m.selectionInactiveBackground,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundOpaque=d.color.blend(_.background,_.selectionInactiveBackgroundTransparent),_.selectionForeground=m.selectionForeground?h(m.selectionForeground,d.NULL_COLOR):void 0,_.selectionForeground===d.NULL_COLOR&&(_.selectionForeground=void 0),d.color.isOpaque(_.selectionBackgroundTransparent)&&(_.selectionBackgroundTransparent=d.color.opacity(_.selectionBackgroundTransparent,.3)),d.color.isOpaque(_.selectionInactiveBackgroundTransparent)&&(_.selectionInactiveBackgroundTransparent=d.color.opacity(_.selectionInactiveBackgroundTransparent,.3)),_.ansi=t.DEFAULT_ANSI_COLORS.slice(),_.ansi[0]=h(m.black,t.DEFAULT_ANSI_COLORS[0]),_.ansi[1]=h(m.red,t.DEFAULT_ANSI_COLORS[1]),_.ansi[2]=h(m.green,t.DEFAULT_ANSI_COLORS[2]),_.ansi[3]=h(m.yellow,t.DEFAULT_ANSI_COLORS[3]),_.ansi[4]=h(m.blue,t.DEFAULT_ANSI_COLORS[4]),_.ansi[5]=h(m.magenta,t.DEFAULT_ANSI_COLORS[5]),_.ansi[6]=h(m.cyan,t.DEFAULT_ANSI_COLORS[6]),_.ansi[7]=h(m.white,t.DEFAULT_ANSI_COLORS[7]),_.ansi[8]=h(m.brightBlack,t.DEFAULT_ANSI_COLORS[8]),_.ansi[9]=h(m.brightRed,t.DEFAULT_ANSI_COLORS[9]),_.ansi[10]=h(m.brightGreen,t.DEFAULT_ANSI_COLORS[10]),_.ansi[11]=h(m.brightYellow,t.DEFAULT_ANSI_COLORS[11]),_.ansi[12]=h(m.brightBlue,t.DEFAULT_ANSI_COLORS[12]),_.ansi[13]=h(m.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),_.ansi[14]=h(m.brightCyan,t.DEFAULT_ANSI_COLORS[14]),_.ansi[15]=h(m.brightWhite,t.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const f=Math.min(_.ansi.length-16,m.extendedAnsi.length);for(let C=0;C<f;C++)_.ansi[C+16]=h(m.extendedAnsi[C],t.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let _=0;_<this._restoreColors.ansi.length;++_)this._colors.ansi[_]=this._restoreColors.ansi[_]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function h(m,_){if(m!==void 0)try{return d.css.toColor(m)}catch{}return _}t.ThemeService=p=l([c(0,r.IOptionsService)],p)},6349:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const l=a(8460),c=a(844);class n extends c.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const g=new Array(v);for(let r=0;r<Math.min(v,this.length);r++)g[r]=this._array[this._getCyclicIndex(r)];this._array=g,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let g=this._length;g<v;g++)this._array[g]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,g){this._array[this._getCyclicIndex(v)]=g}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,g,...r){if(g){for(let e=v;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:v,amount:g})}for(let e=this._length-1;e>=v;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<r.length;e++)this._array[this._getCyclicIndex(v+e)]=r[e];if(r.length&&this.onInsertEmitter.fire({index:v,amount:r.length}),this._length+r.length>this._maxLength){const e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,g,r){if(!(g<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=g-1;o>=0;o--)this.set(v+o+r,this.get(v+o));const e=v+g+r-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(v+e+r,this.get(v+e))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}t.CircularList=n},1439:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function a(l,c=5){if(typeof l!="object")return l;const n=Array.isArray(l)?[]:{};for(const d in l)n[d]=c<=1?l[d]:l[d]&&a(l[d],c-1);return n}},8055:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,v,g,r,e;function o(i){const u=i.toString(16);return u.length<2?"0"+u:u}function s(i,u){return i<u?(u+.05)/(i+.05):(i+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(i){i.toCss=function(u,p,h,m){return m!==void 0?`#${o(u)}${o(p)}${o(h)}${o(m)}`:`#${o(u)}${o(p)}${o(h)}`},i.toRgba=function(u,p,h,m=255){return(u<<24|p<<16|h<<8|m)>>>0},i.toColor=function(u,p,h,m){return{css:i.toCss(u,p,h,m),rgba:i.toRgba(u,p,h,m)}}}(d||(t.channels=d={})),function(i){function u(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}i.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,_=h.rgba>>16&255,f=h.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=b+Math.round((_-b)*n),c=S+Math.round((f-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},i.isOpaque=function(p){return(255&p.rgba)==255},i.ensureContrastRatio=function(p,h,m){const _=e.ensureContrastRatio(p.rgba,h.rgba,m);if(_)return d.toColor(_>>24&255,_>>16&255,_>>8&255)},i.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},i.opacity=u,i.multiplyOpacity=function(p,h){return n=255&p.rgba,u(p,n*h/255)},i.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(v||(t.color=v={})),function(i){let u,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(u=m,u.globalCompositeOperation="copy",p=u.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!u||!p)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=p,u.fillStyle=h,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,l,c,n]=u.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}}(g||(t.css=g={})),function(i){function u(p,h,m){const _=p/255,f=h/255,C=m/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}i.relativeLuminance=function(p){return u(p>>16&255,p>>8&255,255&p)},i.relativeLuminance2=u}(r||(t.rgb=r={})),function(i){function u(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S>0||w>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),w-=Math.max(0,Math.ceil(.1*w)),L-=Math.max(0,Math.ceil(.1*L)),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}function p(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S<255||w<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),w=Math.min(255,w+Math.ceil(.1*(255-w))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}i.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const _=m>>24&255,f=m>>16&255,C=m>>8&255,b=h>>24&255,S=h>>16&255,w=h>>8&255;return a=b+Math.round((_-b)*n),l=S+Math.round((f-S)*n),c=w+Math.round((C-w)*n),d.toRgba(a,l,c)},i.ensureContrastRatio=function(h,m,_){const f=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(s(f,C)<_){if(C<f){const w=u(h,m,_),L=s(f,r.relativeLuminance(w>>8));if(L<_){const D=p(h,m,_);return L>s(f,r.relativeLuminance(D>>8))?w:D}return w}const b=p(h,m,_),S=s(f,r.relativeLuminance(b>>8));if(S<_){const w=u(h,m,_);return S>s(f,r.relativeLuminance(w>>8))?b:w}return b}},i.reduceLuminance=u,i.increaseLuminance=p,i.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}}(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=s},8969:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const l=a(844),c=a(2585),n=a(4348),d=a(7866),v=a(744),g=a(7302),r=a(6975),e=a(8460),o=a(1753),s=a(1480),i=a(7994),u=a(9282),p=a(5435),h=a(5981),m=a(2660);let _=!1;class f extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(b=>{var S;(S=this._onScrollApi)==null||S.fire(b.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(b){for(const S in b)this.optionsService.options[S]=b[S]}constructor(b){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(b)),this._instantiationService.setService(c.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(c.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(c.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(r.CoreService)),this._instantiationService.setService(c.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(c.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(c.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(c.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(c.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.InputHandler(this._bufferService,this._charsetService,this.coreService,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.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new h.WriteBuffer((S,w)=>this._inputHandler.parse(S,w))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(b,S){this._writeBuffer.write(b,S)}writeSync(b,S){this._logService.logLevel<=c.LogLevelEnum.WARN&&!_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),_=!0),this._writeBuffer.writeSync(b,S)}input(b,S=!0){this.coreService.triggerDataEvent(b,S)}resize(b,S){isNaN(b)||isNaN(S)||(b=Math.max(b,v.MINIMUM_COLS),S=Math.max(S,v.MINIMUM_ROWS),this._bufferService.resize(b,S))}scroll(b,S=!1){this._bufferService.scroll(b,S)}scrollLines(b,S,w){this._bufferService.scrollLines(b,S,w)}scrollPages(b){this.scrollLines(b*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(b){const S=b-this._bufferService.buffer.ydisp;S!==0&&this.scrollLines(S)}registerEscHandler(b,S){return this._inputHandler.registerEscHandler(b,S)}registerDcsHandler(b,S){return this._inputHandler.registerDcsHandler(b,S)}registerCsiHandler(b,S){return this._inputHandler.registerCsiHandler(b,S)}registerOscHandler(b,S){return this._inputHandler.registerOscHandler(b,S)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let b=!1;const S=this.optionsService.rawOptions.windowsPty;S&&S.buildNumber!==void 0&&S.buildNumber!==void 0?b=S.backend==="conpty"&&S.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(b=!0),b?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const b=[];b.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),b.push(this.registerCsiHandler({final:"H"},()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const S of b)S.dispose()})}}}t.CoreTerminal=f},8460:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a(c=>l.fire(c))},t.runAndSubscribe=function(a,l){return l(void 0),a(c=>l(c))}},5435:function(O,t,a){var l=this&&this.__decorate||function(M,y,x,R){var A,I=arguments.length,H=I<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(M,y,x,R);else for(var j=M.length-1;j>=0;j--)(A=M[j])&&(H=(I<3?A(H):I>3?A(y,x,H):A(y,x))||H);return I>3&&H&&Object.defineProperty(y,x,H),H},c=this&&this.__param||function(M,y){return function(x,R){y(x,R,M)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),v=a(2015),g=a(844),r=a(482),e=a(8437),o=a(8460),s=a(643),i=a(511),u=a(3734),p=a(2585),h=a(1480),m=a(6242),_=a(6351),f=a(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function S(M,y){if(M>24)return y.setWinLines||!1;switch(M){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var w;(function(M){M[M.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",M[M.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(t.WindowsOptionsReportType=w={}));let L=0;class D extends g.Disposable{getAttrData(){return this._curAttrData}constructor(y,x,R,A,I,H,j,N,T=new v.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=x,this._coreService=R,this._logService=A,this._optionsService=I,this._oscLinkService=H,this._coreMouseService=j,this._unicodeService=N,this._parser=T,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new r.StringToUtf32,this._utf8Decoder=new r.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._parser.setCsiHandlerFallback((E,F)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(E),params:F.toArray()})}),this._parser.setEscHandlerFallback(E=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(E)})}),this._parser.setExecuteHandlerFallback(E=>{this._logService.debug("Unknown EXECUTE code: ",{code:E})}),this._parser.setOscHandlerFallback((E,F,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:E,action:F,data:P})}),this._parser.setDcsHandlerFallback((E,F,P)=>{F==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(E),action:F,payload:P})}),this._parser.setPrintHandler((E,F,P)=>this.print(E,F,P)),this._parser.registerCsiHandler({final:"@"},E=>this.insertChars(E)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},E=>this.scrollLeft(E)),this._parser.registerCsiHandler({final:"A"},E=>this.cursorUp(E)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},E=>this.scrollRight(E)),this._parser.registerCsiHandler({final:"B"},E=>this.cursorDown(E)),this._parser.registerCsiHandler({final:"C"},E=>this.cursorForward(E)),this._parser.registerCsiHandler({final:"D"},E=>this.cursorBackward(E)),this._parser.registerCsiHandler({final:"E"},E=>this.cursorNextLine(E)),this._parser.registerCsiHandler({final:"F"},E=>this.cursorPrecedingLine(E)),this._parser.registerCsiHandler({final:"G"},E=>this.cursorCharAbsolute(E)),this._parser.registerCsiHandler({final:"H"},E=>this.cursorPosition(E)),this._parser.registerCsiHandler({final:"I"},E=>this.cursorForwardTab(E)),this._parser.registerCsiHandler({final:"J"},E=>this.eraseInDisplay(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},E=>this.eraseInDisplay(E,!0)),this._parser.registerCsiHandler({final:"K"},E=>this.eraseInLine(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},E=>this.eraseInLine(E,!0)),this._parser.registerCsiHandler({final:"L"},E=>this.insertLines(E)),this._parser.registerCsiHandler({final:"M"},E=>this.deleteLines(E)),this._parser.registerCsiHandler({final:"P"},E=>this.deleteChars(E)),this._parser.registerCsiHandler({final:"S"},E=>this.scrollUp(E)),this._parser.registerCsiHandler({final:"T"},E=>this.scrollDown(E)),this._parser.registerCsiHandler({final:"X"},E=>this.eraseChars(E)),this._parser.registerCsiHandler({final:"Z"},E=>this.cursorBackwardTab(E)),this._parser.registerCsiHandler({final:"`"},E=>this.charPosAbsolute(E)),this._parser.registerCsiHandler({final:"a"},E=>this.hPositionRelative(E)),this._parser.registerCsiHandler({final:"b"},E=>this.repeatPrecedingCharacter(E)),this._parser.registerCsiHandler({final:"c"},E=>this.sendDeviceAttributesPrimary(E)),this._parser.registerCsiHandler({prefix:">",final:"c"},E=>this.sendDeviceAttributesSecondary(E)),this._parser.registerCsiHandler({final:"d"},E=>this.linePosAbsolute(E)),this._parser.registerCsiHandler({final:"e"},E=>this.vPositionRelative(E)),this._parser.registerCsiHandler({final:"f"},E=>this.hVPosition(E)),this._parser.registerCsiHandler({final:"g"},E=>this.tabClear(E)),this._parser.registerCsiHandler({final:"h"},E=>this.setMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"h"},E=>this.setModePrivate(E)),this._parser.registerCsiHandler({final:"l"},E=>this.resetMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"l"},E=>this.resetModePrivate(E)),this._parser.registerCsiHandler({final:"m"},E=>this.charAttributes(E)),this._parser.registerCsiHandler({final:"n"},E=>this.deviceStatus(E)),this._parser.registerCsiHandler({prefix:"?",final:"n"},E=>this.deviceStatusPrivate(E)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},E=>this.softReset(E)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},E=>this.setCursorStyle(E)),this._parser.registerCsiHandler({final:"r"},E=>this.setScrollRegion(E)),this._parser.registerCsiHandler({final:"s"},E=>this.saveCursor(E)),this._parser.registerCsiHandler({final:"t"},E=>this.windowOptions(E)),this._parser.registerCsiHandler({final:"u"},E=>this.restoreCursor(E)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},E=>this.insertColumns(E)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},E=>this.deleteColumns(E)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},E=>this.selectProtected(E)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},E=>this.requestMode(E,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},E=>this.requestMode(E,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new m.OscHandler(E=>(this.setTitle(E),this.setIconName(E),!0))),this._parser.registerOscHandler(1,new m.OscHandler(E=>this.setIconName(E))),this._parser.registerOscHandler(2,new m.OscHandler(E=>this.setTitle(E))),this._parser.registerOscHandler(4,new m.OscHandler(E=>this.setOrReportIndexedColor(E))),this._parser.registerOscHandler(8,new m.OscHandler(E=>this.setHyperlink(E))),this._parser.registerOscHandler(10,new m.OscHandler(E=>this.setOrReportFgColor(E))),this._parser.registerOscHandler(11,new m.OscHandler(E=>this.setOrReportBgColor(E))),this._parser.registerOscHandler(12,new m.OscHandler(E=>this.setOrReportCursorColor(E))),this._parser.registerOscHandler(104,new m.OscHandler(E=>this.restoreIndexedColor(E))),this._parser.registerOscHandler(110,new m.OscHandler(E=>this.restoreFgColor(E))),this._parser.registerOscHandler(111,new m.OscHandler(E=>this.restoreBgColor(E))),this._parser.registerOscHandler(112,new m.OscHandler(E=>this.restoreCursorColor(E))),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 E in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:E},()=>this.selectCharset("("+E)),this._parser.registerEscHandler({intermediates:")",final:E},()=>this.selectCharset(")"+E)),this._parser.registerEscHandler({intermediates:"*",final:E},()=>this.selectCharset("*"+E)),this._parser.registerEscHandler({intermediates:"+",final:E},()=>this.selectCharset("+"+E)),this._parser.registerEscHandler({intermediates:"-",final:E},()=>this.selectCharset("-"+E)),this._parser.registerEscHandler({intermediates:".",final:E},()=>this.selectCharset("."+E)),this._parser.registerEscHandler({intermediates:"/",final:E},()=>this.selectCharset("/"+E));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(E=>(this._logService.error("Parsing error: ",E),E)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _.DcsHandler((E,F)=>this.requestStatusString(E,F)))}_preserveStack(y,x,R,A){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=R,this._parseStack.position=A}_logSlowResolvingAsync(y){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([y,new Promise((x,R)=>setTimeout(()=>R("#SLOW_TIMEOUT"),5e3))]).catch(x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,x){let R,A=this._activeBuffer.x,I=this._activeBuffer.y,H=0;const j=this._parseStack.paused;if(j){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(R),R;A=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>b&&(H=this._parseStack.position+b)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,E=>String.fromCharCode(E)).join("")}"`),typeof y=="string"?y.split("").map(E=>E.charCodeAt(0)):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<b&&(this._parseBuffer=new Uint32Array(Math.min(y.length,b))),j||this._dirtyRowTracker.clearRange(),y.length>b)for(let E=H;E<y.length;E+=b){const F=E+b<y.length?E+b:y.length,P=typeof y=="string"?this._stringDecoder.decode(y.substring(E,F),this._parseBuffer):this._utf8Decoder.decode(y.subarray(E,F),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,P))return this._preserveStack(A,I,P,E),this._logSlowResolvingAsync(R),R}else if(!j){const E=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,E))return this._preserveStack(A,I,E,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===A&&this._activeBuffer.y===I||this._onCursorMove.fire();const N=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),T=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);T<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(T,this._bufferService.rows-1),Math.min(N,this._bufferService.rows-1))}print(y,x,R){let A,I;const H=this._charsetService.charset,j=this._optionsService.rawOptions.screenReaderMode,N=this._bufferService.cols,T=this._coreService.decPrivateModes.wraparound,E=this._coreService.modes.insertMode,F=this._curAttrData;let P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-x>0&&P.getWidth(this._activeBuffer.x-1)===2&&P.setCellFromCodepoint(this._activeBuffer.x-1,0,1,F);let z=this._parser.precedingJoinState;for(let W=x;W<R;++W){if(A=y[W],A<127&&H){const re=H[String.fromCharCode(A)];re&&(A=re.charCodeAt(0))}const Y=this._unicodeService.charProperties(A,z);I=h.UnicodeService.extractWidth(Y);const U=h.UnicodeService.extractShouldJoin(Y),te=U?h.UnicodeService.extractWidth(z):0;if(z=Y,j&&this._onA11yChar.fire((0,r.stringFromCodePoint)(A)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-te>N){if(T){const re=P;let X=this._activeBuffer.x-te;for(this._activeBuffer.x=te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&P instanceof e.BufferLine&&P.copyCellsFrom(re,X,0,te,!1);X<N;)re.setCellFromCodepoint(X++,0,1,F)}else if(this._activeBuffer.x=N-1,I===2)continue}if(U&&this._activeBuffer.x){const re=P.getWidth(this._activeBuffer.x-1)?1:2;P.addCodepointToCell(this._activeBuffer.x-re,A,I);for(let X=I-te;--X>=0;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,F)}else if(E&&(P.insertCells(this._activeBuffer.x,I-te,this._activeBuffer.getNullCell(F)),P.getWidth(N-1)===2&&P.setCellFromCodepoint(N-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,F)),P.setCellFromCodepoint(this._activeBuffer.x++,A,I,F),I>0)for(;--I;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,F)}this._parser.precedingJoinState=z,this._activeBuffer.x<N&&R-x>0&&P.getWidth(this._activeBuffer.x)===0&&!P.hasContent(this._activeBuffer.x)&&P.setCellFromCodepoint(this._activeBuffer.x,0,1,F),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,x){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,x):this._parser.registerCsiHandler(y,R=>!S(R.params[0],this._optionsService.rawOptions.windowOptions)||x(R))}registerDcsHandler(y,x){return this._parser.registerDcsHandler(y,new _.DcsHandler(x))}registerEscHandler(y,x){return this._parser.registerEscHandler(y,x)}registerOscHandler(y,x){return this._parser.registerOscHandler(y,new m.OscHandler(x))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.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.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(y,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=y,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+x)}cursorUp(y){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const x=y.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=y.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=y.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const x=y.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,x,R,A=!1,I=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);H.replaceCells(x,R,this._activeBuffer.getNullCell(this._eraseAttrData()),I),A&&(H.isWrapped=!1)}_resetBufferLine(y,x=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),R.isWrapped=!1)}eraseInDisplay(y,x=!1){let R;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);R<this._bufferService.rows;R++)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(0);break;case 3:const A=this._activeBuffer.lines.length-this._bufferService.rows;A>0&&(this._activeBuffer.lines.trimStart(A),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-A,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-A,0),this._onScroll.fire(0))}return!0}eraseInLine(y,x=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let x=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-A+1;for(;x--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let x=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let A;for(A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,A=this._bufferService.rows-1+this._activeBuffer.ybase-A;x--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let x=y.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(y){let x=y.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const x=this._parser.precedingJoinState;if(!x)return!0;const R=y.params[0]||1,A=h.UnicodeService.extractWidth(x),I=this._activeBuffer.x-A,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),j=new Uint32Array(H.length*R);let N=0;for(let E=0;E<H.length;){const F=H.codePointAt(E)||0;j[N++]=F,E+=F>65535?2:1}let T=N;for(let E=1;E<R;++E)j.copyWithin(T,0,N),T+=N;return this.print(j,0,T),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),y.params[x]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(y,x){const R=this._coreService.decPrivateModes,{activeProtocol:A,activeEncoding:I}=this._coreMouseService,H=this._coreService,{buffers:j,cols:N}=this._bufferService,{active:T,alt:E}=j,F=this._optionsService.rawOptions,P=U=>U?1:2,z=y.params[0];return W=z,Y=x?z===2?4:z===4?P(H.modes.insertMode):z===12?3:z===20?P(F.convertEol):0:z===1?P(R.applicationCursorKeys):z===3?F.windowOptions.setWinLines?N===80?2:N===132?1:0:0:z===6?P(R.origin):z===7?P(R.wraparound):z===8?3:z===9?P(A==="X10"):z===12?P(F.cursorBlink):z===25?P(!H.isCursorHidden):z===45?P(R.reverseWraparound):z===66?P(R.applicationKeypad):z===67?4:z===1e3?P(A==="VT200"):z===1002?P(A==="DRAG"):z===1003?P(A==="ANY"):z===1004?P(R.sendFocus):z===1005?4:z===1006?P(I==="SGR"):z===1015?4:z===1016?P(I==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?P(T===E):z===2004?P(R.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${x?"":"?"}${W};${Y}$y`),!0;var W,Y}_updateAttrColor(y,x,R,A,I){return x===2?(y|=50331648,y&=-16777216,y|=u.AttributeData.fromColorRGB([R,A,I])):x===5&&(y&=-50331904,y|=33554432|255&R),y}_extractColor(y,x,R){const A=[0,0,-1,0,0,0];let I=0,H=0;do{if(A[H+I]=y.params[x+H],y.hasSubParams(x+H)){const j=y.getSubParams(x+H);let N=0;do A[1]===5&&(I=1),A[H+N+1+I]=j[N];while(++N<j.length&&N+H+1+I<A.length);break}if(A[1]===5&&H+I>=2||A[1]===2&&H+I>=5)break;A[1]&&(I=1)}while(++H+x<y.length&&H+I<A.length);for(let j=2;j<A.length;++j)A[j]===-1&&(A[j]=0);switch(A[0]){case 38:R.fg=this._updateAttrColor(R.fg,A[1],A[3],A[4],A[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,A[1],A[3],A[4],A[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,A[1],A[3],A[4],A[5])}return H}_processUnderline(y,x){x.extended=x.extended.clone(),(!~y||y>5)&&(y=1),x.extended.underlineStyle=y,x.fg|=268435456,y===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(y){y.fg=e.DEFAULT_ATTR_DATA.fg,y.bg=e.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=y.length;let R;const A=this._curAttrData;for(let I=0;I<x;I++)R=y.params[I],R>=30&&R<=37?(A.fg&=-50331904,A.fg|=16777216|R-30):R>=40&&R<=47?(A.bg&=-50331904,A.bg|=16777216|R-40):R>=90&&R<=97?(A.fg&=-50331904,A.fg|=16777224|R-90):R>=100&&R<=107?(A.bg&=-50331904,A.bg|=16777224|R-100):R===0?this._processSGR0(A):R===1?A.fg|=134217728:R===3?A.bg|=67108864:R===4?(A.fg|=268435456,this._processUnderline(y.hasSubParams(I)?y.getSubParams(I)[0]:1,A)):R===5?A.fg|=536870912:R===7?A.fg|=67108864:R===8?A.fg|=1073741824:R===9?A.fg|=2147483648:R===2?A.bg|=134217728:R===21?this._processUnderline(2,A):R===22?(A.fg&=-134217729,A.bg&=-134217729):R===23?A.bg&=-67108865:R===24?(A.fg&=-268435457,this._processUnderline(0,A)):R===25?A.fg&=-536870913:R===27?A.fg&=-67108865:R===28?A.fg&=-1073741825:R===29?A.fg&=2147483647:R===39?(A.fg&=-67108864,A.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):R===49?(A.bg&=-67108864,A.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?I+=this._extractColor(y,I,A):R===53?A.bg|=1073741824:R===55?A.bg&=-1073741825:R===59?(A.extended=A.extended.clone(),A.extended.underlineColor=-1,A.updateExtended()):R===100?(A.fg&=-67108864,A.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,A.bg&=-67108864,A.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${x};${R}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const x=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${x};${R}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.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(y){const x=y.params[0]||1;switch(x){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 R=x%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(y){const x=y.params[0]||1;let R;return(y.length<2||(R=y.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(y){if(!S(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const x=[],R=y.split(";");for(;R.length>1;){const A=R.shift(),I=R.shift();if(/^\d+$/.exec(A)){const H=parseInt(A);if(k(H))if(I==="?")x.push({type:0,index:H});else{const j=(0,f.parseColor)(I);j&&x.push({type:1,index:H,color:j})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(y){const x=y.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(y,x){this._getCurrentLinkId()&&this._finishHyperlink();const R=y.split(":");let A;const I=R.findIndex(H=>H.startsWith("id="));return I!==-1&&(A=R[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:A,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,x){const R=y.split(";");for(let A=0;A<R.length&&!(x>=this._specialColors.length);++A,++x)if(R[A]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const I=(0,f.parseColor)(R[A]);I&&this._onColor.fire([{type:1,index:this._specialColors[x],color:I}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const x=[],R=y.split(";");for(let A=0;A<R.length;++A)if(/^\d+$/.exec(R[A])){const I=parseInt(R[A]);k(I)&&x.push({type:2,index:I})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(C[y[0]],d.CHARSETS[y[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),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._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.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=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new i.CellData;y.content=4194304|"E".charCodeAt(0),y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const R=this._activeBuffer.ybase+this._activeBuffer.y+x,A=this._activeBuffer.lines.get(R);A&&(A.fill(y),A.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,x){const R=this._bufferService.buffer,A=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${I}${n.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[A.cursorStyle]-(A.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,x){this._dirtyRowTracker.markRangeDirty(y,x)}}t.InputHandler=D;let B=class{constructor(M){this._bufferService=M,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(M){M<this.start?this.start=M:M>this.end&&(this.end=M)}markRangeDirty(M,y){M>y&&(L=M,M=y,y=L),M<this.start&&(this.start=M),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function k(M){return 0<=M&&M<256}B=l([c(0,p.IBufferService)],B)},844:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,v){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,v)}get(l,c,n,d){var v;return(v=this._data.get(l,c))==null?void 0:v.get(n,d)}clear(){this._data.clear()}}},6114:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},6106:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let a=0;t.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const c=this._getKey(l);if(c===void 0||(a=this._search(c),a===-1)||this._getKey(this._array[a])!==c)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===c);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,c){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do c(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let c=0,n=this._array.length-1;for(;n>=c;){let d=c+n>>1;const v=this._getKey(this._array[d]);if(v>l)n=d-1;else{if(!(v<l)){for(;d>0&&this._getKey(this._array[d-1])===l;)d--;return d}c=d+1}}return c}}},7226:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(6114);class c{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,r=0,e=v.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=v.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const l=a(643);t.updateWindowsModeWrappedState=function(c){const n=c.buffer.lines.get(c.buffer.ybase+c.buffer.y-1),d=n==null?void 0:n.get(c.cols-1),v=c.buffer.lines.get(c.buffer.ybase+c.buffer.y);v&&d&&(v.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},9092:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const l=a(6349),c=a(7226),n=a(3734),d=a(8437),v=a(4634),g=a(511),r=a(643),e=a(4863),o=a(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(s,i,u){this._hasScrollback=s,this._optionsService=i,this._bufferService=u,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,r.WHITESPACE_CELL_CHAR,r.WHITESPACE_CELL_WIDTH,r.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new c.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,i){return new d.BufferLine(this._bufferService.cols,this.getNullCell(s),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const i=s+this._optionsService.rawOptions.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=d.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,i){const u=this.getNullCell(d.DEFAULT_ATTR_DATA);let p=0;const h=this._getCorrectBufferLength(i);if(h>this.lines.maxLength&&(this.lines.maxLength=h),this.lines.length>0){if(this._cols<s)for(let _=0;_<this.lines.length;_++)p+=+this.lines.get(_).resize(s,u);let m=0;if(this._rows<i)for(let _=this._rows;_<i;_++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(s,u)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(s,u)));else for(let _=this._rows;_>i;_--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(h<this.lines.maxLength){const _=this.lines.length-h;_>0&&(this.lines.trimStart(_),this.ybase=Math.max(this.ybase-_,0),this.ydisp=Math.max(this.ydisp-_,0),this.savedY=Math.max(this.savedY-_,0)),this.lines.maxLength=h}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(s,i),this._cols>s))for(let m=0;m<this.lines.length;m++)p+=+this.lines.get(m).resize(s,u);this._cols=s,this._rows=i,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,i){this._cols!==s&&(s>this._cols?this._reflowLarger(s,i):this._reflowSmaller(s,i))}_reflowLarger(s,i){const u=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(u.length>0){const p=(0,v.reflowLargerCreateNewLayout)(this.lines,u);(0,v.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(s,i,p.countRemoved)}}_reflowLargerAdjustViewport(s,i,u){const p=this.getNullCell(d.DEFAULT_ATTR_DATA);let h=u;for(;h-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new d.BufferLine(s,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-u,0)}_reflowSmaller(s,i){const u=this.getNullCell(d.DEFAULT_ATTR_DATA),p=[];let h=0;for(let m=this.lines.length-1;m>=0;m--){let _=this.lines.get(m);if(!_||!_.isWrapped&&_.getTrimmedLength()<=s)continue;const f=[_];for(;_.isWrapped&&m>0;)_=this.lines.get(--m),f.unshift(_);const C=this.ybase+this.y;if(C>=m&&C<m+f.length)continue;const b=f[f.length-1].getTrimmedLength(),S=(0,v.reflowSmallerGetNewLineLengths)(f,this._cols,s),w=S.length-f.length;let L;L=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const D=[];for(let R=0;R<w;R++){const A=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);D.push(A)}D.length>0&&(p.push({start:m+f.length+h,newLines:D}),h+=D.length),f.push(...D);let B=S.length-1,k=S[B];k===0&&(B--,k=S[B]);let M=f.length-w-1,y=b;for(;M>=0;){const R=Math.min(y,k);if(f[B]===void 0)break;if(f[B].copyCellsFrom(f[M],y-R,k-R,R,!0),k-=R,k===0&&(B--,k=S[B]),y-=R,y===0){M--;const A=Math.max(M,0);y=(0,v.getWrappedLineTrimmedLength)(f,A,this._cols)}}for(let R=0;R<f.length;R++)S[R]<s&&f[R].setCell(S[R],u);let x=w-L;for(;x-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+h)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+i-1)}if(p.length>0){const m=[],_=[];for(let B=0;B<this.lines.length;B++)_.push(this.lines.get(B));const f=this.lines.length;let C=f-1,b=0,S=p[b];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let w=0;for(let B=Math.min(this.lines.maxLength-1,f+h-1);B>=0;B--)if(S&&S.start>C+w){for(let k=S.newLines.length-1;k>=0;k--)this.lines.set(B--,S.newLines[k]);B++,m.push({index:C+1,amount:S.newLines.length}),w+=S.newLines.length,S=p[++b]}else this.lines.set(B,_[C--]);let L=0;for(let B=m.length-1;B>=0;B--)m[B].index+=L,this.lines.onInsertEmitter.fire(m[B]),L+=m[B].amount;const D=Math.max(0,f+h-this.lines.maxLength);D>0&&this.lines.onTrimEmitter.fire(D)}}translateBufferLineToString(s,i,u=0,p){const h=this.lines.get(s);return h?h.translateToString(i,u,p):""}getWrappedRangeForLine(s){let i=s,u=s;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;u+1<this.lines.length&&this.lines.get(u+1).isWrapped;)u++;return{first:i,last:u}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===s&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const i=new e.Marker(s);return this.markers.push(i),i.register(this.lines.onTrim(u=>{i.line-=u,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(u=>{i.line>=u.index&&(i.line+=u.amount)})),i.register(this.lines.onDelete(u=>{i.line>=u.index&&i.line<u.index+u.amount&&i.dispose(),i.line>u.index&&(i.line-=u.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const l=a(3734),c=a(511),n=a(643),d=a(482);t.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let v=0;class g{constructor(e,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const i=o||c.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let u=0;u<e;++u)this.setCell(u,i);this.length=e}get(e){const o=this._data[3*e+0],s=2097151&o;return[this._data[3*e+1],2097152&o?this._combined[e]:s?(0,d.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[e].charCodeAt(this._combined[e].length-1):s]}set(e,o){this._data[3*e+1]=o[n.CHAR_DATA_ATTR_INDEX],o[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=o[1],this._data[3*e+0]=2097152|e|o[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=o[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[n.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 o=this._data[3*e+0];return 2097152&o?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&o}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const o=this._data[3*e+0];return 2097152&o?this._combined[e]:2097151&o?(0,d.stringFromCodePoint)(2097151&o):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,o){return v=3*e,o.content=this._data[v+0],o.fg=this._data[v+1],o.bg=this._data[v+2],2097152&o.content&&(o.combinedData=this._combined[e]),268435456&o.bg&&(o.extended=this._extendedAttrs[e]),o}setCell(e,o){2097152&o.content&&(this._combined[e]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[e]=o.extended),this._data[3*e+0]=o.content,this._data[3*e+1]=o.fg,this._data[3*e+2]=o.bg}setCellFromCodepoint(e,o,s,i){268435456&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=o|s<<22,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}addCodepointToCell(e,o,s){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,d.stringFromCodePoint)(o):2097151&i?(this._combined[e]=(0,d.stringFromCodePoint)(2097151&i)+(0,d.stringFromCodePoint)(o),i&=-2097152,i|=2097152):i=o|4194304,s&&(i&=-12582913,i|=s<<22),this._data[3*e+0]=i}insertCells(e,o,s){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),o<this.length-e){const i=new c.CellData;for(let u=this.length-e-o-1;u>=0;--u)this.setCell(e+o+u,this.loadCell(e+u,i));for(let u=0;u<o;++u)this.setCell(e+u,s)}else for(let i=e;i<this.length;++i)this.setCell(i,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(e,o,s){if(e%=this.length,o<this.length-e){const i=new c.CellData;for(let u=0;u<this.length-e-o;++u)this.setCell(e+u,this.loadCell(e+o+u,i));for(let u=this.length-o;u<this.length;++u)this.setCell(u,s)}else for(let i=e;i<this.length;++i)this.setCell(i,s);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,s)}replaceCells(e,o,s,i=!1){if(i)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);e<o&&e<this.length;)this.isProtected(e)||this.setCell(e,s),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);e<o&&e<this.length;)this.setCell(e++,s)}resize(e,o){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const i=new Uint32Array(s);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,o)}else{this._data=this._data.subarray(0,s);const i=Object.keys(this._combined);for(let p=0;p<i.length;p++){const h=parseInt(i[p],10);h>=e&&delete this._combined[h]}const u=Object.keys(this._extendedAttrs);for(let p=0;p<u.length;p++){const h=parseInt(u[p],10);h>=e&&delete this._extendedAttrs[h]}}return this.length=e,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,e);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const o in e._combined)this._combined[o]=e._combined[o];this._extendedAttrs={};for(const o in e._extendedAttrs)this._extendedAttrs[o]=e._extendedAttrs[o];this.isWrapped=e.isWrapped}clone(){const e=new g(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const o in this._combined)e._combined[o]=this._combined[o];for(const o in this._extendedAttrs)e._extendedAttrs[o]=this._extendedAttrs[o];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,o,s,i,u){const p=e._data;if(u)for(let m=i-1;m>=0;m--){for(let _=0;_<3;_++)this._data[3*(s+m)+_]=p[3*(o+m)+_];268435456&p[3*(o+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[o+m])}else for(let m=0;m<i;m++){for(let _=0;_<3;_++)this._data[3*(s+m)+_]=p[3*(o+m)+_];268435456&p[3*(o+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[o+m])}const h=Object.keys(e._combined);for(let m=0;m<h.length;m++){const _=parseInt(h[m],10);_>=o&&(this._combined[_-o+s]=e._combined[_])}}translateToString(e,o,s,i){o=o??0,s=s??this.length,e&&(s=Math.min(s,this.getTrimmedLength())),i&&(i.length=0);let u="";for(;o<s;){const p=this._data[3*o+0],h=2097151&p,m=2097152&p?this._combined[o]:h?(0,d.stringFromCodePoint)(h):n.WHITESPACE_CELL_CHAR;if(u+=m,i)for(let _=0;_<m.length;++_)i.push(o);o+=p>>22||1}return i&&i.push(o),u}}t.BufferLine=g},4841:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(O,t)=>{function a(l,c,n){if(c===l.length-1)return l[c].getTrimmedLength();const d=!l[c].hasContent(n-1)&&l[c].getWidth(n-1)===1,v=l[c+1].getWidth(0)===2;return d&&v?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(l,c,n,d,v){const g=[];for(let r=0;r<l.length-1;r++){let e=r,o=l.get(++e);if(!o.isWrapped)continue;const s=[l.get(r)];for(;e<l.length&&o.isWrapped;)s.push(o),o=l.get(++e);if(d>=r&&d<e){r+=s.length-1;continue}let i=0,u=a(s,i,c),p=1,h=0;for(;p<s.length;){const _=a(s,p,c),f=_-h,C=n-u,b=Math.min(f,C);s[i].copyCellsFrom(s[p],h,u,b,!1),u+=b,u===n&&(i++,u=0),h+=b,h===_&&(p++,h=0),u===0&&i!==0&&s[i-1].getWidth(n-1)===2&&(s[i].copyCellsFrom(s[i-1],n-1,u++,1,!1),s[i-1].setCell(n-1,v))}s[i].replaceCells(u,n,v);let m=0;for(let _=s.length-1;_>0&&(_>i||s[_].getTrimmedLength()===0);_--)m++;m>0&&(g.push(r+s.length-m),g.push(m)),r+=s.length-1}return g},t.reflowLargerCreateNewLayout=function(l,c){const n=[];let d=0,v=c[d],g=0;for(let r=0;r<l.length;r++)if(v===r){const e=c[++d];l.onDeleteEmitter.fire({index:r-g,amount:e}),r+=e-1,g+=e,v=c[++d]}else n.push(r);return{layout:n,countRemoved:g}},t.reflowLargerApplyNewLayout=function(l,c){const n=[];for(let d=0;d<c.length;d++)n.push(l.get(c[d]));for(let d=0;d<n.length;d++)l.set(d,n[d]);l.length=c.length},t.reflowSmallerGetNewLineLengths=function(l,c,n){const d=[],v=l.map((o,s)=>a(l,s,c)).reduce((o,s)=>o+s);let g=0,r=0,e=0;for(;e<v;){if(v-e<n){d.push(v-e);break}g+=n;const o=a(l,r,c);g>o&&(g-=o,r++);const s=l[r].getWidth(g-1)===2;s&&g--;const i=s?n-1:n;d.push(i),e+=i}return d},t.getWrappedLineTrimmedLength=a},5295:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const l=a(8460),c=a(844),n=a(9092);class d extends c.Disposable{constructor(g,r){super(),this._optionsService=g,this._bufferService=r,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),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(g,r){this._normal.resize(g,r),this._alt.resize(g,r),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}t.BufferSet=d},511:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(482),c=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},643:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const l=a(8460),c=a(844);class n{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,c.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}t.Marker=n,n._nextId=1},7116:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,t)=>{var a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
|
||
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(a||(t.C0=a={})),function(n){n.PAD="",n.HOP="",n.BPH="",n.NBH="",n.IND="",n.NEL="
",n.SSA="",n.ESA="",n.HTS="",n.HTJ="",n.VTS="",n.PLD="",n.PLU="",n.RI="",n.SS2="",n.SS3="",n.DCS="",n.PU1="",n.PU2="",n.STS="",n.CCH="",n.MW="",n.SPA="",n.EPA="",n.SOS="",n.SGCI="",n.SCI="",n.CSI="",n.ST="",n.OSC="",n.PM="",n.APC=""}(l||(t.C1=l={})),function(n){n.ST=`${a.ESC}\\`}(c||(t.C1_ESCAPED=c={}))},7399:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const l=a(2584),c={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:["'",'"']};t.evaluateKeyboardEvent=function(n,d,v,g){const r={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?r.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?r.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?r.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(r.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:r.key=n.ctrlKey?"\b":l.C0.DEL,n.altKey&&(r.key=l.C0.ESC+r.key);break;case 9:if(n.shiftKey){r.key=l.C0.ESC+"[Z";break}r.key=l.C0.HT,r.cancel=!0;break;case 13:r.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,r.cancel=!0;break;case 27:r.key=l.C0.ESC,n.altKey&&(r.key=l.C0.ESC+l.C0.ESC),r.cancel=!0;break;case 37:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"D",r.key===l.C0.ESC+"[1;3D"&&(r.key=l.C0.ESC+(v?"b":"[1;5D"))):r.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"C",r.key===l.C0.ESC+"[1;3C"&&(r.key=l.C0.ESC+(v?"f":"[1;5C"))):r.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"A",v||r.key!==l.C0.ESC+"[1;3A"||(r.key=l.C0.ESC+"[1;5A")):r.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"B",v||r.key!==l.C0.ESC+"[1;3B"||(r.key=l.C0.ESC+"[1;5B")):r.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(r.key=l.C0.ESC+"[2~");break;case 46:r.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:r.key=e?l.C0.ESC+"[1;"+(e+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:r.key=e?l.C0.ESC+"[1;"+(e+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?r.type=2:n.ctrlKey?r.key=l.C0.ESC+"[5;"+(e+1)+"~":r.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?r.type=3:n.ctrlKey?r.key=l.C0.ESC+"[6;"+(e+1)+"~":r.key=l.C0.ESC+"[6~";break;case 112:r.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:r.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:r.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:r.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:r.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:r.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:r.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:r.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:r.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:r.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:r.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:r.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(v&&!g||!n.altKey||n.metaKey)!v||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?r.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(r.key=l.C0.US),n.key==="@"&&(r.key=l.C0.NUL)):n.keyCode===65&&(r.type=1);else{const o=c[n.keyCode],s=o==null?void 0:o[n.shiftKey?1:0];if(s)r.key=l.C0.ESC+s;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let u=String.fromCharCode(i);n.shiftKey&&(u=u.toUpperCase()),r.key=l.C0.ESC+u}else if(n.keyCode===32)r.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),r.key=l.C0.ESC+i,r.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?r.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?r.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?r.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?r.key=l.C0.DEL:n.keyCode===219?r.key=l.C0.ESC:n.keyCode===220?r.key=l.C0.FS:n.keyCode===221&&(r.key=l.C0.GS)}return r}},482:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let v=a[d];v>65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=d;v<c;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=c)return this._interim=g,n;const r=a.charCodeAt(v);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,v,g,r=0,e=0,o=0;if(this.interim[0]){let u=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,f=_-m;for(;o<f;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,u=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}u||(_===2?p<128?o--:l[r++]=p:_===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const s=c-4;let i=o;for(;i<c;){for(;!(!(i<s)||128&(n=a[i])||128&(d=a[i+1])||128&(v=a[i+2])||128&(g=a[i+3]));)l[r++]=n,l[r++]=d,l[r++]=v,l[r++]=g,i+=4;if(n=a[i++],n<128)l[r++]=n;else if((224&n)==192){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}l[r++]=e}else if((240&n)==224){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=v,r;if(g=a[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&v)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},225:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const l=a(1480),c=[[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]],n=[[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 d;t.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let v=0;v<c.length;++v)d.fill(0,c[v][0],c[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?d[v]:function(g,r){let e,o=0,s=r.length-1;if(g<r[0][0]||g>r[s][1])return!1;for(;s>=o;)if(e=o+s>>1,g>r[e][1])o=e+1;else{if(!(g<r[e][0]))return!0;s=e-1}return!1}(v,n)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,g){let r=this.wcwidth(v),e=r===0&&g!==0;if(e){const o=l.UnicodeService.extractWidth(g);o===0?e=!1:o>r&&(r=o)}return l.UnicodeService.createPropertyValue(0,r,e)}}},5981:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const l=a(8460),c=a(844);class n extends c.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let r;for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g)}_innerWrite(v=0,g=!0){const r=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],o=this._action(e,g);if(o){const i=u=>Date.now()-r>=12?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(r,u);return void o.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(i)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-r>=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()}}t.WriteBuffer=n},5941:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const a=/^([\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})$/,l=/^[\da-f]+$/;function c(n,d){const v=n.toString(16),g=v.length<2?"0"+v:v;switch(d){case 4:return v[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}t.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const v=a.exec(d);if(v){const g=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/g*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/g*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const v=d.length/3,g=[0,0,0];for(let r=0;r<3;++r){const e=parseInt(d.slice(v*r,v*r+v),16);g[r]=v===1?e<<4:v===2?e:v===3?e>>4:e>>8}return g}},t.toRgbString=function(n,d=16){const[v,g,r]=n;return`rgb:${c(v,d)}/${c(g,d)}/${c(r,d)}`}},5770:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const l=a(482),c=a(8742),n=a(5770),d=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,r){this._handlers[g]===void 0&&(this._handlers[g]=[]);const e=this._handlers[g];return e.push(r),{dispose:()=>{const o=e.indexOf(r);o!==-1&&e.splice(o,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,r){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(r);else this._handlerFb(this._ident,"HOOK",r)}put(g,r,e){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(g,r,e);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,r,e))}unhook(g,r=!0){if(this._active.length){let e=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,e=r,s=this._stack.fallThrough,this._stack.paused=!1),!s&&e===!1){for(;o>=0&&(e=this._active[o].unhook(g),e!==!0);o--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,e;o--}for(;o>=0;o--)if(e=this._active[o].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",g);this._active=d,this._ident=0}};const v=new c.Params;v.addParam(0),t.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=v,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():v,this._data="",this._hitLimit=!1}put(g,r,e){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,r,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let r=!1;if(this._hitLimit)r=!1;else if(g&&(r=this._handler(this._data,this._params),r instanceof Promise))return r.then(e=>(this._params=v,this._data="",this._hitLimit=!1,e));return this._params=v,this._data="",this._hitLimit=!1,r}}},2015:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const l=a(844),c=a(8742),n=a(6242),d=a(6351);class v{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,i,u){this.table[s<<8|o]=i<<4|u}addMany(o,s,i,u){for(let p=0;p<o.length;p++)this.table[s<<8|o[p]]=i<<4|u}}t.TransitionTable=v;const g=160;t.VT500_TRANSITION_TABLE=function(){const e=new v(4095),o=Array.apply(null,Array(256)).map((m,_)=>_),s=(m,_)=>o.slice(m,_),i=s(32,127),u=s(0,24);u.push(25),u.push.apply(u,s(28,32));const p=s(0,14);let h;for(h in e.setDefault(1,0),e.addMany(i,0,2,0),p)e.addMany([24,26,153,154],h,3,0),e.addMany(s(128,144),h,3,0),e.addMany(s(144,152),h,3,0),e.add(156,h,0,0),e.add(27,h,11,1),e.add(157,h,4,8),e.addMany([152,158,159],h,0,7),e.add(155,h,11,3),e.add(144,h,11,9);return e.addMany(u,0,3,0),e.addMany(u,1,3,1),e.add(127,1,0,1),e.addMany(u,8,0,8),e.addMany(u,3,3,3),e.add(127,3,0,3),e.addMany(u,4,3,4),e.add(127,4,0,4),e.addMany(u,6,3,6),e.addMany(u,5,3,5),e.add(127,5,0,5),e.addMany(u,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(u,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(u,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(u,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(u,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(u,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(u,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(g,0,2,0),e.add(g,8,5,8),e.add(g,6,0,6),e.add(g,11,0,11),e.add(g,13,13,13),e}();class r extends l.Disposable{constructor(o=t.VT500_TRANSITION_TABLE){super(),this._transitions=o,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.precedingJoinState=0,this._printHandlerFb=(s,i,u)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,i)=>{},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.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let i=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=o.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<o.intermediates.length;++p){const h=o.intermediates.charCodeAt(p);if(32>h||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=h}}if(o.final.length!==1)throw new Error("final must be a single byte");const u=o.final.charCodeAt(0);if(s[0]>u||u>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return i<<=8,i|=u,i}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const i=this._identifier(o,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const u=this._escHandlers[i];return u.push(s),{dispose:()=>{const p=u.indexOf(s);p!==-1&&u.splice(p,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const i=this._identifier(o);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const u=this._csiHandlers[i];return u.push(s),{dispose:()=>{const p=u.indexOf(s);p!==-1&&u.splice(p,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,i,u,p){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=i,this._parseStack.transition=u,this._parseStack.chunkPos=p}parse(o,s,i){let u,p=0,h=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const _=this._parseStack.handlers;let f=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&f>-1){for(;f>=0&&(u=_[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._parseStack.handlerPos=f,u}this._parseStack.handlers=[];break;case 4:if(i===!1&&f>-1){for(;f>=0&&(u=_[f](),u!==!0);f--)if(u instanceof Promise)return this._parseStack.handlerPos=f,u}this._parseStack.handlers=[];break;case 6:if(p=o[this._parseStack.chunkPos],u=this._dcsParser.unhook(p!==24&&p!==26,i),u)return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=o[this._parseStack.chunkPos],u=this._oscParser.end(p!==24&&p!==26,i),u)return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let _=m;_<s;++_){switch(p=o[_],h=this._transitions.table[this.currentState<<8|(p<160?p:g)],h>>4){case 2:for(let w=_+1;;++w){if(w>=s||(p=o[w])<32||p>126&&p<g){this._printHandler(o,_,w),_=w-1;break}if(++w>=s||(p=o[w])<32||p>126&&p<g){this._printHandler(o,_,w),_=w-1;break}if(++w>=s||(p=o[w])<32||p>126&&p<g){this._printHandler(o,_,w),_=w-1;break}if(++w>=s||(p=o[w])<32||p>126&&p<g){this._printHandler(o,_,w),_=w-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const f=this._csiHandlers[this._collect<<8|p];let C=f?f.length-1:-1;for(;C>=0&&(u=f[C](this._params),u!==!0);C--)if(u instanceof Promise)return this._preserveStack(3,f,C,h,_),u;C<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingJoinState=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++_<s&&(p=o[_])>47&&p<60);_--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:const b=this._escHandlers[this._collect<<8|p];let S=b?b.length-1:-1;for(;S>=0&&(u=b[S](),u!==!0);S--)if(u instanceof Promise)return this._preserveStack(4,b,S,h,_),u;S<0&&this._escHandlerFb(this._collect<<8|p),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|p,this._params);break;case 13:for(let w=_+1;;++w)if(w>=s||(p=o[w])===24||p===26||p===27||p>127&&p<g){this._dcsParser.put(o,_,w),_=w-1;break}break;case 14:if(u=this._dcsParser.unhook(p!==24&&p!==26),u)return this._preserveStack(6,[],0,h,_),u;p===27&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let w=_+1;;w++)if(w>=s||(p=o[w])<32||p>127&&p<g){this._oscParser.put(o,_,w),_=w-1;break}break;case 6:if(u=this._oscParser.end(p!==24&&p!==26),u)return this._preserveStack(5,[],0,h,_),u;p===27&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&h}}}t.EscapeSequenceParser=r},6242:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const l=a(5770),c=a(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,v){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(v),{dispose:()=>{const r=g.indexOf(v);r!==-1&&g.splice(r,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,v,g){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(d,v,g);else this._handlerFb(this._id,"PUT",(0,c.utf32ToString)(d,v,g))}start(){this.reset(),this._state=1}put(d,v,g){if(this._state!==3){if(this._state===1)for(;v<g;){const r=d[v++];if(r===59){this._state=2,this._start();break}if(r<48||57<r)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+r-48}this._state===2&&g-v>0&&this._put(d,v,g)}}end(d,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,r=this._active.length-1,e=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,g=v,e=this._stack.fallThrough,this._stack.paused=!1),!e&&g===!1){for(;r>=0&&(g=this._active[r].end(d),g!==!0);r--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,g;r--}for(;r>=0;r--)if(g=this._active[r].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,v,g){this._hitLimit||(this._data+=(0,c.utf32ToString)(d,v,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let v=!1;if(this._hitLimit)v=!1;else if(d&&(v=this._handler(this._data),v instanceof Promise))return v.then(g=>(this._data="",this._hitLimit=!1,g));return this._data="",this._hitLimit=!1,v}}},8742:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const a=2147483647;class l{static fromArray(n){const d=new l;if(!n.length)return d;for(let v=Array.isArray(n[0])?1:0;v<n.length;++v){const g=n[v];if(Array.isArray(g))for(let r=0;r<g.length;++r)d.addSubParam(g[r]);else d.addParam(g)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new l(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&n.push(Array.prototype.slice.call(this._subParams,v,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,v=255&this._subParamsIdx[n];return v-d>0?this._subParams.subarray(d,v):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&(n[d]=this._subParams.slice(v,g))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,g=v[d-1];v[d-1]=~g?Math.min(10*g+n,a):n}}t.Params=l},5741:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const c={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(c),l.dispose=()=>this._wrappedAddonDispose(c),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let c=0;c<this._addons.length;c++)if(this._addons[c]===a){l=c;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const l=a(3785),c=a(511);t.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,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(n){const d=this._buffer.lines.get(n);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new c.CellData}}},3785:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const l=a(511);t.BufferLineApiView=class{constructor(c){this._line=c}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(c,n){if(!(c<0||c>=this._line.length))return n?(this._line.loadCell(c,n),n):this._line.loadCell(c,new l.CellData)}translateToString(c,n,d){return this._line.translateToString(c,n,d)}}},8285:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const l=a(8771),c=a(8460),n=a(844);class d extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new c.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}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)}}t.BufferNamespaceApi=d},7975:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,c=>l(c.toArray()))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,(c,n)=>l(c,n.toArray()))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(O,t,a){var l=this&&this.__decorate||function(e,o,s,i){var u,p=arguments.length,h=p<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,s,i);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(h=(p<3?u(h):p>3?u(o,s,h):u(o,s))||h);return p>3&&h&&Object.defineProperty(o,s,h),h},c=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),v=a(5295),g=a(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let r=t.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(e,this))}resize(e,o){this.cols=e,this.rows=o,this.buffers.resize(e,o),this._onResize.fire({cols:e,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,o=!1){const s=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=s.getBlankLine(e,o),this._cachedBlankLine=i),i.isWrapped=o;const u=s.ybase+s.scrollTop,p=s.ybase+s.scrollBottom;if(s.scrollTop===0){const h=s.lines.isFull;p===s.lines.length-1?h?s.lines.recycle().copyFrom(i):s.lines.push(i.clone()):s.lines.splice(p+1,0,i.clone()),h?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const h=p-u+1;s.lines.shiftElements(u+1,h-1,-1),s.lines.set(p,i.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,o,s){const i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const u=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),u!==i.ydisp&&(o||this._onScroll.fire(i.ydisp))}};t.BufferService=r=l([c(0,g.IOptionsService)],r)},7994:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(O,t,a){var l=this&&this.__decorate||function(i,u,p,h){var m,_=arguments.length,f=_<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(i,u,p,h);else for(var C=i.length-1;C>=0;C--)(m=i[C])&&(f=(_<3?m(f):_>3?m(u,p,f):m(u,p))||f);return _>3&&f&&Object.defineProperty(u,p,f),f},c=this&&this.__param||function(i,u){return function(p,h){u(p,h,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=a(2585),d=a(8460),v=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function r(i,u){let p=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(p|=64,p|=i.action):(p|=3&i.button,4&i.button&&(p|=64),8&i.button&&(p|=128),i.action===32?p|=32:i.action!==0||u||(p|=3)),p}const e=String.fromCharCode,o={DEFAULT:i=>{const u=[r(i,!1)+32,i.col+32,i.row+32];return u[0]>255||u[1]>255||u[2]>255?"":`\x1B[M${e(u[0])}${e(u[1])}${e(u[2])}`},SGR:i=>{const u=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${r(i,!0)};${i.col};${i.row}${u}`},SGR_PIXELS:i=>{const u=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${r(i,!0)};${i.x};${i.y}${u}`}};let s=t.CoreMouseService=class extends v.Disposable{constructor(i,u){super(),this._bufferService=i,this._coreService=u,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const p of Object.keys(g))this.addProtocol(p,g[p]);for(const p of Object.keys(o))this.addEncoding(p,o[p]);this.reset()}addProtocol(i,u){this._protocols[i]=u}addEncoding(i,u){this._encodings[i]=u}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const u=this._encodings[this._activeEncoding](i);return u&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(u):this._coreService.triggerDataEvent(u,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,u,p){if(p){if(i.x!==u.x||i.y!==u.y)return!1}else if(i.col!==u.col||i.row!==u.row)return!1;return i.button===u.button&&i.action===u.action&&i.ctrl===u.ctrl&&i.alt===u.alt&&i.shift===u.shift}};t.CoreMouseService=s=l([c(0,n.IBufferService),c(1,n.ICoreService)],s)},6975:function(O,t,a){var l=this&&this.__decorate||function(s,i,u,p){var h,m=arguments.length,_=m<3?i:p===null?p=Object.getOwnPropertyDescriptor(i,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(s,i,u,p);else for(var f=s.length-1;f>=0;f--)(h=s[f])&&(_=(m<3?h(_):m>3?h(i,u,_):h(i,u))||_);return m>3&&_&&Object.defineProperty(i,u,_),_},c=this&&this.__param||function(s,i){return function(u,p){i(u,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=a(1439),d=a(8460),v=a(844),g=a(2585),r=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=t.CoreService=class extends v.Disposable{constructor(s,i,u){super(),this._bufferService=s,this._logService=i,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(r),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(r),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(s,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const u=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(p=>p.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(s))}};t.CoreService=o=l([c(0,g.IBufferService),c(1,g.ILogService),c(2,g.IOptionsService)],o)},9074:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const l=a(8055),c=a(8460),n=a(844),d=a(6106);let v=0,g=0;class r extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new c.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new c.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const i=new e(s);if(i){const u=i.marker.onDispose(()=>i.dispose());i.onDispose(()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),u.dispose())}),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,i,u){let p=0,h=0;for(const m of this._decorations.getKeyIterator(i))p=m.options.x??0,h=p+(m.options.width??1),s>=p&&s<h&&(!u||(m.options.layer??"bottom")===u)&&(yield m)}forEachDecorationAtCell(s,i,u,p){this._decorations.forEachByKey(i,h=>{v=h.options.x??0,g=v+(h.options.width??1),s>=v&&s<g&&(!u||(h.options.layer??"bottom")===u)&&p(h)})}}t.DecorationService=r;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new c.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const l=a(2585),c=a(8343);class n{constructor(...v){this._entries=new Map;for(const[g,r]of v)this.set(g,r)}set(v,g){const r=this._entries.get(v);return this._entries.set(v,g),r}forEach(v){for(const[g,r]of this._entries.entries())v(g,r)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(l.IInstantiationService,this)}setService(d,v){this._services.set(d,v)}getService(d){return this._services.get(d)}createInstance(d,...v){const g=(0,c.getServiceDependencies)(d).sort((o,s)=>o.index-s.index),r=[];for(const o of g){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${o.id}.`);r.push(s)}const e=g.length>0?g[0].index:v.length;if(v.length!==e)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${e+1} conflicts with ${v.length} static arguments`);return new d(...v,...r)}}},7866:function(O,t,a){var l=this&&this.__decorate||function(e,o,s,i){var u,p=arguments.length,h=p<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,s,i);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(h=(p<3?u(h):p>3?u(o,s,h):u(o,s))||h);return p>3&&h&&Object.defineProperty(o,s,h),h},c=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(844),d=a(2585),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(e,...o){var s;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var s;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var s;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var s;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var s;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,s){if(typeof s.value!="function")throw new Error("not supported");const i=s.value;s.value=function(...u){if(g.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,u);g.trace(`GlyphRenderer#${i.name}(${u.map(h=>JSON.stringify(h)).join(", ")})`);const p=i.apply(this,u);return g.trace(`GlyphRenderer#${i.name} return`,p),p}}},7302:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const l=a(8460),c=a(844),n=a(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends c.Disposable{constructor(r){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e={...t.DEFAULT_OPTIONS};for(const o in r)if(o in e)try{const s=r[o];e[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=e,this.options={...e},this._setupOptions(),this.register((0,c.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(r,e){return this.onOptionChange(o=>{o===r&&e(this.rawOptions[r])})}onMultipleOptionChange(r,e){return this.onOptionChange(o=>{r.indexOf(o)!==-1&&e()})}_setupOptions(){const r=o=>{if(!(o in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},e=(o,s)=>{if(!(o in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:r.bind(this,o),set:e.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(r,e){switch(r){case"cursorStyle":if(e||(e=t.DEFAULT_OPTIONS[r]),!function(o){return o==="block"||o==="underline"||o==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${r}`);break;case"wordSeparator":e||(e=t.DEFAULT_OPTIONS[r]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=d.includes(e)?e:t.DEFAULT_OPTIONS[r];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${r} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${r} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${r} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${r} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}t.OptionsService=v},2660:function(O,t,a){var l=this&&this.__decorate||function(v,g,r,e){var o,s=arguments.length,i=s<3?g:e===null?e=Object.getOwnPropertyDescriptor(g,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(v,g,r,e);else for(var u=v.length-1;u>=0;u--)(o=v[u])&&(i=(s<3?o(i):s>3?o(g,r,i):o(g,r))||i);return s>3&&i&&Object.defineProperty(g,r,i),i},c=this&&this.__param||function(v,g){return function(r,e){g(r,e,v)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=a(2585);let d=t.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const g=this._bufferService.buffer;if(v.id===void 0){const u=g.addMarker(g.ybase+g.y),p={data:v,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(p,u)),this._dataByLinkId.set(p.id,p),p.id}const r=v,e=this._getEntryIdKey(r),o=this._entriesWithId.get(e);if(o)return this.addLineToLink(o.id,g.ybase+g.y),o.id;const s=g.addMarker(g.ybase+g.y),i={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(i,s)),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(v,g){const r=this._dataByLinkId.get(v);if(r&&r.lines.every(e=>e.line!==g)){const e=this._bufferService.buffer.addMarker(g);r.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(r,e))}}getLinkData(v){var g;return(g=this._dataByLinkId.get(v))==null?void 0:g.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,g){const r=v.lines.indexOf(g);r!==-1&&(v.lines.splice(r,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};t.OscLinkService=d=l([c(0,n.IBufferService)],d)},8343:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},2585:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(8343);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const l=a(8460),c=a(225);class n{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,g,r=!1){return(16777215&v)<<3|(3&g)<<1|(r?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const v=new c.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let g=0,r=0;const e=v.length;for(let o=0;o<e;++o){let s=v.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=e)return g+this.wcwidth(s);const p=v.charCodeAt(o);56320<=p&&p<=57343?s=1024*(s-55296)+p-56320+65536:g+=this.wcwidth(p)}const i=this.charProperties(s,r);let u=n.extractWidth(i);n.extractShouldJoin(i)&&(u-=n.extractWidth(r)),g+=u,r=i}return g}charProperties(v,g){return this._activeProvider.charProperties(v,g)}}t.UnicodeService=n}},ne={};function ee(O){var t=ne[O];if(t!==void 0)return t.exports;var a=ne[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,ee),a.exports}var le={};return(()=>{var O=le;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const t=ee(9042),a=ee(3236),l=ee(844),c=ee(5741),n=ee(8285),d=ee(7975),v=ee(7090),g=["cols","rows"];class r extends l.Disposable{constructor(o){super(),this._core=this.register(new a.Terminal(o)),this._addonManager=this.register(new c.AddonManager),this._publicOptions={...this._core.options};const s=u=>this._core.options[u],i=(u,p)=>{this._checkReadonlyOptions(u),this._core.options[u]=p};for(const u in this._core.options){const p={get:s.bind(this,u),set:i.bind(this,u)};Object.defineProperty(this._publicOptions,u,p)}}_checkReadonlyOptions(o){if(g.includes(o))throw new Error(`Option "${o}" 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._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.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._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,s=!0){this._core.input(o,s)}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,i){this._verifyIntegers(o,s,i),this._core.select(o,s,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
|
||
`,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return t}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}O.Terminal=r})(),le})())})(Re);var Be=Re.exports,Ae={exports:{}};(function(he,Ce){(function(ce,ne){he.exports=ne()})(self,()=>(()=>{var ce={965:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const l=a(374),c=a(509),n=a(855),d=a(859),v=a(381),g=11,r=g*Float32Array.BYTES_PER_ELEMENT;let e,o=0,s=0,i=0;class u extends d.Disposable{constructor(h,m,_,f){super(),this._terminal=h,this._gl=m,this._dimensions=_,this._optionsService=f,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const C=this._gl;c.TextureAtlas.maxAtlasPages===void 0&&(c.TextureAtlas.maxAtlasPages=Math.min(32,(0,l.throwIfFalsy)(C.getParameter(C.MAX_TEXTURE_IMAGE_UNITS))),c.TextureAtlas.maxTextureSize=(0,l.throwIfFalsy)(C.getParameter(C.MAX_TEXTURE_SIZE))),this._program=(0,l.throwIfFalsy)((0,v.createProgram)(C,`#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 float a_texpage;
|
||
layout (location = 5) in vec2 a_texcoord;
|
||
layout (location = 6) in vec2 a_texsize;
|
||
|
||
uniform mat4 u_projection;
|
||
uniform vec2 u_resolution;
|
||
|
||
out vec2 v_texcoord;
|
||
flat out int v_texpage;
|
||
|
||
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_texpage = int(a_texpage);
|
||
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
||
}`,function(B){let k="";for(let M=1;M<B;M++)k+=` else if (v_texpage == ${M}) { outColor = texture(u_texture[${M}], v_texcoord); }`;return`#version 300 es
|
||
precision lowp float;
|
||
|
||
in vec2 v_texcoord;
|
||
flat in int v_texpage;
|
||
|
||
uniform sampler2D u_texture[${B}];
|
||
|
||
out vec4 outColor;
|
||
|
||
void main() {
|
||
if (v_texpage == 0) {
|
||
outColor = texture(u_texture[0], v_texcoord);
|
||
} ${k}
|
||
}`}(c.TextureAtlas.maxAtlasPages))),this.register((0,d.toDisposable)(()=>C.deleteProgram(this._program))),this._projectionLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=C.createVertexArray(),C.bindVertexArray(this._vertexArrayObject);const b=new Float32Array([0,0,1,0,0,1,1,1]),S=C.createBuffer();this.register((0,d.toDisposable)(()=>C.deleteBuffer(S))),C.bindBuffer(C.ARRAY_BUFFER,S),C.bufferData(C.ARRAY_BUFFER,b,C.STATIC_DRAW),C.enableVertexAttribArray(0),C.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const w=new Uint8Array([0,1,2,3]),L=C.createBuffer();this.register((0,d.toDisposable)(()=>C.deleteBuffer(L))),C.bindBuffer(C.ELEMENT_ARRAY_BUFFER,L),C.bufferData(C.ELEMENT_ARRAY_BUFFER,w,C.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(C.createBuffer()),this.register((0,d.toDisposable)(()=>C.deleteBuffer(this._attributesBuffer))),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.enableVertexAttribArray(2),C.vertexAttribPointer(2,2,C.FLOAT,!1,r,0),C.vertexAttribDivisor(2,1),C.enableVertexAttribArray(3),C.vertexAttribPointer(3,2,C.FLOAT,!1,r,2*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(3,1),C.enableVertexAttribArray(4),C.vertexAttribPointer(4,1,C.FLOAT,!1,r,4*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(4,1),C.enableVertexAttribArray(5),C.vertexAttribPointer(5,2,C.FLOAT,!1,r,5*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(5,1),C.enableVertexAttribArray(6),C.vertexAttribPointer(6,2,C.FLOAT,!1,r,7*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(6,1),C.enableVertexAttribArray(1),C.vertexAttribPointer(1,2,C.FLOAT,!1,r,9*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(1,1),C.useProgram(this._program);const D=new Int32Array(c.TextureAtlas.maxAtlasPages);for(let B=0;B<c.TextureAtlas.maxAtlasPages;B++)D[B]=B;C.uniform1iv(this._textureLocation,D),C.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),this._atlasTextures=[];for(let B=0;B<c.TextureAtlas.maxAtlasPages;B++){const k=new v.GLTexture((0,l.throwIfFalsy)(C.createTexture()));this.register((0,d.toDisposable)(()=>C.deleteTexture(k.texture))),C.activeTexture(C.TEXTURE0+B),C.bindTexture(C.TEXTURE_2D,k.texture),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,1,1,0,C.RGBA,C.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[B]=k}C.enable(C.BLEND),C.blendFunc(C.SRC_ALPHA,C.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(h,m,_,f,C,b,S,w,L){this._updateCell(this._vertices.attributes,h,m,_,f,C,b,S,w,L)}_updateCell(h,m,_,f,C,b,S,w,L,D){o=(_*this._terminal.cols+m)*g,f!==n.NULL_CELL_CODE&&f!==void 0?this._atlas&&(e=w&&w.length>1?this._atlas.getRasterizedGlyphCombinedChar(w,C,b,S,!1):this._atlas.getRasterizedGlyph(f,C,b,S,!1),s=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),C!==D&&e.offset.x>s?(i=e.offset.x-s,h[o]=-(e.offset.x-i)+this._dimensions.device.char.left,h[o+1]=-e.offset.y+this._dimensions.device.char.top,h[o+2]=(e.size.x-i)/this._dimensions.device.canvas.width,h[o+3]=e.size.y/this._dimensions.device.canvas.height,h[o+4]=e.texturePage,h[o+5]=e.texturePositionClipSpace.x+i/this._atlas.pages[e.texturePage].canvas.width,h[o+6]=e.texturePositionClipSpace.y,h[o+7]=e.sizeClipSpace.x-i/this._atlas.pages[e.texturePage].canvas.width,h[o+8]=e.sizeClipSpace.y):(h[o]=-e.offset.x+this._dimensions.device.char.left,h[o+1]=-e.offset.y+this._dimensions.device.char.top,h[o+2]=e.size.x/this._dimensions.device.canvas.width,h[o+3]=e.size.y/this._dimensions.device.canvas.height,h[o+4]=e.texturePage,h[o+5]=e.texturePositionClipSpace.x,h[o+6]=e.texturePositionClipSpace.y,h[o+7]=e.sizeClipSpace.x,h[o+8]=e.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,l.allowRescaling)(f,L,e.size.x,this._dimensions.device.cell.width)&&(h[o+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):h.fill(0,o,o+g-1-2)}clear(){const h=this._terminal,m=h.cols*h.rows*g;this._vertices.count!==m?this._vertices.attributes=new Float32Array(m):this._vertices.attributes.fill(0);let _=0;for(;_<this._vertices.attributesBuffers.length;_++)this._vertices.count!==m?this._vertices.attributesBuffers[_]=new Float32Array(m):this._vertices.attributesBuffers[_].fill(0);this._vertices.count=m,_=0;for(let f=0;f<h.rows;f++)for(let C=0;C<h.cols;C++)this._vertices.attributes[_+9]=C/h.cols,this._vertices.attributes[_+10]=f/h.rows,_+=g}handleResize(){const h=this._gl;h.useProgram(this._program),h.viewport(0,0,h.canvas.width,h.canvas.height),h.uniform2f(this._resolutionLocation,h.canvas.width,h.canvas.height),this.clear()}render(h){if(!this._atlas)return;const m=this._gl;m.useProgram(this._program),m.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const _=this._vertices.attributesBuffers[this._activeBuffer];let f=0;for(let C=0;C<h.lineLengths.length;C++){const b=C*this._terminal.cols*g,S=this._vertices.attributes.subarray(b,b+h.lineLengths[C]*g);_.set(S,f),f+=S.length}m.bindBuffer(m.ARRAY_BUFFER,this._attributesBuffer),m.bufferData(m.ARRAY_BUFFER,_.subarray(0,f),m.STREAM_DRAW);for(let C=0;C<this._atlas.pages.length;C++)this._atlas.pages[C].version!==this._atlasTextures[C].version&&this._bindAtlasPageTexture(m,this._atlas,C);m.drawElementsInstanced(m.TRIANGLE_STRIP,4,m.UNSIGNED_BYTE,0,f/g)}setAtlas(h){this._atlas=h;for(const m of this._atlasTextures)m.version=-1}_bindAtlasPageTexture(h,m,_){h.activeTexture(h.TEXTURE0+_),h.bindTexture(h.TEXTURE_2D,this._atlasTextures[_].texture),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,m.pages[_].canvas),h.generateMipmap(h.TEXTURE_2D),this._atlasTextures[_].version=m.pages[_].version}setDimensions(h){this._dimensions=h}}t.GlyphRenderer=u},742:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const l=a(374),c=a(859),n=a(310),d=a(381),v=8*Float32Array.BYTES_PER_ELEMENT;class g{constructor(){this.attributes=new Float32Array(160),this.count=0}}let r=0,e=0,o=0,s=0,i=0,u=0,p=0;class h extends c.Disposable{constructor(_,f,C,b){super(),this._terminal=_,this._gl=f,this._dimensions=C,this._themeService=b,this._vertices=new g,this._verticesCursor=new g;const S=this._gl;this._program=(0,l.throwIfFalsy)((0,d.createProgram)(S,`#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)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,l.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);const w=new Float32Array([0,0,1,0,0,1,1,1]),L=S.createBuffer();this.register((0,c.toDisposable)(()=>S.deleteBuffer(L))),S.bindBuffer(S.ARRAY_BUFFER,L),S.bufferData(S.ARRAY_BUFFER,w,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),B=S.createBuffer();this.register((0,c.toDisposable)(()=>S.deleteBuffer(B))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,B),S.bufferData(S.ELEMENT_ARRAY_BUFFER,D,S.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(S.createBuffer()),this.register((0,c.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,v,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,v,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,v,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(b.colors),this.register(this._themeService.onChangeColors(k=>{this._updateCachedColors(k),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(_){const f=this._gl;f.useProgram(this._program),f.bindVertexArray(this._vertexArrayObject),f.uniformMatrix4fv(this._projectionLocation,!1,d.PROJECTION_MATRIX),f.bindBuffer(f.ARRAY_BUFFER,this._attributesBuffer),f.bufferData(f.ARRAY_BUFFER,_.attributes,f.DYNAMIC_DRAW),f.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,f.UNSIGNED_BYTE,0,_.count)}handleResize(){this._updateViewportRectangle()}setDimensions(_){this._dimensions=_}_updateCachedColors(_){this._bgFloat=this._colorToFloat32Array(_.background),this._cursorFloat=this._colorToFloat32Array(_.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(_){const f=this._terminal,C=this._vertices;let b,S,w,L,D,B,k,M,y,x,R,A=1;for(b=0;b<f.rows;b++){for(w=-1,L=0,D=0,B=!1,S=0;S<f.cols;S++)k=(b*f.cols+S)*n.RENDER_MODEL_INDICIES_PER_CELL,M=_.cells[k+n.RENDER_MODEL_BG_OFFSET],y=_.cells[k+n.RENDER_MODEL_FG_OFFSET],x=!!(67108864&y),(M!==L||y!==D&&(B||x))&&((L!==0||B&&D!==0)&&(R=8*A++,this._updateRectangle(C,R,D,L,w,S,b)),w=S,L=M,D=y,B=x);(L!==0||B&&D!==0)&&(R=8*A++,this._updateRectangle(C,R,D,L,w,f.cols,b))}C.count=A}updateCursor(_){const f=this._verticesCursor,C=_.cursor;if(!C||C.style==="block")return void(f.count=0);let b,S=0;C.style!=="bar"&&C.style!=="outline"||(b=8*S++,this._addRectangleFloat(f.attributes,b,C.x*this._dimensions.device.cell.width,C.y*this._dimensions.device.cell.height,C.style==="bar"?C.dpr*C.cursorWidth:C.dpr,this._dimensions.device.cell.height,this._cursorFloat)),C.style!=="underline"&&C.style!=="outline"||(b=8*S++,this._addRectangleFloat(f.attributes,b,C.x*this._dimensions.device.cell.width,(C.y+1)*this._dimensions.device.cell.height-C.dpr,C.width*this._dimensions.device.cell.width,C.dpr,this._cursorFloat)),C.style==="outline"&&(b=8*S++,this._addRectangleFloat(f.attributes,b,C.x*this._dimensions.device.cell.width,C.y*this._dimensions.device.cell.height,C.width*this._dimensions.device.cell.width,C.dpr,this._cursorFloat),b=8*S++,this._addRectangleFloat(f.attributes,b,(C.x+C.width)*this._dimensions.device.cell.width-C.dpr,C.y*this._dimensions.device.cell.height,C.dpr,this._dimensions.device.cell.height,this._cursorFloat)),f.count=S}_updateRectangle(_,f,C,b,S,w,L){if(67108864&C)switch(50331648&C){case 16777216:case 33554432:r=this._themeService.colors.ansi[255&C].rgba;break;case 50331648:r=(16777215&C)<<8;break;default:r=this._themeService.colors.foreground.rgba}else switch(50331648&b){case 16777216:case 33554432:r=this._themeService.colors.ansi[255&b].rgba;break;case 50331648:r=(16777215&b)<<8;break;default:r=this._themeService.colors.background.rgba}_.attributes.length<f+4&&(_.attributes=(0,d.expandFloat32Array)(_.attributes,this._terminal.rows*this._terminal.cols*8)),e=S*this._dimensions.device.cell.width,o=L*this._dimensions.device.cell.height,s=(r>>24&255)/255,i=(r>>16&255)/255,u=(r>>8&255)/255,p=1,this._addRectangle(_.attributes,f,e,o,(w-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,s,i,u,p)}_addRectangle(_,f,C,b,S,w,L,D,B,k){_[f]=C/this._dimensions.device.canvas.width,_[f+1]=b/this._dimensions.device.canvas.height,_[f+2]=S/this._dimensions.device.canvas.width,_[f+3]=w/this._dimensions.device.canvas.height,_[f+4]=L,_[f+5]=D,_[f+6]=B,_[f+7]=k}_addRectangleFloat(_,f,C,b,S,w,L){_[f]=C/this._dimensions.device.canvas.width,_[f+1]=b/this._dimensions.device.canvas.height,_[f+2]=S/this._dimensions.device.canvas.width,_[f+3]=w/this._dimensions.device.canvas.height,_[f+4]=L[0],_[f+5]=L[1],_[f+6]=L[2],_[f+7]=L[3]}_colorToFloat32Array(_){return new Float32Array([(_.rgba>>24&255)/255,(_.rgba>>16&255)/255,(_.rgba>>8&255)/255,(255&_.rgba)/255])}}t.RectangleRenderer=h},310:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const l=a(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,l.createSelectionRenderModel)()}resize(c,n){const d=c*n*t.RENDER_MODEL_INDICIES_PER_CELL;d!==this.cells.length&&(this.cells=new Uint32Array(d),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const l=a(820),c=a(274),n=a(627),d=a(457),v=a(56),g=a(374),r=a(345),e=a(859),o=a(147),s=a(782),i=a(855),u=a(965),p=a(742),h=a(310),m=a(733);class _ extends e.Disposable{constructor(S,w,L,D,B,k,M,y,x){super(),this._terminal=S,this._characterJoinerService=w,this._charSizeService=L,this._coreBrowserService=D,this._coreService=B,this._decorationService=k,this._optionsService=M,this._themeService=y,this._cursorBlinkStateManager=new e.MutableDisposable,this._charAtlasDisposable=this.register(new e.MutableDisposable),this._observerDisposable=this.register(new e.MutableDisposable),this._model=new h.RenderModel,this._workCell=new s.CellData,this._workCell2=new s.CellData,this._rectangleRenderer=this.register(new e.MutableDisposable),this._glyphRenderer=this.register(new e.MutableDisposable),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new r.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new m.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,M,this._themeService)],this.dimensions=(0,g.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(M.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const R={antialias:!1,depth:!1,preserveDrawingBuffer:x};if(this._gl=this._canvas.getContext("webgl2",R),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,l.addDisposableDomListener)(this._canvas,"webglcontextlost",A=>{console.log("webglcontextlost event received"),A.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(A)},3e3)})),this.register((0,l.addDisposableDomListener)(this._canvas,"webglcontextrestored",A=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,v.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(A,I)=>this._setCanvasDevicePixelDimensions(A,I)),this.register(this._coreBrowserService.onWindowChange(A=>{this._observerDisposable.value=(0,v.observeDevicePixelDimensions)(this._canvas,A,(I,H)=>this._setCanvasDevicePixelDimensions(I,H))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,e.toDisposable)(()=>{var A;for(const I of this._renderLayers)I.dispose();(A=this._canvas.parentElement)==null||A.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var S;return(S=this._charAtlas)==null?void 0:S.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(S,w){var L,D,B,k;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const M of this._renderLayers)M.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(L=this._rectangleRenderer.value)==null||L.setDimensions(this.dimensions),(D=this._rectangleRenderer.value)==null||D.handleResize(),(B=this._glyphRenderer.value)==null||B.setDimensions(this.dimensions),(k=this._glyphRenderer.value)==null||k.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var S;for(const w of this._renderLayers)w.handleBlur(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.pause(),this._requestRedrawViewport()}handleFocus(){var S;for(const w of this._renderLayers)w.handleFocus(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.resume(),this._requestRedrawViewport()}handleSelectionChanged(S,w,L){for(const D of this._renderLayers)D.handleSelectionChanged(this._terminal,S,w,L);this._model.selection.update(this._core,S,w,L),this._requestRedrawViewport()}handleCursorMove(){var S;for(const w of this._renderLayers)w.handleCursorMove(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new p.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new u.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var w;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const S=(0,n.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==S&&(this._onChangeTextureAtlas.fire(S.pages[0].canvas),this._charAtlasDisposable.value=(0,e.getDisposeArrayDisposable)([(0,r.forwardEvent)(S.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,r.forwardEvent)(S.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=S,this._charAtlas.warmUp(),(w=this._glyphRenderer.value)==null||w.setAtlas(this._charAtlas)}_clearModel(S){var w;this._model.clear(),S&&((w=this._glyphRenderer.value)==null||w.clear())}clearTextureAtlas(){var S;(S=this._charAtlas)==null||S.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var S;this._clearModel(!0);for(const w of this._renderLayers)w.reset(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(S){return-1}deregisterCharacterJoiner(S){return!1}renderRows(S,w){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const L of this._renderLayers)L.handleGridChanged(this._terminal,S,w);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(S,w),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(S,w){const L=this._core;let D,B,k,M,y,x,R,A,I,H,j,N,T,E,F=this._workCell;S=C(S,L.rows-1,0),w=C(w,L.rows-1,0);const P=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=P-L.buffer.ydisp,W=Math.min(this._terminal.buffer.active.cursorX,L.cols-1);let Y=-1;const U=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let te=!1;for(B=S;B<=w;B++)for(k=B+L.buffer.ydisp,M=L.buffer.lines.get(k),this._model.lineLengths[B]=0,y=this._characterJoinerService.getJoinedCharacters(k),T=0;T<L.cols;T++)if(D=this._cellColorResolver.result.bg,M.loadCell(T,F),T===0&&(D=this._cellColorResolver.result.bg),x=!1,R=T,y.length>0&&T===y[0][0]&&(x=!0,A=y.shift(),F=new f(F,M.translateToString(!0,A[0],A[1]),A[1]-A[0]),R=A[1]-1),I=F.getChars(),H=F.getCode(),N=(B*L.cols+T)*h.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(F,T,k,this.dimensions.device.cell.width),U&&k===P&&(T===W&&(this._model.cursor={x:W,y:z,width:F.getWidth(),style:this._coreBrowserService.isFocused?L.options.cursorStyle||"block":L.options.cursorInactiveStyle,cursorWidth:L.options.cursorWidth,dpr:this._devicePixelRatio},Y=W+F.getWidth()-1),T>=W&&T<=Y&&(this._coreBrowserService.isFocused&&(L.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&L.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),H!==i.NULL_CELL_CODE&&(this._model.lineLengths[B]=T+1),(this._model.cells[N]!==H||this._model.cells[N+h.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[N+h.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[N+h.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(te=!0,I.length>1&&(H|=h.COMBINED_CHAR_BIT_MASK),this._model.cells[N]=H,this._model.cells[N+h.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[N+h.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[N+h.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,j=F.getWidth(),this._glyphRenderer.value.updateCell(T,B,H,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,I,j,D),x))for(F=this._workCell,T++;T<R;T++)E=(B*L.cols+T)*h.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(T,B,i.NULL_CELL_CODE,0,0,0,i.NULL_CELL_CHAR,0,0),this._model.cells[E]=i.NULL_CELL_CODE,this._model.cells[E+h.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[E+h.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[E+h.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;te&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(S,w){this._canvas.width===S&&this._canvas.height===w||(this._canvas.width=S,this._canvas.height=w,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const S=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:S,end:S})}}t.WebglRenderer=_;class f extends o.AttributeData{constructor(S,w,L){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=w,this._width=L}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()]}}function C(b,S,w=0){return Math.max(Math.min(b,S),w)}t.JoinedCellData=f},381:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const l=a(374);function c(n,d,v){const g=(0,l.throwIfFalsy)(n.createShader(d));if(n.shaderSource(g,v),n.compileShader(g),n.getShaderParameter(g,n.COMPILE_STATUS))return g;console.error(n.getShaderInfoLog(g)),n.deleteShader(g)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,d,v){const g=(0,l.throwIfFalsy)(n.createProgram());if(n.attachShader(g,(0,l.throwIfFalsy)(c(n,n.VERTEX_SHADER,d))),n.attachShader(g,(0,l.throwIfFalsy)(c(n,n.FRAGMENT_SHADER,v))),n.linkProgram(g),n.getProgramParameter(g,n.LINK_STATUS))return g;console.error(n.getProgramInfoLog(g)),n.deleteProgram(g)},t.createShader=c,t.expandFloat32Array=function(n,d){const v=Math.min(2*n.length,d),g=new Float32Array(v);for(let r=0;r<n.length;r++)g[r]=n[r];return g},t.GLTexture=class{constructor(n){this.texture=n,this.version=-1}}},592:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const l=a(627),c=a(237),n=a(374),d=a(859);class v extends d.Disposable{constructor(r,e,o,s,i,u,p,h){super(),this._container=e,this._alpha=i,this._coreBrowserService=u,this._optionsService=p,this._themeService=h,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${o}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(m=>{this._refreshCharAtlas(r,m),this.reset(r)})),this.register((0,d.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(r){}handleFocus(r){}handleCursorMove(r){}handleGridChanged(r,e,o){}handleSelectionChanged(r,e,o,s=!1){}_setTransparency(r,e){if(e===this._alpha)return;const o=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(r,this._themeService.colors),this.handleGridChanged(r,0,r.rows-1)}_refreshCharAtlas(r,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,l.acquireTextureAtlas)(r,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(r,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(r,this._themeService.colors)}_fillBottomLineAtCells(r,e,o=1){this._ctx.fillRect(r*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,o*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(r,e,o,s){this._alpha?this._ctx.clearRect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(r,e,o,s){this._ctx.font=this._getFont(r,!1,!1),this._ctx.textBaseline=c.TEXT_BASELINE,this._clipCell(o,s,e.getWidth()),this._ctx.fillText(e.getChars(),o*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(r,e,o){this._ctx.beginPath(),this._ctx.rect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(r,e,o){return`${o?"italic":""} ${e?r.options.fontWeightBold:r.options.fontWeight} ${r.options.fontSize*this._coreBrowserService.dpr}px ${r.options.fontFamily}`}}t.BaseRenderLayer=v},733:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const l=a(197),c=a(237),n=a(592);class d extends n.BaseRenderLayer{constructor(g,r,e,o,s,i,u){super(e,g,"link",r,!0,s,i,u),this.register(o.onShowLinkUnderline(p=>this._handleShowLinkUnderline(p))),this.register(o.onHideLinkUnderline(p=>this._handleHideLinkUnderline(p)))}resize(g,r){super.resize(g,r),this._state=void 0}reset(g){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg!==void 0&&(0,l.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let r=g.y1+1;r<g.y2;r++)this._fillBottomLineAtCells(0,r,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}t.LinkRenderLayer=d},820:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,l,c,n){a.addEventListener(l,c,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,c,n))}}}},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const l=a(855),c=a(160),n=a(374);let d,v=0,g=0,r=!1,e=!1,o=!1,s=0;t.CellColorResolver=class{constructor(i,u,p,h,m,_){this._terminal=i,this._optionService=u,this._selectionRenderModel=p,this._decorationService=h,this._coreBrowserService=m,this._themeService=_,this.result={fg:0,bg:0,ext:0}}resolve(i,u,p,h){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=268435456&i.bg?i.extended.ext:0,g=0,v=0,e=!1,r=!1,o=!1,d=this._themeService.colors,s=0,i.getCode()!==l.NULL_CELL_CODE&&i.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));s=u*h%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(u,p,"bottom",m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(v=m.foregroundColorRGB.rgba>>8&16777215,r=!0)}),o=this._selectionRenderModel.isCellSelected(this._terminal,u,p),o){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=(16777215&this.result.bg)<<8|255}g=c.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else g=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,d.selectionForeground&&(v=d.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(i.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))v=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:v=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:v=(16777215&this.result.fg)<<8|255;break;default:v=this._themeService.colors.foreground.rgba}v=c.rgba.blend(v,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(u,p,"top",m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(v=m.foregroundColorRGB.rgba>>8&16777215,r=!0)}),e&&(g=o?-16777216&i.bg&-134217729|g|50331648:-16777216&i.bg|g|50331648),r&&(v=-16777216&i.fg&-67108865|v|50331648),67108864&this.result.fg&&(e&&!r&&(v=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&d.background.rgba>>8|50331648,r=!0),!e&&r&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&d.foreground.rgba>>8|50331648,e=!0)),d=void 0,this.result.bg=e?g:this.result.bg,this.result.fg=r?v:this.result.fg,this.result.ext&=536870911,this.result.ext|=s<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const l=a(509),c=a(197),n=[];t.acquireTextureAtlas=function(d,v,g,r,e,o,s,i){const u=(0,c.generateConfig)(r,e,o,s,v,g,i);for(let m=0;m<n.length;m++){const _=n[m],f=_.ownedBy.indexOf(d);if(f>=0){if((0,c.configEquals)(_.config,u))return _.atlas;_.ownedBy.length===1?(_.atlas.dispose(),n.splice(m,1)):_.ownedBy.splice(f,1);break}}for(let m=0;m<n.length;m++){const _=n[m];if((0,c.configEquals)(_.config,u))return _.ownedBy.push(d),_.atlas}const p=d._core,h={atlas:new l.TextureAtlas(document,u,p.unicodeService),config:u,ownedBy:[d]};return n.push(h),h.atlas},t.removeTerminalFromCache=function(d){for(let v=0;v<n.length;v++){const g=n[v].ownedBy.indexOf(d);if(g!==-1){n[v].ownedBy.length===1?(n[v].atlas.dispose(),n.splice(v,1)):n[v].ownedBy.splice(g,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const l=a(160);t.generateConfig=function(c,n,d,v,g,r,e){const o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:c,deviceCellHeight:n,deviceCharWidth:d,deviceCharHeight:v,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:o}},t.configEquals=function(c,n){for(let d=0;d<c.colors.ansi.length;d++)if(c.colors.ansi[d].rgba!==n.colors.ansi[d].rgba)return!1;return c.devicePixelRatio===n.devicePixelRatio&&c.customGlyphs===n.customGlyphs&&c.lineHeight===n.lineHeight&&c.letterSpacing===n.letterSpacing&&c.fontFamily===n.fontFamily&&c.fontSize===n.fontSize&&c.fontWeight===n.fontWeight&&c.fontWeightBold===n.fontWeightBold&&c.allowTransparency===n.allowTransparency&&c.deviceCharWidth===n.deviceCharWidth&&c.deviceCharHeight===n.deviceCharHeight&&c.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&c.minimumContrastRatio===n.minimumContrastRatio&&c.colors.foreground.rgba===n.colors.foreground.rgba&&c.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const l=a(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╕":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"╘":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"╛":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"╞":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╡":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"╤":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╧":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╪":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(r,e,o,s,i,u,p,h){const m=t.blockElementDefinitions[e];if(m)return function(b,S,w,L,D,B){for(let k=0;k<S.length;k++){const M=S[k],y=D/8,x=B/8;b.fillRect(w+M.x*y,L+M.y*x,M.w*y,M.h*x)}}(r,m,o,s,i,u),!0;const _=c[e];if(_)return function(b,S,w,L,D,B){let k=n.get(S);k||(k=new Map,n.set(S,k));const M=b.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let y=k.get(M);if(!y){const x=S[0].length,R=S.length,A=b.canvas.ownerDocument.createElement("canvas");A.width=x,A.height=R;const I=(0,l.throwIfFalsy)(A.getContext("2d")),H=new ImageData(x,R);let j,N,T,E;if(M.startsWith("#"))j=parseInt(M.slice(1,3),16),N=parseInt(M.slice(3,5),16),T=parseInt(M.slice(5,7),16),E=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[j,N,T,E]=M.substring(5,M.length-1).split(",").map(F=>parseFloat(F))}for(let F=0;F<R;F++)for(let P=0;P<x;P++)H.data[4*(F*x+P)]=j,H.data[4*(F*x+P)+1]=N,H.data[4*(F*x+P)+2]=T,H.data[4*(F*x+P)+3]=S[F][P]*(255*E);I.putImageData(H,0,0),y=(0,l.throwIfFalsy)(b.createPattern(A,null)),k.set(M,y)}b.fillStyle=y,b.fillRect(w,L,D,B)}(r,_,o,s,i,u),!0;const f=t.boxDrawingDefinitions[e];if(f)return function(b,S,w,L,D,B,k){b.strokeStyle=b.fillStyle;for(const[M,y]of Object.entries(S)){let x;b.beginPath(),b.lineWidth=k*Number.parseInt(M),x=typeof y=="function"?y(.15,.15/B*D):y;for(const R of x.split(" ")){const A=R[0],I=v[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(b,g(H,D,B,w,L,!0,k))}b.stroke(),b.closePath()}}(r,f,o,s,i,u,h),!0;const C=t.powerlineDefinitions[e];return!!C&&(function(b,S,w,L,D,B,k,M){const y=new Path2D;y.rect(w,L,D,B),b.clip(y),b.beginPath();const x=k/12;b.lineWidth=M*x;for(const R of S.d.split(" ")){const A=R[0],I=v[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(b,g(H,D,B,w,L,!1,M,(S.leftPadding??0)*(x/2),(S.rightPadding??0)*(x/2)))}S.type===1?(b.strokeStyle=b.fillStyle,b.stroke()):b.fill(),b.closePath()}(r,C,o,s,i,u,p,h),!0)};const n=new Map;function d(r,e,o=0){return Math.max(Math.min(r,e),o)}const v={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function g(r,e,o,s,i,u,p,h=0,m=0){const _=r.map(f=>parseFloat(f)||parseInt(f));if(_.length<2)throw new Error("Too few arguments for instruction");for(let f=0;f<_.length;f+=2)_[f]*=e-h*p-m*p,u&&_[f]!==0&&(_[f]=d(Math.round(_[f]+.5)-.5,e,0)),_[f]+=s+h*p;for(let f=1;f<_.length;f+=2)_[f]*=o,u&&_[f]!==0&&(_[f]=d(Math.round(_[f]+.5)-.5,o,0)),_[f]+=i;return _}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const l=a(859);t.observeDevicePixelDimensions=function(c,n,d){let v=new n.ResizeObserver(g=>{const r=g.find(s=>s.target===c);if(!r)return;if(!("devicePixelContentBoxSize"in r))return v==null||v.disconnect(),void(v=void 0);const e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&d(e,o)});try{v.observe(c,{box:["device-pixel-content-box"]})}catch{v.disconnect(),v=void 0}return(0,l.toDisposable)(()=>v==null?void 0:v.disconnect())}},374:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,v){return n===1&&d>Math.ceil(1.5*v)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!function(g){return 57344<=g&&g<=63743}(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||function(n){return 9472<=n&&n<=9631}(c)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,v=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),s=Math.min(e,c.rows-1);o>=c.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const l=a(237),c=a(860),n=a(374),d=a(160),v=a(345),g=a(485),r=a(385),e=a(147),o=a(855),s={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let i;class u{get pages(){return this._pages}constructor(f,C,b){this._document=f,this._config=C,this._unicodeService=b,this._didWarmUp=!1,this._cacheMap=new g.FourKeyMap,this._cacheMapCombined=new g.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new v.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new v.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=m(f,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const f of this.pages)f.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const f=new r.IdleTaskQueue;for(let C=33;C<126;C++)f.enqueue(()=>{if(!this._cacheMap.get(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const b=this._drawToCache(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,b)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const f of this._pages)f.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(u.maxAtlasPages&&this._pages.length>=Math.max(4,u.maxAtlasPages)){const C=this._pages.filter(k=>2*k.canvas.width<=(u.maxTextureSize||4096)).sort((k,M)=>M.canvas.width!==k.canvas.width?M.canvas.width-k.canvas.width:M.percentageUsed-k.percentageUsed);let b=-1,S=0;for(let k=0;k<C.length;k++)if(C[k].canvas.width!==S)b=k,S=C[k].canvas.width;else if(k-b==3)break;const w=C.slice(b,b+4),L=w.map(k=>k.glyphs[0].texturePage).sort((k,M)=>k>M?1:-1),D=this.pages.length-w.length,B=this._mergePages(w,D);B.version++;for(let k=L.length-1;k>=0;k--)this._deletePage(L[k]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const f=new p(this._document,this._textureSize);return this._pages.push(f),this._activePages.push(f),this._onAddTextureAtlasCanvas.fire(f.canvas),f}_mergePages(f,C){const b=2*f[0].canvas.width,S=new p(this._document,b,f);for(const[w,L]of f.entries()){const D=w*L.canvas.width%b,B=Math.floor(w/2)*L.canvas.height;S.ctx.drawImage(L.canvas,D,B);for(const M of L.glyphs)M.texturePage=C,M.sizeClipSpace.x=M.size.x/b,M.sizeClipSpace.y=M.size.y/b,M.texturePosition.x+=D,M.texturePosition.y+=B,M.texturePositionClipSpace.x=M.texturePosition.x/b,M.texturePositionClipSpace.y=M.texturePosition.y/b;this._onRemoveTextureAtlasCanvas.fire(L.canvas);const k=this._activePages.indexOf(L);k!==-1&&this._activePages.splice(k,1)}return S}_deletePage(f){this._pages.splice(f,1);for(let C=f;C<this._pages.length;C++){const b=this._pages[C];for(const S of b.glyphs)S.texturePage--;b.version++}}getRasterizedGlyphCombinedChar(f,C,b,S,w){return this._getFromCacheMap(this._cacheMapCombined,f,C,b,S,w)}getRasterizedGlyph(f,C,b,S,w){return this._getFromCacheMap(this._cacheMap,f,C,b,S,w)}_getFromCacheMap(f,C,b,S,w,L=!1){return i=f.get(C,b,S,w),i||(i=this._drawToCache(C,b,S,w,L),f.set(C,b,S,w,i)),i}_getColorFromAnsiIndex(f){if(f>=this._config.colors.ansi.length)throw new Error("No color found for idx "+f);return this._config.colors.ansi[f]}_getBackgroundColor(f,C,b,S){if(this._config.allowTransparency)return d.NULL_COLOR;let w;switch(f){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(C);break;case 50331648:const L=e.AttributeData.toColorRGB(C);w=d.channels.toColor(L[0],L[1],L[2]);break;default:w=b?d.color.opaque(this._config.colors.foreground):this._config.colors.background}return w}_getForegroundColor(f,C,b,S,w,L,D,B,k,M){const y=this._getMinimumContrastColor(f,C,b,S,w,L,D,k,B,M);if(y)return y;let x;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&k&&L<8&&(L+=8),x=this._getColorFromAnsiIndex(L);break;case 50331648:const R=e.AttributeData.toColorRGB(L);x=d.channels.toColor(R[0],R[1],R[2]);break;default:x=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(x=d.color.opaque(x)),B&&(x=d.color.multiplyOpacity(x,l.DIM_OPACITY)),x}_resolveBackgroundRgba(f,C,b){switch(f){case 16777216:case 33554432:return this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(f,C,b,S){switch(f){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&C<8&&(C+=8),this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(f,C,b,S,w,L,D,B,k,M){if(this._config.minimumContrastRatio===1||M)return;const y=this._getContrastCache(k),x=y.getColor(f,S);if(x!==void 0)return x||void 0;const R=this._resolveBackgroundRgba(C,b,D),A=this._resolveForegroundRgba(w,L,D,B),I=d.rgba.ensureContrastRatio(R,A,this._config.minimumContrastRatio/(k?2:1));if(!I)return void y.setColor(f,S,null);const H=d.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return y.setColor(f,S,H),H}_getContrastCache(f){return f?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(f,C,b,S,w=!1){const L=typeof f=="number"?String.fromCharCode(f):f,D=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=b,this._workAttributeData.bg=C,this._workAttributeData.extended.ext=S,this._workAttributeData.isInvisible())return s;const k=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),y=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),A=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let H=this._workAttributeData.getFgColor(),j=this._workAttributeData.getFgColorMode(),N=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(M){const $=H;H=N,N=$;const K=j;j=T,T=K}const E=this._getBackgroundColor(T,N,M,y);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const F=k?this._config.fontWeightBold:this._config.fontWeight,P=x?"italic":"";this._tmpCtx.font=`${P} ${F} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;const z=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),W=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Y=this._getForegroundColor(C,T,N,b,j,H,M,y,k,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Y.css;const U=W?0:4;let te=!1;this._config.customGlyphs!==!1&&(te=(0,c.tryDrawCustomChar)(this._tmpCtx,L,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let re,X=!z;if(re=typeof f=="number"?this._unicodeService.wcwidth(f):this._unicodeService.getStringCellWidth(f),R){this._tmpCtx.save();const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())X=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{X=!1;let se=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&se<8&&(se+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(se).css}this._tmpCtx.beginPath();const ie=U,Q=Math.ceil(U+this._config.deviceCharHeight)-K-(w?2*$:0),_e=Q+$,oe=Q+2*$;let ae=this._workAttributeData.getUnderlineVariantOffset();for(let se=0;se<re;se++){this._tmpCtx.save();const Z=ie+se*this._config.deviceCellWidth,J=ie+(se+1)*this._config.deviceCellWidth,fe=Z+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q),this._tmpCtx.moveTo(Z,oe),this._tmpCtx.lineTo(J,oe);break;case 3:const ge=$<=1?oe:Math.ceil(U+this._config.deviceCharHeight-$/2)-K,ve=$<=1?Q:Math.ceil(U+this._config.deviceCharHeight+$/2)-K,Se=new Path2D;Se.rect(Z,Q,this._config.deviceCellWidth,oe-Q),this._tmpCtx.clip(Se),this._tmpCtx.moveTo(Z-this._config.deviceCellWidth/2,_e),this._tmpCtx.bezierCurveTo(Z-this._config.deviceCellWidth/2,ve,Z,ve,Z,_e),this._tmpCtx.bezierCurveTo(Z,ge,fe,ge,fe,_e),this._tmpCtx.bezierCurveTo(fe,ve,J,ve,J,_e),this._tmpCtx.bezierCurveTo(J,ge,J+this._config.deviceCellWidth/2,ge,J+this._config.deviceCellWidth/2,_e);break;case 4:const pe=ae===0?0:ae>=$?2*$-ae:$-ae;ae>=$||pe===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z+pe,Q),this._tmpCtx.lineTo(J,Q)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(Z+pe,Q),this._tmpCtx.moveTo(Z+pe+$,Q),this._tmpCtx.lineTo(J,Q)),ae=(0,n.computeNextVariantOffset)(J-Z,$,ae);break;case 5:const ye=.6,Le=.3,me=J-Z,be=Math.floor(ye*me),we=Math.floor(Le*me),xe=me-be-we;this._tmpCtx.setLineDash([be,we,xe]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q);break;default:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!te&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const se=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in se&&se.actualBoundingBoxDescent>0){this._tmpCtx.save();const Z=new Path2D;Z.rect(ie,Q-Math.ceil($/2),this._config.deviceCellWidth*re,oe-Q+Math.ceil($/2)),this._tmpCtx.clip(Z),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(L,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*re,U+K),this._tmpCtx.stroke()}if(te||this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let $=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X);if($)for(let K=1;K<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight-K),$=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X),$);K++);}if(A){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),K=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*re,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.stroke()}this._tmpCtx.restore();const de=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ue;if(ue=this._config.allowTransparency?function($){for(let K=0;K<$.data.length;K+=4)if($.data[K+3]>0)return!1;return!0}(de):h(de,E,Y,X),ue)return s;const V=this._findGlyphBoundingBox(de,this._workBoundingBox,D,W,te,U);let q,G;for(;;){if(this._activePages.length===0){const $=this._createNewPage();q=$,G=$.currentRow,G.height=V.size.y;break}q=this._activePages[this._activePages.length-1],G=q.currentRow;for(const $ of this._activePages)V.size.y<=$.currentRow.height&&(q=$,G=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(const K of this._activePages[$].fixedRows)K.height<=G.height&&V.size.y<=K.height&&(q=this._activePages[$],G=K);if(G.y+V.size.y>=q.canvas.height||G.height>V.size.y+2){let $=!1;if(q.currentRow.y+q.currentRow.height+V.size.y>=q.canvas.height){let K;for(const ie of this._activePages)if(ie.currentRow.y+ie.currentRow.height+V.size.y<ie.canvas.height){K=ie;break}if(K)q=K;else if(u.maxAtlasPages&&this._pages.length>=u.maxAtlasPages&&G.y+V.size.y<=q.canvas.height&&G.height>=V.size.y&&G.x+V.size.x<=q.canvas.width)$=!0;else{const ie=this._createNewPage();q=ie,G=ie.currentRow,G.height=V.size.y,$=!0}}$||(q.currentRow.height>0&&q.fixedRows.push(q.currentRow),G={x:0,y:q.currentRow.y+q.currentRow.height,height:V.size.y},q.fixedRows.push(G),q.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+V.size.x<=q.canvas.width)break;G===q.currentRow?(G.x=0,G.y+=G.height,G.height=0):q.fixedRows.splice(q.fixedRows.indexOf(G),1)}return V.texturePage=this._pages.indexOf(q),V.texturePosition.x=G.x,V.texturePosition.y=G.y,V.texturePositionClipSpace.x=G.x/q.canvas.width,V.texturePositionClipSpace.y=G.y/q.canvas.height,V.sizeClipSpace.x/=q.canvas.width,V.sizeClipSpace.y/=q.canvas.height,G.height=Math.max(G.height,V.size.y),G.x+=V.size.x,q.ctx.putImageData(de,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),q.addGlyph(V),q.version++,V}_findGlyphBoundingBox(f,C,b,S,w,L){C.top=0;const D=S?this._config.deviceCellHeight:this._tmpCanvas.height,B=S?this._config.deviceCellWidth:b;let k=!1;for(let M=0;M<D;M++){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(f.data[x]!==0){C.top=M,k=!0;break}}if(k)break}C.left=0,k=!1;for(let M=0;M<L+B;M++){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(f.data[x]!==0){C.left=M,k=!0;break}}if(k)break}C.right=B,k=!1;for(let M=L+B-1;M>=L;M--){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(f.data[x]!==0){C.right=M,k=!0;break}}if(k)break}C.bottom=D,k=!1;for(let M=D-1;M>=0;M--){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(f.data[x]!==0){C.bottom=M,k=!0;break}}if(k)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:C.right-C.left+1,y:C.bottom-C.top+1},sizeClipSpace:{x:C.right-C.left+1,y:C.bottom-C.top+1},offset:{x:-C.left+L+(S||w?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-C.top+L+(S||w?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=u;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(f){this._glyphs.push(f),this._usedPixels+=f.size.x*f.size.y}constructor(f,C,b){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],b)for(const S of b)this._glyphs.push(...S.glyphs),this._usedPixels+=S._usedPixels;this.canvas=m(f,C,C),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(_,f,C,b){const S=f.rgba>>>24,w=f.rgba>>>16&255,L=f.rgba>>>8&255,D=C.rgba>>>24,B=C.rgba>>>16&255,k=C.rgba>>>8&255,M=Math.floor((Math.abs(S-D)+Math.abs(w-B)+Math.abs(L-k))/12);let y=!0;for(let x=0;x<_.data.length;x+=4)_.data[x]===S&&_.data[x+1]===w&&_.data[x+2]===L||b&&Math.abs(_.data[x]-S)+Math.abs(_.data[x+1]-w)+Math.abs(_.data[x+2]-L)<M?_.data[x+3]=0:y=!1;return y}function m(_,f,C){const b=_.createElement("canvas");return b.width=f,b.height=C,b}},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,v,g,r,e;function o(i){const u=i.toString(16);return u.length<2?"0"+u:u}function s(i,u){return i<u?(u+.05)/(i+.05):(i+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(i){i.toCss=function(u,p,h,m){return m!==void 0?`#${o(u)}${o(p)}${o(h)}${o(m)}`:`#${o(u)}${o(p)}${o(h)}`},i.toRgba=function(u,p,h,m=255){return(u<<24|p<<16|h<<8|m)>>>0},i.toColor=function(u,p,h,m){return{css:i.toCss(u,p,h,m),rgba:i.toRgba(u,p,h,m)}}}(d||(t.channels=d={})),function(i){function u(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}i.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,_=h.rgba>>16&255,f=h.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=b+Math.round((_-b)*n),c=S+Math.round((f-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},i.isOpaque=function(p){return(255&p.rgba)==255},i.ensureContrastRatio=function(p,h,m){const _=e.ensureContrastRatio(p.rgba,h.rgba,m);if(_)return d.toColor(_>>24&255,_>>16&255,_>>8&255)},i.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},i.opacity=u,i.multiplyOpacity=function(p,h){return n=255&p.rgba,u(p,n*h/255)},i.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(v||(t.color=v={})),function(i){let u,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(u=m,u.globalCompositeOperation="copy",p=u.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!u||!p)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=p,u.fillStyle=h,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,l,c,n]=u.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}}(g||(t.css=g={})),function(i){function u(p,h,m){const _=p/255,f=h/255,C=m/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}i.relativeLuminance=function(p){return u(p>>16&255,p>>8&255,255&p)},i.relativeLuminance2=u}(r||(t.rgb=r={})),function(i){function u(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S>0||w>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),w-=Math.max(0,Math.ceil(.1*w)),L-=Math.max(0,Math.ceil(.1*L)),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}function p(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S<255||w<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),w=Math.min(255,w+Math.ceil(.1*(255-w))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}i.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const _=m>>24&255,f=m>>16&255,C=m>>8&255,b=h>>24&255,S=h>>16&255,w=h>>8&255;return a=b+Math.round((_-b)*n),l=S+Math.round((f-S)*n),c=w+Math.round((C-w)*n),d.toRgba(a,l,c)},i.ensureContrastRatio=function(h,m,_){const f=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(s(f,C)<_){if(C<f){const w=u(h,m,_),L=s(f,r.relativeLuminance(w>>8));if(L<_){const D=p(h,m,_);return L>s(f,r.relativeLuminance(D>>8))?w:D}return w}const b=p(h,m,_),S=s(f,r.relativeLuminance(b>>8));if(S<_){const w=u(h,m,_);return S>s(f,r.relativeLuminance(w>>8))?b:w}return b}},i.reduceLuminance=u,i.increaseLuminance=p,i.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}}(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=s},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a(c=>l.fire(c))},t.runAndSubscribe=function(a,l){return l(void 0),a(c=>l(c))}},859:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,v){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,v)}get(l,c,n,d){var v;return(v=this._data.get(l,c))==null?void 0:v.get(n,d)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,r=0,e=v.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=v.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(133),c=a(855),n=a(147);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let v=a[d];v>65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=d;v<c;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=c)return this._interim=g,n;const r=a.charCodeAt(v);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,v,g,r=0,e=0,o=0;if(this.interim[0]){let u=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,f=_-m;for(;o<f;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,u=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}u||(_===2?p<128?o--:l[r++]=p:_===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const s=c-4;let i=o;for(;i<c;){for(;!(!(i<s)||128&(n=a[i])||128&(d=a[i+1])||128&(v=a[i+2])||128&(g=a[i+3]));)l[r++]=n,l[r++]=d,l[r++]=v,l[r++]=g,i+=4;if(n=a[i++],n<128)l[r++]=n;else if((224&n)==192){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}l[r++]=e}else if((240&n)==224){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=v,r;if(g=a[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&v)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(O,t,a){var l=this&&this.__decorate||function(e,o,s,i){var u,p=arguments.length,h=p<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,s,i);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(h=(p<3?u(h):p>3?u(o,s,h):u(o,s))||h);return p>3&&h&&Object.defineProperty(o,s,h),h},c=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),d=a(97),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(e,...o){var s;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var s;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var s;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var s;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var s;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,s){if(typeof s.value!="function")throw new Error("not supported");const i=s.value;s.value=function(...u){if(g.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,u);g.trace(`GlyphRenderer#${i.name}(${u.map(h=>JSON.stringify(h)).join(", ")})`);const p=i.apply(this,u);return g.trace(`GlyphRenderer#${i.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(726);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},ne={};function ee(O){var t=ne[O];if(t!==void 0)return t.exports;var a=ne[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,ee),a.exports}var le={};return(()=>{var O=le;Object.defineProperty(O,"__esModule",{value:!0}),O.WebglAddon=void 0;const t=ee(345),a=ee(859),l=ee(399),c=ee(666),n=ee(776);class d extends a.Disposable{constructor(g){if(l.isSafari&&(0,l.getSafariVersion)()<16){const r={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",r))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=g,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(g){const r=g._core;if(!g.element)return void this.register(r.onWillOpen(()=>this.activate(g)));this._terminal=g;const e=r.coreService,o=r.optionsService,s=r,i=s._renderService,u=s._characterJoinerService,p=s._charSizeService,h=s._coreBrowserService,m=s._decorationService,_=s._logService,f=s._themeService;(0,n.setTraceLogger)(_),this._renderer=this.register(new c.WebglRenderer(g,u,p,h,e,m,o,f,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),i.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const C=this._terminal._core._renderService;C.setRenderer(this._terminal._core._createRenderer()),C.handleResize(g.cols,g.rows)}))}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}O.WebglAddon=d})(),le})())})(Ae);var Oe=Ae.exports,De={exports:{}};(function(he,Ce){(function(ce,ne){he.exports=ne()})(self,()=>(()=>{var ce={903:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const l=a(274),c=a(627),n=a(237),d=a(860),v=a(374),g=a(296),r=a(345),e=a(859),o=a(399),s=a(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var h;return(h=this._charAtlas)==null?void 0:h.pages[0].canvas}constructor(h,m,_,f,C,b,S,w,L,D){super(),this._terminal=h,this._container=m,this._alpha=C,this._themeService=b,this._bufferService=S,this._optionsService=w,this._decorationService=L,this._coreBrowserService=D,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,g.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new l.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${_}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(B=>{this._refreshCharAtlas(B),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,e.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,v.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(h,m){}handleSelectionChanged(h,m,_=!1){this._selectionModel.update(this._terminal._core,h,m,_)}_setTransparency(h){if(h===this._alpha)return;const m=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(h){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,r.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let m=0;m<this._charAtlas.pages.length;m++)this._bitmapGenerator[m]=new u(this._charAtlas.pages[m].canvas)}}resize(h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var h;(h=this._charAtlas)==null||h.clearTexture()}_fillCells(h,m,_,f){this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,_*this._deviceCellWidth,f*this._deviceCellHeight)}_fillMiddleLineAtCells(h,m,_=1){const f=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(h*this._deviceCellWidth,(m+1)*this._deviceCellHeight-f-this._coreBrowserService.dpr,_*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(h,m,_=1,f=0){this._ctx.fillRect(h*this._deviceCellWidth,(m+1)*this._deviceCellHeight+f-this._coreBrowserService.dpr-1,_*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(h,m,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f;for(let C=0;C<_;C++){const b=(h+C)*this._deviceCellWidth,S=(h+C+.5)*this._deviceCellWidth,w=(h+C+1)*this._deviceCellWidth,L=(m+1)*this._deviceCellHeight-f-1,D=L-f,B=L+f;this._ctx.moveTo(b,L),this._ctx.bezierCurveTo(b,D,S,D,S,L),this._ctx.bezierCurveTo(S,B,w,B,w,L)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(h,m,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f,this._ctx.setLineDash([2*f,f]);const C=h*this._deviceCellWidth,b=(m+1)*this._deviceCellHeight-f-1;this._ctx.moveTo(C,b);for(let S=0;S<_;S++){const w=(h+_+S)*this._deviceCellWidth;this._ctx.lineTo(w,b)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(h,m,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const f=this._coreBrowserService.dpr;this._ctx.lineWidth=f,this._ctx.setLineDash([4*f,3*f]);const C=h*this._deviceCellWidth,b=(h+_)*this._deviceCellWidth,S=(m+1)*this._deviceCellHeight-f-1;this._ctx.moveTo(C,S),this._ctx.lineTo(b,S),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(h,m,_){this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,this._coreBrowserService.dpr*_,this._deviceCellHeight)}_strokeRectAtCell(h,m,_,f){const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.strokeRect(h*this._deviceCellWidth+C/2,m*this._deviceCellHeight+C/2,_*this._deviceCellWidth-C,f*this._deviceCellHeight-C)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(h,m,_,f){this._alpha?this._ctx.clearRect(h*this._deviceCellWidth,m*this._deviceCellHeight,_*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,_*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(h,m,_){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(_);let f=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(f=(0,d.tryDrawCustomChar)(this._ctx,h.getChars(),m*this._deviceCellWidth,_*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),f||this._ctx.fillText(h.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,_*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(h,m,_){var L,D,B,k;const f=h.getChars(),C=h.getCode(),b=h.getWidth();if(this._cellColorResolver.resolve(h,m,this._bufferService.buffer.ydisp+_,this._deviceCellWidth),!this._charAtlas)return;let S;if(S=f&&f.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(f,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(h.getCode()||s.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!S.size.x||!S.size.y)return;this._ctx.save(),this._clipRow(_),this._bitmapGenerator[S.texturePage]&&this._charAtlas.pages[S.texturePage].canvas!==this._bitmapGenerator[S.texturePage].canvas&&((D=(L=this._bitmapGenerator[S.texturePage])==null?void 0:L.bitmap)==null||D.close(),delete this._bitmapGenerator[S.texturePage]),this._charAtlas.pages[S.texturePage].version!==((B=this._bitmapGenerator[S.texturePage])==null?void 0:B.version)&&(this._bitmapGenerator[S.texturePage]||(this._bitmapGenerator[S.texturePage]=new u(this._charAtlas.pages[S.texturePage].canvas)),this._bitmapGenerator[S.texturePage].refresh(),this._bitmapGenerator[S.texturePage].version=this._charAtlas.pages[S.texturePage].version);let w=S.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,v.allowRescaling)(C,b,S.size.x,this._deviceCellWidth)&&(w=this._deviceCellWidth-1),this._ctx.drawImage(((k=this._bitmapGenerator[S.texturePage])==null?void 0:k.bitmap)||this._charAtlas.pages[S.texturePage].canvas,S.texturePosition.x,S.texturePosition.y,S.size.x,S.size.y,m*this._deviceCellWidth+this._deviceCharLeft-S.offset.x,_*this._deviceCellHeight+this._deviceCharTop-S.offset.y,w,S.size.y),this._ctx.restore()}_clipRow(h){this._ctx.beginPath(),this._ctx.rect(0,h*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(h,m){return`${m?"italic":""} ${h?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=i;class u{get bitmap(){return this._bitmap}constructor(h){this.canvas=h,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var h;(h=this._bitmap)==null||h.close(),this._bitmap=void 0,o.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var h;this._state===0&&((h=this._bitmap)==null||h.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(m=>{this._state===2?this.refresh():this._bitmap=m,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;const l=a(627),c=a(56),n=a(374),d=a(345),v=a(859),g=a(873),r=a(43),e=a(630),o=a(744);class s extends v.Disposable{constructor(u,p,h,m,_,f,C,b,S,w,L){super(),this._terminal=u,this._screenElement=p,this._bufferService=m,this._charSizeService=_,this._optionsService=f,this._coreBrowserService=S,this._themeService=L,this._observerDisposable=this.register(new v.MutableDisposable),this._onRequestRedraw=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new d.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new d.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const D=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new o.TextRenderLayer(this._terminal,this._screenElement,0,D,this._bufferService,this._optionsService,C,w,this._coreBrowserService,L),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,w,this._optionsService,L),new r.LinkRenderLayer(this._terminal,this._screenElement,2,h,this._bufferService,this._optionsService,w,this._coreBrowserService,L),new g.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,b,this._coreBrowserService,w,L)];for(const B of this._renderLayers)(0,d.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(B,k)=>this._setCanvasDevicePixelDimensions(B,k)),this.register(this._coreBrowserService.onWindowChange(B=>{this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,B,(k,M)=>this._setCanvasDevicePixelDimensions(k,M))})),this.register((0,v.toDisposable)(()=>{for(const B of this._renderLayers)B.dispose();(0,l.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(u,p){this._updateDimensions();for(const h of this._renderLayers)h.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(u=>u.handleBlur())}handleFocus(){this._runOperation(u=>u.handleFocus())}handleSelectionChanged(u,p,h=!1){this._runOperation(m=>m.handleSelectionChanged(u,p,h)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(u=>u.handleCursorMove())}clear(){this._runOperation(u=>u.reset())}_runOperation(u){for(const p of this._renderLayers)u(p)}renderRows(u,p){for(const h of this._renderLayers)h.handleGridChanged(u,p)}clearTextureAtlas(){for(const u of this._renderLayers)u.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const u=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*u),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*u),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/u),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/u),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(u,p){this.dimensions.device.canvas.height=p,this.dimensions.device.canvas.width=u;for(const h of this._renderLayers)h.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=s},873:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;const l=a(457),c=a(859),n=a(399),d=a(782),v=a(903);class g extends v.BaseRenderLayer{constructor(e,o,s,i,u,p,h,m,_,f){super(e,o,"cursor",s,!0,f,u,p,_,m),this._onRequestRedraw=i,this._coreService=h,this._cursorBlinkStateManager=this.register(new c.MutableDisposable),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),outline:this._renderOutlineCursor.bind(this)},this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)==null||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)==null||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new l.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation()}handleGridChanged(e,o){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const o=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=o-this._bufferService.buffer.ydisp;if(s<0||s>=this._bufferService.rows)return void this._clearCursor();const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(o).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const u=this._optionsService.rawOptions.cursorStyle,p=this._optionsService.rawOptions.cursorInactiveStyle;return p&&p!=="none"&&this._cursorRenderers[p](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=u,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(n.isFirefox||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(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,o,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,o,s.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(s,e,o),this._ctx.restore()}_renderUnderlineCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,o),this._ctx.restore()}_renderOutlineCursor(e,o,s){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,o,s.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=g},574:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(a,l){for(let c=0;c<a;c++){this.cache.length<=c&&this.cache.push([]);for(let n=this.cache[c].length;n<l;n++)this.cache[c].push(void 0);this.cache[c].length=l}this.cache.length=a}clear(){for(let a=0;a<this.cache.length;a++)for(let l=0;l<this.cache[a].length;l++)this.cache[a][l]=void 0}}},43:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const l=a(197),c=a(237),n=a(903);class d extends n.BaseRenderLayer{constructor(g,r,e,o,s,i,u,p,h){super(g,r,"link",e,!0,h,s,i,u,p),this.register(o.onShowLinkUnderline(m=>this._handleShowLinkUnderline(m))),this.register(o.onHideLinkUnderline(m=>this._handleHideLinkUnderline(m)))}resize(g){super.resize(g),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg&&(0,l.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let r=g.y1+1;r<g.y2;r++)this._fillBottomLineAtCells(0,r,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}t.LinkRenderLayer=d},630:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;const l=a(903);class c extends l.BaseRenderLayer{constructor(d,v,g,r,e,o,s,i){super(d,v,"selection",g,!0,i,r,s,o,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(d){super.resize(d),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(d,v,g){super.handleSelectionChanged(d,v,g),this._redrawSelection(d,v,g)}_redrawSelection(d,v,g){if(!this._didStateChange(d,v,g,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!d||!v)return void this._clearState();const r=d[1]-this._bufferService.buffer.ydisp,e=v[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(e,this._bufferService.rows-1);if(o>=this._bufferService.rows||s<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,g){const i=d[0],u=v[0]-i,p=s-o+1;this._fillCells(i,o,u,p)}else{const i=r===o?d[0]:0,u=o===e?v[0]:this._bufferService.cols;this._fillCells(i,o,u-i,1);const p=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,p),o!==s){const h=e===s?v[0]:this._bufferService.cols;this._fillCells(0,s,h,1)}}this._state.start=[d[0],d[1]],this._state.end=[v[0],v[1]],this._state.columnSelectMode=g,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(d,v,g,r){return!this._areCoordinatesEqual(d,this._state.start)||!this._areCoordinatesEqual(v,this._state.end)||g!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(d,v){return!(!d||!v)&&d[0]===v[0]&&d[1]===v[1]}}t.SelectionRenderLayer=c},744:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;const l=a(577),c=a(147),n=a(782),d=a(855),v=a(903),g=a(574);class r extends v.BaseRenderLayer{constructor(o,s,i,u,p,h,m,_,f,C){super(o,s,"text",i,u,C,p,h,_,f),this._characterJoinerService=m,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new g.GridCache,this.register(h.onSpecificOptionChange("allowTransparency",b=>this._setTransparency(b)))}resize(o){super.resize(o);const s=this._getFont(!1,!1);this._characterWidth===o.device.char.width&&this._characterFont===s||(this._characterWidth=o.device.char.width,this._characterFont=s,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(o,s,i){for(let u=o;u<=s;u++){const p=u+this._bufferService.buffer.ydisp,h=this._bufferService.buffer.lines.get(p),m=this._characterJoinerService.getJoinedCharacters(p);for(let _=0;_<this._bufferService.cols;_++){h.loadCell(_,this._workCell);let f=this._workCell,C=!1,b=_;if(f.getWidth()!==0){if(m.length>0&&_===m[0][0]){C=!0;const S=m.shift();f=new l.JoinedCellData(this._workCell,h.translateToString(!0,S[0],S[1]),S[1]-S[0]),b=S[1]-1}!C&&this._isOverlapping(f)&&b<h.length-1&&h.getCodePoint(b+1)===d.NULL_CELL_CODE&&(f.content&=-12582913,f.content|=8388608),i(f,_,u),_=b}}}}_drawBackground(o,s){const i=this._ctx,u=this._bufferService.cols;let p=0,h=0,m=null;i.save(),this._forEachCell(o,s,(_,f,C)=>{let b=null;_.isInverse()?b=_.isFgDefault()?this._themeService.colors.foreground.css:_.isFgRGB()?`rgb(${c.AttributeData.toColorRGB(_.getFgColor()).join(",")})`:this._themeService.colors.ansi[_.getFgColor()].css:_.isBgRGB()?b=`rgb(${c.AttributeData.toColorRGB(_.getBgColor()).join(",")})`:_.isBgPalette()&&(b=this._themeService.colors.ansi[_.getBgColor()].css);let S=!1;this._decorationService.forEachDecorationAtCell(f,this._bufferService.buffer.ydisp+C,void 0,w=>{w.options.layer!=="top"&&S||(w.backgroundColorRGB&&(b=w.backgroundColorRGB.css),S=w.options.layer==="top")}),m===null&&(p=f,h=C),C!==h?(i.fillStyle=m||"",this._fillCells(p,h,u-p,1),p=f,h=C):m!==b&&(i.fillStyle=m||"",this._fillCells(p,h,f-p,1),p=f,h=C),m=b}),m!==null&&(i.fillStyle=m,this._fillCells(p,h,u-p,1)),i.restore()}_drawForeground(o,s){this._forEachCell(o,s,(i,u,p)=>this._drawChars(i,u,p))}handleGridChanged(o,s){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,o,this._bufferService.cols,s-o+1),this._drawBackground(o,s),this._drawForeground(o,s))}_isOverlapping(o){if(o.getWidth()!==1||o.getCode()<256)return!1;const s=o.getChars();if(this._characterOverlapCache.hasOwnProperty(s))return this._characterOverlapCache[s];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(s).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[s]=i,i}}t.TextRenderLayer=r},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const l=a(855),c=a(160),n=a(374);let d,v=0,g=0,r=!1,e=!1,o=!1,s=0;t.CellColorResolver=class{constructor(i,u,p,h,m,_){this._terminal=i,this._optionService=u,this._selectionRenderModel=p,this._decorationService=h,this._coreBrowserService=m,this._themeService=_,this.result={fg:0,bg:0,ext:0}}resolve(i,u,p,h){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=268435456&i.bg?i.extended.ext:0,g=0,v=0,e=!1,r=!1,o=!1,d=this._themeService.colors,s=0,i.getCode()!==l.NULL_CELL_CODE&&i.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));s=u*h%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(u,p,"bottom",m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(v=m.foregroundColorRGB.rgba>>8&16777215,r=!0)}),o=this._selectionRenderModel.isCellSelected(this._terminal,u,p),o){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=(16777215&this.result.bg)<<8|255}g=c.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else g=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,d.selectionForeground&&(v=d.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(i.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))v=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:v=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:v=(16777215&this.result.fg)<<8|255;break;default:v=this._themeService.colors.foreground.rgba}v=c.rgba.blend(v,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(u,p,"top",m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(v=m.foregroundColorRGB.rgba>>8&16777215,r=!0)}),e&&(g=o?-16777216&i.bg&-134217729|g|50331648:-16777216&i.bg|g|50331648),r&&(v=-16777216&i.fg&-67108865|v|50331648),67108864&this.result.fg&&(e&&!r&&(v=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&d.background.rgba>>8|50331648,r=!0),!e&&r&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&d.foreground.rgba>>8|50331648,e=!0)),d=void 0,this.result.bg=e?g:this.result.bg,this.result.fg=r?v:this.result.fg,this.result.ext&=536870911,this.result.ext|=s<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const l=a(509),c=a(197),n=[];t.acquireTextureAtlas=function(d,v,g,r,e,o,s,i){const u=(0,c.generateConfig)(r,e,o,s,v,g,i);for(let m=0;m<n.length;m++){const _=n[m],f=_.ownedBy.indexOf(d);if(f>=0){if((0,c.configEquals)(_.config,u))return _.atlas;_.ownedBy.length===1?(_.atlas.dispose(),n.splice(m,1)):_.ownedBy.splice(f,1);break}}for(let m=0;m<n.length;m++){const _=n[m];if((0,c.configEquals)(_.config,u))return _.ownedBy.push(d),_.atlas}const p=d._core,h={atlas:new l.TextureAtlas(document,u,p.unicodeService),config:u,ownedBy:[d]};return n.push(h),h.atlas},t.removeTerminalFromCache=function(d){for(let v=0;v<n.length;v++){const g=n[v].ownedBy.indexOf(d);if(g!==-1){n[v].ownedBy.length===1?(n[v].atlas.dispose(),n.splice(v,1)):n[v].ownedBy.splice(g,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const l=a(160);t.generateConfig=function(c,n,d,v,g,r,e){const o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:c,deviceCellHeight:n,deviceCharWidth:d,deviceCharHeight:v,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:o}},t.configEquals=function(c,n){for(let d=0;d<c.colors.ansi.length;d++)if(c.colors.ansi[d].rgba!==n.colors.ansi[d].rgba)return!1;return c.devicePixelRatio===n.devicePixelRatio&&c.customGlyphs===n.customGlyphs&&c.lineHeight===n.lineHeight&&c.letterSpacing===n.letterSpacing&&c.fontFamily===n.fontFamily&&c.fontSize===n.fontSize&&c.fontWeight===n.fontWeight&&c.fontWeightBold===n.fontWeightBold&&c.allowTransparency===n.allowTransparency&&c.deviceCharWidth===n.deviceCharWidth&&c.deviceCharHeight===n.deviceCharHeight&&c.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&c.minimumContrastRatio===n.minimumContrastRatio&&c.colors.foreground.rgba===n.colors.foreground.rgba&&c.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const l=a(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╕":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"╘":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"╛":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"╞":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╡":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"╤":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╧":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╪":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(r,e,o,s,i,u,p,h){const m=t.blockElementDefinitions[e];if(m)return function(b,S,w,L,D,B){for(let k=0;k<S.length;k++){const M=S[k],y=D/8,x=B/8;b.fillRect(w+M.x*y,L+M.y*x,M.w*y,M.h*x)}}(r,m,o,s,i,u),!0;const _=c[e];if(_)return function(b,S,w,L,D,B){let k=n.get(S);k||(k=new Map,n.set(S,k));const M=b.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let y=k.get(M);if(!y){const x=S[0].length,R=S.length,A=b.canvas.ownerDocument.createElement("canvas");A.width=x,A.height=R;const I=(0,l.throwIfFalsy)(A.getContext("2d")),H=new ImageData(x,R);let j,N,T,E;if(M.startsWith("#"))j=parseInt(M.slice(1,3),16),N=parseInt(M.slice(3,5),16),T=parseInt(M.slice(5,7),16),E=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[j,N,T,E]=M.substring(5,M.length-1).split(",").map(F=>parseFloat(F))}for(let F=0;F<R;F++)for(let P=0;P<x;P++)H.data[4*(F*x+P)]=j,H.data[4*(F*x+P)+1]=N,H.data[4*(F*x+P)+2]=T,H.data[4*(F*x+P)+3]=S[F][P]*(255*E);I.putImageData(H,0,0),y=(0,l.throwIfFalsy)(b.createPattern(A,null)),k.set(M,y)}b.fillStyle=y,b.fillRect(w,L,D,B)}(r,_,o,s,i,u),!0;const f=t.boxDrawingDefinitions[e];if(f)return function(b,S,w,L,D,B,k){b.strokeStyle=b.fillStyle;for(const[M,y]of Object.entries(S)){let x;b.beginPath(),b.lineWidth=k*Number.parseInt(M),x=typeof y=="function"?y(.15,.15/B*D):y;for(const R of x.split(" ")){const A=R[0],I=v[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(b,g(H,D,B,w,L,!0,k))}b.stroke(),b.closePath()}}(r,f,o,s,i,u,h),!0;const C=t.powerlineDefinitions[e];return!!C&&(function(b,S,w,L,D,B,k,M){const y=new Path2D;y.rect(w,L,D,B),b.clip(y),b.beginPath();const x=k/12;b.lineWidth=M*x;for(const R of S.d.split(" ")){const A=R[0],I=v[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(b,g(H,D,B,w,L,!1,M,(S.leftPadding??0)*(x/2),(S.rightPadding??0)*(x/2)))}S.type===1?(b.strokeStyle=b.fillStyle,b.stroke()):b.fill(),b.closePath()}(r,C,o,s,i,u,p,h),!0)};const n=new Map;function d(r,e,o=0){return Math.max(Math.min(r,e),o)}const v={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function g(r,e,o,s,i,u,p,h=0,m=0){const _=r.map(f=>parseFloat(f)||parseInt(f));if(_.length<2)throw new Error("Too few arguments for instruction");for(let f=0;f<_.length;f+=2)_[f]*=e-h*p-m*p,u&&_[f]!==0&&(_[f]=d(Math.round(_[f]+.5)-.5,e,0)),_[f]+=s+h*p;for(let f=1;f<_.length;f+=2)_[f]*=o,u&&_[f]!==0&&(_[f]=d(Math.round(_[f]+.5)-.5,o,0)),_[f]+=i;return _}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const l=a(859);t.observeDevicePixelDimensions=function(c,n,d){let v=new n.ResizeObserver(g=>{const r=g.find(s=>s.target===c);if(!r)return;if(!("devicePixelContentBoxSize"in r))return v==null||v.disconnect(),void(v=void 0);const e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&d(e,o)});try{v.observe(c,{box:["device-pixel-content-box"]})}catch{v.disconnect(),v=void 0}return(0,l.toDisposable)(()=>v==null?void 0:v.disconnect())}},374:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,v){return n===1&&d>Math.ceil(1.5*v)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!function(g){return 57344<=g&&g<=63743}(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||function(n){return 9472<=n&&n<=9631}(c)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,v=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),s=Math.min(e,c.rows-1);o>=c.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const l=a(237),c=a(860),n=a(374),d=a(160),v=a(345),g=a(485),r=a(385),e=a(147),o=a(855),s={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let i;class u{get pages(){return this._pages}constructor(f,C,b){this._document=f,this._config=C,this._unicodeService=b,this._didWarmUp=!1,this._cacheMap=new g.FourKeyMap,this._cacheMapCombined=new g.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new v.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new v.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=m(f,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const f of this.pages)f.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const f=new r.IdleTaskQueue;for(let C=33;C<126;C++)f.enqueue(()=>{if(!this._cacheMap.get(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const b=this._drawToCache(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,b)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const f of this._pages)f.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(u.maxAtlasPages&&this._pages.length>=Math.max(4,u.maxAtlasPages)){const C=this._pages.filter(k=>2*k.canvas.width<=(u.maxTextureSize||4096)).sort((k,M)=>M.canvas.width!==k.canvas.width?M.canvas.width-k.canvas.width:M.percentageUsed-k.percentageUsed);let b=-1,S=0;for(let k=0;k<C.length;k++)if(C[k].canvas.width!==S)b=k,S=C[k].canvas.width;else if(k-b==3)break;const w=C.slice(b,b+4),L=w.map(k=>k.glyphs[0].texturePage).sort((k,M)=>k>M?1:-1),D=this.pages.length-w.length,B=this._mergePages(w,D);B.version++;for(let k=L.length-1;k>=0;k--)this._deletePage(L[k]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const f=new p(this._document,this._textureSize);return this._pages.push(f),this._activePages.push(f),this._onAddTextureAtlasCanvas.fire(f.canvas),f}_mergePages(f,C){const b=2*f[0].canvas.width,S=new p(this._document,b,f);for(const[w,L]of f.entries()){const D=w*L.canvas.width%b,B=Math.floor(w/2)*L.canvas.height;S.ctx.drawImage(L.canvas,D,B);for(const M of L.glyphs)M.texturePage=C,M.sizeClipSpace.x=M.size.x/b,M.sizeClipSpace.y=M.size.y/b,M.texturePosition.x+=D,M.texturePosition.y+=B,M.texturePositionClipSpace.x=M.texturePosition.x/b,M.texturePositionClipSpace.y=M.texturePosition.y/b;this._onRemoveTextureAtlasCanvas.fire(L.canvas);const k=this._activePages.indexOf(L);k!==-1&&this._activePages.splice(k,1)}return S}_deletePage(f){this._pages.splice(f,1);for(let C=f;C<this._pages.length;C++){const b=this._pages[C];for(const S of b.glyphs)S.texturePage--;b.version++}}getRasterizedGlyphCombinedChar(f,C,b,S,w){return this._getFromCacheMap(this._cacheMapCombined,f,C,b,S,w)}getRasterizedGlyph(f,C,b,S,w){return this._getFromCacheMap(this._cacheMap,f,C,b,S,w)}_getFromCacheMap(f,C,b,S,w,L=!1){return i=f.get(C,b,S,w),i||(i=this._drawToCache(C,b,S,w,L),f.set(C,b,S,w,i)),i}_getColorFromAnsiIndex(f){if(f>=this._config.colors.ansi.length)throw new Error("No color found for idx "+f);return this._config.colors.ansi[f]}_getBackgroundColor(f,C,b,S){if(this._config.allowTransparency)return d.NULL_COLOR;let w;switch(f){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(C);break;case 50331648:const L=e.AttributeData.toColorRGB(C);w=d.channels.toColor(L[0],L[1],L[2]);break;default:w=b?d.color.opaque(this._config.colors.foreground):this._config.colors.background}return w}_getForegroundColor(f,C,b,S,w,L,D,B,k,M){const y=this._getMinimumContrastColor(f,C,b,S,w,L,D,k,B,M);if(y)return y;let x;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&k&&L<8&&(L+=8),x=this._getColorFromAnsiIndex(L);break;case 50331648:const R=e.AttributeData.toColorRGB(L);x=d.channels.toColor(R[0],R[1],R[2]);break;default:x=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(x=d.color.opaque(x)),B&&(x=d.color.multiplyOpacity(x,l.DIM_OPACITY)),x}_resolveBackgroundRgba(f,C,b){switch(f){case 16777216:case 33554432:return this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(f,C,b,S){switch(f){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&C<8&&(C+=8),this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(f,C,b,S,w,L,D,B,k,M){if(this._config.minimumContrastRatio===1||M)return;const y=this._getContrastCache(k),x=y.getColor(f,S);if(x!==void 0)return x||void 0;const R=this._resolveBackgroundRgba(C,b,D),A=this._resolveForegroundRgba(w,L,D,B),I=d.rgba.ensureContrastRatio(R,A,this._config.minimumContrastRatio/(k?2:1));if(!I)return void y.setColor(f,S,null);const H=d.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return y.setColor(f,S,H),H}_getContrastCache(f){return f?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(f,C,b,S,w=!1){const L=typeof f=="number"?String.fromCharCode(f):f,D=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=b,this._workAttributeData.bg=C,this._workAttributeData.extended.ext=S,this._workAttributeData.isInvisible())return s;const k=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),y=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),A=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let H=this._workAttributeData.getFgColor(),j=this._workAttributeData.getFgColorMode(),N=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(M){const $=H;H=N,N=$;const K=j;j=T,T=K}const E=this._getBackgroundColor(T,N,M,y);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const F=k?this._config.fontWeightBold:this._config.fontWeight,P=x?"italic":"";this._tmpCtx.font=`${P} ${F} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;const z=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),W=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Y=this._getForegroundColor(C,T,N,b,j,H,M,y,k,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Y.css;const U=W?0:4;let te=!1;this._config.customGlyphs!==!1&&(te=(0,c.tryDrawCustomChar)(this._tmpCtx,L,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let re,X=!z;if(re=typeof f=="number"?this._unicodeService.wcwidth(f):this._unicodeService.getStringCellWidth(f),R){this._tmpCtx.save();const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())X=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{X=!1;let se=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&se<8&&(se+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(se).css}this._tmpCtx.beginPath();const ie=U,Q=Math.ceil(U+this._config.deviceCharHeight)-K-(w?2*$:0),_e=Q+$,oe=Q+2*$;let ae=this._workAttributeData.getUnderlineVariantOffset();for(let se=0;se<re;se++){this._tmpCtx.save();const Z=ie+se*this._config.deviceCellWidth,J=ie+(se+1)*this._config.deviceCellWidth,fe=Z+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q),this._tmpCtx.moveTo(Z,oe),this._tmpCtx.lineTo(J,oe);break;case 3:const ge=$<=1?oe:Math.ceil(U+this._config.deviceCharHeight-$/2)-K,ve=$<=1?Q:Math.ceil(U+this._config.deviceCharHeight+$/2)-K,Se=new Path2D;Se.rect(Z,Q,this._config.deviceCellWidth,oe-Q),this._tmpCtx.clip(Se),this._tmpCtx.moveTo(Z-this._config.deviceCellWidth/2,_e),this._tmpCtx.bezierCurveTo(Z-this._config.deviceCellWidth/2,ve,Z,ve,Z,_e),this._tmpCtx.bezierCurveTo(Z,ge,fe,ge,fe,_e),this._tmpCtx.bezierCurveTo(fe,ve,J,ve,J,_e),this._tmpCtx.bezierCurveTo(J,ge,J+this._config.deviceCellWidth/2,ge,J+this._config.deviceCellWidth/2,_e);break;case 4:const pe=ae===0?0:ae>=$?2*$-ae:$-ae;ae>=$||pe===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z+pe,Q),this._tmpCtx.lineTo(J,Q)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(Z+pe,Q),this._tmpCtx.moveTo(Z+pe+$,Q),this._tmpCtx.lineTo(J,Q)),ae=(0,n.computeNextVariantOffset)(J-Z,$,ae);break;case 5:const ye=.6,Le=.3,me=J-Z,be=Math.floor(ye*me),we=Math.floor(Le*me),xe=me-be-we;this._tmpCtx.setLineDash([be,we,xe]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q);break;default:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!te&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const se=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in se&&se.actualBoundingBoxDescent>0){this._tmpCtx.save();const Z=new Path2D;Z.rect(ie,Q-Math.ceil($/2),this._config.deviceCellWidth*re,oe-Q+Math.ceil($/2)),this._tmpCtx.clip(Z),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(L,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*re,U+K),this._tmpCtx.stroke()}if(te||this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let $=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X);if($)for(let K=1;K<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight-K),$=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X),$);K++);}if(A){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),K=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*re,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.stroke()}this._tmpCtx.restore();const de=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ue;if(ue=this._config.allowTransparency?function($){for(let K=0;K<$.data.length;K+=4)if($.data[K+3]>0)return!1;return!0}(de):h(de,E,Y,X),ue)return s;const V=this._findGlyphBoundingBox(de,this._workBoundingBox,D,W,te,U);let q,G;for(;;){if(this._activePages.length===0){const $=this._createNewPage();q=$,G=$.currentRow,G.height=V.size.y;break}q=this._activePages[this._activePages.length-1],G=q.currentRow;for(const $ of this._activePages)V.size.y<=$.currentRow.height&&(q=$,G=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(const K of this._activePages[$].fixedRows)K.height<=G.height&&V.size.y<=K.height&&(q=this._activePages[$],G=K);if(G.y+V.size.y>=q.canvas.height||G.height>V.size.y+2){let $=!1;if(q.currentRow.y+q.currentRow.height+V.size.y>=q.canvas.height){let K;for(const ie of this._activePages)if(ie.currentRow.y+ie.currentRow.height+V.size.y<ie.canvas.height){K=ie;break}if(K)q=K;else if(u.maxAtlasPages&&this._pages.length>=u.maxAtlasPages&&G.y+V.size.y<=q.canvas.height&&G.height>=V.size.y&&G.x+V.size.x<=q.canvas.width)$=!0;else{const ie=this._createNewPage();q=ie,G=ie.currentRow,G.height=V.size.y,$=!0}}$||(q.currentRow.height>0&&q.fixedRows.push(q.currentRow),G={x:0,y:q.currentRow.y+q.currentRow.height,height:V.size.y},q.fixedRows.push(G),q.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+V.size.x<=q.canvas.width)break;G===q.currentRow?(G.x=0,G.y+=G.height,G.height=0):q.fixedRows.splice(q.fixedRows.indexOf(G),1)}return V.texturePage=this._pages.indexOf(q),V.texturePosition.x=G.x,V.texturePosition.y=G.y,V.texturePositionClipSpace.x=G.x/q.canvas.width,V.texturePositionClipSpace.y=G.y/q.canvas.height,V.sizeClipSpace.x/=q.canvas.width,V.sizeClipSpace.y/=q.canvas.height,G.height=Math.max(G.height,V.size.y),G.x+=V.size.x,q.ctx.putImageData(de,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),q.addGlyph(V),q.version++,V}_findGlyphBoundingBox(f,C,b,S,w,L){C.top=0;const D=S?this._config.deviceCellHeight:this._tmpCanvas.height,B=S?this._config.deviceCellWidth:b;let k=!1;for(let M=0;M<D;M++){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(f.data[x]!==0){C.top=M,k=!0;break}}if(k)break}C.left=0,k=!1;for(let M=0;M<L+B;M++){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(f.data[x]!==0){C.left=M,k=!0;break}}if(k)break}C.right=B,k=!1;for(let M=L+B-1;M>=L;M--){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(f.data[x]!==0){C.right=M,k=!0;break}}if(k)break}C.bottom=D,k=!1;for(let M=D-1;M>=0;M--){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(f.data[x]!==0){C.bottom=M,k=!0;break}}if(k)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:C.right-C.left+1,y:C.bottom-C.top+1},sizeClipSpace:{x:C.right-C.left+1,y:C.bottom-C.top+1},offset:{x:-C.left+L+(S||w?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-C.top+L+(S||w?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=u;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(f){this._glyphs.push(f),this._usedPixels+=f.size.x*f.size.y}constructor(f,C,b){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],b)for(const S of b)this._glyphs.push(...S.glyphs),this._usedPixels+=S._usedPixels;this.canvas=m(f,C,C),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(_,f,C,b){const S=f.rgba>>>24,w=f.rgba>>>16&255,L=f.rgba>>>8&255,D=C.rgba>>>24,B=C.rgba>>>16&255,k=C.rgba>>>8&255,M=Math.floor((Math.abs(S-D)+Math.abs(w-B)+Math.abs(L-k))/12);let y=!0;for(let x=0;x<_.data.length;x+=4)_.data[x]===S&&_.data[x+1]===w&&_.data[x+2]===L||b&&Math.abs(_.data[x]-S)+Math.abs(_.data[x+1]-w)+Math.abs(_.data[x+2]-L)<M?_.data[x+3]=0:y=!1;return y}function m(_,f,C){const b=_.createElement("canvas");return b.width=f,b.height=C,b}},577:function(O,t,a){var l=this&&this.__decorate||function(o,s,i,u){var p,h=arguments.length,m=h<3?s:u===null?u=Object.getOwnPropertyDescriptor(s,i):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,s,i,u);else for(var _=o.length-1;_>=0;_--)(p=o[_])&&(m=(h<3?p(m):h>3?p(s,i,m):p(s,i))||m);return h>3&&m&&Object.defineProperty(s,i,m),m},c=this&&this.__param||function(o,s){return function(i,u){s(i,u,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(147),d=a(855),v=a(782),g=a(97);class r extends n.AttributeData{constructor(s,i,u){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=i,this._width=u}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()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class ke{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(s){const i={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(i),i.id}deregister(s){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===s)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(s);if(!i||i.length===0)return[];const u=[],p=i.translateToString(!0);let h=0,m=0,_=0,f=i.getFg(0),C=i.getBg(0);for(let b=0;b<i.getTrimmedLength();b++)if(i.loadCell(b,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==C){if(b-h>1){const S=this._getJoinedRanges(p,_,m,i,h);for(let w=0;w<S.length;w++)u.push(S[w])}h=b,_=m,f=this._workCell.fg,C=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-h>1){const b=this._getJoinedRanges(p,_,m,i,h);for(let S=0;S<b.length;S++)u.push(b[S])}return u}_getJoinedRanges(s,i,u,p,h){const m=s.substring(i,u);let _=[];try{_=this._characterJoiners[0].handler(m)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{const C=this._characterJoiners[f].handler(m);for(let b=0;b<C.length;b++)ke._mergeRanges(_,C[b])}catch(C){console.error(C)}return this._stringRangesToCellRanges(_,p,h),_}_stringRangesToCellRanges(s,i,u){let p=0,h=!1,m=0,_=s[p];if(_){for(let f=u;f<this._bufferService.cols;f++){const C=i.getWidth(f),b=i.getString(f).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!h&&_[0]<=m&&(_[0]=f,h=!0),_[1]<=m){if(_[1]=f,_=s[++p],!_)break;_[0]<=m?(_[0]=f,h=!0):h=!1}m+=b}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(s,i){let u=!1;for(let p=0;p<s.length;p++){const h=s[p];if(u){if(i[1]<=h[0])return s[p-1][1]=i[1],s;if(i[1]<=h[1])return s[p-1][1]=Math.max(i[1],h[1]),s.splice(p,1),s;s.splice(p,1),p--}else{if(i[1]<=h[0])return s.splice(p,0,i),s;if(i[1]<=h[1])return h[0]=Math.min(i[0],h[0]),s;i[0]<h[1]&&(h[0]=Math.min(i[0],h[0]),u=!0)}}return u?s[s.length-1][1]=i[1]:s.push(i),s}};t.CharacterJoinerService=e=l([c(0,g.IBufferService)],e)},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,v,g,r,e;function o(i){const u=i.toString(16);return u.length<2?"0"+u:u}function s(i,u){return i<u?(u+.05)/(i+.05):(i+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(i){i.toCss=function(u,p,h,m){return m!==void 0?`#${o(u)}${o(p)}${o(h)}${o(m)}`:`#${o(u)}${o(p)}${o(h)}`},i.toRgba=function(u,p,h,m=255){return(u<<24|p<<16|h<<8|m)>>>0},i.toColor=function(u,p,h,m){return{css:i.toCss(u,p,h,m),rgba:i.toRgba(u,p,h,m)}}}(d||(t.channels=d={})),function(i){function u(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}i.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,_=h.rgba>>16&255,f=h.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=b+Math.round((_-b)*n),c=S+Math.round((f-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},i.isOpaque=function(p){return(255&p.rgba)==255},i.ensureContrastRatio=function(p,h,m){const _=e.ensureContrastRatio(p.rgba,h.rgba,m);if(_)return d.toColor(_>>24&255,_>>16&255,_>>8&255)},i.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},i.opacity=u,i.multiplyOpacity=function(p,h){return n=255&p.rgba,u(p,n*h/255)},i.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(v||(t.color=v={})),function(i){let u,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(u=m,u.globalCompositeOperation="copy",p=u.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!u||!p)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=p,u.fillStyle=h,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,l,c,n]=u.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}}(g||(t.css=g={})),function(i){function u(p,h,m){const _=p/255,f=h/255,C=m/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}i.relativeLuminance=function(p){return u(p>>16&255,p>>8&255,255&p)},i.relativeLuminance2=u}(r||(t.rgb=r={})),function(i){function u(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S>0||w>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),w-=Math.max(0,Math.ceil(.1*w)),L-=Math.max(0,Math.ceil(.1*L)),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}function p(h,m,_){const f=h>>24&255,C=h>>16&255,b=h>>8&255;let S=m>>24&255,w=m>>16&255,L=m>>8&255,D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));for(;D<_&&(S<255||w<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),w=Math.min(255,w+Math.ceil(.1*(255-w))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=s(r.relativeLuminance2(S,w,L),r.relativeLuminance2(f,C,b));return(S<<24|w<<16|L<<8|255)>>>0}i.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const _=m>>24&255,f=m>>16&255,C=m>>8&255,b=h>>24&255,S=h>>16&255,w=h>>8&255;return a=b+Math.round((_-b)*n),l=S+Math.round((f-S)*n),c=w+Math.round((C-w)*n),d.toRgba(a,l,c)},i.ensureContrastRatio=function(h,m,_){const f=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(s(f,C)<_){if(C<f){const w=u(h,m,_),L=s(f,r.relativeLuminance(w>>8));if(L<_){const D=p(h,m,_);return L>s(f,r.relativeLuminance(D>>8))?w:D}return w}const b=p(h,m,_),S=s(f,r.relativeLuminance(b>>8));if(S<_){const w=u(h,m,_);return S>s(f,r.relativeLuminance(w>>8))?b:w}return b}},i.reduceLuminance=u,i.increaseLuminance=p,i.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}}(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=s},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a(c=>l.fire(c))},t.runAndSubscribe=function(a,l){return l(void 0),a(c=>l(c))}},859:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,v){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,v)}get(l,c,n,d){var v;return(v=this._data.get(l,c))==null?void 0:v.get(n,d)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,r=0,e=v.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=v.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(133),c=a(855),n=a(147);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let v=a[d];v>65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=d;v<c;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=c)return this._interim=g,n;const r=a.charCodeAt(v);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,v,g,r=0,e=0,o=0;if(this.interim[0]){let u=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,f=_-m;for(;o<f;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,u=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}u||(_===2?p<128?o--:l[r++]=p:_===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const s=c-4;let i=o;for(;i<c;){for(;!(!(i<s)||128&(n=a[i])||128&(d=a[i+1])||128&(v=a[i+2])||128&(g=a[i+3]));)l[r++]=n,l[r++]=d,l[r++]=v,l[r++]=g,i+=4;if(n=a[i++],n<128)l[r++]=n;else if((224&n)==192){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}l[r++]=e}else if((240&n)==224){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(i>=c)return this.interim[0]=n,r;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,r;if(v=a[i++],(192&v)!=128){i--;continue}if(i>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=v,r;if(g=a[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&v)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(O,t,a){var l=this&&this.__decorate||function(e,o,s,i){var u,p=arguments.length,h=p<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,s,i);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(h=(p<3?u(h):p>3?u(o,s,h):u(o,s))||h);return p>3&&h&&Object.defineProperty(o,s,h),h},c=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),d=a(97),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(e,...o){var s;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var s;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var s;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var s;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var s;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,s){if(typeof s.value!="function")throw new Error("not supported");const i=s.value;s.value=function(...u){if(g.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,u);g.trace(`GlyphRenderer#${i.name}(${u.map(h=>JSON.stringify(h)).join(", ")})`);const p=i.apply(this,u);return g.trace(`GlyphRenderer#${i.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(726);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},ne={};function ee(O){var t=ne[O];if(t!==void 0)return t.exports;var a=ne[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,ee),a.exports}var le={};return(()=>{var O=le;Object.defineProperty(O,"__esModule",{value:!0}),O.CanvasAddon=void 0;const t=ee(345),a=ee(859),l=ee(776),c=ee(949);class n extends a.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var v;return(v=this._renderer)==null?void 0:v.textureAtlas}activate(v){const g=v._core;if(!v.element)return void this.register(g.onWillOpen(()=>this.activate(v)));this._terminal=v;const r=g.coreService,e=g.optionsService,o=g.screenElement,s=g.linkifier,i=g,u=i._bufferService,p=i._renderService,h=i._characterJoinerService,m=i._charSizeService,_=i._coreBrowserService,f=i._decorationService,C=i._logService,b=i._themeService;(0,l.setTraceLogger)(C),this._renderer=new c.CanvasRenderer(v,o,s,u,m,e,h,r,_,f,b),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),p.setRenderer(this._renderer),p.handleResize(u.cols,u.rows),this.register((0,a.toDisposable)(()=>{var S;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(v.cols,v.rows),(S=this._renderer)==null||S.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var v;(v=this._renderer)==null||v.clearTextureAtlas()}}O.CanvasAddon=n})(),le})())})(De);var Pe=De.exports,Te={exports:{}};(function(he,Ce){(function(ce,ne){he.exports=ne()})(self,()=>(()=>{var ce={};return(()=>{var ne=ce;Object.defineProperty(ne,"__esModule",{value:!0}),ne.FitAddon=void 0,ne.FitAddon=class{activate(ee){this._terminal=ee}dispose(){}fit(){const ee=this.proposeDimensions();if(!ee||!this._terminal||isNaN(ee.cols)||isNaN(ee.rows))return;const le=this._terminal._core;this._terminal.rows===ee.rows&&this._terminal.cols===ee.cols||(le._renderService.clear(),this._terminal.resize(ee.cols,ee.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const ee=this._terminal._core,le=ee._renderService.dimensions;if(le.css.cell.width===0||le.css.cell.height===0)return;const O=this._terminal.options.scrollback===0?0:ee.viewport.scrollBarWidth,t=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(t.getPropertyValue("height")),l=Math.max(0,parseInt(t.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),n=a-(parseInt(c.getPropertyValue("padding-top"))+parseInt(c.getPropertyValue("padding-bottom"))),d=l-(parseInt(c.getPropertyValue("padding-right"))+parseInt(c.getPropertyValue("padding-left")))-O;return{cols:Math.max(2,Math.floor(d/le.css.cell.width)),rows:Math.max(1,Math.floor(n/le.css.cell.height))}}}})(),ce})())})(Te);var Ie=Te.exports;let Ee=document.getElementById("js-web-terminal");if(Ee!==null){const he=new Be.Terminal({allowTransparency:!0,theme:{background:"rgba(22,22,23,0)",foreground:"#cccccc",selectionBackground:"#399ef440",black:"#666666",blue:"#399ef4",brightBlack:"#666666",brightBlue:"#399ef4",brightCyan:"#21c5c7",brightGreen:"#4eb071",brightMagenta:"#b168df",brightRed:"#da6771",brightWhite:"#efefef",brightYellow:"#fff099",cyan:"#21c5c7",green:"#4eb071",magenta:"#b168df",red:"#da6771",white:"#efefef",yellow:"#fff099"}});typeof WebGL2RenderingContext<"u"?he.loadAddon(new Oe.WebglAddon):he.loadAddon(new Pe.CanvasAddon);const Ce=new Ie.FitAddon;he.loadAddon(Ce),he.open(Ee),Ce.fit();const ce=new WebSocket(`ws://${window.location.host}/_shell/?sessionId=${window.terminal.sessionId}`);ce.addEventListener("open",ne=>{he.onData(ee=>ce.send(ee)),ce.addEventListener("message",ee=>he.write(ee.data))}),ce.addEventListener("error",ne=>{he.reset(),he.writeln("Connection error.")}),ce.addEventListener("close",ne=>{ne.wasClean&&(he.reset(),he.writeln(ne.reason??"Connection closed."))})}
|