-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp-17a263b2.entry.js
5 lines (5 loc) · 292 KB
/
p-17a263b2.entry.js
1
2
3
4
5
/*!
* Built by BASIS
* Copyright BASIS International Ltd.
*/
import{r as t,c as s,h as i,H as h,g as e}from"./p-0e3693b5.js";var r,n={exports:{}};globalThis,r=()=>(()=>{var t={4567:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const r=i(9042),n=i(9924),o=i(844),c=i(4725),a=i(2585),l=i(3656);let u=s.AccessibilityManager=class extends o.Disposable{constructor(t,s,i,h){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=h,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 t=0;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);if(this._topBoundaryFocusListener=t=>this._handleBoundaryFocus(t,0),this._bottomBoundaryFocusListener=t=>this._handleBoundaryFocus(t,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 n.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((t=>this._handleResize(t.rows)))),this.register(this._terminal.onRender((t=>this._refreshRows(t.start,t.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((t=>this._handleChar(t)))),this.register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this.register(this._terminal.onA11yTab((t=>this._handleTab(t)))),this.register(this._terminal.onKey((t=>this._handleKey(t.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,l.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,o.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(t){for(let s=0;s<t;s++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,"\n"===t&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=r.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),/\p{Control}/u.test(t)||this._charsToConsume.push(t)}_refreshRows(t,s){this._liveRegionDebouncer.refresh(t,s,this._terminal.rows)}_renderRows(t,s){const i=this._terminal.buffer,h=i.lines.length.toString();for(let e=t;e<=s;e++){const t=i.lines.get(i.ydisp+e),s=[],r=t?.translateToString(!0,void 0,void 0,s)||"",n=(i.ydisp+e+1).toString(),o=this._rowElements[e];o&&(0===r.length?(o.innerText=" ",this._rowColumns.set(o,[0,1])):(o.textContent=r,this._rowColumns.set(o,s)),o.setAttribute("aria-posinset",n),o.setAttribute("aria-setsize",h))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,s){const i=t.target,h=this._rowElements[0===s?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===s?"1":`${this._terminal.buffer.lines.length}`))return;if(t.relatedTarget!==h)return;let e,r;if(0===s?(e=i,r=this._rowElements.pop(),this._rowContainer.removeChild(r)):(e=this._rowElements.shift(),r=i,this._rowContainer.removeChild(e)),e.removeEventListener("focus",this._topBoundaryFocusListener),r.removeEventListener("focus",this._bottomBoundaryFocusListener),0===s){const t=this._createAccessibilityTreeNode();this._rowElements.unshift(t),this._rowContainer.insertAdjacentElement("afterbegin",t)}else{const t=this._createAccessibilityTreeNode();this._rowElements.push(t),this._rowContainer.appendChild(t)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===s?-1:1),this._rowElements[0===s?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(0===this._rowElements.length)return;const t=document.getSelection();if(!t)return;if(t.isCollapsed)return void(this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection());if(!t.anchorNode||!t.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((s.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===i.node&&s.offset>i.offset)&&([s,i]=[i,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const h=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(h)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:h,offset:h.textContent?.length??0}),!this._rowContainer.contains(i.node))return;const e=({node:t,offset:s})=>{const i=t instanceof Text?t.parentNode:t;let h=parseInt(i?.getAttribute("aria-posinset"),10)-1;if(isNaN(h))return console.warn("row is invalid. Race condition?"),null;const e=this._rowColumns.get(i);if(!e)return console.warn("columns is null. Race condition?"),null;let r=s<e.length?e[s]:e.slice(-1)[0]+1;return r>=this._terminal.cols&&(++h,r=0),{row:h,column:r}},r=e(s),n=e(i);if(r&&n){if(r.row>n.row||r.row===n.row&&r.column>=n.column)throw new Error("invalid range");this._terminal.select(r.column,r.row,(n.row-r.row)*this._terminal.cols-r.column+n.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=u=h([e(1,a.IInstantiationService),e(2,c.ICoreBrowserService),e(3,c.IRenderService)],u)},3614:(t,s)=>{function i(t){return t.replace(/\r?\n/g,"\r")}function h(t,s){return s?"[200~"+t+"[201~":t}function e(t,s,e,r){t=h(t=i(t),e.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode),e.triggerDataEvent(t,!0),s.value=""}function r(t,s,i){const h=i.getBoundingClientRect(),e=t.clientX-h.left-10,r=t.clientY-h.top-10;s.style.width="20px",s.style.height="20px",s.style.left=`${e}px`,s.style.top=`${r}px`,s.style.zIndex="1000",s.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=i,s.bracketTextForPaste=h,s.copyHandler=function(t,s){t.clipboardData&&t.clipboardData.setData("text/plain",s.selectionText),t.preventDefault()},s.handlePasteEvent=function(t,s,i,h){t.stopPropagation(),t.clipboardData&&e(t.clipboardData.getData("text/plain"),s,i,h)},s.paste=e,s.moveTextAreaUnderMouseCursor=r,s.rightClickHandler=function(t,s,i,h,e){r(t,s,i),e&&h.rightClickSelect(t),s.value=h.selectionText,s.select()}},7239:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=i(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(t,s,i){this._css.set(t,s,i)}getCss(t,s){return this._css.get(t,s)}setColor(t,s,i){this._color.set(t,s,i)}getColor(t,s){return this._color.get(t,s)}clear(){this._color.clear(),this._css.clear()}}},3656:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(t,s,i,h){t.addEventListener(s,i,h);let e=!1;return{dispose:()=>{e||(e=!0,t.removeEventListener(s,i,h))}}}},3551:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const r=i(3656),n=i(8460),o=i(844),c=i(2585),a=i(4725);let l=s.Linkifier=class extends o.Disposable{get currentLink(){return this._currentLink}constructor(t,s,i,h,e){super(),this._element=t,this._mouseService=s,this._renderService=i,this._bufferService=h,this._linkProviderService=e,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new n.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new n.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,o.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,o.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,r.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,r.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,r.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,r.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(t){this._lastMouseEvent=t;const s=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const i=t.composedPath();for(let t=0;t<i.length;t++){const s=i[t];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(t,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,s){this._activeProviderReplies&&s||(this._activeProviderReplies?.forEach((t=>{t?.forEach((t=>{t.link.dispose&&t.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(const[h,e]of this._linkProviderService.linkProviders.entries())if(s){const s=this._activeProviderReplies?.get(h);s&&(i=this._checkLinkProviderResult(h,t,i))}else e.provideLinks(t.y,(s=>{if(this._isMouseOut)return;const e=s?.map((t=>({link:t})));this._activeProviderReplies?.set(h,e),i=this._checkLinkProviderResult(h,t,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)}))}_removeIntersectingLinks(t,s){const i=new Set;for(let h=0;h<s.size;h++){const e=s.get(h);if(e)for(let s=0;s<e.length;s++){const h=e[s],r=h.link.range.start.y<t?0:h.link.range.start.x,n=h.link.range.end.y>t?this._bufferService.cols:h.link.range.end.x;for(let t=r;t<=n;t++){if(i.has(t)){e.splice(s--,1);break}i.add(t)}}}}_checkLinkProviderResult(t,s,i){if(!this._activeProviderReplies)return i;const h=this._activeProviderReplies.get(t);let e=!1;for(let s=0;s<t;s++)this._activeProviderReplies.has(s)&&!this._activeProviderReplies.get(s)||(e=!0);if(!e&&h){const t=h.find((t=>this._linkAtPosition(t.link,s)));t&&(i=!0,this._handleNewLink(t))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let t=0;t<this._activeProviderReplies.size;t++){const h=this._activeProviderReplies.get(t)?.find((t=>this._linkAtPosition(t.link,s)));if(h){i=!0,this._handleNewLink(h);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;const s=this._positionFromMouseEvent(t,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,s){this._currentLink&&this._lastMouseEvent&&(!t||!s||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,o.disposeArray)(this._linkCacheDisposables))}_handleNewLink(t){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:void 0===t.link.decorations||t.link.decorations.underline,pointerCursor:void 0===t.link.decorations||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:t=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:s=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const s=0===t.start?0:t.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(s,i),this._lastMouseEvent)){const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._askForLink(t,!1)}}))))}_linkHover(t,s,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(i,s.text)}_fireUnderlineEvent(t,s){const i=t.range,h=this._bufferService.buffer.ydisp,e=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-h-1,i.end.x,i.end.y-h-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(e)}_linkLeave(t,s,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(i,s.text)}_linkAtPosition(t,s){const i=s.y*this._bufferService.cols+s.x;return t.range.start.y*this._bufferService.cols+t.range.start.x<=i&&i<=t.range.end.y*this._bufferService.cols+t.range.end.x}_positionFromMouseEvent(t,s,i){const h=i.getCoords(t,s,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,s,i,h,e){return{x1:t,y1:s,x2:i,y2:h,cols:this._bufferService.cols,fg:e}}};s.Linkifier=l=h([e(1,a.IMouseService),e(2,a.IRenderService),e(3,c.IBufferService),e(4,a.ILinkProviderService)],l)},9042:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const r=i(511),n=i(2585);let o=s.OscLinkProvider=class{constructor(t,s,i){this._bufferService=t,this._optionsService=s,this._oscLinkService=i}provideLinks(t,s){const i=this._bufferService.buffer.lines.get(t-1);if(!i)return void s(void 0);const h=[],e=this._optionsService.rawOptions.linkHandler,n=new r.CellData,o=i.getTrimmedLength();let a=-1,l=-1,u=!1;for(let s=0;s<o;s++)if(-1!==l||i.hasContent(s)){if(i.loadCell(s,n),n.hasExtendedAttrs()&&n.extended.urlId){if(-1===l){l=s,a=n.extended.urlId;continue}u=n.extended.urlId!==a}else-1!==l&&(u=!0);if(u||-1!==l&&s===o-1){const i=this._oscLinkService.getLinkData(a)?.uri;if(i){const r={start:{x:l+1,y:t},end:{x:s+(u||s!==o-1?0:1),y:t}};let n=!1;if(!e?.allowNonHttpProtocols)try{const t=new URL(i);["http:","https:"].includes(t.protocol)||(n=!0)}catch(t){n=!0}n||h.push({text:i,range:r,activate:(t,s)=>e?e.activate(t,s,r):c(0,s),hover:(t,s)=>e?.hover?.(t,s,r),leave:(t,s)=>e?.leave?.(t,s,r)})}u=!1,n.hasExtendedAttrs()&&n.extended.urlId?(l=s,a=n.extended.urlId):(l=-1,a=-1)}}s(h)}};function c(t,s){if(confirm(`Do you want to navigate to ${s}?\n\nWARNING: This link could potentially be dangerous`)){const t=window.open();if(t){try{t.opener=null}catch{}t.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=o=h([e(0,n.IBufferService),e(1,n.IOptionsService),e(2,n.IOscLinkService)],o)},6193:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(t,s){this._renderCallback=t,this._coreBrowserService=s,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(t,s,i){this._rowCount=i,t=void 0!==t?t:0,s=void 0!==s?s:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,t):t,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,s):s,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const t=Math.max(this._rowStart,0),s=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,s),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}}},3236:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=i(3614),e=i(3656),r=i(3551),n=i(9042),o=i(3730),c=i(1680),a=i(3107),l=i(5744),u=i(2950),f=i(1296),d=i(428),v=i(4269),p=i(5114),b=i(8934),w=i(3230),g=i(9312),m=i(4725),_=i(6731),x=i(8055),k=i(8969),M=i(8460),y=i(844),C=i(6114),O=i(8437),$=i(2584),S=i(7399),R=i(5941),j=i(9074),E=i(2585),A=i(5435),D=i(4567),I=i(779);s.Terminal=class extends k.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=C,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new y.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(E.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(I.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(o.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((t,s)=>this.refresh(t,s)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((t=>this._reportWindowsOptions(t)))),this.register(this._inputHandler.onColor((t=>this._handleColorEvent(t)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((t=>this._afterResize(t.cols,t.rows)))),this.register((0,y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(t){if(this._themeService)for(const s of t){let t,i="";switch(s.index){case 256:t="foreground",i="10";break;case 257:t="background",i="11";break;case 258:t="cursor",i="12";break;default:t="ansi",i="4;"+s.index}switch(s.type){case 0:const h=x.color.toColorRGB("ansi"===t?this._themeService.colors.ansi[s.index]:this._themeService.colors[t]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${i};${(0,R.toRgbString)(h)}${$.C1_ESCAPED.ST}`);break;case 1:if("ansi"===t)this._themeService.modifyColors((t=>t.ansi[s.index]=x.channels.toColor(...s.color)));else{const i=t;this._themeService.modifyColors((t=>t[i]=x.channels.toColor(...s.color)))}break;case 2:this._themeService.restoreColor(s.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(D.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(t){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const t=this.buffer.lines.get(this.buffer.ybase+this.buffer.y);if(!t)return;const s=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,h=t.getWidth(s),e=this._renderService.dimensions.css.cell.width*h,r=this.buffer.y*this._renderService.dimensions.css.cell.height;this.textarea.style.left=s*this._renderService.dimensions.css.cell.width+"px",this.textarea.style.top=r+"px",this.textarea.style.width=e+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,e.addDisposableDomListener)(this.element,"copy",(t=>{this.hasSelection()&&(0,h.copyHandler)(t,this._selectionService)})));const t=t=>(0,h.handlePasteEvent)(t,this.textarea,this.coreService,this.optionsService);this.register((0,e.addDisposableDomListener)(this.textarea,"paste",t)),this.register((0,e.addDisposableDomListener)(this.element,"paste",t)),this.register(C.isFirefox?(0,e.addDisposableDomListener)(this.element,"mousedown",(t=>{2===t.button&&(0,h.rightClickHandler)(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):(0,e.addDisposableDomListener)(this.element,"contextmenu",(t=>{(0,h.rightClickHandler)(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),C.isLinux&&this.register((0,e.addDisposableDomListener)(this.element,"auxclick",(t=>{1===t.button&&(0,h.moveTextAreaUnderMouseCursor)(t,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,e.addDisposableDomListener)(this.textarea,"keyup",(t=>this._keyUp(t)),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keydown",(t=>this._keyDown(t)),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keypress",(t=>this._keyPress(t)),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionupdate",(t=>this._compositionHelper.compositionupdate(t)))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,e.addDisposableDomListener)(this.textarea,"input",(t=>this._inputEvent(t)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(t){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"),this.element?.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 s=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),s.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,e.addDisposableDomListener)(this.screenElement,"mousemove",(t=>this.updateCursorStyle(t)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),s.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",n.promptLabel),C.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??"undefined"!=typeof window?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,e.addDisposableDomListener)(this.textarea,"focus",(t=>this._handleTextAreaFocus(t)))),this.register((0,e.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(_.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((t=>this._onRender.fire(t)))),this.onResize((t=>this._renderService.resize(t.cols,t.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(r.Linkifier,this.screenElement)),this.element.appendChild(s);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((t=>this.scrollLines(t.amount,t.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(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((t=>this.scrollLines(t.amount,t.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((t=>this._renderService.handleSelectionChanged(t.start,t.end,t.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((t=>{this.textarea.value=t,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((()=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,e.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(a.BufferDecorationRenderer,this.screenElement)),this.register((0,e.addDisposableDomListener)(this.element,"mousedown",(t=>this._selectionService.handleMouseDown(t)))),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(D.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(t=>this._handleScreenReaderModeOptionChange(t)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(t=>{!this._overviewRulerRenderer&&t&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const t=this,s=this.element;function i(s){const i=t._mouseService.getMouseReportCoords(s,t.screenElement);if(!i)return!1;let h,e;switch(s.overrideType||s.type){case"mousemove":e=32,void 0===s.buttons?(h=3,void 0!==s.button&&(h=s.button<3?s.button:3)):h=1&s.buttons?0:4&s.buttons?1:2&s.buttons?2:3;break;case"mouseup":e=0,h=s.button<3?s.button:3;break;case"mousedown":e=1,h=s.button<3?s.button:3;break;case"wheel":if(t._customWheelEventHandler&&!1===t._customWheelEventHandler(s))return!1;if(0===t.viewport.getLinesScrolled(s))return!1;e=s.deltaY<0?0:1,h=4;break;default:return!1}return!(void 0===e||void 0===h||h>4)&&t.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:h,action:e,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}const h={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:t=>(i(t),t.buttons||(this._document.removeEventListener("mouseup",h.mouseup),h.mousedrag&&this._document.removeEventListener("mousemove",h.mousedrag)),this.cancel(t)),wheel:t=>(i(t),this.cancel(t,!0)),mousedrag:t=>{t.buttons&&i(t)},mousemove:t=>{t.buttons||i(t)}};this.register(this.coreMouseService.onProtocolChange((t=>{t?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(t)),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&t?h.mousemove||(s.addEventListener("mousemove",r.mousemove),h.mousemove=r.mousemove):(s.removeEventListener("mousemove",h.mousemove),h.mousemove=null),16&t?h.wheel||(s.addEventListener("wheel",r.wheel,{passive:!1}),h.wheel=r.wheel):(s.removeEventListener("wheel",h.wheel),h.wheel=null),2&t?h.mouseup||(h.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",h.mouseup),h.mouseup=null),4&t?h.mousedrag||(h.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",h.mousedrag),h.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,e.addDisposableDomListener)(s,"mousedown",(t=>{if(t.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(t))return i(t),h.mouseup&&this._document.addEventListener("mouseup",h.mouseup),h.mousedrag&&this._document.addEventListener("mousemove",h.mousedrag),this.cancel(t)}))),this.register((0,e.addDisposableDomListener)(s,"wheel",(t=>{if(!h.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(t))return!1;if(!this.buffer.hasScrollback){const s=this.viewport.getLinesScrolled(t);if(0===s)return;const i=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B");let h="";for(let t=0;t<Math.abs(s);t++)h+=i;return this.coreService.triggerDataEvent(h,!0),this.cancel(t,!0)}return this.viewport.handleWheel(t)?this.cancel(t):void 0}}),{passive:!1})),this.register((0,e.addDisposableDomListener)(s,"touchstart",(t=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(t),this.cancel(t)}),{passive:!0})),this.register((0,e.addDisposableDomListener)(s,"touchmove",(t=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(t)?void 0:this.cancel(t)}),{passive:!1}))}refresh(t,s){this._renderService?.refreshRows(t,s)}updateCursorStyle(t){this._selectionService?.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,s,i=0){1===i?(super.scrollLines(t,s,i),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(t)}paste(t){(0,h.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 s=this._characterJoinerService.register(t);return this.refresh(0,this.rows-1),s}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,s,i){this._selectionService.setSelection(t,s,i)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(t,s){this._selectionService?.selectLines(t,s)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(t))return!1;const s=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!s&&!this._compositionHelper.keydown(t))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;s||"Dead"!==t.key&&"AltGraph"!==t.key||(this._unprocessedDeadKey=!0);const i=(0,S.evaluateKeyboardEvent)(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),3===i.type||2===i.type){const s=this.rows-1;return this.scrollLines(2===i.type?-s:s),this.cancel(t,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,t)||(i.cancel&&this.cancel(t,!0),!i.key||!!(t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&1===t.key.length&&t.key.charCodeAt(0)>=65&&t.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==$.C0.ETX&&i.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||t.altKey||t.ctrlKey?this.cancel(t,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(t,s){const i=t.isMac&&!this.options.macOptionIsMeta&&s.altKey&&!s.ctrlKey&&!s.metaKey||t.isWindows&&s.altKey&&s.ctrlKey&&!s.metaKey||t.isWindows&&s.getModifierState("AltGraph");return"keypress"===s.type?i:i&&(!s.keyCode||s.keyCode>47)}_keyUp(t){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(t)||(function(t){return 16===t.keyCode||17===t.keyCode||18===t.keyCode}(t)||this.focus(),this.updateCursorStyle(t),this._keyPressHandled=!1)}_keyPress(t){let s;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(t))return!1;if(this.cancel(t),t.charCode)s=t.charCode;else if(null==t.which)s=t.keyCode;else{if(0===t.which||0===t.charCode)return!1;s=t.which}return!(!s||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t)||(s=String.fromCharCode(s),this._onKey.fire({key:s,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(s,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(t){return!(!t.data||"insertText"!==t.inputType||t.composed&&this._keyDownSeen||this.optionsService.rawOptions.screenReaderMode||this._keyPressHandled||(this._unprocessedDeadKey=!1,this.coreService.triggerDataEvent(t.data,!0),this.cancel(t),0))}resize(t,s){t!==this.cols||s!==this.rows?super.resize(t,s):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(t,s){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){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 t=1;t<this.rows;t++)this.buffer.lines.push(this.buffer.getBlankLine(O.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const t=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(t){if(this._renderService)switch(t){case A.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${s};${t}t`);break;case A.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const i=this._renderService.dimensions.css.cell.width.toFixed(0),h=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${h};${i}t`)}}cancel(t,s){if(this.options.cancelEvents||s)return t.preventDefault(),t.stopPropagation(),!1}}},9924:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(t,s=1e3){this._renderCallback=t,this._debounceThresholdMS=s,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(t,s,i){this._rowCount=i,t=void 0!==t?t:0,s=void 0!==s?s:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,t):t,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,s):s;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const t=this._debounceThresholdMS-(h-this._lastRefreshMs);this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const t=Math.max(this._rowStart,0),s=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,s)}}},1680:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const r=i(3656),n=i(4725),o=i(8460),c=i(844),a=i(2585);let l=s.Viewport=class extends c.Disposable{constructor(t,s,i,h,e,n,c,a){super(),this._viewportElement=t,this._scrollArea=s,this._bufferService=i,this._optionsService=h,this._charSizeService=e,this._renderService=n,this._coreBrowserService=c,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 o.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,r.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((t=>this._activeBuffer=t.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((t=>this._renderDimensions=t))),this._handleThemeChange(a.colors),this.register(a.onChangeColors((t=>this._handleThemeChange(t)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(t){this._viewportElement.style.backgroundColor=t.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(t){if(t)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(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 t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null}syncScrollArea(t=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(t)}_handleScroll(t){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||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const t=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(t*(this._smoothScrollState.target-this._smoothScrollState.origin)),t<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(t,s){return!(s<0&&0!==this._viewportElement.scrollTop||s>0&&this._viewportElement.scrollTop+this._lastRecordedViewportHeight<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)}handleWheel(t){const s=this._getPixelsScrolled(t);return 0!==s&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?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(t,s))}scrollLines(t){if(0!==t)if(this._optionsService.rawOptions.smoothScrollDuration){const s=t*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:t,suppressScrollEvent:!1})}_getPixelsScrolled(t){if(0===t.deltaY||t.shiftKey)return 0;let s=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(t,s){let i,h="";const e=[],r=s??this._bufferService.buffer.lines.length,n=this._bufferService.buffer.lines;for(let s=t;s<r;s++){const t=n.get(s);if(!t)continue;const r=n.get(s+1)?.isWrapped;if(h+=t.translateToString(!r),!r||s===n.length-1){const t=document.createElement("div");t.textContent=h,e.push(t),h.length>0&&(i=t),h=""}}return{bufferElements:e,cursorElement:i}}getLinesScrolled(t){if(0===t.deltaY||t.shiftKey)return 0;let s=this._applyScrollModifier(t.deltaY,t);return t.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):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(t,s){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&s.altKey||"ctrl"===i&&s.ctrlKey||"shift"===i&&s.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(t){this._lastTouchY=t.touches[0].pageY}handleTouchMove(t){const s=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,0!==s&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(t,s))}};s.Viewport=l=h([e(2,a.IBufferService),e(3,a.IOptionsService),e(4,n.ICharSizeService),e(5,n.IRenderService),e(6,n.ICoreBrowserService),e(7,n.IThemeService)],l)},3107:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const r=i(4725),n=i(844),o=i(2585);let c=s.BufferDecorationRenderer=class extends n.Disposable{constructor(t,s,i,h,e){super(),this._screenElement=t,this._bufferService=s,this._coreBrowserService=i,this._decorationService=h,this._renderService=e,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((t=>this._removeDecoration(t)))),this.register((0,n.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){const s=this._coreBrowserService.mainDocument.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer","top"===t?.options?.layer),s.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=(t.options.height||1)*this._renderService.dimensions.css.cell.height+"px",s.style.top=(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=t.options.x??0;return i&&i>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(t,s),s}_refreshStyle(t){const s=t.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let i=this._decorationElements.get(t);i||(i=this._createElement(t),t.element=i,this._decorationElements.set(t,i),this._container.appendChild(i),t.onDispose((()=>{this._decorationElements.delete(t),i.remove()}))),i.style.top=s*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",t.onRenderEmitter.fire(i)}}_refreshXPosition(t,s=t.element){if(!s)return;const i=t.options.x??0;"right"===(t.options.anchor||"left")?s.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(t){this._decorationElements.get(t)?.remove(),this._decorationElements.delete(t),t.dispose()}};s.BufferDecorationRenderer=c=h([e(1,o.IBufferService),e(2,r.ICoreBrowserService),e(3,o.IDecorationService),e(4,r.IRenderService)],c)},5871:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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(t){if(t.options.overviewRulerOptions){for(const s of this._zones)if(s.color===t.options.overviewRulerOptions.color&&s.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(s,t.marker.line))return;if(this._lineAdjacentToZone(s,t.marker.line,t.options.overviewRulerOptions.position))return void this._addLineToZone(s,t.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=t.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=t.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=t.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=t.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:t.options.overviewRulerOptions.color,position:t.options.overviewRulerOptions.position,startBufferLine:t.marker.line,endBufferLine:t.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(t){this._linePadding=t}_lineIntersectsZone(t,s){return s>=t.startBufferLine&&s<=t.endBufferLine}_lineAdjacentToZone(t,s,i){return s>=t.startBufferLine-this._linePadding[i||"full"]&&s<=t.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(t,s){t.startBufferLine=Math.min(t.startBufferLine,s),t.endBufferLine=Math.max(t.endBufferLine,s)}}},5744:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const r=i(5871),n=i(4725),o=i(844),c=i(2585),a={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let f=s.OverviewRulerRenderer=class extends o.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,s,i,h,e,n,c){super(),this._viewportElement=t,this._screenElement=s,this._bufferService=i,this._decorationService=h,this._renderService=e,this._optionsService=n,this._coreBrowserService=c,this._colorZoneStore=new r.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const a=this._canvas.getContext("2d");if(!a)throw new Error("Ctx cannot be null");this._ctx=a,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,o.toDisposable)((()=>{this._canvas?.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 t=Math.floor(this._canvas.width/3),s=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=t,l.center=s,l.right=t,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=l.left,u.right=l.left+l.center}_refreshDrawHeightConstants(){a.full=Math.round(2*this._coreBrowserService.dpr);const t=Math.round(Math.max(Math.min(this._canvas.height/this._bufferService.buffer.lines.length,12),6)*this._coreBrowserService.dpr);a.left=t,a.center=t,a.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const s of t)"full"!==s.position&&this._renderColorZone(s);for(const s of t)"full"===s.position&&this._renderColorZone(s);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(u[t.position||"full"],Math.round(t.startBufferLine/this._bufferService.buffers.active.lines.length*(this._canvas.height-1)-a[t.position||"full"]/2),l[t.position||"full"],Math.round((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length*(this._canvas.height-1)+a[t.position||"full"]))}_queueRefresh(t,s){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=s||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=f=h([e(2,c.IBufferService),e(3,c.IDecorationService),e(4,n.IRenderService),e(5,c.IOptionsService),e(6,n.ICoreBrowserService)],f)},2950:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const r=i(4725),n=i(2585),o=i(2584);let c=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(t,s,i,h,e,r){this._textarea=t,this._compositionView=s,this._bufferService=i,this._optionsService=h,this._coreService=e,this._renderService=r,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(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(229===t.keyCode)return!1;if(16===t.keyCode||17===t.keyCode||18===t.keyCode)return!1;this._finalizeComposition(!1)}return 229!==t.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const t=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const s=this._textarea.value,i=s.replace(t,"");this._dataAlreadySent=i,s.length>t.length?this._coreService.triggerDataEvent(i,!0):s.length<t.length?this._coreService.triggerDataEvent(`${o.C0.DEL}`,!0):s.length===t.length&&s!==t&&this._coreService.triggerDataEvent(s,!0)}}),0)}updateCompositionElements(t){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const e=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(e.width,1)+"px",this._textarea.style.height=Math.max(e.height,1)+"px",this._textarea.style.lineHeight=e.height+"px"}t||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=c=h([e(2,n.IBufferService),e(3,n.IOptionsService),e(4,n.ICoreService),e(5,r.IRenderService)],c)},9806:(t,s)=>{function i(t,s,i){const h=i.getBoundingClientRect(),e=t.getComputedStyle(i),r=parseInt(e.getPropertyValue("padding-left")),n=parseInt(e.getPropertyValue("padding-top"));return[s.clientX-h.left-r,s.clientY-h.top-n]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=i,s.getCoords=function(t,s,h,e,r,n,o,c,a){if(!n)return;const l=i(t,s,h);return l?(l[0]=Math.ceil((l[0]+(a?o/2:0))/o),l[1]=Math.ceil(l[1]/c),l[0]=Math.min(Math.max(l[0],1),e+(a?1:0)),l[1]=Math.min(Math.max(l[1],1),r),l):void 0}},9504:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=i(2584);function e(t,s,i,h){const e=t-r(t,i),o=s-r(s,i),l=Math.abs(e-o)-function(t,s,i){let h=0;const e=t-r(t,i),o=s-r(s,i);for(let r=0;r<Math.abs(e-o);r++){const o="A"===n(t,s)?-1:1,c=i.buffer.lines.get(e+o*r);c?.isWrapped&&h++}return h}(t,s,i);return a(l,c(n(t,s),h))}function r(t,s){let i=0,h=s.buffer.lines.get(t),e=h?.isWrapped;for(;e&&t>=0&&t<s.rows;)i++,h=s.buffer.lines.get(--t),e=h?.isWrapped;return i}function n(t,s){return t>s?"A":"B"}function o(t,s,i,h,e,r){let n=t,o=s,c="";for(;n!==i||o!==h;)n+=e?1:-1,e&&n>r.cols-1?(c+=r.buffer.translateBufferLineToString(o,!1,t,n),n=0,t=0,o++):!e&&n<0&&(c+=r.buffer.translateBufferLineToString(o,!1,0,t+1),n=r.cols-1,t=n,o--);return c+r.buffer.translateBufferLineToString(o,!1,t,n)}function c(t,s){return h.C0.ESC+(s?"O":"[")+t}function a(t,s){t=Math.floor(t);let i="";for(let h=0;h<t;h++)i+=s;return i}s.moveToCellSequence=function(t,s,i,h){const n=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return function(t,s,i,h,n,l){return 0===e(s,h,n,l).length?"":a(o(t,s,t,s-r(s,n),!1,n).length,c("D",l))}(n,l,0,s,i,h)+e(l,s,i,h)+function(t,s,i,h,n,l){let u;u=e(s,h,n,l).length>0?h-r(h,n):s;const f=h,d=function(t,s,i,h,n,o){let c;return c=e(i,h,n,o).length>0?h-r(h,n):s,t<i&&c<=h||t>=i&&c<h?"C":"D"}(t,s,i,h,n,l);return a(o(t,u,i,f,"C"===d,n).length,c(d,l))}(n,l,t,s,i,h);let u;if(l===s)return u=n>t?"D":"C",a(Math.abs(n-t),c(u,h));u=l>s?"D":"C";const f=Math.abs(l-s);return a(function(t,s){return s.cols-t}(l>s?t:n,i)+(f-1)*i.cols+1+((l>s?n:t)-1),c(u,h))}},1296:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const r=i(3787),n=i(2550),o=i(2223),c=i(6171),a=i(6052),l=i(4725),u=i(8055),f=i(8460),d=i(844),v=i(2585),p="xterm-dom-renderer-owner-",b="xterm-rows",w="xterm-fg-",g="xterm-bg-",m="xterm-focus",_="xterm-selection";let x=1,k=s.DomRenderer=class extends d.Disposable{constructor(t,s,i,h,e,o,l,u,v,w,g,m,k){super(),this._terminal=t,this._document=s,this._element=i,this._screenElement=h,this._viewportElement=e,this._helperContainer=o,this._linkifier2=l,this._charSizeService=v,this._optionsService=w,this._bufferService=g,this._coreBrowserService=m,this._themeService=k,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,a.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(_),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((t=>this._injectCss(t)))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(r.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((t=>this._handleLinkHover(t)))),this.register(this._linkifier2.onHideLinkUnderline((t=>this._handleLinkLeave(t)))),this.register((0,d.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 n.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 t=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*t,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*t),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/t),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/t),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 t of this._rowElements)t.style.width=`${this.dimensions.css.canvas.width}px`,t.style.height=`${this.dimensions.css.cell.height}px`,t.style.lineHeight=`${this.dimensions.css.cell.height}px`,t.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement)),this._dimensionsStyleElement.textContent=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`,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(t){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let s=`${this._terminalSelector} .${b} { color: ${t.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;s+=`${this._terminalSelector} .${b} .xterm-dim { color: ${u.color.multiplyOpacity(t.foreground,.5).css};}`,s+=`${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 i=`blink_underline_${this._terminalClass}`,h=`blink_bar_${this._terminalClass}`,e=`blink_block_${this._terminalClass}`;s+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,s+=`@keyframes ${h} { 50% { box-shadow: none; }}`,s+=`@keyframes ${e} { 0% { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css}; } 50% { background-color: inherit; color: ${t.cursor.css}; }}`,s+=`${this._terminalSelector} .${b}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${b}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${h} 1s step-end infinite;}${this._terminalSelector} .${b}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${e} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${t.cursor.css} !important; color: ${t.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${t.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${t.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${t.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,s+=`${this._terminalSelector} .${_} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${_} div { position: absolute; background-color: ${t.selectionBackgroundOpaque.css};}${this._terminalSelector} .${_} div { position: absolute; background-color: ${t.selectionInactiveBackgroundOpaque.css};}`;for(const[i,h]of t.ansi.entries())s+=`${this._terminalSelector} .${w}${i} { color: ${h.css}; }${this._terminalSelector} .${w}${i}.xterm-dim { color: ${u.color.multiplyOpacity(h,.5).css}; }${this._terminalSelector} .${g}${i} { background-color: ${h.css}; }`;s+=`${this._terminalSelector} .${w}${o.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(t.background).css}; }${this._terminalSelector} .${w}${o.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(t.background),.5).css}; }${this._terminalSelector} .${g}${o.INVERTED_DEFAULT_COLOR} { background-color: ${t.foreground.css}; }`,this._themeStyleElement.textContent=s}_setDefaultSpacing(){const t=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${t}px`,this._rowFactory.defaultSpacing=t}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(t,s){for(let t=this._rowElements.length;t<=s;t++){const t=this._document.createElement("div");this._rowContainer.appendChild(t),this._rowElements.push(t)}for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(t,s){this._refreshRowElements(t,s),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(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(t,s,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(t,s,i),this.renderRows(0,this._bufferService.rows-1),!t||!s)return;this._selectionRenderModel.update(this._terminal,t,s,i);const h=this._selectionRenderModel.viewportStartRow,e=this._selectionRenderModel.viewportEndRow,r=this._selectionRenderModel.viewportCappedStartRow,n=this._selectionRenderModel.viewportCappedEndRow;if(r>=this._bufferService.rows||n<0)return;const o=this._document.createDocumentFragment();if(i){const i=t[0]>s[0];o.appendChild(this._createSelectionElement(r,i?s[0]:t[0],i?t[0]:s[0],n-r+1))}else o.appendChild(this._createSelectionElement(r,h===r?t[0]:0,r===e?s[0]:this._bufferService.cols)),o.appendChild(this._createSelectionElement(r+1,0,this._bufferService.cols,n-r-1)),r!==n&&o.appendChild(this._createSelectionElement(n,0,e===n?s[0]:this._bufferService.cols));this._selectionContainer.appendChild(o)}_createSelectionElement(t,s,i,h=1){const e=this._document.createElement("div"),r=s*this.dimensions.css.cell.width;let n=this.dimensions.css.cell.width*(i-s);return r+n>this.dimensions.css.canvas.width&&(n=this.dimensions.css.canvas.width-r),e.style.height=h*this.dimensions.css.cell.height+"px",e.style.top=t*this.dimensions.css.cell.height+"px",e.style.left=`${r}px`,e.style.width=`${n}px`,e}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 t of this._rowElements)t.replaceChildren()}renderRows(t,s){const i=this._bufferService.buffer,h=i.ybase+i.y,e=Math.min(i.x,this._bufferService.cols-1),r=this._optionsService.rawOptions.cursorBlink,n=this._optionsService.rawOptions.cursorStyle,o=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=t;c<=s;c++){const t=c+i.ydisp,s=this._rowElements[c],a=i.lines.get(t);if(!s||!a)break;s.replaceChildren(...this._rowFactory.createRow(a,t,t===h,n,o,e,r,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)}_handleLinkLeave(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)}_setCellUnderline(t,s,i,h,e,r){i<0&&(t=0),h<0&&(s=0);const n=this._bufferService.rows-1;i=Math.max(Math.min(i,n),0),h=Math.max(Math.min(h,n),0),e=Math.min(e,this._bufferService.cols);const o=this._bufferService.buffer,c=o.ybase+o.y,a=Math.min(o.x,e-1),l=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let n=i;n<=h;++n){const d=n+o.ydisp,v=this._rowElements[n],p=o.lines.get(d);if(!v||!p)break;v.replaceChildren(...this._rowFactory.createRow(p,d,d===c,u,f,a,l,this.dimensions.css.cell.width,this._widthCache,r?n===i?t:0:-1,r?(n===h?s:e)-1:-1))}}};s.DomRenderer=k=h([e(7,v.IInstantiationService),e(8,l.ICharSizeService),e(9,v.IOptionsService),e(10,v.IBufferService),e(11,l.ICoreBrowserService),e(12,l.IThemeService)],k)},3787:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const r=i(2223),n=i(643),o=i(511),c=i(2585),a=i(8055),l=i(4725),u=i(4269),f=i(6171),d=i(3734);let v=s.DomRendererRowFactory=class{constructor(t,s,i,h,e,r,n){this._document=t,this._characterJoinerService=s,this._optionsService=i,this._coreBrowserService=h,this._coreService=e,this._decorationService=r,this._themeService=n,this._workCell=new o.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(t,s,i){this._selectionStart=t,this._selectionEnd=s,this._columnSelectMode=i}createRow(t,s,i,h,e,o,c,l,f,v,b){const w=[],g=this._characterJoinerService.getJoinedCharacters(s),m=this._themeService.colors;let _,x=t.getNoBgTrimmedLength();i&&x<o+1&&(x=o+1);let k=0,M="",y=0,C=0,O=0,$=!1,S=0,R=!1,j=0;const E=[],A=-1!==v&&-1!==b;for(let D=0;D<x;D++){t.loadCell(D,this._workCell);let x=this._workCell.getWidth();if(0===x)continue;let I=!1,T=D,P=this._workCell;if(g.length>0&&D===g[0][0]){I=!0;const s=g.shift();P=new u.JoinedCellData(this._workCell,t.translateToString(!0,s[0],s[1]),s[1]-s[0]),T=s[1]-1,x=P.getWidth()}const L=this._isCellInSelection(D,s),B=i&&D===o,H=A&&D>=v&&D<=b;let F=!1;this._decorationService.forEachDecorationAtCell(D,s,void 0,(()=>{F=!0}));let W=P.getChars()||n.WHITESPACE_CELL_CHAR;if(" "===W&&(P.isUnderline()||P.isOverline())&&(W=" "),j=x*l-f.get(W,P.isBold(),P.isItalic()),_){if(k&&(L&&R||!L&&!R&&P.bg===y)&&(L&&R&&m.selectionForeground||P.fg===C)&&P.extended.ext===O&&H===$&&j===S&&!B&&!I&&!F){P.isInvisible()?M+=n.WHITESPACE_CELL_CHAR:M+=W,k++;continue}k&&(_.textContent=M),_=this._document.createElement("span"),k=0,M=""}else _=this._document.createElement("span");if(y=P.bg,C=P.fg,O=P.extended.ext,$=H,S=j,R=L,I&&o>=D&&o<=T&&(o=D),!this._coreService.isCursorHidden&&B&&this._coreService.isCursorInitialized)if(E.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&E.push("xterm-cursor-blink"),E.push("bar"===h?"xterm-cursor-bar":"underline"===h?"xterm-cursor-underline":"xterm-cursor-block");else if(e)switch(e){case"outline":E.push("xterm-cursor-outline");break;case"block":E.push("xterm-cursor-block");break;case"bar":E.push("xterm-cursor-bar");break;case"underline":E.push("xterm-cursor-underline")}if(P.isBold()&&E.push("xterm-bold"),P.isItalic()&&E.push("xterm-italic"),P.isDim()&&E.push("xterm-dim"),M=P.isInvisible()?n.WHITESPACE_CELL_CHAR:P.getChars()||n.WHITESPACE_CELL_CHAR,P.isUnderline()&&(E.push(`xterm-underline-${P.extended.underlineStyle}`)," "===M&&(M=" "),!P.isUnderlineColorDefault()))if(P.isUnderlineColorRGB())_.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(P.getUnderlineColor()).join(",")})`;else{let t=P.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&P.isBold()&&t<8&&(t+=8),_.style.textDecorationColor=m.ansi[t].css}P.isOverline()&&(E.push("xterm-overline")," "===M&&(M=" ")),P.isStrikethrough()&&E.push("xterm-strikethrough"),H&&(_.style.textDecoration="underline");let U=P.getFgColor(),N=P.getFgColorMode(),z=P.getBgColor(),G=P.getBgColorMode();const q=!!P.isInverse();if(q){const t=U;U=z,z=t;const s=N;N=G,G=s}let K,V,X,J=!1;switch(this._decorationService.forEachDecorationAtCell(D,s,void 0,(t=>{"top"!==t.options.layer&&J||(t.backgroundColorRGB&&(G=50331648,z=t.backgroundColorRGB.rgba>>8&16777215,K=t.backgroundColorRGB),t.foregroundColorRGB&&(N=50331648,U=t.foregroundColorRGB.rgba>>8&16777215,V=t.foregroundColorRGB),J="top"===t.options.layer)})),!J&&L&&(K=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,z=K.rgba>>8&16777215,G=50331648,J=!0,m.selectionForeground&&(N=50331648,U=m.selectionForeground.rgba>>8&16777215,V=m.selectionForeground)),J&&E.push("xterm-decoration-top"),G){case 16777216:case 33554432:X=m.ansi[z],E.push(`xterm-bg-${z}`);break;case 50331648:X=a.channels.toColor(z>>16,z>>8&255,255&z),this._addStyle(_,`background-color:#${p((z>>>0).toString(16),"0",6)}`);break;default:q?(X=m.foreground,E.push(`xterm-bg-${r.INVERTED_DEFAULT_COLOR}`)):X=m.background}switch(K||P.isDim()&&(K=a.color.multiplyOpacity(X,.5)),N){case 16777216:case 33554432:P.isBold()&&U<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(U+=8),this._applyMinimumContrast(_,X,m.ansi[U],P,K,void 0)||E.push(`xterm-fg-${U}`);break;case 50331648:const t=a.channels.toColor(U>>16&255,U>>8&255,255&U);this._applyMinimumContrast(_,X,t,P,K,V)||this._addStyle(_,`color:#${p(U.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(_,X,m.foreground,P,K,V)||q&&E.push(`xterm-fg-${r.INVERTED_DEFAULT_COLOR}`)}E.length&&(_.className=E.join(" "),E.length=0),B||I||F?_.textContent=M:k++,j!==this.defaultSpacing&&(_.style.letterSpacing=`${j}px`),w.push(_),D=T}return _&&k&&(_.textContent=M),w}_applyMinimumContrast(t,s,i,h,e,r){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,f.treatGlyphAsBackgroundColor)(h.getCode()))return!1;const n=this._getContrastCache(h);let o;if(e||r||(o=n.getColor(s.rgba,i.rgba)),void 0===o){const t=this._optionsService.rawOptions.minimumContrastRatio/(h.isDim()?2:1);o=a.color.ensureContrastRatio(e||s,r||i,t),n.setColor((e||s).rgba,(r||i).rgba,o??null)}return!!o&&(this._addStyle(t,`color:${o.css}`),!0)}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,s){t.setAttribute("style",`${t.getAttribute("style")||""}${s};`)}_isCellInSelection(t,s){const i=this._selectionStart,h=this._selectionEnd;return!(!i||!h)&&(this._columnSelectMode?i[0]<=h[0]?t>=i[0]&&s>=i[1]&&t<h[0]&&s<=h[1]:t<i[0]&&s>=i[1]&&t>=h[0]&&s<=h[1]:s>i[1]&&s<h[1]||i[1]===h[1]&&s===i[1]&&t>=i[0]&&t<h[0]||i[1]<h[1]&&s===h[1]&&t<h[0]||i[1]<h[1]&&s===i[1]&&t>=i[0])}};function p(t,s,i){for(;t.length<i;)t=s+t;return t}s.DomRendererRowFactory=v=h([e(1,l.ICharacterJoinerService),e(2,c.IOptionsService),e(3,l.ICoreBrowserService),e(4,c.ICoreService),e(5,c.IDecorationService),e(6,l.IThemeService)],v)},2550:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(t,s){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=t.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 i=t.createElement("span");i.classList.add("xterm-char-measure-element");const h=t.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const e=t.createElement("span");e.classList.add("xterm-char-measure-element"),e.style.fontStyle="italic";const r=t.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold",r.style.fontStyle="italic",this._measureElements=[i,h,e,r],this._container.appendChild(i),this._container.appendChild(h),this._container.appendChild(e),this._container.appendChild(r),s.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(t,s,i,h){t===this._font&&s===this._fontSize&&i===this._weight&&h===this._weightBold||(this._font=t,this._fontSize=s,this._weight=i,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(t,s,i){let h=0;if(!s&&!i&&1===t.length&&(h=t.charCodeAt(0))<256){if(-9999!==this._flat[h])return this._flat[h];const s=this._measure(t,0);return s>0&&(this._flat[h]=s),s}let e=t;s&&(e+="B"),i&&(e+="I");let r=this._holey.get(e);if(void 0===r){let h=0;s&&(h|=1),i&&(h|=2),r=this._measure(t,h),r>0&&this._holey.set(e,r)}return r}_measure(t,s){const i=this._measureElements[s];return i.textContent=t.repeat(32),i.offsetWidth/32}}},2223:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=i(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(t,s)=>{function i(t){return 57508<=t&&t<=57558}function h(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(t){if(!t)throw new Error("value must not be falsy");return t},s.isPowerlineGlyph=i,s.isRestrictedPowerlineGlyph=function(t){return 57520<=t&&t<=57527},s.isEmoji=h,s.allowRescaling=function(t,s,e,r){return 1===s&&e>Math.ceil(1.5*r)&&void 0!==t&&t>255&&!h(t)&&!i(t)&&!function(t){return 57344<=t&&t<=63743}(t)},s.treatGlyphAsBackgroundColor=function(t){return i(t)||function(t){return 9472<=t&&t<=9631}(t)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(t,s,i=0){return(t-(2*Math.round(s)-i))%(2*Math.round(s))}},6052:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class i{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(t,s,i,h=!1){if(this.selectionStart=s,this.selectionEnd=i,!s||!i||s[0]===i[0]&&s[1]===i[1])return void this.clear();const e=t.buffers.active.ydisp,r=s[1]-e,n=i[1]-e,o=Math.max(r,0),c=Math.min(n,t.rows-1);o>=t.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=h,this.viewportStartRow=r,this.viewportEndRow=n,this.viewportCappedStartRow=o,this.viewportCappedEndRow=c,this.startCol=s[0],this.endCol=i[0])}isCellSelected(t,s,i){return!!this.hasSelection&&(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?s>=this.startCol&&i>=this.viewportCappedStartRow&&s<this.endCol&&i<=this.viewportCappedEndRow:s<this.startCol&&i>=this.viewportCappedStartRow&&s>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol)}}s.createSelectionRenderModel=function(){return new i}},456:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(t){this._bufferService=t,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 t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const t=this.selectionStart,s=this.selectionEnd;return!(!t||!s)&&(t[1]>s[1]||t[1]===s[1]&&t[0]>s[0])}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const r=i(2585),n=i(8460),o=i(844);let c=s.CharSizeService=class extends o.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(t,s,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new n.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new l(t,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const t=this._measureStrategy.measure();t.width===this.width&&t.height===this.height||(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};s.CharSizeService=c=h([e(2,r.IOptionsService)],c);class a extends o.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,s){void 0!==t&&t>0&&void 0!==s&&s>0&&(this._result.width=t,this._result.height=s)}}class l extends a{constructor(t,s,i){super(),this._document=t,this._parentElement=s,this._optionsService=i,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 u extends a{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const s=this._ctx.measureText("W");if(!("width"in s&&"fontBoundingBoxAscent"in s&&"fontBoundingBoxDescent"in s))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const r=i(3734),n=i(643),o=i(511),c=i(2585);s.JoinedCellData=class extends r.AttributeData{constructor(t,s,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=s,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};let a=s.CharacterJoinerService=class t{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new o.CellData}register(t){const s={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(s),s.id}deregister(t){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===t)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(t){if(0===this._characterJoiners.length)return[];const s=this._bufferService.buffer.lines.get(t);if(!s||0===s.length)return[];const i=[],h=s.translateToString(!0);let e=0,r=0,o=0,c=s.getFg(0),a=s.getBg(0);for(let t=0;t<s.getTrimmedLength();t++)if(s.loadCell(t,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==c||this._workCell.bg!==a){if(t-e>1){const t=this._getJoinedRanges(h,o,r,s,e);for(let s=0;s<t.length;s++)i.push(t[s])}e=t,o=r,c=this._workCell.fg,a=this._workCell.bg}r+=this._workCell.getChars().length||n.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-e>1){const t=this._getJoinedRanges(h,o,r,s,e);for(let s=0;s<t.length;s++)i.push(t[s])}return i}_getJoinedRanges(s,i,h,e,r){const n=s.substring(i,h);let o=[];try{o=this._characterJoiners[0].handler(n)}catch(t){console.error(t)}for(let s=1;s<this._characterJoiners.length;s++)try{const i=this._characterJoiners[s].handler(n);for(let s=0;s<i.length;s++)t._mergeRanges(o,i[s])}catch(t){console.error(t)}return this._stringRangesToCellRanges(o,e,r),o}_stringRangesToCellRanges(t,s,i){let h=0,e=!1,r=0,o=t[h];if(o){for(let c=i;c<this._bufferService.cols;c++){const i=s.getWidth(c),a=s.getString(c).length||n.WHITESPACE_CELL_CHAR.length;if(0!==i){if(!e&&o[0]<=r&&(o[0]=c,e=!0),o[1]<=r){if(o[1]=c,o=t[++h],!o)break;o[0]<=r?(o[0]=c,e=!0):e=!1}r+=a}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(t,s){let i=!1;for(let h=0;h<t.length;h++){const e=t[h];if(i){if(s[1]<=e[0])return t[h-1][1]=s[1],t;if(s[1]<=e[1])return t[h-1][1]=Math.max(s[1],e[1]),t.splice(h,1),t;t.splice(h,1),h--}else{if(s[1]<=e[0])return t.splice(h,0,s),t;if(s[1]<=e[1])return e[0]=Math.min(s[0],e[0]),t;s[0]<e[1]&&(e[0]=Math.min(s[0],e[0]),i=!0)}}return i?t[t.length-1][1]=s[1]:t.push(s),t}};s.CharacterJoinerService=a=h([e(0,c.IBufferService)],a)},5114:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const h=i(844),e=i(8460),r=i(3656);s.CoreBrowserService=class extends h.Disposable{constructor(t,s,i){super(),this._textarea=t,this._window=s,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new n(this._window),this._onDprChange=this.register(new e.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new e.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((t=>this._screenDprMonitor.setWindow(t)))),this.register((0,e.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(t){this._window!==t&&(this._window=t,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}};class n extends h.Disposable{constructor(t){super(),this._parentWindow=t,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new e.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(t){this._parentWindow=t,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,r.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const h=i(844);s.LinkProviderService=class extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{const s=this.linkProviders.indexOf(t);-1!==s&&this.linkProviders.splice(s,1)}}}}},8934:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const r=i(4725),n=i(9806);let o=s.MouseService=class{constructor(t,s){this._renderService=t,this._charSizeService=s}getCoords(t,s,i,h,e){return(0,n.getCoords)(window,t,s,i,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(t,s){const i=(0,n.getCoordsRelativeToElement)(window,t,s);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};s.MouseService=o=h([e(0,r.IRenderService),e(1,r.ICharSizeService)],o)},3230:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const r=i(6193),n=i(4725),o=i(8460),c=i(844),a=i(7226),l=i(2585);let u=s.RenderService=class extends c.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(t,s,i,h,e,n,l,u){super(),this._rowCount=t,this._charSizeService=h,this._renderer=this.register(new c.MutableDisposable),this._pausedResizeTask=new a.DebouncedIdleTask,this._observerDisposable=this.register(new c.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 o.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new o.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new o.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new o.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new r.RenderDebouncer(((t,s)=>this._renderRows(t,s)),l),this.register(this._renderDebouncer),this.register(l.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(n.onResize((()=>this._fullRefresh()))),this.register(n.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(i.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(e.onDecorationRegistered((()=>this._fullRefresh()))),this.register(e.onDecorationRemoved((()=>this._fullRefresh()))),this.register(i.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(n.cols,n.rows),this._fullRefresh()}))),this.register(i.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(n.buffer.y,n.buffer.y,!0)))),this.register(u.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(l.window,s),this.register(l.onWindowChange((t=>this._registerIntersectionObserver(t,s))))}_registerIntersectionObserver(t,s){if("IntersectionObserver"in t){const i=new t.IntersectionObserver((t=>this._handleIntersectionChange(t[t.length-1])),{threshold:0});i.observe(s),this._observerDisposable.value=(0,c.toDisposable)((()=>i.disconnect()))}}_handleIntersectionChange(t){this._isPaused=void 0===t.isIntersecting?0===t.intersectionRatio:!t.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(t,s,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,s,this._rowCount))}_renderRows(t,s){this._renderer.value&&(t=Math.min(t,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(t,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:s}),this._onRender.fire({start:t,end:s}),this._isNextRenderRedrawOnly=!0)}resize(t,s){this._rowCount=s,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(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw((t=>this.refreshRows(t.start,t.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(t,s))):this._renderer.value.handleResize(t,s),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(t,s,i){this._selectionState.start=t,this._selectionState.end=s,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(t,s,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};s.RenderService=u=h([e(2,l.IOptionsService),e(3,n.ICharSizeService),e(4,l.IDecorationService),e(5,l.IBufferService),e(6,n.ICoreBrowserService),e(7,n.IThemeService)],u)},9312:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const r=i(9806),n=i(9504),o=i(456),c=i(4725),a=i(8460),l=i(844),u=i(6114),f=i(4841),d=i(511),v=i(2585),p=String.fromCharCode(160),b=new RegExp(p,"g");let w=s.SelectionService=class extends l.Disposable{constructor(t,s,i,h,e,r,n,c,u){super(),this._element=t,this._screenElement=s,this._linkifier=i,this._bufferService=h,this._coreService=e,this._mouseService=r,this._optionsService=n,this._renderService=c,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new a.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new a.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new a.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new a.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=t=>this._handleMouseMove(t),this._mouseUpListener=t=>this._handleMouseUp(t),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((t=>this._handleTrim(t))),this.register(this._bufferService.buffers.onBufferActivate((t=>this._handleBufferActivate(t)))),this.enable(),this._model=new o.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.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 t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!t||!s||t[0]===s[0]&&t[1]===s[1])}get selectionText(){const t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;if(!t||!s)return"";const i=this._bufferService.buffer,h=[];if(3===this._activeSelectionMode){if(t[0]===s[0])return"";const e=t[0]<s[0]?t[0]:s[0],r=t[0]<s[0]?s[0]:t[0];for(let n=t[1];n<=s[1];n++){const t=i.translateBufferLineToString(n,!0,e,r);h.push(t)}}else{h.push(i.translateBufferLineToString(t[1],!0,t[0],t[1]===s[1]?s[0]:void 0));for(let e=t[1]+1;e<=s[1]-1;e++){const t=i.lines.get(e),s=i.translateBufferLineToString(e,!0);t?.isWrapped?h[h.length-1]+=s:h.push(s)}if(t[1]!==s[1]){const t=i.lines.get(s[1]),e=i.translateBufferLineToString(s[1],!0,0,s[0]);t&&t.isWrapped?h[h.length-1]+=e:h.push(e)}}return h.map((t=>t.replace(b," "))).join(u.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(t){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&t&&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:3===this._activeSelectionMode})}_isClickInSelection(t){const s=this._getMouseBufferCoords(t),i=this._model.finalSelectionStart,h=this._model.finalSelectionEnd;return!!(i&&h&&s)&&this._areCoordsInSelection(s,i,h)}isCellInSelection(t,s){const i=this._model.finalSelectionStart,h=this._model.finalSelectionEnd;return!(!i||!h)&&this._areCoordsInSelection([t,s],i,h)}_areCoordsInSelection(t,s,i){return t[1]>s[1]&&t[1]<i[1]||s[1]===i[1]&&t[1]===s[1]&&t[0]>=s[0]&&t[0]<i[0]||s[1]<i[1]&&t[1]===i[1]&&t[0]<i[0]||s[1]<i[1]&&t[1]===s[1]&&t[0]>=s[0]}_selectWordAtCursor(t,s){const i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const h=this._getMouseBufferCoords(t);return!!h&&(this._selectWordAt(h,s),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(t,s){this._model.clearSelection(),t=Math.max(t,0),s=Math.min(s,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._bufferService.cols,s],this.refresh(),this._onSelectionChange.fire()}_handleTrim(t){this._model.handleTrim(t)&&this.refresh()}_getMouseBufferCoords(t){const s=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(s)return s[0]--,s[1]--,s[1]+=this._bufferService.buffer.ydisp,s}_getMouseEventScrollAmount(t){let s=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,t,this._screenElement)[1];const i=this._renderService.dimensions.css.canvas.height;return s>=0&&s<=i?0:(s>i&&(s-=i),s=Math.min(Math.max(s,-50),50),s/=50,s/Math.abs(s)+Math.round(14*s))}shouldForceSelection(t){return u.isMac?t.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:t.shiftKey}handleMouseDown(t){if(this._mouseDownTimeStamp=t.timeStamp,(2!==t.button||!this.hasSelection)&&0===t.button){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._handleIncrementalClick(t):1===t.detail?this._handleSingleClick(t):2===t.detail?this._handleDoubleClick(t):3===t.detail&&this._handleTripleClick(t),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(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))}_handleSingleClick(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const s=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);s&&s.length!==this._model.selectionStart[0]&&0===s.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(t){this._selectWordAtCursor(t,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(t){const s=this._getMouseBufferCoords(t);s&&(this._activeSelectionMode=2,this._selectLineAt(s[1]))}shouldColumnSelect(t){return t.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(t){if(t.stopImmediatePropagation(),!this._model.selectionStart)return;const s=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[0]=this._model.selectionEnd[1]<this._model.selectionStart[1]?0:this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(t),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){const t=i.lines.get(this._model.selectionEnd[1]);t&&0===t.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}s&&s[0]===this._model.selectionEnd[0]&&s[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 t=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(t.ydisp+this._bufferService.rows,t.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=t.ydisp),this.refresh()}}_handleMouseUp(t){const s=t.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&s<500&&t.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const s=this._mouseService.getCoords(t,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&void 0!==s[0]&&void 0!==s[1]){const t=(0,n.moveToCellSequence)(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(t,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const t=this._model.finalSelectionStart,s=this._model.finalSelectionEnd,i=!(!t||!s||t[0]===s[0]&&t[1]===s[1]);i?t&&s&&(this._oldSelectionStart&&this._oldSelectionEnd&&t[0]===this._oldSelectionStart[0]&&t[1]===this._oldSelectionStart[1]&&s[0]===this._oldSelectionEnd[0]&&s[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(t,s,i)):this._oldHasSelection&&this._fireOnSelectionChange(t,s,i)}_fireOnSelectionChange(t,s,i){this._oldSelectionStart=t,this._oldSelectionEnd=s,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(t){this.clearSelection(),this._trimListener.dispose(),this._trimListener=t.activeBuffer.lines.onTrim((t=>this._handleTrim(t)))}_convertViewportColToCharacterIndex(t,s){let i=s;for(let h=0;s>=h;h++){const e=t.loadCell(h,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:e>1&&s!==h&&(i+=e-1)}return i}setSelection(t,s,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,s],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(t){this._isClickInSelection(t)||(this._selectWordAtCursor(t,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(t,s,i=!0,h=!0){if(t[0]>=this._bufferService.cols)return;const e=this._bufferService.buffer,r=e.lines.get(t[1]);if(!r)return;const n=e.translateBufferLineToString(t[1],!1);let o=this._convertViewportColToCharacterIndex(r,t[0]),c=o;const a=t[0]-o;let l=0,u=0,f=0,d=0;if(" "===n.charAt(o)){for(;o>0&&" "===n.charAt(o-1);)o--;for(;c<n.length&&" "===n.charAt(c+1);)c++}else{let s=t[0],i=t[0];0===r.getWidth(s)&&(l++,s--),2===r.getWidth(i)&&(u++,i++);const h=r.getString(i).length;for(h>1&&(d+=h-1,c+=h-1);s>0&&o>0&&!this._isCharWordSeparator(r.loadCell(s-1,this._workCell));){r.loadCell(s-1,this._workCell);const t=this._workCell.getChars().length;0===this._workCell.getWidth()?(l++,s--):t>1&&(f+=t-1,o-=t-1),o--,s--}for(;i<r.length&&c+1<n.length&&!this._isCharWordSeparator(r.loadCell(i+1,this._workCell));){r.loadCell(i+1,this._workCell);const t=this._workCell.getChars().length;2===this._workCell.getWidth()?(u++,i++):t>1&&(d+=t-1,c+=t-1),c++,i++}}c++;let v=o+a-l+f,p=Math.min(this._bufferService.cols,c-o+l+u-f-d);if(s||""!==n.slice(o,c).trim()){if(i&&0===v&&32!==r.getCodePoint(0)){const s=e.lines.get(t[1]-1);if(s&&r.isWrapped&&32!==s.getCodePoint(this._bufferService.cols-1)){const s=this._getWordAt([this._bufferService.cols-1,t[1]-1],!1,!0,!1);if(s){const t=this._bufferService.cols-s.start;v-=t,p+=t}}}if(h&&v+p===this._bufferService.cols&&32!==r.getCodePoint(this._bufferService.cols-1)){const s=e.lines.get(t[1]+1);if(s?.isWrapped&&32!==s.getCodePoint(0)){const s=this._getWordAt([0,t[1]+1],!1,!1,!0);s&&(p+=s.length)}}return{start:v,length:p}}}_selectWordAt(t,s){const i=this._getWordAt(t,s);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,t[1]--;this._model.selectionStart=[i.start,t[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(t){const s=this._getWordAt(t,!0);if(s){let i=t[1];for(;s.start<0;)s.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;s.start+s.length>this._bufferService.cols;)s.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?s.start:s.start+s.length,i]}}_isCharWordSeparator(t){return 0!==t.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(t.getChars())>=0}_selectLineAt(t){const s=this._bufferService.buffer.getWrappedRangeForLine(t),i={start:{x:0,y:s.first},end:{x:this._bufferService.cols-1,y:s.last}};this._model.selectionStart=[0,s.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols)}};s.SelectionService=w=h([e(3,v.IBufferService),e(4,v.ICoreService),e(5,c.IMouseService),e(6,v.IOptionsService),e(7,c.IRenderService),e(8,c.ICoreBrowserService)],w)},4725:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=i(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService"),s.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const r=i(7239),n=i(8055),o=i(8460),c=i(844),a=i(2585),l=n.css.toColor("#ffffff"),u=n.css.toColor("#000000"),f=n.css.toColor("#ffffff"),d=n.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const t=[n.css.toColor("#2e3436"),n.css.toColor("#cc0000"),n.css.toColor("#4e9a06"),n.css.toColor("#c4a000"),n.css.toColor("#3465a4"),n.css.toColor("#75507b"),n.css.toColor("#06989a"),n.css.toColor("#d3d7cf"),n.css.toColor("#555753"),n.css.toColor("#ef2929"),n.css.toColor("#8ae234"),n.css.toColor("#fce94f"),n.css.toColor("#729fcf"),n.css.toColor("#ad7fa8"),n.css.toColor("#34e2e2"),n.css.toColor("#eeeeec")],s=[0,95,135,175,215,255];for(let i=0;i<216;i++){const h=s[i/36%6|0],e=s[i/6%6|0],r=s[i%6];t.push({css:n.channels.toCss(h,e,r),rgba:n.channels.toRgba(h,e,r)})}for(let s=0;s<24;s++){const i=8+10*s;t.push({css:n.channels.toCss(i,i,i),rgba:n.channels.toRgba(i,i,i)})}return t})());let p=s.ThemeService=class extends c.Disposable{get colors(){return this._colors}constructor(t){super(),this._optionsService=t,this._contrastCache=new r.ColorContrastCache,this._halfContrastCache=new r.ColorContrastCache,this._onChangeColors=this.register(new o.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:u,cursor:f,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:n.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:n.color.blend(u,v),ansi:s.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(t={}){const i=this._colors;if(i.foreground=b(t.foreground,l),i.background=b(t.background,u),i.cursor=b(t.cursor,f),i.cursorAccent=b(t.cursorAccent,d),i.selectionBackgroundTransparent=b(t.selectionBackground,v),i.selectionBackgroundOpaque=n.color.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=b(t.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=n.color.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=t.selectionForeground?b(t.selectionForeground,n.NULL_COLOR):void 0,i.selectionForeground===n.NULL_COLOR&&(i.selectionForeground=void 0),n.color.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=n.color.opacity(i.selectionBackgroundTransparent,.3)),n.color.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=n.color.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.ansi=s.DEFAULT_ANSI_COLORS.slice(),i.ansi[0]=b(t.black,s.DEFAULT_ANSI_COLORS[0]),i.ansi[1]=b(t.red,s.DEFAULT_ANSI_COLORS[1]),i.ansi[2]=b(t.green,s.DEFAULT_ANSI_COLORS[2]),i.ansi[3]=b(t.yellow,s.DEFAULT_ANSI_COLORS[3]),i.ansi[4]=b(t.blue,s.DEFAULT_ANSI_COLORS[4]),i.ansi[5]=b(t.magenta,s.DEFAULT_ANSI_COLORS[5]),i.ansi[6]=b(t.cyan,s.DEFAULT_ANSI_COLORS[6]),i.ansi[7]=b(t.white,s.DEFAULT_ANSI_COLORS[7]),i.ansi[8]=b(t.brightBlack,s.DEFAULT_ANSI_COLORS[8]),i.ansi[9]=b(t.brightRed,s.DEFAULT_ANSI_COLORS[9]),i.ansi[10]=b(t.brightGreen,s.DEFAULT_ANSI_COLORS[10]),i.ansi[11]=b(t.brightYellow,s.DEFAULT_ANSI_COLORS[11]),i.ansi[12]=b(t.brightBlue,s.DEFAULT_ANSI_COLORS[12]),i.ansi[13]=b(t.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),i.ansi[14]=b(t.brightCyan,s.DEFAULT_ANSI_COLORS[14]),i.ansi[15]=b(t.brightWhite,s.DEFAULT_ANSI_COLORS[15]),t.extendedAnsi){const h=Math.min(i.ansi.length-16,t.extendedAnsi.length);for(let e=0;e<h;e++)i.ansi[e+16]=b(t.extendedAnsi[e],s.DEFAULT_ANSI_COLORS[e+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(t){this._restoreColor(t),this._onChangeColors.fire(this.colors)}_restoreColor(t){if(void 0!==t)switch(t){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[t]=this._restoreColors.ansi[t]}else for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t]}modifyColors(t){t(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 b(t,s){if(void 0!==t)try{return n.css.toColor(t)}catch{}return s}s.ThemeService=p=h([e(0,a.IOptionsService)],p)},6349:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=i(8460),e=i(844);s.CircularList=class extends e.Disposable{constructor(t){super(),this._maxLength=t,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(t){if(this._maxLength===t)return;const s=new Array(t);for(let i=0;i<Math.min(t,this.length);i++)s[i]=this._array[this._getCyclicIndex(i)];this._array=s,this._maxLength=t,this._startIndex=0}get length(){return this._length}set length(t){if(t>this._length)for(let s=this._length;s<t;s++)this._array[s]=void 0;this._length=t}get(t){return this._array[this._getCyclicIndex(t)]}set(t,s){this._array[this._getCyclicIndex(t)]=s}push(t){this._array[this._getCyclicIndex(this._length)]=t,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(t,s,...i){if(s){for(let i=t;i<this._length-s;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+s)];this._length-=s,this.onDeleteEmitter.fire({index:t,amount:s})}for(let s=this._length-1;s>=t;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(t+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:t,amount:i.length}),this._length+i.length>this._maxLength){const t=this._length+i.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=i.length}trimStart(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)}shiftElements(t,s,i){if(!(s<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let h=s-1;h>=0;h--)this.set(t+h+i,this.get(t+h));const h=t+s+i-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<s;h++)this.set(t+h+i,this.get(t+h))}}_getCyclicIndex(t){return(this._startIndex+t)%this._maxLength}}},1439:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function t(s,i=5){if("object"!=typeof s)return s;const h=Array.isArray(s)?[]:{};for(const e in s)h[e]=i<=1?s[e]:s[e]&&t(s[e],i-1);return h}},8055:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let i=0,h=0,e=0,r=0;var n,o,c,a,l;function u(t){const s=t.toString(16);return s.length<2?"0"+s:s}function f(t,s){return t<s?(s+.05)/(t+.05):(t+.05)/(s+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(t,s,i,h){return void 0!==h?`#${u(t)}${u(s)}${u(i)}${u(h)}`:`#${u(t)}${u(s)}${u(i)}`},t.toRgba=function(t,s,i,h=255){return(t<<24|s<<16|i<<8|h)>>>0},t.toColor=function(s,i,h,e){return{css:t.toCss(s,i,h,e),rgba:t.toRgba(s,i,h,e)}}}(n||(s.channels=n={})),function(t){function s(t,s){return r=Math.round(255*s),[i,h,e]=l.toChannels(t.rgba),{css:n.toCss(i,h,e,r),rgba:n.toRgba(i,h,e,r)}}t.blend=function(t,s){if(r=(255&s.rgba)/255,1===r)return{css:s.css,rgba:s.rgba};const o=s.rgba>>16&255,c=s.rgba>>8&255,a=t.rgba>>24&255,l=t.rgba>>16&255,u=t.rgba>>8&255;return i=a+Math.round(((s.rgba>>24&255)-a)*r),h=l+Math.round((o-l)*r),e=u+Math.round((c-u)*r),{css:n.toCss(i,h,e),rgba:n.toRgba(i,h,e)}},t.isOpaque=function(t){return!(255&~t.rgba)},t.ensureContrastRatio=function(t,s,i){const h=l.ensureContrastRatio(t.rgba,s.rgba,i);if(h)return n.toColor(h>>24&255,h>>16&255,h>>8&255)},t.opaque=function(t){const s=(255|t.rgba)>>>0;return[i,h,e]=l.toChannels(s),{css:n.toCss(i,h,e),rgba:s}},t.opacity=s,t.multiplyOpacity=function(t,i){return r=255&t.rgba,s(t,r*i/255)},t.toColorRGB=function(t){return[t.rgba>>24&255,t.rgba>>16&255,t.rgba>>8&255]}}(o||(s.color=o={})),function(t){let s,o;try{const t=document.createElement("canvas");t.width=1,t.height=1;const i=t.getContext("2d",{willReadFrequently:!0});i&&(s=i,s.globalCompositeOperation="copy",o=s.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(t){if(t.match(/#[\da-f]{3,8}/i))switch(t.length){case 4:return i=parseInt(t.slice(1,2).repeat(2),16),h=parseInt(t.slice(2,3).repeat(2),16),e=parseInt(t.slice(3,4).repeat(2),16),n.toColor(i,h,e);case 5:return i=parseInt(t.slice(1,2).repeat(2),16),h=parseInt(t.slice(2,3).repeat(2),16),e=parseInt(t.slice(3,4).repeat(2),16),r=parseInt(t.slice(4,5).repeat(2),16),n.toColor(i,h,e,r);case 7:return{css:t,rgba:(parseInt(t.slice(1),16)<<8|255)>>>0};case 9:return{css:t,rgba:parseInt(t.slice(1),16)>>>0}}const c=t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return i=parseInt(c[1]),h=parseInt(c[2]),e=parseInt(c[3]),r=Math.round(255*(void 0===c[5]?1:parseFloat(c[5]))),n.toColor(i,h,e,r);if(!s||!o)throw new Error("css.toColor: Unsupported css format");if(s.fillStyle=o,s.fillStyle=t,"string"!=typeof s.fillStyle)throw new Error("css.toColor: Unsupported css format");if(s.fillRect(0,0,1,1),[i,h,e,r]=s.getImageData(0,0,1,1).data,255!==r)throw new Error("css.toColor: Unsupported css format");return{rgba:n.toRgba(i,h,e,r),css:t}}}(c||(s.css=c={})),function(t){function s(t,s,i){const h=t/255,e=s/255,r=i/255;return.2126*(h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))}t.relativeLuminance=function(t){return s(t>>16&255,t>>8&255,255&t)},t.relativeLuminance2=s}(a||(s.rgb=a={})),function(t){function s(t,s,i){const h=t>>24&255,e=t>>16&255,r=t>>8&255;let n=s>>24&255,o=s>>16&255,c=s>>8&255,l=f(a.relativeLuminance2(n,o,c),a.relativeLuminance2(h,e,r));for(;l<i&&(n>0||o>0||c>0);)n-=Math.max(0,Math.ceil(.1*n)),o-=Math.max(0,Math.ceil(.1*o)),c-=Math.max(0,Math.ceil(.1*c)),l=f(a.relativeLuminance2(n,o,c),a.relativeLuminance2(h,e,r));return(n<<24|o<<16|c<<8|255)>>>0}function o(t,s,i){const h=t>>24&255,e=t>>16&255,r=t>>8&255;let n=s>>24&255,o=s>>16&255,c=s>>8&255,l=f(a.relativeLuminance2(n,o,c),a.relativeLuminance2(h,e,r));for(;l<i&&(n<255||o<255||c<255);)n=Math.min(255,n+Math.ceil(.1*(255-n))),o=Math.min(255,o+Math.ceil(.1*(255-o))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=f(a.relativeLuminance2(n,o,c),a.relativeLuminance2(h,e,r));return(n<<24|o<<16|c<<8|255)>>>0}t.blend=function(t,s){if(r=(255&s)/255,1===r)return s;const o=s>>16&255,c=s>>8&255,a=t>>24&255,l=t>>16&255,u=t>>8&255;return i=a+Math.round(((s>>24&255)-a)*r),h=l+Math.round((o-l)*r),e=u+Math.round((c-u)*r),n.toRgba(i,h,e)},t.ensureContrastRatio=function(t,i,h){const e=a.relativeLuminance(t>>8),r=a.relativeLuminance(i>>8);if(f(e,r)<h){if(r<e){const r=s(t,i,h),n=f(e,a.relativeLuminance(r>>8));if(n<h){const s=o(t,i,h);return n>f(e,a.relativeLuminance(s>>8))?r:s}return r}const n=o(t,i,h),c=f(e,a.relativeLuminance(n>>8));if(c<h){const r=s(t,i,h);return c>f(e,a.relativeLuminance(r>>8))?n:r}return n}},t.reduceLuminance=s,t.increaseLuminance=o,t.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]}}(l||(s.rgba=l={})),s.toPaddedHex=u,s.contrastRatio=f},8969:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=i(844),e=i(2585),r=i(4348),n=i(7866),o=i(744),c=i(7302),a=i(6975),l=i(8460),u=i(1753),f=i(1480),d=i(7994),v=i(9282),p=i(5435),b=i(5981),w=i(2660);let g=!1;s.CoreTerminal=class extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((t=>{this._onScrollApi?.fire(t.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(t){for(const s in t)this.optionsService.options[s]=t[s]}constructor(t){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new r.InstantiationService,this.optionsService=this.register(new c.OptionsService(t)),this._instantiationService.setService(e.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(o.BufferService)),this._instantiationService.setService(e.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(n.LogService)),this._instantiationService.setService(e.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(a.CoreService)),this._instantiationService.setService(e.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(e.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(e.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(e.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(e.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,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.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((()=>{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((()=>{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 b.WriteBuffer(((t,s)=>this._inputHandler.parse(t,s)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(t,s){this._writeBuffer.write(t,s)}writeSync(t,s){this._logService.logLevel<=e.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(t,s)}input(t,s=!0){this.coreService.triggerDataEvent(t,s)}resize(t,s){isNaN(t)||isNaN(s)||(t=Math.max(t,o.MINIMUM_COLS),s=Math.max(s,o.MINIMUM_ROWS),this._bufferService.resize(t,s))}scroll(t,s=!1){this._bufferService.scroll(t,s)}scrollLines(t,s,i){this._bufferService.scrollLines(t,s,i)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){const s=t-this._bufferService.buffer.ydisp;0!==s&&this.scrollLines(s)}registerEscHandler(t,s){return this._inputHandler.registerEscHandler(t,s)}registerDcsHandler(t,s){return this._inputHandler.registerDcsHandler(t,s)}registerCsiHandler(t,s){return this._inputHandler.registerCsiHandler(t,s)}registerOscHandler(t,s){return this._inputHandler.registerOscHandler(t,s)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let t=!1;const s=this.optionsService.rawOptions.windowsPty;s&&void 0!==s.buildNumber&&void 0!==s.buildNumber?t=!!("conpty"===s.backend&&s.buildNumber<21376):this.optionsService.rawOptions.windowsMode&&(t=!0),t?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const s of t)s.dispose()}))}}}},8460:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let s=0;s<this._listeners.length;s++)if(this._listeners[s]===t)return void this._listeners.splice(s,1)}})),this._event}fire(t,s){const i=[];for(let t=0;t<this._listeners.length;t++)i.push(this._listeners[t]);for(let h=0;h<i.length;h++)i[h].call(void 0,t,s)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(t,s){return t((t=>s.fire(t)))},s.runAndSubscribe=function(t,s){return s(void 0),t((t=>s(t)))}},5435:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const r=i(2584),n=i(7116),o=i(2015),c=i(844),a=i(482),l=i(8437),u=i(8460),f=i(643),d=i(511),v=i(3734),p=i(2585),b=i(1480),w=i(6242),g=i(6351),m=i(5941),_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function k(t,s){if(t>24)return s.setWinLines||!1;switch(t){case 1:return!!s.restoreWin;case 2:return!!s.minimizeWin;case 3:return!!s.setWinPosition;case 4:return!!s.setWinSizePixels;case 5:return!!s.raiseWin;case 6:return!!s.lowerWin;case 7:return!!s.refreshWin;case 8:return!!s.setWinSizeChars;case 9:return!!s.maximizeWin;case 10:return!!s.fullscreenWin;case 11:return!!s.getWinState;case 13:return!!s.getWinPosition;case 14:return!!s.getWinSizePixels;case 15:return!!s.getScreenSizePixels;case 16:return!!s.getCellSizePixels;case 18:return!!s.getWinSizeChars;case 19:return!!s.getScreenSizeChars;case 20:return!!s.getIconTitle;case 21:return!!s.getWinTitle;case 22:return!!s.pushTitle;case 23:return!!s.popTitle;case 24:return!!s.setWinLines}return!1}var M;!function(t){t[t.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",t[t.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(M||(s.WindowsOptionsReportType=M={}));let y=0;s.InputHandler=class extends c.Disposable{getAttrData(){return this._curAttrData}constructor(t,s,i,h,e,c,f,v,p=new o.EscapeSequenceParser){super(),this._bufferService=t,this._charsetService=s,this._coreService=i,this._logService=h,this._optionsService=e,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=v,this._parser=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new a.StringToUtf32,this._utf8Decoder=new a.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 C(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((t=>this._activeBuffer=t.activeBuffer))),this._parser.setCsiHandlerFallback(((t,s)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(t),params:s.toArray()})})),this._parser.setEscHandlerFallback((t=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(t)})})),this._parser.setExecuteHandlerFallback((t=>{this._logService.debug("Unknown EXECUTE code: ",{code:t})})),this._parser.setOscHandlerFallback(((t,s,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:t,action:s,data:i})})),this._parser.setDcsHandlerFallback(((t,s,i)=>{"HOOK"===s&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(t),action:s,payload:i})})),this._parser.setPrintHandler(((t,s,i)=>this.print(t,s,i))),this._parser.registerCsiHandler({final:"@"},(t=>this.insertChars(t))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(t=>this.scrollLeft(t))),this._parser.registerCsiHandler({final:"A"},(t=>this.cursorUp(t))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(t=>this.scrollRight(t))),this._parser.registerCsiHandler({final:"B"},(t=>this.cursorDown(t))),this._parser.registerCsiHandler({final:"C"},(t=>this.cursorForward(t))),this._parser.registerCsiHandler({final:"D"},(t=>this.cursorBackward(t))),this._parser.registerCsiHandler({final:"E"},(t=>this.cursorNextLine(t))),this._parser.registerCsiHandler({final:"F"},(t=>this.cursorPrecedingLine(t))),this._parser.registerCsiHandler({final:"G"},(t=>this.cursorCharAbsolute(t))),this._parser.registerCsiHandler({final:"H"},(t=>this.cursorPosition(t))),this._parser.registerCsiHandler({final:"I"},(t=>this.cursorForwardTab(t))),this._parser.registerCsiHandler({final:"J"},(t=>this.eraseInDisplay(t,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(t=>this.eraseInDisplay(t,!0))),this._parser.registerCsiHandler({final:"K"},(t=>this.eraseInLine(t,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(t=>this.eraseInLine(t,!0))),this._parser.registerCsiHandler({final:"L"},(t=>this.insertLines(t))),this._parser.registerCsiHandler({final:"M"},(t=>this.deleteLines(t))),this._parser.registerCsiHandler({final:"P"},(t=>this.deleteChars(t))),this._parser.registerCsiHandler({final:"S"},(t=>this.scrollUp(t))),this._parser.registerCsiHandler({final:"T"},(t=>this.scrollDown(t))),this._parser.registerCsiHandler({final:"X"},(t=>this.eraseChars(t))),this._parser.registerCsiHandler({final:"Z"},(t=>this.cursorBackwardTab(t))),this._parser.registerCsiHandler({final:"`"},(t=>this.charPosAbsolute(t))),this._parser.registerCsiHandler({final:"a"},(t=>this.hPositionRelative(t))),this._parser.registerCsiHandler({final:"b"},(t=>this.repeatPrecedingCharacter(t))),this._parser.registerCsiHandler({final:"c"},(t=>this.sendDeviceAttributesPrimary(t))),this._parser.registerCsiHandler({prefix:">",final:"c"},(t=>this.sendDeviceAttributesSecondary(t))),this._parser.registerCsiHandler({final:"d"},(t=>this.linePosAbsolute(t))),this._parser.registerCsiHandler({final:"e"},(t=>this.vPositionRelative(t))),this._parser.registerCsiHandler({final:"f"},(t=>this.hVPosition(t))),this._parser.registerCsiHandler({final:"g"},(t=>this.tabClear(t))),this._parser.registerCsiHandler({final:"h"},(t=>this.setMode(t))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(t=>this.setModePrivate(t))),this._parser.registerCsiHandler({final:"l"},(t=>this.resetMode(t))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(t=>this.resetModePrivate(t))),this._parser.registerCsiHandler({final:"m"},(t=>this.charAttributes(t))),this._parser.registerCsiHandler({final:"n"},(t=>this.deviceStatus(t))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(t=>this.deviceStatusPrivate(t))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(t=>this.softReset(t))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(t=>this.setCursorStyle(t))),this._parser.registerCsiHandler({final:"r"},(t=>this.setScrollRegion(t))),this._parser.registerCsiHandler({final:"s"},(t=>this.saveCursor(t))),this._parser.registerCsiHandler({final:"t"},(t=>this.windowOptions(t))),this._parser.registerCsiHandler({final:"u"},(t=>this.restoreCursor(t))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(t=>this.insertColumns(t))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(t=>this.deleteColumns(t))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(t=>this.selectProtected(t))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(t=>this.requestMode(t,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(t=>this.requestMode(t,!1))),this._parser.setExecuteHandler(r.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(r.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(r.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(r.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(r.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(r.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(r.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(r.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(r.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(r.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(r.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(r.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((t=>(this.setTitle(t),this.setIconName(t),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((t=>this.setIconName(t)))),this._parser.registerOscHandler(2,new w.OscHandler((t=>this.setTitle(t)))),this._parser.registerOscHandler(4,new w.OscHandler((t=>this.setOrReportIndexedColor(t)))),this._parser.registerOscHandler(8,new w.OscHandler((t=>this.setHyperlink(t)))),this._parser.registerOscHandler(10,new w.OscHandler((t=>this.setOrReportFgColor(t)))),this._parser.registerOscHandler(11,new w.OscHandler((t=>this.setOrReportBgColor(t)))),this._parser.registerOscHandler(12,new w.OscHandler((t=>this.setOrReportCursorColor(t)))),this._parser.registerOscHandler(104,new w.OscHandler((t=>this.restoreIndexedColor(t)))),this._parser.registerOscHandler(110,new w.OscHandler((t=>this.restoreFgColor(t)))),this._parser.registerOscHandler(111,new w.OscHandler((t=>this.restoreBgColor(t)))),this._parser.registerOscHandler(112,new w.OscHandler((t=>this.restoreCursorColor(t)))),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 t in n.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:t},(()=>this.selectCharset("("+t))),this._parser.registerEscHandler({intermediates:")",final:t},(()=>this.selectCharset(")"+t))),this._parser.registerEscHandler({intermediates:"*",final:t},(()=>this.selectCharset("*"+t))),this._parser.registerEscHandler({intermediates:"+",final:t},(()=>this.selectCharset("+"+t))),this._parser.registerEscHandler({intermediates:"-",final:t},(()=>this.selectCharset("-"+t))),this._parser.registerEscHandler({intermediates:".",final:t},(()=>this.selectCharset("."+t))),this._parser.registerEscHandler({intermediates:"/",final:t},(()=>this.selectCharset("/"+t)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((t=>(this._logService.error("Parsing error: ",t),t))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((t,s)=>this.requestStatusString(t,s))))}_preserveStack(t,s,i,h){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=s,this._parseStack.decodedLength=i,this._parseStack.position=h}_logSlowResolvingAsync(t){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([t,new Promise(((t,s)=>setTimeout((()=>s("#SLOW_TIMEOUT")),5e3)))]).catch((t=>{if("#SLOW_TIMEOUT"!==t)throw t;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,s){let i,h=this._activeBuffer.x,e=this._activeBuffer.y,r=0;const n=this._parseStack.paused;if(n){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,s))return this._logSlowResolvingAsync(i),i;h=this._parseStack.cursorStartX,e=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>x&&(r=this._parseStack.position+x)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof t?` "${t}"`:` "${Array.prototype.map.call(t,(t=>String.fromCharCode(t))).join("")}"`),"string"==typeof t?t.split("").map((t=>t.charCodeAt(0))):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(t.length,x))),n||this._dirtyRowTracker.clearRange(),t.length>x)for(let s=r;s<t.length;s+=x){const r=s+x<t.length?s+x:t.length,n="string"==typeof t?this._stringDecoder.decode(t.substring(s,r),this._parseBuffer):this._utf8Decoder.decode(t.subarray(s,r),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,n))return this._preserveStack(h,e,n,s),this._logSlowResolvingAsync(i),i}else if(!n){const s="string"==typeof t?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,s))return this._preserveStack(h,e,s,0),this._logSlowResolvingAsync(i),i}this._activeBuffer.x===h&&this._activeBuffer.y===e||this._onCursorMove.fire();const o=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(c,this._bufferService.rows-1),Math.min(o,this._bufferService.rows-1))}print(t,s,i){let h,e;const r=this._charsetService.charset,n=this._optionsService.rawOptions.screenReaderMode,o=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData;let v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-s>0&&2===v.getWidth(this._activeBuffer.x-1)&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let p=this._parser.precedingJoinState;for(let w=s;w<i;++w){if(h=t[w],h<127&&r){const t=r[String.fromCharCode(h)];t&&(h=t.charCodeAt(0))}const s=this._unicodeService.charProperties(h,p);e=b.UnicodeService.extractWidth(s);const i=b.UnicodeService.extractShouldJoin(s),g=i?b.UnicodeService.extractWidth(p):0;if(p=s,n&&this._onA11yChar.fire((0,a.stringFromCodePoint)(h)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+e-g>o)if(c){const t=v;let s=this._activeBuffer.x-g;for(this._activeBuffer.x=g,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),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),g>0&&v instanceof l.BufferLine&&v.copyCellsFrom(t,s,0,g,!1);s<o;)t.setCellFromCodepoint(s++,0,1,d)}else if(this._activeBuffer.x=o-1,2===e)continue;if(i&&this._activeBuffer.x){const t=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-t,h,e);for(let t=e-g;--t>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}else if(u&&(v.insertCells(this._activeBuffer.x,e-g,this._activeBuffer.getNullCell(d)),2===v.getWidth(o-1)&&v.setCellFromCodepoint(o-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,d)),v.setCellFromCodepoint(this._activeBuffer.x++,h,e,d),e>0)for(;--e;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=p,this._activeBuffer.x<o&&i-s>0&&0===v.getWidth(this._activeBuffer.x)&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,s){return this._parser.registerCsiHandler(t,"t"!==t.final||t.prefix||t.intermediates?s:t=>!k(t.params[0],this._optionsService.rawOptions.windowOptions)||s(t))}registerDcsHandler(t,s){return this._parser.registerDcsHandler(t,new g.DcsHandler(s))}registerEscHandler(t,s){return this._parser.registerEscHandler(t,s)}registerOscHandler(t,s){return this._parser.registerOscHandler(t,new w.OscHandler(s))}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(){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(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.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 t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,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(t,s){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+s):(this._activeBuffer.x=t,this._activeBuffer.y=s),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,s){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+s)}cursorUp(t){const s=this._activeBuffer.y-this._activeBuffer.scrollTop;return this._moveCursor(0,s>=0?-Math.min(s,t.params[0]||1):-(t.params[0]||1)),!0}cursorDown(t){const s=this._activeBuffer.scrollBottom-this._activeBuffer.y;return this._moveCursor(0,s>=0?Math.min(s,t.params[0]||1):t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){const s=t.params[0];return 0===s?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===s&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let s=t.params[0]||1;for(;s--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let s=t.params[0]||1;for(;s--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){const s=t.params[0];return 1===s&&(this._curAttrData.bg|=536870912),2!==s&&0!==s||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,s,i,h=!1,e=!1){const r=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);r.replaceCells(s,i,this._activeBuffer.getNullCell(this._eraseAttrData()),e),h&&(r.isWrapped=!1)}_resetBufferLine(t,s=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),s),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,s=!1){let i;switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,s);i<this._bufferService.rows;i++)this._resetBufferLine(i,s);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,s),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,s);this._dirtyRowTracker.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,s);this._dirtyRowTracker.markDirty(0);break;case 3:const t=this._activeBuffer.lines.length-this._bufferService.rows;t>0&&(this._activeBuffer.lines.trimStart(t),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-t,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-t,0),this._onScroll.fire(0))}return!0}eraseInLine(t,s=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,s);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,s);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,s)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let s=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const i=this._activeBuffer.ybase+this._activeBuffer.y,h=this._bufferService.rows-1+this._activeBuffer.ybase-(this._bufferService.rows-1-this._activeBuffer.scrollBottom)+1;for(;s--;)this._activeBuffer.lines.splice(h-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let s=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const i=this._activeBuffer.ybase+this._activeBuffer.y;let h;for(h=this._bufferService.rows-1-this._activeBuffer.scrollBottom,h=this._bufferService.rows-1+this._activeBuffer.ybase-h;s--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(h,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();const s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();const s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let s=t.params[0]||1;for(;s--;)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(t){let s=t.params[0]||1;for(;s--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const s=t.params[0]||1;for(let t=this._activeBuffer.scrollTop;t<=this._activeBuffer.scrollBottom;++t){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i.deleteCells(0,s,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const s=t.params[0]||1;for(let t=this._activeBuffer.scrollTop;t<=this._activeBuffer.scrollBottom;++t){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i.insertCells(0,s,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const s=t.params[0]||1;for(let t=this._activeBuffer.scrollTop;t<=this._activeBuffer.scrollBottom;++t){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i.insertCells(this._activeBuffer.x,s,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const s=t.params[0]||1;for(let t=this._activeBuffer.scrollTop;t<=this._activeBuffer.scrollBottom;++t){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i.deleteCells(this._activeBuffer.x,s,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();const s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return s&&(s.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){const s=this._parser.precedingJoinState;if(!s)return!0;const i=t.params[0]||1,h=b.UnicodeService.extractWidth(s),e=this._activeBuffer.x-h,r=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(e),n=new Uint32Array(r.length*i);let o=0;for(let t=0;t<r.length;){const s=r.codePointAt(t)||0;n[o++]=s,t+=s>65535?2:1}let c=o;for(let t=1;t<i;++t)n.copyWithin(c,0,o),c+=o;return this.print(n,0,c),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(r.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(r.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(r.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(r.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(r.C0.ESC+"[>83;40003;0c")),!0}_is(t){return 0===(this._optionsService.rawOptions.termName+"").indexOf(t)}setMode(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,n.DEFAULT_CHARSET),this._charsetService.setgCharset(1,n.DEFAULT_CHARSET),this._charsetService.setgCharset(2,n.DEFAULT_CHARSET),this._charsetService.setgCharset(3,n.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(t){for(let s=0;s<t.length;s++)switch(t.params[s]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(t){for(let s=0;s<t.length;s++)switch(t.params[s]){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(),1049===t.params[s]&&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(t,s){const i=this._coreService.decPrivateModes,{activeProtocol:h,activeEncoding:e}=this._coreMouseService,n=this._coreService,{buffers:o,cols:c}=this._bufferService,{active:a,alt:l}=o,u=this._optionsService.rawOptions,f=t=>t?1:2,d=t.params[0];return v=d,p=s?2===d?4:4===d?f(n.modes.insertMode):12===d?3:20===d?f(u.convertEol):0:1===d?f(i.applicationCursorKeys):3===d?u.windowOptions.setWinLines?80===c?2:132===c?1:0:0:6===d?f(i.origin):7===d?f(i.wraparound):8===d?3:9===d?f("X10"===h):12===d?f(u.cursorBlink):25===d?f(!n.isCursorHidden):45===d?f(i.reverseWraparound):66===d?f(i.applicationKeypad):67===d?4:1e3===d?f("VT200"===h):1002===d?f("DRAG"===h):1003===d?f("ANY"===h):1004===d?f(i.sendFocus):1005===d?4:1006===d?f("SGR"===e):1015===d?4:1016===d?f("SGR_PIXELS"===e):1048===d?1:47===d||1047===d||1049===d?f(a===l):2004===d?f(i.bracketedPasteMode):0,n.triggerDataEvent(`${r.C0.ESC}[${s?"":"?"}${v};${p}$y`),!0;var v,p}_updateAttrColor(t,s,i,h,e){return 2===s?(t|=50331648,t&=-16777216,t|=v.AttributeData.fromColorRGB([i,h,e])):5===s&&(t&=-50331904,t|=33554432|255&i),t}_extractColor(t,s,i){const h=[0,0,-1,0,0,0];let e=0,r=0;do{if(h[r+e]=t.params[s+r],t.hasSubParams(s+r)){const i=t.getSubParams(s+r);let n=0;do{5===h[1]&&(e=1),h[r+n+1+e]=i[n]}while(++n<i.length&&n+r+1+e<h.length);break}if(5===h[1]&&r+e>=2||2===h[1]&&r+e>=5)break;h[1]&&(e=1)}while(++r+s<t.length&&r+e<h.length);for(let t=2;t<h.length;++t)-1===h[t]&&(h[t]=0);switch(h[0]){case 38:i.fg=this._updateAttrColor(i.fg,h[1],h[3],h[4],h[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,h[1],h[3],h[4],h[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,h[1],h[3],h[4],h[5])}return r}_processUnderline(t,s){s.extended=s.extended.clone(),(!~t||t>5)&&(t=1),s.extended.underlineStyle=t,s.fg|=268435456,0===t&&(s.fg&=-268435457),s.updateExtended()}_processSGR0(t){t.fg=l.DEFAULT_ATTR_DATA.fg,t.bg=l.DEFAULT_ATTR_DATA.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(1===t.length&&0===t.params[0])return this._processSGR0(this._curAttrData),!0;const s=t.length;let i;const h=this._curAttrData;for(let e=0;e<s;e++)i=t.params[e],i>=30&&i<=37?(h.fg&=-50331904,h.fg|=16777216|i-30):i>=40&&i<=47?(h.bg&=-50331904,h.bg|=16777216|i-40):i>=90&&i<=97?(h.fg&=-50331904,h.fg|=16777224|i-90):i>=100&&i<=107?(h.bg&=-50331904,h.bg|=16777224|i-100):0===i?this._processSGR0(h):1===i?h.fg|=134217728:3===i?h.bg|=67108864:4===i?(h.fg|=268435456,this._processUnderline(t.hasSubParams(e)?t.getSubParams(e)[0]:1,h)):5===i?h.fg|=536870912:7===i?h.fg|=67108864:8===i?h.fg|=1073741824:9===i?h.fg|=2147483648:2===i?h.bg|=134217728:21===i?this._processUnderline(2,h):22===i?(h.fg&=-134217729,h.bg&=-134217729):23===i?h.bg&=-67108865:24===i?(h.fg&=-268435457,this._processUnderline(0,h)):25===i?h.fg&=-536870913:27===i?h.fg&=-67108865:28===i?h.fg&=-1073741825:29===i?h.fg&=2147483647:39===i?(h.fg&=-67108864,h.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):49===i?(h.bg&=-67108864,h.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?e+=this._extractColor(t,e,h):53===i?h.bg|=1073741824:55===i?h.bg&=-1073741825:59===i?(h.extended=h.extended.clone(),h.extended.underlineColor=-1,h.updateExtended()):100===i?(h.fg&=-67108864,h.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,h.bg&=-67108864,h.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${r.C0.ESC}[0n`);break;case 6:this._coreService.triggerDataEvent(`${r.C0.ESC}[${this._activeBuffer.y+1};${this._activeBuffer.x+1}R`)}return!0}deviceStatusPrivate(t){return 6===t.params[0]&&this._coreService.triggerDataEvent(`${r.C0.ESC}[?${this._activeBuffer.y+1};${this._activeBuffer.x+1}R`),!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(t){const s=t.params[0]||1;switch(s){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"}return this._optionsService.options.cursorBlink=s%2==1,!0}setScrollRegion(t){const s=t.params[0]||1;let i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>s&&(this._activeBuffer.scrollTop=s-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!k(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;const s=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:2!==s&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${r.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==s&&2!==s||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==s&&1!==s||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==s&&2!==s||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==s&&1!==s||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(t){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(t){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(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){const s=[],i=t.split(";");for(;i.length>1;){const t=i.shift(),h=i.shift();if(/^\d+$/.exec(t)){const i=parseInt(t);if(O(i))if("?"===h)s.push({type:0,index:i});else{const t=(0,m.parseColor)(h);t&&s.push({type:1,index:i,color:t})}}}return s.length&&this._onColor.fire(s),!0}setHyperlink(t){const s=t.split(";");return!(s.length<2)&&(s[1]?this._createHyperlink(s[0],s[1]):!s[0]&&this._finishHyperlink())}_createHyperlink(t,s){this._getCurrentLinkId()&&this._finishHyperlink();const i=t.split(":");let h;const e=i.findIndex((t=>t.startsWith("id=")));return-1!==e&&(h=i[e].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:h,uri:s}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,s){const i=t.split(";");for(let t=0;t<i.length&&!(s>=this._specialColors.length);++t,++s)if("?"===i[t])this._onColor.fire([{type:0,index:this._specialColors[s]}]);else{const h=(0,m.parseColor)(i[t]);h&&this._onColor.fire([{type:1,index:this._specialColors[s],color:h}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;const s=[],i=t.split(";");for(let t=0;t<i.length;++t)if(/^\d+$/.exec(i[t])){const h=parseInt(i[t]);O(h)&&s.push({type:2,index:h})}return s.length&&this._onColor.fire(s),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){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,n.DEFAULT_CHARSET),!0}selectCharset(t){return 2!==t.length?(this.selectDefaultCharset(),!0):("/"===t[0]||this._charsetService.setgCharset(_[t[0]],n.CHARSETS[t[1]]||n.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(){return this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop?(this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop,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)):(this._activeBuffer.y--,this._restrictCursor()),!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){const t=new d.CellData;t.content=1<<22|"E".charCodeAt(0),t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let s=0;s<this._bufferService.rows;++s){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y+s);i&&(i.fill(t),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,s){const i=this._bufferService.buffer,h=this._optionsService.rawOptions;return(t=>(this._coreService.triggerDataEvent(`${r.C0.ESC}${t}${r.C0.ESC}\\`),!0))('"q'===t?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===t?'P1$r61;1"p':"r"===t?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===t?"P1$r0m":" q"===t?`P1$r${{block:2,underline:4,bar:6}[h.cursorStyle]-(h.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,s){this._dirtyRowTracker.markRangeDirty(t,s)}};let C=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,s){t>s&&(y=t,t=s,s=y),t<this.start&&(this.start=t),s>this.end&&(this.end=s)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function O(t){return 0<=t&&t<256}C=h([e(0,p.IBufferService)],C)},844:(t,s)=>{function i(t){for(const s of t)s.dispose();t.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const t of this._disposables)t.dispose();this._disposables.length=0}register(t){return this._disposables.push(t),t}unregister(t){const s=this._disposables.indexOf(t);-1!==s&&this._disposables.splice(s,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},s.toDisposable=function(t){return{dispose:t}},s.disposeArray=i,s.getDisposeArrayDisposable=function(t){return{dispose:()=>i(t)}}},1505:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(t,s,i){this._data[t]||(this._data[t]={}),this._data[t][s]=i}get(t,s){return this._data[t]?this._data[t][s]:void 0}clear(){this._data={}}}s.TwoKeyMap=i,s.FourKeyMap=class{constructor(){this._data=new i}set(t,s,h,e,r){this._data.get(t,s)||this._data.set(t,s,new i),this._data.get(t,s).set(h,e,r)}get(t,s,i,h){return this._data.get(t,s)?.get(i,h)}clear(){this._data.clear()}}},6114:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode="undefined"!=typeof process&&"title"in process;const i=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=i.includes("Firefox"),s.isLegacyEdge=i.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(i),s.getSafariVersion=function(){if(!s.isSafari)return 0;const t=i.match(/Version\/(\d+)/);return null===t||t.length<2?0:parseInt(t[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad="iPad"===h,s.isIphone="iPhone"===h,s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(i)},6106:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let i=0;s.SortedList=class{constructor(t){this._getKey=t,this._array=[]}clear(){this._array.length=0}insert(t){0!==this._array.length?(i=this._search(this._getKey(t)),this._array.splice(i,0,t)):this._array.push(t)}delete(t){if(0===this._array.length)return!1;const s=this._getKey(t);if(void 0===s)return!1;if(i=this._search(s),-1===i)return!1;if(this._getKey(this._array[i])!==s)return!1;do{if(this._array[i]===t)return this._array.splice(i,1),!0}while(++i<this._array.length&&this._getKey(this._array[i])===s);return!1}*getKeyIterator(t){if(0!==this._array.length&&(i=this._search(t),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===t))do{yield this._array[i]}while(++i<this._array.length&&this._getKey(this._array[i])===t)}forEachByKey(t,s){if(0!==this._array.length&&(i=this._search(t),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===t))do{s(this._array[i])}while(++i<this._array.length&&this._getKey(this._array[i])===t)}values(){return[...this._array].values()}_search(t){let s=0,i=this._array.length-1;for(;i>=s;){let h=s+i>>1;const e=this._getKey(this._array[h]);if(e>t)i=h-1;else{if(!(e<t)){for(;h>0&&this._getKey(this._array[h-1])===t;)h--;return h}s=h+1}}return s}}},7226:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=i(6114);class e{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let s=0,i=0,h=t.timeRemaining(),e=0;for(;this._i<this._tasks.length;){if(s=Date.now(),this._tasks[this._i]()||this._i++,s=Math.max(1,Date.now()-s),i=Math.max(s,i),e=t.timeRemaining(),1.5*i>e)return h-s<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-s))}ms`),void this._start();h=e}this.clear()}}class r extends e{_requestCallback(t){return setTimeout((()=>t(this._createDeadline(16))))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){const s=Date.now()+t;return{timeRemaining:()=>Math.max(0,s-Date.now())}}}s.PriorityTaskQueue=r,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends e{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}}:r,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}}},9282:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=i(643);s.updateWindowsModeWrappedState=function(t){const s=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1),i=s?.get(t.cols-1),e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);e&&i&&(e.isWrapped=i[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&i[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(t){return[t>>>16&255,t>>>8&255,255&t]}static fromColorRGB(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]}clone(){const t=new i;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=i;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(t){this._ext&=-67108864,this._ext|=67108863&t}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){const t=(3758096384&this._ext)>>29;return t<0?4294967288^t:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}clone(){return new h(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}s.ExtendedAttrs=h},9092:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=i(6349),e=i(7226),r=i(3734),n=i(8437),o=i(4634),c=i(511),a=i(643),l=i(4863),u=i(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(t,s,i){this._hasScrollback=t,this._optionsService=s,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,a.WHITESPACE_CELL_CHAR,a.WHITESPACE_CELL_WIDTH,a.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new e.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new r.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new r.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,s){return new n.BufferLine(this._bufferService.cols,this.getNullCell(t),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const i=t+this._optionsService.rawOptions.scrollback;return i>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:i}fillViewportRows(t){if(0===this.lines.length){void 0===t&&(t=n.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,s){const i=this.getNullCell(n.DEFAULT_ATTR_DATA);let h=0;const e=this._getCorrectBufferLength(s);if(e>this.lines.maxLength&&(this.lines.maxLength=e),this.lines.length>0){if(this._cols<t)for(let s=0;s<this.lines.length;s++)h+=+this.lines.get(s).resize(t,i);let r=0;if(this._rows<s)for(let h=this._rows;h<s;h++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||void 0!==this._optionsService.rawOptions.windowsPty.backend||void 0!==this._optionsService.rawOptions.windowsPty.buildNumber?this.lines.push(new n.BufferLine(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+r+1?(this.ybase--,r++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(t,i)));else for(let t=this._rows;t>s;t--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(e<this.lines.maxLength){const t=this.lines.length-e;t>0&&(this.lines.trimStart(t),this.ybase=Math.max(this.ybase-t,0),this.ydisp=Math.max(this.ydisp-t,0),this.savedY=Math.max(this.savedY-t,0)),this.lines.maxLength=e}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,s-1),r&&(this.y+=r),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(t,s),this._cols>t))for(let s=0;s<this.lines.length;s++)h+=+this.lines.get(s).resize(t,i);this._cols=t,this._rows=s,this._memoryCleanupQueue.clear(),h>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&"conpty"===t.backend&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,s){this._cols!==t&&(t>this._cols?this._reflowLarger(t,s):this._reflowSmaller(t,s))}_reflowLarger(t,s){const i=(0,o.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(i.length>0){const h=(0,o.reflowLargerCreateNewLayout)(this.lines,i);(0,o.reflowLargerApplyNewLayout)(this.lines,h.layout),this._reflowLargerAdjustViewport(t,s,h.countRemoved)}}_reflowLargerAdjustViewport(t,s,i){const h=this.getNullCell(n.DEFAULT_ATTR_DATA);let e=i;for(;e-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new n.BufferLine(t,h))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,s){const i=this.getNullCell(n.DEFAULT_ATTR_DATA),h=[];let e=0;for(let r=this.lines.length-1;r>=0;r--){let c=this.lines.get(r);if(!c||!c.isWrapped&&c.getTrimmedLength()<=t)continue;const a=[c];for(;c.isWrapped&&r>0;)c=this.lines.get(--r),a.unshift(c);const l=this.ybase+this.y;if(l>=r&&l<r+a.length)continue;const u=a[a.length-1].getTrimmedLength(),f=(0,o.reflowSmallerGetNewLineLengths)(a,this._cols,t),d=f.length-a.length;let v;v=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);const p=[];for(let t=0;t<d;t++){const t=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);p.push(t)}p.length>0&&(h.push({start:r+a.length+e,newLines:p}),e+=p.length),a.push(...p);let b=f.length-1,w=f[b];0===w&&(b--,w=f[b]);let g=a.length-d-1,m=u;for(;g>=0;){const t=Math.min(m,w);if(void 0===a[b])break;if(a[b].copyCellsFrom(a[g],m-t,w-t,t,!0),w-=t,0===w&&(b--,w=f[b]),m-=t,0===m){g--;const t=Math.max(g,0);m=(0,o.getWrappedLineTrimmedLength)(a,t,this._cols)}}for(let s=0;s<a.length;s++)f[s]<t&&a[s].setCell(f[s],i);let _=d-v;for(;_-- >0;)0===this.ybase?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+e)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+s-1)}if(h.length>0){const t=[],s=[];for(let t=0;t<this.lines.length;t++)s.push(this.lines.get(t));const i=this.lines.length;let r=i-1,n=0,o=h[n];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+e);let c=0;for(let a=Math.min(this.lines.maxLength-1,i+e-1);a>=0;a--)if(o&&o.start>r+c){for(let t=o.newLines.length-1;t>=0;t--)this.lines.set(a--,o.newLines[t]);a++,t.push({index:r+1,amount:o.newLines.length}),c+=o.newLines.length,o=h[++n]}else this.lines.set(a,s[r--]);let a=0;for(let s=t.length-1;s>=0;s--)t[s].index+=a,this.lines.onInsertEmitter.fire(t[s]),a+=t[s].amount;const l=Math.max(0,i+e-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}translateBufferLineToString(t,s,i=0,h){const e=this.lines.get(t);return e?e.translateToString(s,i,h):""}getWrappedRangeForLine(t){let s=t,i=t;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:s,last:i}}setupTabStops(t){for(null!=t?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(null==t&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===t&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const s=new l.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim((t=>{s.line-=t,s.line<0&&s.dispose()}))),s.register(this.lines.onInsert((t=>{s.line>=t.index&&(s.line+=t.amount)}))),s.register(this.lines.onDelete((t=>{s.line>=t.index&&s.line<t.index+t.amount&&s.dispose(),s.line>t.index&&(s.line-=t.amount)}))),s.register(s.onDispose((()=>this._removeMarker(s)))),s}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=i(3734),e=i(511),r=i(643),n=i(482);s.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let o=0;class c{constructor(t,s,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const h=s||e.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let s=0;s<t;++s)this.setCell(s,h);this.length=t}get(t){const s=this._data[3*t+0],i=2097151&s;return[this._data[3*t+1],2097152&s?this._combined[t]:i?(0,n.stringFromCodePoint)(i):"",s>>22,2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,s){this._data[3*t+1]=s[r.CHAR_DATA_ATTR_INDEX],s[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=s[1],this._data[3*t+0]=2097152|t|s[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=s[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const s=this._data[3*t+0];return 2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&s}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const s=this._data[3*t+0];return 2097152&s?this._combined[t]:2097151&s?(0,n.stringFromCodePoint)(2097151&s):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,s){return o=3*t,s.content=this._data[o+0],s.fg=this._data[o+1],s.bg=this._data[o+2],2097152&s.content&&(s.combinedData=this._combined[t]),268435456&s.bg&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){2097152&s.content&&(this._combined[t]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=s.content,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}setCellFromCodepoint(t,s,i,h){268435456&h.bg&&(this._extendedAttrs[t]=h.extended),this._data[3*t+0]=s|i<<22,this._data[3*t+1]=h.fg,this._data[3*t+2]=h.bg}addCodepointToCell(t,s,i){let h=this._data[3*t+0];2097152&h?this._combined[t]+=(0,n.stringFromCodePoint)(s):2097151&h?(this._combined[t]=(0,n.stringFromCodePoint)(2097151&h)+(0,n.stringFromCodePoint)(s),h&=-2097152,h|=2097152):h=s|1<<22,i&&(h&=-12582913,h|=i<<22),this._data[3*t+0]=h}insertCells(t,s,i){if((t%=this.length)&&2===this.getWidth(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length-t){const h=new e.CellData;for(let i=this.length-t-s-1;i>=0;--i)this.setCell(t+s+i,this.loadCell(t+i,h));for(let h=0;h<s;++h)this.setCell(t+h,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);2===this.getWidth(this.length-1)&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,s,i){if(s<this.length-(t%=this.length)){const h=new e.CellData;for(let i=0;i<this.length-t-s;++i)this.setCell(t+i,this.loadCell(t+s+i,h));for(let t=this.length-s;t<this.length;++t)this.setCell(t,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);t&&2===this.getWidth(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),0!==this.getWidth(t)||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,s,i,h=!1){if(h)for(t&&2===this.getWidth(t-1)&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length&&2===this.getWidth(s-1)&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,i);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;else for(t&&2===this.getWidth(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),s<this.length&&2===this.getWidth(s-1)&&this.setCellFromCodepoint(s,0,1,i);t<s&&t<this.length;)this.setCell(t++,i)}resize(t,s){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const t=new Uint32Array(i);t.set(this._data),this._data=t}for(let i=this.length;i<t;++i)this.setCell(i,s)}else{this._data=this._data.subarray(0,i);const s=Object.keys(this._combined);for(let i=0;i<s.length;i++){const h=parseInt(s[i],10);h>=t&&delete this._combined[h]}const h=Object.keys(this._extendedAttrs);for(let s=0;s<h.length;s++){const i=parseInt(h[s],10);i>=t&&delete this._extendedAttrs[i]}}return this.length=t,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(const s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){const t=new c(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const s in this._combined)t._combined[s]=this._combined[s];for(const s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,s,i,h,e){const r=t._data;if(e)for(let e=h-1;e>=0;e--){for(let t=0;t<3;t++)this._data[3*(i+e)+t]=r[3*(s+e)+t];268435456&r[3*(s+e)+2]&&(this._extendedAttrs[i+e]=t._extendedAttrs[s+e])}else for(let e=0;e<h;e++){for(let t=0;t<3;t++)this._data[3*(i+e)+t]=r[3*(s+e)+t];268435456&r[3*(s+e)+2]&&(this._extendedAttrs[i+e]=t._extendedAttrs[s+e])}const n=Object.keys(t._combined);for(let h=0;h<n.length;h++){const e=parseInt(n[h],10);e>=s&&(this._combined[e-s+i]=t._combined[e])}}translateToString(t,s,i,h){s=s??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),h&&(h.length=0);let e="";for(;s<i;){const t=this._data[3*s+0],i=2097151&t,o=2097152&t?this._combined[s]:i?(0,n.stringFromCodePoint)(i):r.WHITESPACE_CELL_CHAR;if(e+=o,h)for(let t=0;t<o.length;++t)h.push(s);s+=t>>22||1}return h&&h.push(s),e}}s.BufferLine=c},4841:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(t,s){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return s*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}},4634:(t,s)=>{function i(t,s,i){if(s===t.length-1)return t[s].getTrimmedLength();const h=!t[s].hasContent(i-1)&&1===t[s].getWidth(i-1),e=2===t[s+1].getWidth(0);return h&&e?i-1:i}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(t,s,h,e,r){const n=[];for(let o=0;o<t.length-1;o++){let c=o,a=t.get(++c);if(!a.isWrapped)continue;const l=[t.get(o)];for(;c<t.length&&a.isWrapped;)l.push(a),a=t.get(++c);if(e>=o&&e<c){o+=l.length-1;continue}let u=0,f=i(l,u,s),d=1,v=0;for(;d<l.length;){const t=i(l,d,s),e=Math.min(t-v,h-f);l[u].copyCellsFrom(l[d],v,f,e,!1),f+=e,f===h&&(u++,f=0),v+=e,v===t&&(d++,v=0),0===f&&0!==u&&2===l[u-1].getWidth(h-1)&&(l[u].copyCellsFrom(l[u-1],h-1,f++,1,!1),l[u-1].setCell(h-1,r))}l[u].replaceCells(f,h,r);let p=0;for(let t=l.length-1;t>0&&(t>u||0===l[t].getTrimmedLength());t--)p++;p>0&&(n.push(o+l.length-p),n.push(p)),o+=l.length-1}return n},s.reflowLargerCreateNewLayout=function(t,s){const i=[];let h=0,e=s[h],r=0;for(let n=0;n<t.length;n++)if(e===n){const i=s[++h];t.onDeleteEmitter.fire({index:n-r,amount:i}),n+=i-1,r+=i,e=s[++h]}else i.push(n);return{layout:i,countRemoved:r}},s.reflowLargerApplyNewLayout=function(t,s){const i=[];for(let h=0;h<s.length;h++)i.push(t.get(s[h]));for(let s=0;s<i.length;s++)t.set(s,i[s]);t.length=s.length},s.reflowSmallerGetNewLineLengths=function(t,s,h){const e=[],r=t.map(((h,e)=>i(t,e,s))).reduce(((t,s)=>t+s));let n=0,o=0,c=0;for(;c<r;){if(r-c<h){e.push(r-c);break}n+=h;const a=i(t,o,s);n>a&&(n-=a,o++);const l=2===t[o].getWidth(n-1);l&&n--;const u=l?h-1:h;e.push(u),c+=u}return e},s.getWrappedLineTrimmedLength=i},5295:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=i(8460),e=i(844),r=i(9092);s.BufferSet=class extends e.Disposable{constructor(t,s){super(),this._optionsService=t,this._bufferService=s,this._onBufferActivate=this.register(new h.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 r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.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(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),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(t,s){this._normal.resize(t,s),this._alt.resize(t,s),this.setupTabStops(t)}setupTabStops(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)}}},511:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=i(482),e=i(643),r=i(3734);class n extends r.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new r.ExtendedAttrs,this.combinedData=""}static fromCharData(t){const s=new n;return s.setFromCharData(t),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(t){this.fg=t[e.CHAR_DATA_ATTR_INDEX],this.bg=0;let s=!1;if(t[e.CHAR_DATA_CHAR_INDEX].length>2)s=!0;else if(2===t[e.CHAR_DATA_CHAR_INDEX].length){const i=t[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const h=t[e.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(i-55296)+h-56320+65536|t[e.CHAR_DATA_WIDTH_INDEX]<<22:s=!0}else s=!0}else this.content=t[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[e.CHAR_DATA_WIDTH_INDEX]<<22;s&&(this.combinedData=t[e.CHAR_DATA_CHAR_INDEX],this.content=2097152|t[e.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=n},643:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=i(8460),e=i(844);class r{get id(){return this._id}constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=r._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,e.disposeArray)(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}}s.Marker=r,r._nextId=1},7116:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(t,s)=>{var i,h,e;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(t){t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="",t.BS="\b",t.HT="\t",t.LF="\n",t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""}(i||(s.C0=i={})),function(t){t.PAD="",t.HOP="",t.BPH="",t.NBH="",t.IND="",t.NEL="
",t.SSA="",t.ESA="",t.HTS="",t.HTJ="",t.VTS="",t.PLD="",t.PLU="",t.RI="",t.SS2="",t.SS3="",t.DCS="",t.PU1="",t.PU2="",t.STS="",t.CCH="",t.MW="",t.SPA="",t.EPA="",t.SOS="",t.SGCI="",t.SCI="",t.CSI="",t.ST="",t.OSC="",t.PM="",t.APC=""}(h||(s.C1=h={})),function(t){t.ST=`${i.ESC}\\`}(e||(s.C1_ESCAPED=e={}))},7399:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=i(2584),e={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:["'",'"']};s.evaluateKeyboardEvent=function(t,s,i,r){const n={type:0,cancel:!1,key:void 0},o=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?n.key=s?h.C0.ESC+"OA":h.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?n.key=s?h.C0.ESC+"OD":h.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?n.key=s?h.C0.ESC+"OC":h.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(n.key=s?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:n.key=t.ctrlKey?"\b":h.C0.DEL,t.altKey&&(n.key=h.C0.ESC+n.key);break;case 9:if(t.shiftKey){n.key=h.C0.ESC+"[Z";break}n.key=h.C0.HT,n.cancel=!0;break;case 13:n.key=t.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,n.cancel=!0;break;case 27:n.key=h.C0.ESC,t.altKey&&(n.key=h.C0.ESC+h.C0.ESC),n.cancel=!0;break;case 37:if(t.metaKey)break;o?(n.key=h.C0.ESC+"[1;"+(o+1)+"D",n.key===h.C0.ESC+"[1;3D"&&(n.key=h.C0.ESC+(i?"b":"[1;5D"))):n.key=s?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(t.metaKey)break;o?(n.key=h.C0.ESC+"[1;"+(o+1)+"C",n.key===h.C0.ESC+"[1;3C"&&(n.key=h.C0.ESC+(i?"f":"[1;5C"))):n.key=s?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(t.metaKey)break;o?(n.key=h.C0.ESC+"[1;"+(o+1)+"A",i||n.key!==h.C0.ESC+"[1;3A"||(n.key=h.C0.ESC+"[1;5A")):n.key=s?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(t.metaKey)break;o?(n.key=h.C0.ESC+"[1;"+(o+1)+"B",i||n.key!==h.C0.ESC+"[1;3B"||(n.key=h.C0.ESC+"[1;5B")):n.key=s?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(n.key=h.C0.ESC+"[2~");break;case 46:n.key=o?h.C0.ESC+"[3;"+(o+1)+"~":h.C0.ESC+"[3~";break;case 36:n.key=o?h.C0.ESC+"[1;"+(o+1)+"H":s?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:n.key=o?h.C0.ESC+"[1;"+(o+1)+"F":s?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:t.shiftKey?n.type=2:n.key=t.ctrlKey?h.C0.ESC+"[5;"+(o+1)+"~":h.C0.ESC+"[5~";break;case 34:t.shiftKey?n.type=3:n.key=t.ctrlKey?h.C0.ESC+"[6;"+(o+1)+"~":h.C0.ESC+"[6~";break;case 112:n.key=o?h.C0.ESC+"[1;"+(o+1)+"P":h.C0.ESC+"OP";break;case 113:n.key=o?h.C0.ESC+"[1;"+(o+1)+"Q":h.C0.ESC+"OQ";break;case 114:n.key=o?h.C0.ESC+"[1;"+(o+1)+"R":h.C0.ESC+"OR";break;case 115:n.key=o?h.C0.ESC+"[1;"+(o+1)+"S":h.C0.ESC+"OS";break;case 116:n.key=o?h.C0.ESC+"[15;"+(o+1)+"~":h.C0.ESC+"[15~";break;case 117:n.key=o?h.C0.ESC+"[17;"+(o+1)+"~":h.C0.ESC+"[17~";break;case 118:n.key=o?h.C0.ESC+"[18;"+(o+1)+"~":h.C0.ESC+"[18~";break;case 119:n.key=o?h.C0.ESC+"[19;"+(o+1)+"~":h.C0.ESC+"[19~";break;case 120:n.key=o?h.C0.ESC+"[20;"+(o+1)+"~":h.C0.ESC+"[20~";break;case 121:n.key=o?h.C0.ESC+"[21;"+(o+1)+"~":h.C0.ESC+"[21~";break;case 122:n.key=o?h.C0.ESC+"[23;"+(o+1)+"~":h.C0.ESC+"[23~";break;case 123:n.key=o?h.C0.ESC+"[24;"+(o+1)+"~":h.C0.ESC+"[24~";break;default:if(!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)if(i&&!r||!t.altKey||t.metaKey)!i||t.altKey||t.ctrlKey||t.shiftKey||!t.metaKey?t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&1===t.key.length?n.key=t.key:t.key&&t.ctrlKey&&("_"===t.key&&(n.key=h.C0.US),"@"===t.key&&(n.key=h.C0.NUL)):65===t.keyCode&&(n.type=1);else{const s=e[t.keyCode],i=s?.[t.shiftKey?1:0];if(i)n.key=h.C0.ESC+i;else if(t.keyCode>=65&&t.keyCode<=90){let s=String.fromCharCode(t.ctrlKey?t.keyCode-64:t.keyCode+32);t.shiftKey&&(s=s.toUpperCase()),n.key=h.C0.ESC+s}else if(32===t.keyCode)n.key=h.C0.ESC+(t.ctrlKey?h.C0.NUL:" ");else if("Dead"===t.key&&t.code.startsWith("Key")){let s=t.code.slice(3,4);t.shiftKey||(s=s.toLowerCase()),n.key=h.C0.ESC+s,n.cancel=!0}}else t.keyCode>=65&&t.keyCode<=90?n.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?n.key=h.C0.NUL:t.keyCode>=51&&t.keyCode<=55?n.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?n.key=h.C0.DEL:219===t.keyCode?n.key=h.C0.ESC:220===t.keyCode?n.key=h.C0.FS:221===t.keyCode&&(n.key=h.C0.GS)}return n}},482:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(t){return t>65535?(t-=65536,String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},s.utf32ToString=function(t,s=0,i=t.length){let h="";for(let e=s;e<i;++e){let s=t[e];s>65535?(s-=65536,h+=String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):h+=String.fromCharCode(s)}return h},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,s){const i=t.length;if(!i)return 0;let h=0,e=0;if(this._interim){const i=t.charCodeAt(e++);56320<=i&&i<=57343?s[h++]=1024*(this._interim-55296)+i-56320+65536:(s[h++]=this._interim,s[h++]=i),this._interim=0}for(let r=e;r<i;++r){const e=t.charCodeAt(r);if(55296<=e&&e<=56319){if(++r>=i)return this._interim=e,h;const n=t.charCodeAt(r);56320<=n&&n<=57343?s[h++]=1024*(e-55296)+n-56320+65536:(s[h++]=e,s[h++]=n)}else 65279!==e&&(s[h++]=e)}return h}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,s){const i=t.length;if(!i)return 0;let h,e,r,n,o=0,c=0,a=0;if(this.interim[0]){let h=!1,e=this.interim[0];e&=192==(224&e)?31:224==(240&e)?15:7;let r,n=0;for(;(r=63&this.interim[++n])&&n<4;)e<<=6,e|=r;const c=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=c-n;for(;a<l;){if(a>=i)return 0;if(r=t[a++],128!=(192&r)){a--,h=!0;break}this.interim[n++]=r,e<<=6,e|=63&r}h||(2===c?e<128?a--:s[o++]=e:3===c?e<2048||e>=55296&&e<=57343||65279===e||(s[o++]=e):e<65536||e>1114111||(s[o++]=e)),this.interim.fill(0)}const l=i-4;let u=a;for(;u<i;){for(;!(!(u<l)||128&(h=t[u])||128&(e=t[u+1])||128&(r=t[u+2])||128&(n=t[u+3]));)s[o++]=h,s[o++]=e,s[o++]=r,s[o++]=n,u+=4;if(h=t[u++],h<128)s[o++]=h;else if(192==(224&h)){if(u>=i)return this.interim[0]=h,o;if(e=t[u++],128!=(192&e)){u--;continue}if(c=(31&h)<<6|63&e,c<128){u--;continue}s[o++]=c}else if(224==(240&h)){if(u>=i)return this.interim[0]=h,o;if(e=t[u++],128!=(192&e)){u--;continue}if(u>=i)return this.interim[0]=h,this.interim[1]=e,o;if(r=t[u++],128!=(192&r)){u--;continue}if(c=(15&h)<<12|(63&e)<<6|63&r,c<2048||c>=55296&&c<=57343||65279===c)continue;s[o++]=c}else if(240==(248&h)){if(u>=i)return this.interim[0]=h,o;if(e=t[u++],128!=(192&e)){u--;continue}if(u>=i)return this.interim[0]=h,this.interim[1]=e,o;if(r=t[u++],128!=(192&r)){u--;continue}if(u>=i)return this.interim[0]=h,this.interim[1]=e,this.interim[2]=r,o;if(n=t[u++],128!=(192&n)){u--;continue}if(c=(7&h)<<18|(63&e)<<12|(63&r)<<6|63&n,c<65536||c>1114111)continue;s[o++]=c}}return o}}},225:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=i(1480),e=[[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]],r=[[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 n;s.UnicodeV6=class{constructor(){if(this.version="6",!n){n=new Uint8Array(65536),n.fill(1),n[0]=0,n.fill(0,1,32),n.fill(0,127,160),n.fill(2,4352,4448),n[9001]=2,n[9002]=2,n.fill(2,11904,42192),n[12351]=1,n.fill(2,44032,55204),n.fill(2,63744,64256),n.fill(2,65040,65050),n.fill(2,65072,65136),n.fill(2,65280,65377),n.fill(2,65504,65511);for(let t=0;t<e.length;++t)n.fill(0,e[t][0],e[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?n[t]:function(t,s){let i,h=0,e=s.length-1;if(t<s[0][0]||t>s[e][1])return!1;for(;e>=h;)if(i=h+e>>1,t>s[i][1])h=i+1;else{if(!(t<s[i][0]))return!0;e=i-1}return!1}(t,r)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,s){let i=this.wcwidth(t),e=0===i&&0!==s;if(e){const t=h.UnicodeService.extractWidth(s);0===t?e=!1:t>i&&(i=t)}return h.UnicodeService.createPropertyValue(0,i,e)}}},5981:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=i(8460),e=i(844);s.WriteBuffer=class extends e.Disposable{constructor(t){super(),this._action=t,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(t,s){if(void 0!==s&&this._syncCalls>s)return void(this._syncCalls=0);if(this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(t,s){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+=t.length,this._writeBuffer.push(t),this._callbacks.push(s),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(s)}_innerWrite(t=0,s=!0){const i=t||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],h=this._action(t,s);if(h){const t=t=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,t))):this._innerWrite(i,t);return void h.catch((t=>(queueMicrotask((()=>{throw t})),Promise.resolve(!1)))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const i=/^([\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})$/,h=/^[\da-f]+$/;function e(t,s){const i=t.toString(16),h=i.length<2?"0"+i:i;switch(s){case 4:return i[0];case 8:return h;case 12:return(h+h).slice(0,3);default:return h+h}}s.parseColor=function(t){if(!t)return;let s=t.toLowerCase();if(0===s.indexOf("rgb:")){s=s.slice(4);const t=i.exec(s);if(t){const s=t[1]?15:t[4]?255:t[7]?4095:65535;return[Math.round(parseInt(t[1]||t[4]||t[7]||t[10],16)/s*255),Math.round(parseInt(t[2]||t[5]||t[8]||t[11],16)/s*255),Math.round(parseInt(t[3]||t[6]||t[9]||t[12],16)/s*255)]}}else if(0===s.indexOf("#")&&(s=s.slice(1),h.exec(s)&&[3,6,9,12].includes(s.length))){const t=s.length/3,i=[0,0,0];for(let h=0;h<3;++h){const e=parseInt(s.slice(t*h,t*h+t),16);i[h]=1===t?e<<4:2===t?e:3===t?e>>4:e>>8}return i}},s.toRgbString=function(t,s=16){const[i,h,r]=t;return`rgb:${e(i,s)}/${e(h,s)}/${e(r,s)}`}},5770:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=i(482),e=i(8742),r=i(5770),n=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=n,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}registerHandler(t,s){void 0===this._handlers[t]&&(this._handlers[t]=[]);const i=this._handlers[t];return i.push(s),{dispose:()=>{const t=i.indexOf(s);-1!==t&&i.splice(t,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=n,this._ident=0}hook(t,s){if(this.reset(),this._ident=t,this._active=this._handlers[t]||n,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(s);else this._handlerFb(this._ident,"HOOK",s)}put(t,s,i){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(t,s,i);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(t,s,i))}unhook(t,s=!0){if(this._active.length){let i=!1,h=this._active.length-1,e=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,i=s,e=this._stack.fallThrough,this._stack.paused=!1),!e&&!1===i){for(;h>=0&&(i=this._active[h].unhook(t),!0!==i);h--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,i;h--}for(;h>=0;h--)if(i=this._active[h].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",t);this._active=n,this._ident=0}};const o=new e.Params;o.addParam(0),s.DcsHandler=class{constructor(t){this._handler=t,this._data="",this._params=o,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():o,this._data="",this._hitLimit=!1}put(t,s,i){this._hitLimit||(this._data+=(0,h.utf32ToString)(t,s,i),this._data.length>r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(t){let s=!1;if(this._hitLimit)s=!1;else if(t&&(s=this._handler(this._data,this._params),s instanceof Promise))return s.then((t=>(this._params=o,this._data="",this._hitLimit=!1,t)));return this._params=o,this._data="",this._hitLimit=!1,s}}},2015:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=i(844),e=i(8742),r=i(6242),n=i(6351);class o{constructor(t){this.table=new Uint8Array(t)}setDefault(t,s){this.table.fill(t<<4|s)}add(t,s,i,h){this.table[s<<8|t]=i<<4|h}addMany(t,s,i,h){for(let e=0;e<t.length;e++)this.table[s<<8|t[e]]=i<<4|h}}s.TransitionTable=o;const c=160;s.VT500_TRANSITION_TABLE=function(){const t=new o(4095),s=Array.apply(null,Array(256)).map(((t,s)=>s)),i=(t,i)=>s.slice(t,i),h=i(32,127),e=i(0,24);e.push(25),e.push.apply(e,i(28,32));const r=i(0,14);let n;for(n in t.setDefault(1,0),t.addMany(h,0,2,0),r)t.addMany([24,26,153,154],n,3,0),t.addMany(i(128,144),n,3,0),t.addMany(i(144,152),n,3,0),t.add(156,n,0,0),t.add(27,n,11,1),t.add(157,n,4,8),t.addMany([152,158,159],n,0,7),t.add(155,n,11,3),t.add(144,n,11,9);return t.addMany(e,0,3,0),t.addMany(e,1,3,1),t.add(127,1,0,1),t.addMany(e,8,0,8),t.addMany(e,3,3,3),t.add(127,3,0,3),t.addMany(e,4,3,4),t.add(127,4,0,4),t.addMany(e,6,3,6),t.addMany(e,5,3,5),t.add(127,5,0,5),t.addMany(e,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(h,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(h,7,0,7),t.addMany(e,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(e,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(e,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(e,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(e,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(e,13,13,13),t.addMany(h,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(c,0,2,0),t.add(c,8,5,8),t.add(c,6,0,6),t.add(c,11,0,11),t.add(c,13,13,13),t}(),s.EscapeSequenceParser=class extends h.Disposable{constructor(t=s.VT500_TRANSITION_TABLE){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new e.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=()=>{},this._executeHandlerFb=()=>{},this._csiHandlerFb=()=>{},this._escHandlerFb=()=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new r.OscParser),this._dcsParser=this.register(new n.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(t,s=[64,126]){let i=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=t.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<t.intermediates.length;++s){const h=t.intermediates.charCodeAt(s);if(32>h||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=h}}if(1!==t.final.length)throw new Error("final must be a single byte");const h=t.final.charCodeAt(0);if(s[0]>h||h>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return i<<=8,i|=h,i}identToString(t){const s=[];for(;t;)s.push(String.fromCharCode(255&t)),t>>=8;return s.reverse().join("")}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,s){const i=this._identifier(t,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const h=this._escHandlers[i];return h.push(s),{dispose:()=>{const t=h.indexOf(s);-1!==t&&h.splice(t,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,s){this._executeHandlers[t.charCodeAt(0)]=s}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,s){const i=this._identifier(t);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const h=this._csiHandlers[i];return h.push(s),{dispose:()=>{const t=h.indexOf(s);-1!==t&&h.splice(t,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,s){return this._dcsParser.registerHandler(this._identifier(t),s)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,s){return this._oscParser.registerHandler(t,s)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(t,s,i,h,e){this._parseStack.state=t,this._parseStack.handlers=s,this._parseStack.handlerPos=i,this._parseStack.transition=h,this._parseStack.chunkPos=e}parse(t,s,i){let h,e=0,r=0,n=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const s=this._parseStack.handlers;let r=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&r>-1)for(;r>=0&&(h=s[r](this._params),!0!==h);r--)if(h instanceof Promise)return this._parseStack.handlerPos=r,h;this._parseStack.handlers=[];break;case 4:if(!1===i&&r>-1)for(;r>=0&&(h=s[r](),!0!==h);r--)if(h instanceof Promise)return this._parseStack.handlerPos=r,h;this._parseStack.handlers=[];break;case 6:if(e=t[this._parseStack.chunkPos],h=this._dcsParser.unhook(24!==e&&26!==e,i),h)return h;27===e&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(e=t[this._parseStack.chunkPos],h=this._oscParser.end(24!==e&&26!==e,i),h)return h;27===e&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let i=n;i<s;++i){switch(e=t[i],r=this._transitions.table[this.currentState<<8|(e<160?e:c)],r>>4){case 2:for(let h=i+1;;++h){if(h>=s||(e=t[h])<32||e>126&&e<c){this._printHandler(t,i,h),i=h-1;break}if(++h>=s||(e=t[h])<32||e>126&&e<c){this._printHandler(t,i,h),i=h-1;break}if(++h>=s||(e=t[h])<32||e>126&&e<c){this._printHandler(t,i,h),i=h-1;break}if(++h>=s||(e=t[h])<32||e>126&&e<c){this._printHandler(t,i,h),i=h-1;break}}break;case 3:this._executeHandlers[e]?this._executeHandlers[e]():this._executeHandlerFb(e),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:i,code:e,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const n=this._csiHandlers[this._collect<<8|e];let o=n?n.length-1:-1;for(;o>=0&&(h=n[o](this._params),!0!==h);o--)if(h instanceof Promise)return this._preserveStack(3,n,o,r,i),h;o<0&&this._csiHandlerFb(this._collect<<8|e,this._params),this.precedingJoinState=0;break;case 8:do{switch(e){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(e-48)}}while(++i<s&&(e=t[i])>47&&e<60);i--;break;case 9:this._collect<<=8,this._collect|=e;break;case 10:const a=this._escHandlers[this._collect<<8|e];let l=a?a.length-1:-1;for(;l>=0&&(h=a[l](),!0!==h);l--)if(h instanceof Promise)return this._preserveStack(4,a,l,r,i),h;l<0&&this._escHandlerFb(this._collect<<8|e),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|e,this._params);break;case 13:for(let h=i+1;;++h)if(h>=s||24===(e=t[h])||26===e||27===e||e>127&&e<c){this._dcsParser.put(t,i,h),i=h-1;break}break;case 14:if(h=this._dcsParser.unhook(24!==e&&26!==e),h)return this._preserveStack(6,[],0,r,i),h;27===e&&(r|=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 h=i+1;;h++)if(h>=s||(e=t[h])<32||e>127&&e<c){this._oscParser.put(t,i,h),i=h-1;break}break;case 6:if(h=this._oscParser.end(24!==e&&26!==e),h)return this._preserveStack(5,[],0,r,i),h;27===e&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&r}}}},6242:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=i(5770),e=i(482),r=[];s.OscParser=class{constructor(){this._state=0,this._active=r,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,s){void 0===this._handlers[t]&&(this._handlers[t]=[]);const i=this._handlers[t];return i.push(s),{dispose:()=>{const t=i.indexOf(s);-1!==t&&i.splice(t,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=r}reset(){if(2===this._state)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=r,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||r,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].start();else this._handlerFb(this._id,"START")}_put(t,s,i){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(t,s,i);else this._handlerFb(this._id,"PUT",(0,e.utf32ToString)(t,s,i))}start(){this.reset(),this._state=1}put(t,s,i){if(3!==this._state){if(1===this._state)for(;s<i;){const i=t[s++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&i-s>0&&this._put(t,s,i)}}end(t,s=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,h=this._active.length-1,e=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,i=s,e=this._stack.fallThrough,this._stack.paused=!1),!e&&!1===i){for(;h>=0&&(i=this._active[h].end(t),!0!==i);h--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,i;h--}for(;h>=0;h--)if(i=this._active[h].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",t);this._active=r,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,s,i){this._hitLimit||(this._data+=(0,e.utf32ToString)(t,s,i),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(t){let s=!1;if(this._hitLimit)s=!1;else if(t&&(s=this._handler(this._data),s instanceof Promise))return s.then((t=>(this._data="",this._hitLimit=!1,t)));return this._data="",this._hitLimit=!1,s}}},8742:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const i=2147483647;class h{static fromArray(t){const s=new h;if(!t.length)return s;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){const h=t[i];if(Array.isArray(h))for(let t=0;t<h.length;++t)s.addSubParam(h[t]);else s.addParam(h)}return s}constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const t=new h(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){const t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);const i=this._subParamsIdx[s]>>8,h=255&this._subParamsIdx[s];h-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,h))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>i?i:t}}addSubParam(t){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>i?i:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(255&this._subParamsIdx[t])-(this._subParamsIdx[t]>>8)>0}getSubParams(t){const s=this._subParamsIdx[t]>>8,i=255&this._subParamsIdx[t];return i-s>0?this._subParams.subarray(s,i):null}getSubParamsAll(){const t={};for(let s=0;s<this.length;++s){const i=this._subParamsIdx[s]>>8,h=255&this._subParamsIdx[s];h-i>0&&(t[s]=this._subParams.slice(i,h))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const h=this._digitIsSub?this._subParams:this.params,e=h[s-1];h[s-1]=~e?Math.min(10*e+t,i):t}}s.Params=h},5741:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let t=this._addons.length-1;t>=0;t--)this._addons[t].instance.dispose()}loadAddon(t,s){const i={instance:s,dispose:s.dispose,isDisposed:!1};this._addons.push(i),s.dispose=()=>this._wrappedAddonDispose(i),s.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let s=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===t){s=i;break}if(-1===s)throw new Error("Could not dispose an addon that has not been loaded");t.isDisposed=!0,t.dispose.apply(t.instance),this._addons.splice(s,1)}}},8771:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=i(3785),e=i(511);s.BufferApiView=class{constructor(t,s){this._buffer=t,this.type=s}init(t){return this._buffer=t,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(t){const s=this._buffer.lines.get(t);if(s)return new h.BufferLineApiView(s)}getNullCell(){return new e.CellData}}},3785:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=i(511);s.BufferLineApiView=class{constructor(t){this._line=t}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(t,s){if(!(t<0||t>=this._line.length))return s?(this._line.loadCell(t,s),s):this._line.loadCell(t,new h.CellData)}translateToString(t,s,i){return this._line.translateToString(t,s,i)}}},8285:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=i(8771),e=i(8460),r=i(844);s.BufferNamespaceApi=class extends r.Disposable{constructor(t){super(),this._core=t,this._onBufferChange=this.register(new e.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}},7975:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(t){this._core=t}registerCsiHandler(t,s){return this._core.registerCsiHandler(t,(t=>s(t.toArray())))}addCsiHandler(t,s){return this.registerCsiHandler(t,s)}registerDcsHandler(t,s){return this._core.registerDcsHandler(t,((t,i)=>s(t,i.toArray())))}addDcsHandler(t,s){return this.registerDcsHandler(t,s)}registerEscHandler(t,s){return this._core.registerEscHandler(t,s)}addEscHandler(t,s){return this.registerEscHandler(t,s)}registerOscHandler(t,s){return this._core.registerOscHandler(t,s)}addOscHandler(t,s){return this.registerOscHandler(t,s)}}},7090:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}}},744:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const r=i(8460),n=i(844),o=i(5295),c=i(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let a=s.BufferService=class extends n.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new o.BufferSet(t,this))}resize(t,s){this.cols=t,this.rows=s,this.buffers.resize(t,s),this._onResize.fire({cols:t,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,s=!1){const i=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===t.fg&&h.getBg(0)===t.bg||(h=i.getBlankLine(t,s),this._cachedBlankLine=h),h.isWrapped=s;const e=i.ybase+i.scrollTop,r=i.ybase+i.scrollBottom;if(0===i.scrollTop){const t=i.lines.isFull;r===i.lines.length-1?t?i.lines.recycle().copyFrom(h):i.lines.push(h.clone()):i.lines.splice(r+1,0,h.clone()),t?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else i.lines.shiftElements(e+1,r-e+1-1,-1),i.lines.set(r,h.clone());this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(t,s,i){const h=this.buffer;if(t<0){if(0===h.ydisp)return;this.isUserScrolling=!0}else t+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const e=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+t,h.ybase),0),e!==h.ydisp&&(s||this._onScroll.fire(h.ydisp))}};s.BufferService=a=h([e(0,c.IOptionsService)],a)},7994:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,s){this._charsets[t]=s,this.glevel===t&&(this.charset=s)}}},1753:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const r=i(2585),n=i(8460),o=i(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>4!==t.button&&1===t.action&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>32!==t.action},DRAG:{events:23,restrict:t=>32!==t.action||3!==t.button},ANY:{events:31,restrict:()=>!0}};function a(t,s){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return 4===t.button?(i|=64,i|=t.action):(i|=3&t.button,4&t.button&&(i|=64),8&t.button&&(i|=128),32===t.action?i|=32:0!==t.action||s||(i|=3)),i}const l=String.fromCharCode,u={DEFAULT:t=>{const s=[a(t,!1)+32,t.col+32,t.row+32];return s[0]>255||s[1]>255||s[2]>255?"":`[M${l(s[0])}${l(s[1])}${l(s[2])}`},SGR:t=>{const s=0===t.action&&4!==t.button?"m":"M";return`[<${a(t,!0)};${t.col};${t.row}${s}`},SGR_PIXELS:t=>{const s=0===t.action&&4!==t.button?"m":"M";return`[<${a(t,!0)};${t.x};${t.y}${s}`}};let f=s.CoreMouseService=class extends o.Disposable{constructor(t,s){super(),this._bufferService=t,this._coreService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new n.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const t of Object.keys(c))this.addProtocol(t,c[t]);for(const t of Object.keys(u))this.addEncoding(t,u[t]);this.reset()}addProtocol(t,s){this._protocols[t]=s}addEncoding(t,s){this._encodings[t]=s}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows)return!1;if(4===t.button&&32===t.action)return!1;if(3===t.button&&32!==t.action)return!1;if(4!==t.button&&(2===t.action||3===t.action))return!1;if(t.col++,t.row++,32===t.action&&this._lastEvent&&this._equalEvents(this._lastEvent,t,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(t))return!1;const s=this._encodings[this._activeEncoding](t);return s&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(s):this._coreService.triggerDataEvent(s,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,s,i){if(i){if(t.x!==s.x)return!1;if(t.y!==s.y)return!1}else{if(t.col!==s.col)return!1;if(t.row!==s.row)return!1}return t.button===s.button&&t.action===s.action&&t.ctrl===s.ctrl&&t.alt===s.alt&&t.shift===s.shift}};s.CoreMouseService=f=h([e(0,r.IBufferService),e(1,r.ICoreService)],f)},6975:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const r=i(1439),n=i(8460),o=i(844),c=i(2585),a=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=s.CoreService=class extends o.Disposable{constructor(t,s,i){super(),this._bufferService=t,this._logService=s,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new n.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new n.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,r.clone)(a),this.decPrivateModes=(0,r.clone)(l)}reset(){this.modes=(0,r.clone)(a),this.decPrivateModes=(0,r.clone)(l)}triggerDataEvent(t,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,(()=>t.split("").map((t=>t.charCodeAt(0))))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,(()=>t.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(t))}};s.CoreService=u=h([e(0,c.IBufferService),e(1,c.ILogService),e(2,c.IOptionsService)],u)},9074:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=i(8055),e=i(8460),r=i(844),n=i(6106);let o=0,c=0;s.DecorationService=class extends r.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new n.SortedList((t=>t?.marker.line)),this._onDecorationRegistered=this.register(new e.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new e.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,r.toDisposable)((()=>this.reset())))}registerDecoration(t){if(t.marker.isDisposed)return;const s=new a(t);if(s){const t=s.marker.onDispose((()=>s.dispose()));s.onDispose((()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),t.dispose())})),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,s,i){let h=0,e=0;for(const r of this._decorations.getKeyIterator(s))h=r.options.x??0,e=h+(r.options.width??1),t>=h&&t<e&&(!i||(r.options.layer??"bottom")===i)&&(yield r)}forEachDecorationAtCell(t,s,i,h){this._decorations.forEachByKey(s,(s=>{o=s.options.x??0,c=o+(s.options.width??1),t>=o&&t<c&&(!i||(s.options.layer??"bottom")===i)&&h(s)}))}};class a extends r.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return null===this._cachedBg&&(this._cachedBg=this.options.backgroundColor?h.css.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this._cachedFg=this.options.foregroundColor?h.css.toColor(this.options.foregroundColor):void 0),this._cachedFg}constructor(t){super(),this.options=t,this.onRenderEmitter=this.register(new e.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new e.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=i(2585),e=i(8343);class r{constructor(...t){this._entries=new Map;for(const[s,i]of t)this.set(s,i)}set(t,s){const i=this._entries.get(t);return this._entries.set(t,s),i}forEach(t){for(const[s,i]of this._entries.entries())t(s,i)}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}}s.ServiceCollection=r,s.InstantiationService=class{constructor(){this._services=new r,this._services.set(h.IInstantiationService,this)}setService(t,s){this._services.set(t,s)}getService(t){return this._services.get(t)}createInstance(t,...s){const i=(0,e.getServiceDependencies)(t).sort(((t,s)=>t.index-s.index)),h=[];for(const s of i){const i=this._services.get(s.id);if(!i)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${s.id}.`);h.push(i)}const r=i.length>0?i[0].index:s.length;if(s.length!==r)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${r+1} conflicts with ${s.length} static arguments`);return new t(...[...s,...h])}}},7866:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const r=i(844),n=i(2585),o={trace:n.LogLevelEnum.TRACE,debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};let c,a=s.LogService=class extends r.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let s=0;s<t.length;s++)"function"==typeof t[s]&&(t[s]=t[s]())}_log(t,s,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...i)}trace(t,...s){this._logLevel<=n.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,s)}debug(t,...s){this._logLevel<=n.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,s)}info(t,...s){this._logLevel<=n.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,s)}warn(t,...s){this._logLevel<=n.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,s)}error(t,...s){this._logLevel<=n.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,s)}};s.LogService=a=h([e(0,n.IOptionsService)],a),s.setTraceLogger=function(t){c=t},s.traceCall=function(t,s,i){if("function"!=typeof i.value)throw new Error("not supported");const h=i.value;i.value=function(...t){if(c.logLevel!==n.LogLevelEnum.TRACE)return h.apply(this,t);c.trace(`GlyphRenderer#${h.name}(${t.map((t=>JSON.stringify(t))).join(", ")})`);const s=h.apply(this,t);return c.trace(`GlyphRenderer#${h.name} return`,s),s}}},7302:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=i(8460),e=i(844),r=i(6114);s.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:r.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const n=["normal","bold","100","200","300","400","500","600","700","800","900"];s.OptionsService=class extends e.Disposable{constructor(t){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...s.DEFAULT_OPTIONS};for(const s in t)if(s in i)try{i[s]=this._sanitizeAndValidateOption(s,t[s])}catch(t){console.error(t)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,e.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(t,s){return this.onOptionChange((i=>{i===t&&s(this.rawOptions[t])}))}onMultipleOptionChange(t,s){return this.onOptionChange((i=>{-1!==t.indexOf(i)&&s()}))}_setupOptions(){const t=t=>{if(!(t in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${t}"`);return this.rawOptions[t]},i=(t,i)=>{if(!(t in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${t}"`);i=this._sanitizeAndValidateOption(t,i),this.rawOptions[t]!==i&&(this.rawOptions[t]=i,this._onOptionChange.fire(t))};for(const s in this.rawOptions){const h={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,h)}}_sanitizeAndValidateOption(t,i){switch(t){case"cursorStyle":if(i||(i=s.DEFAULT_OPTIONS[t]),!function(t){return"block"===t||"underline"===t||"bar"===t}(i))throw new Error(`"${i}" is not a valid value for ${t}`);break;case"wordSeparator":i||(i=s.DEFAULT_OPTIONS[t]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=n.includes(i)?i:s.DEFAULT_OPTIONS[t];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${t} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${t} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${t} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw new Error(`${t} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}},2660:function(t,s,i){var h=this&&this.__decorate||function(t,s,i,h){var e,r=arguments.length,n=r<3?s:null===h?h=Object.getOwnPropertyDescriptor(s,i):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,s,i,h);else for(var o=t.length-1;o>=0;o--)(e=t[o])&&(n=(r<3?e(n):r>3?e(s,i,n):e(s,i))||n);return r>3&&n&&Object.defineProperty(s,i,n),n},e=this&&this.__param||function(t,s){return function(i,h){s(i,h,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const r=i(2585);let n=s.OscLinkService=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){const s=this._bufferService.buffer;if(void 0===t.id){const i=s.addMarker(s.ybase+s.y),h={data:t,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(h,i))),this._dataByLinkId.set(h.id,h),h.id}const i=t,h=this._getEntryIdKey(i),e=this._entriesWithId.get(h);if(e)return this.addLineToLink(e.id,s.ybase+s.y),e.id;const r=s.addMarker(s.ybase+s.y),n={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[r]};return r.onDispose((()=>this._removeMarkerFromLink(n,r))),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(t,s){const i=this._dataByLinkId.get(t);if(i&&i.lines.every((t=>t.line!==s))){const t=this._bufferService.buffer.addMarker(s);i.lines.push(t),t.onDispose((()=>this._removeMarkerFromLink(i,t)))}}getLinkData(t){return this._dataByLinkId.get(t)?.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,s){const i=t.lines.indexOf(s);-1!==i&&(t.lines.splice(i,1),0===t.lines.length&&(void 0!==t.data.id&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};s.OscLinkService=n=h([e(0,r.IBufferService)],n)},8343:(t,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const i="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(t){return t[h]||[]},s.createDecorator=function(t){if(s.serviceRegistry.has(t))return s.serviceRegistry.get(t);const e=function(t,s,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(t,s,e){s[i]===s?s[h].push({id:t,index:e}):(s[h]=[{id:t,index:e}],s[i]=s)}(e,t,r)};return e.toString=()=>t,s.serviceRegistry.set(t,e),e}},2585:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=i(8343);var e;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),function(t){t[t.TRACE=0]="TRACE",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.OFF=5]="OFF"}(e||(s.LogLevelEnum=e={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(t,s,i)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=i(8460),e=i(225);class r{static extractShouldJoin(t){return!!(1&t)}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,i=!1){return(16777215&t)<<3|(3&s)<<1|(i?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const t=new e.UnicodeV6;this.register(t),this._active=t.version,this._activeProvider=t}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,i=0;const h=t.length;for(let e=0;e<h;++e){let n=t.charCodeAt(e);if(55296<=n&&n<=56319){if(++e>=h)return s+this.wcwidth(n);const i=t.charCodeAt(e);56320<=i&&i<=57343?n=1024*(n-55296)+i-56320+65536:s+=this.wcwidth(i)}const o=this.charProperties(n,i);let c=r.extractWidth(o);r.extractShouldJoin(o)&&(c-=r.extractWidth(i)),s+=c,i=o}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}}s.UnicodeService=r}},s={};function i(h){var e=s[h];if(void 0!==e)return e.exports;var r=s[h]={exports:{}};return t[h].call(r.exports,r,r.exports,i),r.exports}var h={};return(()=>{var t=h;Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(9042),e=i(3236),r=i(844),n=i(5741),o=i(8285),c=i(7975),a=i(7090),l=["cols","rows"];t.Terminal=class extends r.Disposable{constructor(t){super(),this._core=this.register(new e.Terminal(t)),this._addonManager=this.register(new n.AddonManager),this._publicOptions={...this._core.options};const s=t=>this._core.options[t],i=(t,s)=>{this._checkReadonlyOptions(t),this._core.options[t]=s};for(const t in this._core.options){const h={get:s.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this._publicOptions,t,h)}}_checkReadonlyOptions(t){if(l.includes(t))throw new Error(`Option "${t}" 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 c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new a.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 o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const t=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:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(const s in t)this._publicOptions[s]=t[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,s=!0){this._core.input(t,s)}resize(t,s){this._verifyIntegers(t,s),this._core.resize(t,s)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,s,i){this._verifyIntegers(t,s,i),this._core.select(t,s,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,s){this._verifyIntegers(t,s),this._core.selectLines(t,s)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,s){this._core.write(t,s)}writeln(t,s){this._core.write(t),this._core.write("\r\n",s)}paste(t){this._core.paste(t)}refresh(t,s){this._verifyIntegers(t,s),this._core.refresh(t,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return s}_verifyIntegers(...t){for(const s of t)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(const s of t)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}})(),h})(),n.exports=r();var o,c={exports:{}};o=c,function(t,s){o.exports=s()}(self,(()=>{return t={},(()=>{var s=t;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(t){this._terminal=t}dispose(){}fit(){const t=this.proposeDimensions();t&&this._terminal&&!isNaN(t.cols)&&!isNaN(t.rows)&&(this._terminal.rows===t.rows&&this._terminal.cols===t.cols||(this._terminal._core._renderService.clear(),this._terminal.resize(t.cols,t.rows)))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const t=this._terminal._core,s=t._renderService.dimensions;if(0===s.css.cell.width||0===s.css.cell.height)return;const i=0===this._terminal.options.scrollback?0:t.viewport.scrollBarWidth,h=window.getComputedStyle(this._terminal.element.parentElement),e=parseInt(h.getPropertyValue("height")),r=Math.max(0,parseInt(h.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o=e-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),c=r-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(c/s.css.cell.width)),rows:Math.max(1,Math.floor(o/s.css.cell.height))}}}})(),t;var t}));var a={exports:{}};!function(t){!function(s,i){t.exports=i()}(self,(()=>(()=>{var t={6:(t,s)=>{function i(t){try{const s=new URL(t),i=s.password&&s.username?`${s.protocol}//${s.username}:${s.password}@${s.host}`:s.username?`${s.protocol}//${s.username}@${s.host}`:`${s.protocol}//${s.host}`;return t.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch(t){return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(t,s,i,h={}){this._terminal=t,this._regex=s,this._handler=i,this._options=h}provideLinks(t,s){const i=h.computeLink(t,this._regex,this._terminal,this._handler);s(this._addCallbacks(i))}_addCallbacks(t){return t.map((t=>(t.leave=this._options.leave,t.hover=(s,i)=>{if(this._options.hover){const{range:h}=t;this._options.hover(s,i,h)}},t)))}};class h{static computeLink(t,s,e,r){const n=new RegExp(s.source,(s.flags||"")+"g"),[o,c]=h._getWindowedLineStrings(t-1,e),a=o.join("");let l;const u=[];for(;l=n.exec(a);){const t=l[0];if(!i(t))continue;const[s,n]=h._mapStrIdx(e,c,0,l.index),[o,a]=h._mapStrIdx(e,s,n,t.length);-1!==s&&-1!==n&&-1!==o&&-1!==a&&u.push({range:{start:{x:n+1,y:s+1},end:{x:a,y:o+1}},text:t,activate:r})}return u}static _getWindowedLineStrings(t,s){let i,h=t,e=t,r=0,n="";const o=[];if(i=s.buffer.active.getLine(t)){const t=i.translateToString(!0);if(i.isWrapped&&" "!==t[0]){for(r=0;(i=s.buffer.active.getLine(--h))&&r<2048&&(n=i.translateToString(!0),r+=n.length,o.push(n),i.isWrapped&&-1===n.indexOf(" ")););o.reverse()}for(o.push(t),r=0;(i=s.buffer.active.getLine(++e))&&i.isWrapped&&r<2048&&(n=i.translateToString(!0),r+=n.length,o.push(n),-1===n.indexOf(" ")););}return[o,h]}static _mapStrIdx(t,s,i,h){const e=t.buffer.active,r=e.getNullCell();let n=i;for(;h;){const t=e.getLine(s);if(!t)return[-1,-1];for(let i=n;i<t.length;++i){t.getCell(i,r);const n=r.getChars();if(r.getWidth()&&(h-=n.length||1,i===t.length-1&&""===n)){const t=e.getLine(s+1);t&&t.isWrapped&&(t.getCell(0,r),2===r.getWidth()&&(h+=1))}if(h<0)return[s,i]}s++,n=0}return[s,n]}}s.LinkComputer=h}},s={};function i(h){var e=s[h];if(void 0!==e)return e.exports;var r=s[h]={exports:{}};return t[h](r,r.exports,i),r.exports}var h={};return(()=>{var t=h;Object.defineProperty(t,"__esModule",{value:!0}),t.WebLinksAddon=void 0;const s=i(6),e=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function r(t,s){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}t.WebLinksAddon=class{constructor(t=r,s={}){this._handler=t,this._options=s}activate(t){this._terminal=t;const i=this._options;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,i.urlRegex||e,this._handler,i))}dispose(){this._linkProvider?.dispose()}}})(),h})()))}(a);const l={cursorBlink:!0,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:'"Cascadia Code", Menlo, monospace',fontSize:14,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,tabStopWidth:8,rightClickSelectsWord:!0,altClickMovesCursor:!0,convertEol:!0},u=class{constructor(i){t(this,i),this.dataEvent=s(this,"dwc-data",7),this.keyEvent=s(this,"dwc-key",7),this.fitAddon=new c.exports.FitAddon,this.autoFit=!1,this.cols=80,this.options=l,this.rows=24,this.theme={black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightCyan:"#29b8db",brightWhite:"#e5e5e5",background:"#1e1e1e",foreground:"#cccccc",selectionBackground:"#3a3d41",cursor:"#ffffff"}}onTerminalSizeChange(){this.terminal.resize(this.cols,this.rows)}onOptionsChange(){this.terminal.options=Object.assign(Object.assign(Object.assign({},l),this.options),{theme:this.theme})}connectedCallback(){this.handleResize=this.handleResize.bind(this),this.setupResizeObserver()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.terminal=new n.exports.Terminal,this.fitAddon=new c.exports.FitAddon,this.onOptionsChange(),this.terminal.open(this.el.shadowRoot.querySelector('[part="control"]')),this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new a.exports.WebLinksAddon),this.onTerminalSizeChange(),this.terminal.onData((t=>this.dataEvent.emit(t))),this.terminal.onKey((({key:t,domEvent:s})=>this.keyEvent.emit({value:t,event:s}))),this.fit()}setupResizeObserver(){this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.el)}async setFocus(){this.terminal.focus()}async removeFocus(){this.terminal.blur()}async fit(){this.autoFit&&this.fitAddon.fit()}async clear(){this.terminal.clear()}async reset(){this.terminal.reset()}async selectAll(){this.terminal.selectAll()}async select(t,s,i){this.terminal.select(t,s,i)}async selectLines(t,s){this.terminal.selectLines(t,s)}async clearSelection(){this.terminal.clearSelection()}async getSelection(){return this.terminal.getSelection()}async getSelectionPosition(){return this.terminal.getSelectionPosition()||{start:{x:-1,y:-1},end:{x:-1,y:-1}}}async write(t){return new Promise((s=>{this.terminal.write(t,s)}))}async writeln(t){return new Promise((s=>{this.terminal.writeln(t,s)}))}async scrollLines(t){this.terminal.scrollLines(t)}async scrollToLine(t){this.terminal.scrollToLine(t)}async scrollToTop(){this.terminal.scrollToTop()}async scrollToBottom(){this.terminal.scrollToBottom()}handleResize(){this.fit()}render(){return i(h,{key:"e5d14151e274250b7a60f1894165c8dffdb3a20d"},i("div",{key:"740d32f7823ec30b6860c14a016ae6d294c828e4",part:"control"}))}get el(){return e(this)}static get watchers(){return{cols:["onTerminalSizeChange"],rows:["onTerminalSizeChange"],theme:["onOptionsChange"],options:["onOptionsChange"]}}};u.style=".xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#FFF;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1 !important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:host{display:block}[part=control]{height:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;width:inherit}.xterm{height:100%;width:100%}.xterm .xterm-viewport{overflow-y:auto}";export{u as dwc_terminal}