claude-wec 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +675 -0
  2. package/README.md +371 -0
  3. package/dist/api-docs.html +879 -0
  4. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist/assets/index-cIxJ4RXb.js +1226 -0
  64. package/dist/assets/index-oyEz69sP.css +32 -0
  65. package/dist/assets/vendor-codemirror-CJLzwpLB.js +39 -0
  66. package/dist/assets/vendor-react-DcyRfQm3.js +59 -0
  67. package/dist/assets/vendor-xterm-DfaPXD3y.js +66 -0
  68. package/dist/clear-cache.html +85 -0
  69. package/dist/convert-icons.md +53 -0
  70. package/dist/favicon.png +0 -0
  71. package/dist/favicon.svg +9 -0
  72. package/dist/generate-icons.js +49 -0
  73. package/dist/icons/claude-ai-icon.svg +1 -0
  74. package/dist/icons/codex-white.svg +3 -0
  75. package/dist/icons/codex.svg +3 -0
  76. package/dist/icons/cursor-white.svg +12 -0
  77. package/dist/icons/cursor.svg +1 -0
  78. package/dist/icons/generate-icons.md +19 -0
  79. package/dist/icons/icon-128x128.png +0 -0
  80. package/dist/icons/icon-128x128.svg +12 -0
  81. package/dist/icons/icon-144x144.png +0 -0
  82. package/dist/icons/icon-144x144.svg +12 -0
  83. package/dist/icons/icon-152x152.png +0 -0
  84. package/dist/icons/icon-152x152.svg +12 -0
  85. package/dist/icons/icon-192x192.png +0 -0
  86. package/dist/icons/icon-192x192.svg +12 -0
  87. package/dist/icons/icon-384x384.png +0 -0
  88. package/dist/icons/icon-384x384.svg +12 -0
  89. package/dist/icons/icon-512x512.png +0 -0
  90. package/dist/icons/icon-512x512.svg +12 -0
  91. package/dist/icons/icon-72x72.png +0 -0
  92. package/dist/icons/icon-72x72.svg +12 -0
  93. package/dist/icons/icon-96x96.png +0 -0
  94. package/dist/icons/icon-96x96.svg +12 -0
  95. package/dist/icons/icon-template.svg +12 -0
  96. package/dist/index.html +52 -0
  97. package/dist/logo-128.png +0 -0
  98. package/dist/logo-256.png +0 -0
  99. package/dist/logo-32.png +0 -0
  100. package/dist/logo-512.png +0 -0
  101. package/dist/logo-64.png +0 -0
  102. package/dist/logo.svg +17 -0
  103. package/dist/manifest.json +61 -0
  104. package/dist/screenshots/cli-selection.png +0 -0
  105. package/dist/screenshots/desktop-main.png +0 -0
  106. package/dist/screenshots/mobile-chat.png +0 -0
  107. package/dist/screenshots/tools-modal.png +0 -0
  108. package/dist/sw.js +49 -0
  109. package/package.json +109 -0
  110. package/server/claude-sdk.js +721 -0
  111. package/server/cli.js +327 -0
  112. package/server/cursor-cli.js +267 -0
  113. package/server/database/auth.db +0 -0
  114. package/server/database/db.js +361 -0
  115. package/server/database/init.sql +52 -0
  116. package/server/index.js +1747 -0
  117. package/server/middleware/auth.js +111 -0
  118. package/server/openai-codex.js +389 -0
  119. package/server/projects.js +1604 -0
  120. package/server/routes/agent.js +1230 -0
  121. package/server/routes/auth.js +135 -0
  122. package/server/routes/cli-auth.js +263 -0
  123. package/server/routes/codex.js +345 -0
  124. package/server/routes/commands.js +521 -0
  125. package/server/routes/cursor.js +795 -0
  126. package/server/routes/git.js +1128 -0
  127. package/server/routes/mcp-utils.js +48 -0
  128. package/server/routes/mcp.js +552 -0
  129. package/server/routes/projects.js +378 -0
  130. package/server/routes/settings.js +178 -0
  131. package/server/routes/taskmaster.js +1963 -0
  132. package/server/routes/user.js +106 -0
  133. package/server/utils/commandParser.js +303 -0
  134. package/server/utils/gitConfig.js +24 -0
  135. package/server/utils/mcp-detector.js +198 -0
  136. package/server/utils/taskmaster-websocket.js +129 -0
  137. package/shared/modelConstants.js +65 -0
@@ -0,0 +1,66 @@
1
+ var Se={exports:{}},xe;function Be(){return xe||(xe=1,function(ue,we){(function(ce,ne){ue.exports=ne()})(globalThis,()=>(()=>{var ce={4567:function(O,t,a){var h=this&&this.__decorate||function(s,r,_,p){var u,m=arguments.length,l=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,r,_,p);else for(var g=s.length-1;g>=0;g--)(u=s[g])&&(l=(m<3?u(l):m>3?u(r,_,l):u(r,_))||l);return m>3&&l&&Object.defineProperty(r,_,l),l},d=this&&this.__param||function(s,r){return function(_,p){r(_,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=a(9042),c=a(9924),f=a(844),v=a(4725),o=a(2585),e=a(3656);let i=t.AccessibilityManager=class extends f.Disposable{constructor(s,r,_,p){super(),this._terminal=s,this._coreBrowserService=_,this._renderService=p,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,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 c.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(u=>this._handleResize(u.rows))),this.register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(u=>this._handleChar(u))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
+ `))),this.register(this._terminal.onA11yTab(u=>this._handleTab(u))),this.register(this._terminal.onKey(u=>this._handleKey(u.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,e.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,f.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let r=0;r<s;r++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,r){this._liveRegionDebouncer.refresh(s,r,this._terminal.rows)}_renderRows(s,r){const _=this._terminal.buffer,p=_.lines.length.toString();for(let u=s;u<=r;u++){const m=_.lines.get(_.ydisp+u),l=[],g=m?.translateToString(!0,void 0,void 0,l)||"",S=(_.ydisp+u+1).toString(),y=this._rowElements[u];y&&(g.length===0?(y.innerText=" ",this._rowColumns.set(y,[0,1])):(y.textContent=g,this._rowColumns.set(y,l)),y.setAttribute("aria-posinset",S),y.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,r){const _=s.target,p=this._rowElements[r===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==p)return;let u,m;if(r===0?(u=_,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(u=this._rowElements.shift(),m=_,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:s.anchorNode,offset:s.anchorOffset},_={node:s.focusNode,offset:s.focusOffset};if((r.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===_.node&&r.offset>_.offset)&&([r,_]=[_,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const p=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:p,offset:p.textContent?.length??0}),!this._rowContainer.contains(_.node))return;const u=({node:g,offset:S})=>{const y=g instanceof Text?g.parentNode:g;let b=parseInt(y?.getAttribute("aria-posinset"),10)-1;if(isNaN(b))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(y);if(!w)return console.warn("columns is null. Race condition?"),null;let x=S<w.length?w[S]:w.slice(-1)[0]+1;return x>=this._terminal.cols&&(++b,x=0),{row:b,column:x}},m=u(r),l=u(_);if(m&&l){if(m.row>l.row||m.row===l.row&&m.column>=l.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(l.row-m.row)*this._terminal.cols-m.column+l.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=i=h([d(1,o.IInstantiationService),d(2,v.ICoreBrowserService),d(3,v.IRenderService)],i)},3614:(O,t)=>{function a(c){return c.replace(/\r?\n/g,"\r")}function h(c,f){return f?"\x1B[200~"+c+"\x1B[201~":c}function d(c,f,v,o){c=h(c=a(c),v.decPrivateModes.bracketedPasteMode&&o.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),f.value=""}function n(c,f,v){const o=v.getBoundingClientRect(),e=c.clientX-o.left-10,i=c.clientY-o.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${i}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=a,t.bracketTextForPaste=h,t.copyHandler=function(c,f){c.clipboardData&&c.clipboardData.setData("text/plain",f.selectionText),c.preventDefault()},t.handlePasteEvent=function(c,f,v,o){c.stopPropagation(),c.clipboardData&&d(c.clipboardData.getData("text/plain"),f,v,o)},t.paste=d,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(c,f,v,o,e){n(c,f,v),e&&o.rightClickSelect(c),f.value=o.selectionText,f.select()}},7239:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const h=a(1505);t.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(d,n,c){this._css.set(d,n,c)}getCss(d,n){return this._css.get(d,n)}setColor(d,n,c){this._color.set(d,n,c)}getColor(d,n){return this._color.get(d,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,h,d,n){a.addEventListener(h,d,n);let c=!1;return{dispose:()=>{c||(c=!0,a.removeEventListener(h,d,n))}}}},3551:function(O,t,a){var h=this&&this.__decorate||function(i,s,r,_){var p,u=arguments.length,m=u<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,r):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,r,_);else for(var l=i.length-1;l>=0;l--)(p=i[l])&&(m=(u<3?p(m):u>3?p(s,r,m):p(s,r))||m);return u>3&&m&&Object.defineProperty(s,r,m),m},d=this&&this.__param||function(i,s){return function(r,_){s(r,_,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=a(3656),c=a(8460),f=a(844),v=a(2585),o=a(4725);let e=t.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(i,s,r,_,p){super(),this._element=i,this._mouseService=s,this._renderService=r,this._bufferService=_,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const s=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const r=i.composedPath();for(let _=0;_<r.length;_++){const p=r[_];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,s){this._activeProviderReplies&&s||(this._activeProviderReplies?.forEach(_=>{_?.forEach(p=>{p.link.dispose&&p.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[_,p]of this._linkProviderService.linkProviders.entries())s?this._activeProviderReplies?.get(_)&&(r=this._checkLinkProviderResult(_,i,r)):p.provideLinks(i.y,u=>{if(this._isMouseOut)return;const m=u?.map(l=>({link:l}));this._activeProviderReplies?.set(_,m),r=this._checkLinkProviderResult(_,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,s){const r=new Set;for(let _=0;_<s.size;_++){const p=s.get(_);if(p)for(let u=0;u<p.length;u++){const m=p[u],l=m.link.range.start.y<i?0:m.link.range.start.x,g=m.link.range.end.y>i?this._bufferService.cols:m.link.range.end.x;for(let S=l;S<=g;S++){if(r.has(S)){p.splice(u--,1);break}r.add(S)}}}}_checkLinkProviderResult(i,s,r){if(!this._activeProviderReplies)return r;const _=this._activeProviderReplies.get(i);let p=!1;for(let u=0;u<i;u++)this._activeProviderReplies.has(u)&&!this._activeProviderReplies.get(u)||(p=!0);if(!p&&_){const u=_.find(m=>this._linkAtPosition(m.link,s));u&&(r=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let u=0;u<this._activeProviderReplies.size;u++){const m=this._activeProviderReplies.get(u)?.find(l=>this._linkAtPosition(l.link,s));if(m){r=!0,this._handleNewLink(m);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const s=this._positionFromMouseEvent(i,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,s){this._currentLink&&this._lastMouseEvent&&(!i||!s||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(i.link,s)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const _=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(_,p),this._lastMouseEvent)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(i,s,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(r,s.text)}_fireUnderlineEvent(i,s){const r=i.range,_=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-_-1,r.end.x,r.end.y-_-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(i,s,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(r,s.text)}_linkAtPosition(i,s){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,_=i.range.end.y*this._bufferService.cols+i.range.end.x,p=s.y*this._bufferService.cols+s.x;return r<=p&&p<=_}_positionFromMouseEvent(i,s,r){const _=r.getCoords(i,s,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,s,r,_,p){return{x1:i,y1:s,x2:r,y2:_,cols:this._bufferService.cols,fg:p}}};t.Linkifier=e=h([d(1,o.IMouseService),d(2,o.IRenderService),d(3,v.IBufferService),d(4,o.ILinkProviderService)],e)},9042:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,t,a){var h=this&&this.__decorate||function(o,e,i,s){var r,_=arguments.length,p=_<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,i,s);else for(var u=o.length-1;u>=0;u--)(r=o[u])&&(p=(_<3?r(p):_>3?r(e,i,p):r(e,i))||p);return _>3&&p&&Object.defineProperty(e,i,p),p},d=this&&this.__param||function(o,e){return function(i,s){e(i,s,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=a(511),c=a(2585);let f=t.OscLinkProvider=class{constructor(o,e,i){this._bufferService=o,this._optionsService=e,this._oscLinkService=i}provideLinks(o,e){const i=this._bufferService.buffer.lines.get(o-1);if(!i)return void e(void 0);const s=[],r=this._optionsService.rawOptions.linkHandler,_=new n.CellData,p=i.getTrimmedLength();let u=-1,m=-1,l=!1;for(let g=0;g<p;g++)if(m!==-1||i.hasContent(g)){if(i.loadCell(g,_),_.hasExtendedAttrs()&&_.extended.urlId){if(m===-1){m=g,u=_.extended.urlId;continue}l=_.extended.urlId!==u}else m!==-1&&(l=!0);if(l||m!==-1&&g===p-1){const S=this._oscLinkService.getLinkData(u)?.uri;if(S){const y={start:{x:m+1,y:o},end:{x:g+(l||g!==p-1?0:1),y:o}};let b=!1;if(!r?.allowNonHttpProtocols)try{const w=new URL(S);["http:","https:"].includes(w.protocol)||(b=!0)}catch{b=!0}b||s.push({text:S,range:y,activate:(w,x)=>r?r.activate(w,x,y):v(0,x),hover:(w,x)=>r?.hover?.(w,x,y),leave:(w,x)=>r?.leave?.(w,x,y)})}l=!1,_.hasExtendedAttrs()&&_.extended.urlId?(m=g,u=_.extended.urlId):(m=-1,u=-1)}}e(s)}};function v(o,e){if(confirm(`Do you want to navigate to ${e}?
4
+
5
+ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=f=h([d(0,c.IBufferService),d(1,c.IOptionsService),d(2,c.IOscLinkService)],f)},6193:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(a,h){this._renderCallback=a,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,h,d){this._rowCount=d,a=a!==void 0?a:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const h=a(3614),d=a(3656),n=a(3551),c=a(9042),f=a(3730),v=a(1680),o=a(3107),e=a(5744),i=a(2950),s=a(1296),r=a(428),_=a(4269),p=a(5114),u=a(8934),m=a(3230),l=a(9312),g=a(4725),S=a(6731),y=a(8055),b=a(8969),w=a(8460),x=a(844),k=a(6114),B=a(8437),T=a(2584),M=a(7399),C=a(5941),L=a(9074),R=a(2585),D=a(5435),I=a(4567),H=a(779);class z extends b.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(A={}){super(A),this.browser=k,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(g.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((E,P)=>this.refresh(E,P))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(E=>this._reportWindowsOptions(E))),this.register(this._inputHandler.onColor(E=>this._handleColorEvent(E))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(E=>this._afterResize(E.cols,E.rows))),this.register((0,x.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const E of A){let P,F="";switch(E.index){case 256:P="foreground",F="10";break;case 257:P="background",F="11";break;case 258:P="cursor",F="12";break;default:P="ansi",F="4;"+E.index}switch(E.type){case 0:const $=y.color.toColorRGB(P==="ansi"?this._themeService.colors.ansi[E.index]:this._themeService.colors[P]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${F};${(0,C.toRgbString)($)}${T.C1_ESCAPED.ST}`);break;case 1:if(P==="ansi")this._themeService.modifyColors(W=>W.ansi[E.index]=y.channels.toColor(...E.color));else{const W=P;this._themeService.modifyColors(G=>G[W]=y.channels.toColor(...E.color))}break;case 2:this._themeService.restoreColor(E.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.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(T.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 A=this.buffer.ybase+this.buffer.y,E=this.buffer.lines.get(A);if(!E)return;const P=Math.min(this.buffer.x,this.cols-1),F=this._renderService.dimensions.css.cell.height,$=E.getWidth(P),W=this._renderService.dimensions.css.cell.width*$,G=this.buffer.y*this._renderService.dimensions.css.cell.height,j=P*this._renderService.dimensions.css.cell.width;this.textarea.style.left=j+"px",this.textarea.style.top=G+"px",this.textarea.style.width=W+"px",this.textarea.style.height=F+"px",this.textarea.style.lineHeight=F+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",E=>{this.hasSelection()&&(0,h.copyHandler)(E,this._selectionService)}));const A=E=>(0,h.handlePasteEvent)(E,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,d.addDisposableDomListener)(this.element,"paste",A)),k.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",E=>{E.button===2&&(0,h.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",E=>{(0,h.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),k.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",E=>{E.button===1&&(0,h.moveTextAreaUnderMouseCursor)(E,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){if(!A)throw new Error("Terminal requires a parent element.");if(A.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=A.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"),A.appendChild(this.element);const E=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),E.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,d.addDisposableDomListener)(this.screenElement,"mousemove",P=>this.updateCursorStyle(P))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),E.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),k.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,A.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(g.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",P=>this._handleTextAreaFocus(P))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(r.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(g.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(S.ThemeService),this._instantiationService.setService(g.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(g.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(g.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(P=>this._onRender.fire(P))),this.onResize(P=>this._renderService.resize(P.cols,P.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(u.MouseService),this._instantiationService.setService(g.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(E);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(P=>this.scrollLines(P.amount,P.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(g.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(P=>this.scrollLines(P.amount,P.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(P=>this._renderService.handleSelectionChanged(P.start,P.end,P.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(P=>{this.textarea.value=P,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(P=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(o.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",P=>this._selectionService.handleMouseDown(P))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",P=>this._handleScreenReaderModeOptionChange(P))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const A=this,E=this.element;function P(W){const G=A._mouseService.getMouseReportCoords(W,A.screenElement);if(!G)return!1;let j,Z;switch(W.overrideType||W.type){case"mousemove":Z=32,W.buttons===void 0?(j=3,W.button!==void 0&&(j=W.button<3?W.button:3)):j=1&W.buttons?0:4&W.buttons?1:2&W.buttons?2:3;break;case"mouseup":Z=0,j=W.button<3?W.button:3;break;case"mousedown":Z=1,j=W.button<3?W.button:3;break;case"wheel":if(A._customWheelEventHandler&&A._customWheelEventHandler(W)===!1||A.viewport.getLinesScrolled(W)===0)return!1;Z=W.deltaY<0?0:1,j=4;break;default:return!1}return!(Z===void 0||j===void 0||j>4)&&A.coreMouseService.triggerMouseEvent({col:G.col,row:G.row,x:G.x,y:G.y,button:j,action:Z,ctrl:W.ctrlKey,alt:W.altKey,shift:W.shiftKey})}const F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:W=>(P(W),W.buttons||(this._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.removeEventListener("mousemove",F.mousedrag)),this.cancel(W)),wheel:W=>(P(W),this.cancel(W,!0)),mousedrag:W=>{W.buttons&&P(W)},mousemove:W=>{W.buttons||P(W)}};this.register(this.coreMouseService.onProtocolChange(W=>{W?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(W)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&W?F.mousemove||(E.addEventListener("mousemove",$.mousemove),F.mousemove=$.mousemove):(E.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&W?F.wheel||(E.addEventListener("wheel",$.wheel,{passive:!1}),F.wheel=$.wheel):(E.removeEventListener("wheel",F.wheel),F.wheel=null),2&W?F.mouseup||(F.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&W?F.mousedrag||(F.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(E,"mousedown",W=>{if(W.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(W))return P(W),F.mouseup&&this._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.addEventListener("mousemove",F.mousedrag),this.cancel(W)})),this.register((0,d.addDisposableDomListener)(E,"wheel",W=>{if(!F.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(W)===!1)return!1;if(!this.buffer.hasScrollback){const G=this.viewport.getLinesScrolled(W);if(G===0)return;const j=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(W.deltaY<0?"A":"B");let Z="";for(let se=0;se<Math.abs(G);se++)Z+=j;return this.coreService.triggerDataEvent(Z,!0),this.cancel(W,!0)}return this.viewport.handleWheel(W)?this.cancel(W):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(E,"touchstart",W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(W),this.cancel(W)},{passive:!0})),this.register((0,d.addDisposableDomListener)(E,"touchmove",W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(W)?void 0:this.cancel(W)},{passive:!1}))}refresh(A,E){this._renderService?.refreshRows(A,E)}updateCursorStyle(A){this._selectionService?.shouldColumnSelect(A)?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(A,E,P=0){P===1?(super.scrollLines(A,E,P),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(A)}paste(A){(0,h.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}attachCustomWheelEventHandler(A){this._customWheelEventHandler=A}registerLinkProvider(A){return this._linkProviderService.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const E=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),E}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,E,P){this._selectionService.setSelection(A,E,P)}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(A,E){this._selectionService?.selectLines(A,E)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const E=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!E&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;E||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const P=(0,M.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),P.type===3||P.type===2){const F=this.rows-1;return this.scrollLines(P.type===2?-F:F),this.cancel(A,!0)}return P.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(P.cancel&&this.cancel(A,!0),!P.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(P.key!==T.C0.ETX&&P.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:P.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(P.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,E){const P=A.isMac&&!this.options.macOptionIsMeta&&E.altKey&&!E.ctrlKey&&!E.metaKey||A.isWindows&&E.altKey&&E.ctrlKey&&!E.metaKey||A.isWindows&&E.getModifierState("AltGraph");return E.type==="keypress"?P:P&&(!E.keyCode||E.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(E){return E.keyCode===16||E.keyCode===17||E.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let E;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)E=A.charCode;else if(A.which===null||A.which===void 0)E=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;E=A.which}return!(!E||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(E=String.fromCharCode(E),this._onKey.fire({key:E,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(E,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const E=A.data;return this.coreService.triggerDataEvent(E,!0),this.cancel(A),!0}return!1}resize(A,E){A!==this.cols||E!==this.rows?super.resize(A,E):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,E){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine(B.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 A=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=A,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const E=this._renderService.dimensions.css.canvas.width.toFixed(0),P=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${P};${E}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const F=this._renderService.dimensions.css.cell.width.toFixed(0),$=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${$};${F}t`)}}cancel(A,E){if(this.options.cancelEvents||E)return A.preventDefault(),A.stopPropagation(),!1}}t.Terminal=z},9924:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(a,h=1e3){this._renderCallback=a,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,h,d){this._rowCount=d,a=a!==void 0?a:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const c=n-this._lastRefreshMs,f=this._debounceThresholdMS-c;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h)}}},1680:function(O,t,a){var h=this&&this.__decorate||function(i,s,r,_){var p,u=arguments.length,m=u<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,r):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,r,_);else for(var l=i.length-1;l>=0;l--)(p=i[l])&&(m=(u<3?p(m):u>3?p(s,r,m):p(s,r))||m);return u>3&&m&&Object.defineProperty(s,r,m),m},d=this&&this.__param||function(i,s){return function(r,_){s(r,_,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=a(3656),c=a(4725),f=a(8460),v=a(844),o=a(2585);let e=t.Viewport=class extends v.Disposable{constructor(i,s,r,_,p,u,m,l){super(),this._viewportElement=i,this._scrollArea=s,this._bufferService=r,this._optionsService=_,this._charSizeService=p,this._renderService=u,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(g=>this._activeBuffer=g.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(g=>this._renderDimensions=g)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(g=>this._handleThemeChange(g))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.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(i){if(i)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<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(i,s){const r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&r<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const s=this._getPixelsScrolled(i);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(i,s))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=i*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:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let s=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(i,s){let r,_="";const p=[],u=s??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let l=i;l<u;l++){const g=m.get(l);if(!g)continue;const S=m.get(l+1)?.isWrapped;if(_+=g.translateToString(!S),!S||l===m.length-1){const y=document.createElement("div");y.textContent=_,p.push(y),_.length>0&&(r=y),_=""}}return{bufferElements:p,cursorElement:r}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let s=this._applyScrollModifier(i.deltaY,i);return i.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):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(i,s){const r=this._optionsService.rawOptions.fastScrollModifier;return r==="alt"&&s.altKey||r==="ctrl"&&s.ctrlKey||r==="shift"&&s.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const s=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(i,s))}};t.Viewport=e=h([d(2,o.IBufferService),d(3,o.IOptionsService),d(4,c.ICharSizeService),d(5,c.IRenderService),d(6,c.ICoreBrowserService),d(7,c.IThemeService)],e)},3107:function(O,t,a){var h=this&&this.__decorate||function(o,e,i,s){var r,_=arguments.length,p=_<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,i,s);else for(var u=o.length-1;u>=0;u--)(r=o[u])&&(p=(_<3?r(p):_>3?r(e,i,p):r(e,i))||p);return _>3&&p&&Object.defineProperty(e,i,p),p},d=this&&this.__param||function(o,e){return function(i,s){e(i,s,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=a(4725),c=a(844),f=a(2585);let v=t.BufferDecorationRenderer=class extends c.Disposable{constructor(o,e,i,s,r){super(),this._screenElement=o,this._bufferService=e,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,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(_=>this._removeDecoration(_))),this.register((0,c.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const o of this._decorationService.decorations)this._renderDecoration(o);this._dimensionsChanged=!1}_renderDecoration(o){this._refreshStyle(o),this._dimensionsChanged&&this._refreshXPosition(o)}_createElement(o){const e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",o?.options?.layer==="top"),e.style.width=`${Math.round((o.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,e.style.height=(o.options.height||1)*this._renderService.dimensions.css.cell.height+"px",e.style.top=(o.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",e.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=o.options.x??0;return i&&i>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(o,e),e}_refreshStyle(o){const e=o.marker.line-this._bufferService.buffers.active.ydisp;if(e<0||e>=this._bufferService.rows)o.element&&(o.element.style.display="none",o.onRenderEmitter.fire(o.element));else{let i=this._decorationElements.get(o);i||(i=this._createElement(o),o.element=i,this._decorationElements.set(o,i),this._container.appendChild(i),o.onDispose(()=>{this._decorationElements.delete(o),i.remove()})),i.style.top=e*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",o.onRenderEmitter.fire(i)}}_refreshXPosition(o,e=o.element){if(!e)return;const i=o.options.x??0;(o.options.anchor||"left")==="right"?e.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":e.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(o){this._decorationElements.get(o)?.remove(),this._decorationElements.delete(o),o.dispose()}};t.BufferDecorationRenderer=v=h([d(1,f.IBufferService),d(2,n.ICoreBrowserService),d(3,f.IDecorationService),d(4,n.IRenderService)],v)},5871:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const h of this._zones)if(h.color===a.options.overviewRulerOptions.color&&h.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,a.marker.line))return;if(this._lineAdjacentToZone(h,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(h,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,h){return h>=a.startBufferLine&&h<=a.endBufferLine}_lineAdjacentToZone(a,h,d){return h>=a.startBufferLine-this._linePadding[d||"full"]&&h<=a.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(a,h){a.startBufferLine=Math.min(a.startBufferLine,h),a.endBufferLine=Math.max(a.endBufferLine,h)}}},5744:function(O,t,a){var h=this&&this.__decorate||function(r,_,p,u){var m,l=arguments.length,g=l<3?_:u===null?u=Object.getOwnPropertyDescriptor(_,p):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,_,p,u);else for(var S=r.length-1;S>=0;S--)(m=r[S])&&(g=(l<3?m(g):l>3?m(_,p,g):m(_,p))||g);return l>3&&g&&Object.defineProperty(_,p,g),g},d=this&&this.__param||function(r,_){return function(p,u){_(p,u,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=a(5871),c=a(4725),f=a(844),v=a(2585),o={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let s=t.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(r,_,p,u,m,l,g){super(),this._viewportElement=r,this._screenElement=_,this._bufferService=p,this._decorationService=u,this._renderService=m,this._optionsService=l,this._coreBrowserService=g,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const S=this._canvas.getContext("2d");if(!S)throw new Error("Ctx cannot be null");this._ctx=S,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.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 r=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);e.full=this._canvas.width,e.left=r,e.center=_,e.right=r,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=e.left,i.right=e.left+e.center}_refreshDrawHeightConstants(){o.full=Math.round(2*this._coreBrowserService.dpr);const r=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(r,12),6)*this._coreBrowserService.dpr);o.left=_,o.center=_,o.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const r=this._colorZoneStore.zones;for(const _ of r)_.position!=="full"&&this._renderColorZone(_);for(const _ of r)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(r){this._ctx.fillStyle=r.color,this._ctx.fillRect(i[r.position||"full"],Math.round((this._canvas.height-1)*(r.startBufferLine/this._bufferService.buffers.active.lines.length)-o[r.position||"full"]/2),e[r.position||"full"],Math.round((this._canvas.height-1)*((r.endBufferLine-r.startBufferLine)/this._bufferService.buffers.active.lines.length)+o[r.position||"full"]))}_queueRefresh(r,_){this._shouldUpdateDimensions=r||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t.OverviewRulerRenderer=s=h([d(2,v.IBufferService),d(3,v.IDecorationService),d(4,c.IRenderService),d(5,v.IOptionsService),d(6,c.ICoreBrowserService)],s)},2950:function(O,t,a){var h=this&&this.__decorate||function(o,e,i,s){var r,_=arguments.length,p=_<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,i,s);else for(var u=o.length-1;u>=0;u--)(r=o[u])&&(p=(_<3?r(p):_>3?r(e,i,p):r(e,i))||p);return _>3&&p&&Object.defineProperty(e,i,p),p},d=this&&this.__param||function(o,e){return function(i,s){e(i,s,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=a(4725),c=a(2585),f=a(2584);let v=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(o,e,i,s,r,_){this._textarea=o,this._compositionView=e,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=_,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(o){this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229||o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(o){if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const o=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,i=e.replace(o,"");this._dataAlreadySent=i,e.length>o.length?this._coreService.triggerDataEvent(i,!0):e.length<o.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):e.length===o.length&&e!==o&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(o){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}o||setTimeout(()=>this.updateCompositionElements(!0),0)}}};t.CompositionHelper=v=h([d(2,c.IBufferService),d(3,c.IOptionsService),d(4,c.ICoreService),d(5,n.IRenderService)],v)},9806:(O,t)=>{function a(h,d,n){const c=n.getBoundingClientRect(),f=h.getComputedStyle(n),v=parseInt(f.getPropertyValue("padding-left")),o=parseInt(f.getPropertyValue("padding-top"));return[d.clientX-c.left-v,d.clientY-c.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=a,t.getCoords=function(h,d,n,c,f,v,o,e,i){if(!v)return;const s=a(h,d,n);return s?(s[0]=Math.ceil((s[0]+(i?o/2:0))/o),s[1]=Math.ceil(s[1]/e),s[0]=Math.min(Math.max(s[0],1),c+(i?1:0)),s[1]=Math.min(Math.max(s[1],1),f),s):void 0}},9504:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const h=a(2584);function d(e,i,s,r){const _=e-n(e,s),p=i-n(i,s),u=Math.abs(_-p)-function(m,l,g){let S=0;const y=m-n(m,g),b=l-n(l,g);for(let w=0;w<Math.abs(y-b);w++){const x=c(m,l)==="A"?-1:1;g.buffer.lines.get(y+x*w)?.isWrapped&&S++}return S}(e,i,s);return o(u,v(c(e,i),r))}function n(e,i){let s=0,r=i.buffer.lines.get(e),_=r?.isWrapped;for(;_&&e>=0&&e<i.rows;)s++,r=i.buffer.lines.get(--e),_=r?.isWrapped;return s}function c(e,i){return e>i?"A":"B"}function f(e,i,s,r,_,p){let u=e,m=i,l="";for(;u!==s||m!==r;)u+=_?1:-1,_&&u>p.cols-1?(l+=p.buffer.translateBufferLineToString(m,!1,e,u),u=0,e=0,m++):!_&&u<0&&(l+=p.buffer.translateBufferLineToString(m,!1,0,e+1),u=p.cols-1,e=u,m--);return l+p.buffer.translateBufferLineToString(m,!1,e,u)}function v(e,i){const s=i?"O":"[";return h.C0.ESC+s+e}function o(e,i){e=Math.floor(e);let s="";for(let r=0;r<e;r++)s+=i;return s}t.moveToCellSequence=function(e,i,s,r){const _=s.buffer.x,p=s.buffer.y;if(!s.buffer.hasScrollback)return function(l,g,S,y,b,w){return d(g,y,b,w).length===0?"":o(f(l,g,l,g-n(g,b),!1,b).length,v("D",w))}(_,p,0,i,s,r)+d(p,i,s,r)+function(l,g,S,y,b,w){let x;x=d(g,y,b,w).length>0?y-n(y,b):g;const k=y,B=function(T,M,C,L,R,D){let I;return I=d(C,L,R,D).length>0?L-n(L,R):M,T<C&&I<=L||T>=C&&I<L?"C":"D"}(l,g,S,y,b,w);return o(f(l,x,S,k,B==="C",b).length,v(B,w))}(_,p,e,i,s,r);let u;if(p===i)return u=_>e?"D":"C",o(Math.abs(_-e),v(u,r));u=p>i?"D":"C";const m=Math.abs(p-i);return o(function(l,g){return g.cols-l}(p>i?e:_,s)+(m-1)*s.cols+1+((p>i?_:e)-1),v(u,r))}},1296:function(O,t,a){var h=this&&this.__decorate||function(w,x,k,B){var T,M=arguments.length,C=M<3?x:B===null?B=Object.getOwnPropertyDescriptor(x,k):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,x,k,B);else for(var L=w.length-1;L>=0;L--)(T=w[L])&&(C=(M<3?T(C):M>3?T(x,k,C):T(x,k))||C);return M>3&&C&&Object.defineProperty(x,k,C),C},d=this&&this.__param||function(w,x){return function(k,B){x(k,B,w)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=a(3787),c=a(2550),f=a(2223),v=a(6171),o=a(6052),e=a(4725),i=a(8055),s=a(8460),r=a(844),_=a(2585),p="xterm-dom-renderer-owner-",u="xterm-rows",m="xterm-fg-",l="xterm-bg-",g="xterm-focus",S="xterm-selection";let y=1,b=t.DomRenderer=class extends r.Disposable{constructor(w,x,k,B,T,M,C,L,R,D,I,H,z){super(),this._terminal=w,this._document=x,this._element=k,this._screenElement=B,this._viewportElement=T,this._helperContainer=M,this._linkifier2=C,this._charSizeService=R,this._optionsService=D,this._bufferService=I,this._coreBrowserService=H,this._themeService=z,this._terminalClass=y++,this._rowElements=[],this._selectionRenderModel=(0,o.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(u),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(S),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(U=>this._injectCss(U))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(U=>this._handleLinkHover(U))),this.register(this._linkifier2.onHideLinkUnderline(U=>this._handleLinkLeave(U))),this.register((0,r.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 c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const k of this._rowElements)k.style.width=`${this.dimensions.css.canvas.width}px`,k.style.height=`${this.dimensions.css.cell.height}px`,k.style.lineHeight=`${this.dimensions.css.cell.height}px`,k.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const x=`${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=x,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let x=`${this._terminalSelector} .${u} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;x+=`${this._terminalSelector} .${u} .xterm-dim { color: ${i.color.multiplyOpacity(w.foreground,.5).css};}`,x+=`${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 k=`blink_underline_${this._terminalClass}`,B=`blink_bar_${this._terminalClass}`,T=`blink_block_${this._terminalClass}`;x+=`@keyframes ${k} { 50% { border-bottom-style: hidden; }}`,x+=`@keyframes ${B} { 50% { box-shadow: none; }}`,x+=`@keyframes ${T} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,x+=`${this._terminalSelector} .${u}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${k} 1s step-end infinite;}${this._terminalSelector} .${u}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${u}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,x+=`${this._terminalSelector} .${S} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${S} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${S} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[M,C]of w.ansi.entries())x+=`${this._terminalSelector} .${m}${M} { color: ${C.css}; }${this._terminalSelector} .${m}${M}.xterm-dim { color: ${i.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${l}${M} { background-color: ${C.css}; }`;x+=`${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR} { color: ${i.color.opaque(w.background).css}; }${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${i.color.multiplyOpacity(i.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${l}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=x}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,x){for(let k=this._rowElements.length;k<=x;k++){const B=this._document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,x){this._refreshRowElements(w,x),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(g),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(g),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,x,k){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,x,k),this.renderRows(0,this._bufferService.rows-1),!w||!x)return;this._selectionRenderModel.update(this._terminal,w,x,k);const B=this._selectionRenderModel.viewportStartRow,T=this._selectionRenderModel.viewportEndRow,M=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(M>=this._bufferService.rows||C<0)return;const L=this._document.createDocumentFragment();if(k){const R=w[0]>x[0];L.appendChild(this._createSelectionElement(M,R?x[0]:w[0],R?w[0]:x[0],C-M+1))}else{const R=B===M?w[0]:0,D=M===T?x[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(M,R,D));const I=C-M-1;if(L.appendChild(this._createSelectionElement(M+1,0,this._bufferService.cols,I)),M!==C){const H=T===C?x[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(C,0,H))}}this._selectionContainer.appendChild(L)}_createSelectionElement(w,x,k,B=1){const T=this._document.createElement("div"),M=x*this.dimensions.css.cell.width;let C=this.dimensions.css.cell.width*(k-x);return M+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-M),T.style.height=B*this.dimensions.css.cell.height+"px",T.style.top=w*this.dimensions.css.cell.height+"px",T.style.left=`${M}px`,T.style.width=`${C}px`,T}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,x){const k=this._bufferService.buffer,B=k.ybase+k.y,T=Math.min(k.x,this._bufferService.cols-1),M=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=w;R<=x;R++){const D=R+k.ydisp,I=this._rowElements[R],H=k.lines.get(D);if(!I||!H)break;I.replaceChildren(...this._rowFactory.createRow(H,D,D===B,C,L,T,M,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,x,k,B,T,M){k<0&&(w=0),B<0&&(x=0);const C=this._bufferService.rows-1;k=Math.max(Math.min(k,C),0),B=Math.max(Math.min(B,C),0),T=Math.min(T,this._bufferService.cols);const L=this._bufferService.buffer,R=L.ybase+L.y,D=Math.min(L.x,T-1),I=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let U=k;U<=B;++U){const A=U+L.ydisp,E=this._rowElements[U],P=L.lines.get(A);if(!E||!P)break;E.replaceChildren(...this._rowFactory.createRow(P,A,A===R,H,z,D,I,this.dimensions.css.cell.width,this._widthCache,M?U===k?w:0:-1,M?(U===B?x:T)-1:-1))}}};t.DomRenderer=b=h([d(7,_.IInstantiationService),d(8,e.ICharSizeService),d(9,_.IOptionsService),d(10,_.IBufferService),d(11,e.ICoreBrowserService),d(12,e.IThemeService)],b)},3787:function(O,t,a){var h=this&&this.__decorate||function(u,m,l,g){var S,y=arguments.length,b=y<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,l):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,m,l,g);else for(var w=u.length-1;w>=0;w--)(S=u[w])&&(b=(y<3?S(b):y>3?S(m,l,b):S(m,l))||b);return y>3&&b&&Object.defineProperty(m,l,b),b},d=this&&this.__param||function(u,m){return function(l,g){m(l,g,u)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=a(2223),c=a(643),f=a(511),v=a(2585),o=a(8055),e=a(4725),i=a(4269),s=a(6171),r=a(3734);let _=t.DomRendererRowFactory=class{constructor(u,m,l,g,S,y,b){this._document=u,this._characterJoinerService=m,this._optionsService=l,this._coreBrowserService=g,this._coreService=S,this._decorationService=y,this._themeService=b,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(u,m,l){this._selectionStart=u,this._selectionEnd=m,this._columnSelectMode=l}createRow(u,m,l,g,S,y,b,w,x,k,B){const T=[],M=this._characterJoinerService.getJoinedCharacters(m),C=this._themeService.colors;let L,R=u.getNoBgTrimmedLength();l&&R<y+1&&(R=y+1);let D=0,I="",H=0,z=0,U=0,A=!1,E=0,P=!1,F=0;const $=[],W=k!==-1&&B!==-1;for(let G=0;G<R;G++){u.loadCell(G,this._workCell);let j=this._workCell.getWidth();if(j===0)continue;let Z=!1,se=G,q=this._workCell;if(M.length>0&&G===M[0][0]){Z=!0;const K=M.shift();q=new i.JoinedCellData(this._workCell,u.translateToString(!0,K[0],K[1]),K[1]-K[0]),se=K[1]-1,j=q.getWidth()}const le=this._isCellInSelection(G,m),_e=l&&G===y,J=W&&G>=k&&G<=B;let V=!1;this._decorationService.forEachDecorationAtCell(G,m,void 0,K=>{V=!0});let X=q.getChars()||c.WHITESPACE_CELL_CHAR;if(X===" "&&(q.isUnderline()||q.isOverline())&&(X=" "),F=j*w-x.get(X,q.isBold(),q.isItalic()),L){if(D&&(le&&P||!le&&!P&&q.bg===H)&&(le&&P&&C.selectionForeground||q.fg===z)&&q.extended.ext===U&&J===A&&F===E&&!_e&&!Z&&!V){q.isInvisible()?I+=c.WHITESPACE_CELL_CHAR:I+=X,D++;continue}D&&(L.textContent=I),L=this._document.createElement("span"),D=0,I=""}else L=this._document.createElement("span");if(H=q.bg,z=q.fg,U=q.extended.ext,A=J,E=F,P=le,Z&&y>=G&&y<=se&&(y=G),!this._coreService.isCursorHidden&&_e&&this._coreService.isCursorInitialized){if($.push("xterm-cursor"),this._coreBrowserService.isFocused)b&&$.push("xterm-cursor-blink"),$.push(g==="bar"?"xterm-cursor-bar":g==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(S)switch(S){case"outline":$.push("xterm-cursor-outline");break;case"block":$.push("xterm-cursor-block");break;case"bar":$.push("xterm-cursor-bar");break;case"underline":$.push("xterm-cursor-underline")}}if(q.isBold()&&$.push("xterm-bold"),q.isItalic()&&$.push("xterm-italic"),q.isDim()&&$.push("xterm-dim"),I=q.isInvisible()?c.WHITESPACE_CELL_CHAR:q.getChars()||c.WHITESPACE_CELL_CHAR,q.isUnderline()&&($.push(`xterm-underline-${q.extended.underlineStyle}`),I===" "&&(I=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${r.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let K=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&K<8&&(K+=8),L.style.textDecorationColor=C.ansi[K].css}q.isOverline()&&($.push("xterm-overline"),I===" "&&(I=" ")),q.isStrikethrough()&&$.push("xterm-strikethrough"),J&&(L.style.textDecoration="underline");let N=q.getFgColor(),Y=q.getFgColorMode(),ie=q.getBgColor(),te=q.getBgColorMode();const de=!!q.isInverse();if(de){const K=N;N=ie,ie=K;const fe=Y;Y=te,te=fe}let oe,he,re,ee=!1;switch(this._decorationService.forEachDecorationAtCell(G,m,void 0,K=>{K.options.layer!=="top"&&ee||(K.backgroundColorRGB&&(te=50331648,ie=K.backgroundColorRGB.rgba>>8&16777215,oe=K.backgroundColorRGB),K.foregroundColorRGB&&(Y=50331648,N=K.foregroundColorRGB.rgba>>8&16777215,he=K.foregroundColorRGB),ee=K.options.layer==="top")}),!ee&&le&&(oe=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,ie=oe.rgba>>8&16777215,te=50331648,ee=!0,C.selectionForeground&&(Y=50331648,N=C.selectionForeground.rgba>>8&16777215,he=C.selectionForeground)),ee&&$.push("xterm-decoration-top"),te){case 16777216:case 33554432:re=C.ansi[ie],$.push(`xterm-bg-${ie}`);break;case 50331648:re=o.channels.toColor(ie>>16,ie>>8&255,255&ie),this._addStyle(L,`background-color:#${p((ie>>>0).toString(16),"0",6)}`);break;default:de?(re=C.foreground,$.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):re=C.background}switch(oe||q.isDim()&&(oe=o.color.multiplyOpacity(re,.5)),Y){case 16777216:case 33554432:q.isBold()&&N<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(N+=8),this._applyMinimumContrast(L,re,C.ansi[N],q,oe,void 0)||$.push(`xterm-fg-${N}`);break;case 50331648:const K=o.channels.toColor(N>>16&255,N>>8&255,255&N);this._applyMinimumContrast(L,re,K,q,oe,he)||this._addStyle(L,`color:#${p(N.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,re,C.foreground,q,oe,he)||de&&$.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}$.length&&(L.className=$.join(" "),$.length=0),_e||Z||V?L.textContent=I:D++,F!==this.defaultSpacing&&(L.style.letterSpacing=`${F}px`),T.push(L),G=se}return L&&D&&(L.textContent=I),T}_applyMinimumContrast(u,m,l,g,S,y){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(g.getCode()))return!1;const b=this._getContrastCache(g);let w;if(S||y||(w=b.getColor(m.rgba,l.rgba)),w===void 0){const x=this._optionsService.rawOptions.minimumContrastRatio/(g.isDim()?2:1);w=o.color.ensureContrastRatio(S||m,y||l,x),b.setColor((S||m).rgba,(y||l).rgba,w??null)}return!!w&&(this._addStyle(u,`color:${w.css}`),!0)}_getContrastCache(u){return u.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(u,m){u.setAttribute("style",`${u.getAttribute("style")||""}${m};`)}_isCellInSelection(u,m){const l=this._selectionStart,g=this._selectionEnd;return!(!l||!g)&&(this._columnSelectMode?l[0]<=g[0]?u>=l[0]&&m>=l[1]&&u<g[0]&&m<=g[1]:u<l[0]&&m>=l[1]&&u>=g[0]&&m<=g[1]:m>l[1]&&m<g[1]||l[1]===g[1]&&m===l[1]&&u>=l[0]&&u<g[0]||l[1]<g[1]&&m===g[1]&&u<g[0]||l[1]<g[1]&&m===l[1]&&u>=l[0])}};function p(u,m,l){for(;u.length<l;)u=m+u;return u}t.DomRendererRowFactory=_=h([d(1,e.ICharacterJoinerService),d(2,v.IOptionsService),d(3,e.ICoreBrowserService),d(4,v.ICoreService),d(5,v.IDecorationService),d(6,e.IThemeService)],_)},2550:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(a,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=a.createElement("span");d.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const c=a.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";const f=a.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[d,n,c,f],this._container.appendChild(d),this._container.appendChild(n),this._container.appendChild(c),this._container.appendChild(f),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,h,d,n){a===this._font&&h===this._fontSize&&d===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=h,this._weight=d,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,h,d){let n=0;if(!h&&!d&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const v=this._measure(a,0);return v>0&&(this._flat[n]=v),v}let c=a;h&&(c+="B"),d&&(c+="I");let f=this._holey.get(c);if(f===void 0){let v=0;h&&(v|=1),d&&(v|=2),f=this._measure(a,v),f>0&&this._holey.set(c,f)}return f}_measure(a,h){const d=this._measureElements[h];return d.textContent=a.repeat(32),d.offsetWidth/32}}},2223:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const h=a(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(O,t)=>{function a(d){return 57508<=d&&d<=57558}function h(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},t.isEmoji=h,t.allowRescaling=function(d,n,c,f){return n===1&&c>Math.ceil(1.5*f)&&d!==void 0&&d>255&&!h(d)&&!a(d)&&!function(v){return 57344<=v&&v<=63743}(d)},t.treatGlyphAsBackgroundColor=function(d){return a(d)||function(n){return 9472<=n&&n<=9631}(d)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(d,n,c=0){return(d-(2*Math.round(n)-c))%(2*Math.round(n))}},6052:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(d,n,c,f=!1){if(this.selectionStart=n,this.selectionEnd=c,!n||!c||n[0]===c[0]&&n[1]===c[1])return void this.clear();const v=d.buffers.active.ydisp,o=n[1]-v,e=c[1]-v,i=Math.max(o,0),s=Math.min(e,d.rows-1);i>=d.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=i,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=c[0])}isCellSelected(d,n,c){return!!this.hasSelection&&(c-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&c>=this.viewportCappedStartRow&&n<this.endCol&&c<=this.viewportCappedEndRow:n<this.startCol&&c>=this.viewportCappedStartRow&&n>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},456:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,h=this.selectionEnd;return!(!a||!h)&&(a[1]>h[1]||a[1]===h[1]&&a[0]>h[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,t,a){var h=this&&this.__decorate||function(s,r,_,p){var u,m=arguments.length,l=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,r,_,p);else for(var g=s.length-1;g>=0;g--)(u=s[g])&&(l=(m<3?u(l):m>3?u(r,_,l):u(r,_))||l);return m>3&&l&&Object.defineProperty(r,_,l),l},d=this&&this.__param||function(s,r){return function(_,p){r(_,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=a(2585),c=a(8460),f=a(844);let v=t.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,r,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new i(this._optionsService))}catch{this._measureStrategy=this.register(new e(s,r,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};t.CharSizeService=v=h([d(2,n.IOptionsService)],v);class o extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(r,_){r!==void 0&&r>0&&_!==void 0&&_>0&&(this._result.width=r,this._result.height=_)}}class e extends o{constructor(r,_,p){super(),this._document=r,this._parentElement=_,this._optionsService=p,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class i extends o{constructor(r){super(),this._optionsService=r,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const r=this._ctx.measureText("W");return this._validateAndSet(r.width,r.fontBoundingBoxAscent+r.fontBoundingBoxDescent),this._result}}},4269:function(O,t,a){var h=this&&this.__decorate||function(i,s,r,_){var p,u=arguments.length,m=u<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,r):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,r,_);else for(var l=i.length-1;l>=0;l--)(p=i[l])&&(m=(u<3?p(m):u>3?p(s,r,m):p(s,r))||m);return u>3&&m&&Object.defineProperty(s,r,m),m},d=this&&this.__param||function(i,s){return function(r,_){s(r,_,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(3734),c=a(643),f=a(511),v=a(2585);class o extends n.AttributeData{constructor(s,r,_){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=r,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=o;let e=t.CharacterJoinerService=class Ae{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(s){const r={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(r),r.id}deregister(s){for(let r=0;r<this._characterJoiners.length;r++)if(this._characterJoiners[r].id===s)return this._characterJoiners.splice(r,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const r=this._bufferService.buffer.lines.get(s);if(!r||r.length===0)return[];const _=[],p=r.translateToString(!0);let u=0,m=0,l=0,g=r.getFg(0),S=r.getBg(0);for(let y=0;y<r.getTrimmedLength();y++)if(r.loadCell(y,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==g||this._workCell.bg!==S){if(y-u>1){const b=this._getJoinedRanges(p,l,m,r,u);for(let w=0;w<b.length;w++)_.push(b[w])}u=y,l=m,g=this._workCell.fg,S=this._workCell.bg}m+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-u>1){const y=this._getJoinedRanges(p,l,m,r,u);for(let b=0;b<y.length;b++)_.push(y[b])}return _}_getJoinedRanges(s,r,_,p,u){const m=s.substring(r,_);let l=[];try{l=this._characterJoiners[0].handler(m)}catch(g){console.error(g)}for(let g=1;g<this._characterJoiners.length;g++)try{const S=this._characterJoiners[g].handler(m);for(let y=0;y<S.length;y++)Ae._mergeRanges(l,S[y])}catch(S){console.error(S)}return this._stringRangesToCellRanges(l,p,u),l}_stringRangesToCellRanges(s,r,_){let p=0,u=!1,m=0,l=s[p];if(l){for(let g=_;g<this._bufferService.cols;g++){const S=r.getWidth(g),y=r.getString(g).length||c.WHITESPACE_CELL_CHAR.length;if(S!==0){if(!u&&l[0]<=m&&(l[0]=g,u=!0),l[1]<=m){if(l[1]=g,l=s[++p],!l)break;l[0]<=m?(l[0]=g,u=!0):u=!1}m+=y}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(s,r){let _=!1;for(let p=0;p<s.length;p++){const u=s[p];if(_){if(r[1]<=u[0])return s[p-1][1]=r[1],s;if(r[1]<=u[1])return s[p-1][1]=Math.max(r[1],u[1]),s.splice(p,1),s;s.splice(p,1),p--}else{if(r[1]<=u[0])return s.splice(p,0,r),s;if(r[1]<=u[1])return u[0]=Math.min(r[0],u[0]),s;r[0]<u[1]&&(u[0]=Math.min(r[0],u[0]),_=!0)}}return _?s[s.length-1][1]=r[1]:s.push(r),s}};t.CharacterJoinerService=e=h([d(0,v.IBufferService)],e)},5114:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const h=a(844),d=a(8460),n=a(3656);class c extends h.Disposable{constructor(o,e,i){super(),this._textarea=o,this._window=e,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,d.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(o){this._window!==o&&(this._window=o,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}t.CoreBrowserService=c;class f extends h.Disposable{constructor(o){super(),this._parentWindow=o,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new d.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(o){this._parentWindow=o,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){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:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const h=a(844);class d extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{const f=this.linkProviders.indexOf(c);f!==-1&&this.linkProviders.splice(f,1)}}}}t.LinkProviderService=d},8934:function(O,t,a){var h=this&&this.__decorate||function(v,o,e,i){var s,r=arguments.length,_=r<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(v,o,e,i);else for(var p=v.length-1;p>=0;p--)(s=v[p])&&(_=(r<3?s(_):r>3?s(o,e,_):s(o,e))||_);return r>3&&_&&Object.defineProperty(o,e,_),_},d=this&&this.__param||function(v,o){return function(e,i){o(e,i,v)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=a(4725),c=a(9806);let f=t.MouseService=class{constructor(v,o){this._renderService=v,this._charSizeService=o}getCoords(v,o,e,i,s){return(0,c.getCoords)(window,v,o,e,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(v,o){const e=(0,c.getCoordsRelativeToElement)(window,v,o);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};t.MouseService=f=h([d(0,n.IRenderService),d(1,n.ICharSizeService)],f)},3230:function(O,t,a){var h=this&&this.__decorate||function(s,r,_,p){var u,m=arguments.length,l=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,r,_,p);else for(var g=s.length-1;g>=0;g--)(u=s[g])&&(l=(m<3?u(l):m>3?u(r,_,l):u(r,_))||l);return m>3&&l&&Object.defineProperty(r,_,l),l},d=this&&this.__param||function(s,r){return function(_,p){r(_,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=a(6193),c=a(4725),f=a(8460),v=a(844),o=a(7226),e=a(2585);let i=t.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,r,_,p,u,m,l,g){super(),this._rowCount=s,this._charSizeService=p,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._observerDisposable=this.register(new v.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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer((S,y)=>this._renderRows(S,y),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(m.onResize(()=>this._fullRefresh())),this.register(m.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(_.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(u.onDecorationRegistered(()=>this._fullRefresh())),this.register(u.onDecorationRemoved(()=>this._fullRefresh())),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()})),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(m.buffer.y,m.buffer.y,!0))),this.register(g.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,r),this.register(l.onWindowChange(S=>this._registerIntersectionObserver(S,r)))}_registerIntersectionObserver(s,r){if("IntersectionObserver"in s){const _=new s.IntersectionObserver(p=>this._handleIntersectionChange(p[p.length-1]),{threshold:0});_.observe(r),this._observerDisposable.value=(0,v.toDisposable)(()=>_.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,r,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,r,this._rowCount))}_renderRows(s,r){this._renderer.value&&(s=Math.min(s,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(s,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:r}),this._onRender.fire({start:s,end:r}),this._isNextRenderRedrawOnly=!0)}resize(s,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){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(s,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(s,r)):this._renderer.value.handleResize(s,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(s,r,_){this._selectionState.start=s,this._selectionState.end=r,this._selectionState.columnSelectMode=_,this._renderer.value?.handleSelectionChanged(s,r,_)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=i=h([d(2,e.IOptionsService),d(3,c.ICharSizeService),d(4,e.IDecorationService),d(5,e.IBufferService),d(6,c.ICoreBrowserService),d(7,c.IThemeService)],i)},9312:function(O,t,a){var h=this&&this.__decorate||function(l,g,S,y){var b,w=arguments.length,x=w<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,g,S,y);else for(var k=l.length-1;k>=0;k--)(b=l[k])&&(x=(w<3?b(x):w>3?b(g,S,x):b(g,S))||x);return w>3&&x&&Object.defineProperty(g,S,x),x},d=this&&this.__param||function(l,g){return function(S,y){g(S,y,l)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=a(9806),c=a(9504),f=a(456),v=a(4725),o=a(8460),e=a(844),i=a(6114),s=a(4841),r=a(511),_=a(2585),p=" ",u=new RegExp(p,"g");let m=t.SelectionService=class extends e.Disposable{constructor(l,g,S,y,b,w,x,k,B){super(),this._element=l,this._screenElement=g,this._linkifier=S,this._bufferService=y,this._coreService=b,this._mouseService=w,this._optionsService=x,this._renderService=k,this._coreBrowserService=B,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new r.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new o.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new o.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new o.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 f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;return!(!l||!g||l[0]===g[0]&&l[1]===g[1])}get selectionText(){const l=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;if(!l||!g)return"";const S=this._bufferService.buffer,y=[];if(this._activeSelectionMode===3){if(l[0]===g[0])return"";const b=l[0]<g[0]?l[0]:g[0],w=l[0]<g[0]?g[0]:l[0];for(let x=l[1];x<=g[1];x++){const k=S.translateBufferLineToString(x,!0,b,w);y.push(k)}}else{const b=l[1]===g[1]?g[0]:void 0;y.push(S.translateBufferLineToString(l[1],!0,l[0],b));for(let w=l[1]+1;w<=g[1]-1;w++){const x=S.lines.get(w),k=S.translateBufferLineToString(w,!0);x?.isWrapped?y[y.length-1]+=k:y.push(k)}if(l[1]!==g[1]){const w=S.lines.get(g[1]),x=S.translateBufferLineToString(g[1],!0,0,g[0]);w&&w.isWrapped?y[y.length-1]+=x:y.push(x)}}return y.map(b=>b.replace(u," ")).join(i.isWindows?`\r
6
+ `:`
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),i.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const g=this._getMouseBufferCoords(l),S=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!!(S&&y&&g)&&this._areCoordsInSelection(g,S,y)}isCellInSelection(l,g){const S=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!(!S||!y)&&this._areCoordsInSelection([l,g],S,y)}_areCoordsInSelection(l,g,S){return l[1]>g[1]&&l[1]<S[1]||g[1]===S[1]&&l[1]===g[1]&&l[0]>=g[0]&&l[0]<S[0]||g[1]<S[1]&&l[1]===S[1]&&l[0]<S[0]||g[1]<S[1]&&l[1]===g[1]&&l[0]>=g[0]}_selectWordAtCursor(l,g){const S=this._linkifier.currentLink?.link?.range;if(S)return this._model.selectionStart=[S.start.x-1,S.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(S,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const y=this._getMouseBufferCoords(l);return!!y&&(this._selectWordAt(y,g),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,g){this._model.clearSelection(),l=Math.max(l,0),g=Math.min(g,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,g],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const g=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(g)return g[0]--,g[1]--,g[1]+=this._bufferService.buffer.ydisp,g}_getMouseEventScrollAmount(l){let g=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const S=this._renderService.dimensions.css.canvas.height;return g>=0&&g<=S?0:(g>S&&(g-=S),g=Math.min(Math.max(g,-50),50),g/=50,g/Math.abs(g)+Math.round(14*g))}shouldForceSelection(l){return i.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),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(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const g=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);g&&g.length!==this._model.selectionStart[0]&&g.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const g=this._getMouseBufferCoords(l);g&&(this._activeSelectionMode=2,this._selectLineAt(g[1]))}shouldColumnSelect(l){return l.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const g=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(l),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const S=this._bufferService.buffer;if(this._model.selectionEnd[1]<S.lines.length){const y=S.lines.get(this._model.selectionEnd[1]);y&&y.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}g&&g[0]===this._model.selectionEnd[0]&&g[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 l=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const g=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&g<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const S=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(S&&S[0]!==void 0&&S[1]!==void 0){const y=(0,c.moveToCellSequence)(S[0]-1,S[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(y,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,g=this._model.finalSelectionEnd,S=!(!l||!g||l[0]===g[0]&&l[1]===g[1]);S?l&&g&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&g[0]===this._oldSelectionEnd[0]&&g[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,g,S)):this._oldHasSelection&&this._fireOnSelectionChange(l,g,S)}_fireOnSelectionChange(l,g,S){this._oldSelectionStart=l,this._oldSelectionEnd=g,this._oldHasSelection=S,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(g=>this._handleTrim(g))}_convertViewportColToCharacterIndex(l,g){let S=g;for(let y=0;g>=y;y++){const b=l.loadCell(y,this._workCell).getChars().length;this._workCell.getWidth()===0?S--:b>1&&g!==y&&(S+=b-1)}return S}setSelection(l,g,S){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,g],this._model.selectionStartLength=S,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,g,S=!0,y=!0){if(l[0]>=this._bufferService.cols)return;const b=this._bufferService.buffer,w=b.lines.get(l[1]);if(!w)return;const x=b.translateBufferLineToString(l[1],!1);let k=this._convertViewportColToCharacterIndex(w,l[0]),B=k;const T=l[0]-k;let M=0,C=0,L=0,R=0;if(x.charAt(k)===" "){for(;k>0&&x.charAt(k-1)===" ";)k--;for(;B<x.length&&x.charAt(B+1)===" ";)B++}else{let H=l[0],z=l[0];w.getWidth(H)===0&&(M++,H--),w.getWidth(z)===2&&(C++,z++);const U=w.getString(z).length;for(U>1&&(R+=U-1,B+=U-1);H>0&&k>0&&!this._isCharWordSeparator(w.loadCell(H-1,this._workCell));){w.loadCell(H-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(M++,H--):A>1&&(L+=A-1,k-=A-1),k--,H--}for(;z<w.length&&B+1<x.length&&!this._isCharWordSeparator(w.loadCell(z+1,this._workCell));){w.loadCell(z+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(C++,z++):A>1&&(R+=A-1,B+=A-1),B++,z++}}B++;let D=k+T-M+L,I=Math.min(this._bufferService.cols,B-k+M+C-L-R);if(g||x.slice(k,B).trim()!==""){if(S&&D===0&&w.getCodePoint(0)!==32){const H=b.lines.get(l[1]-1);if(H&&w.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const z=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(z){const U=this._bufferService.cols-z.start;D-=U,I+=U}}}if(y&&D+I===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const H=b.lines.get(l[1]+1);if(H?.isWrapped&&H.getCodePoint(0)!==32){const z=this._getWordAt([0,l[1]+1],!1,!1,!0);z&&(I+=z.length)}}return{start:D,length:I}}}_selectWordAt(l,g){const S=this._getWordAt(l,g);if(S){for(;S.start<0;)S.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[S.start,l[1]],this._model.selectionStartLength=S.length}}_selectToWordAt(l){const g=this._getWordAt(l,!0);if(g){let S=l[1];for(;g.start<0;)g.start+=this._bufferService.cols,S--;if(!this._model.areSelectionValuesReversed())for(;g.start+g.length>this._bufferService.cols;)g.length-=this._bufferService.cols,S++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?g.start:g.start+g.length,S]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const g=this._bufferService.buffer.getWrappedRangeForLine(l),S={start:{x:0,y:g.first},end:{x:this._bufferService.cols-1,y:g.last}};this._model.selectionStart=[0,g.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(S,this._bufferService.cols)}};t.SelectionService=m=h([d(3,_.IBufferService),d(4,_.ICoreService),d(5,v.IMouseService),d(6,_.IOptionsService),d(7,v.IRenderService),d(8,v.ICoreBrowserService)],m)},4725:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const h=a(8343);t.ICharSizeService=(0,h.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),t.IMouseService=(0,h.createDecorator)("MouseService"),t.IRenderService=(0,h.createDecorator)("RenderService"),t.ISelectionService=(0,h.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,h.createDecorator)("ThemeService"),t.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(O,t,a){var h=this&&this.__decorate||function(m,l,g,S){var y,b=arguments.length,w=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,l,g,S);else for(var x=m.length-1;x>=0;x--)(y=m[x])&&(w=(b<3?y(w):b>3?y(l,g,w):y(l,g))||w);return b>3&&w&&Object.defineProperty(l,g,w),w},d=this&&this.__param||function(m,l){return function(g,S){l(g,S,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),c=a(8055),f=a(8460),v=a(844),o=a(2585),e=c.css.toColor("#ffffff"),i=c.css.toColor("#000000"),s=c.css.toColor("#ffffff"),r=c.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[c.css.toColor("#2e3436"),c.css.toColor("#cc0000"),c.css.toColor("#4e9a06"),c.css.toColor("#c4a000"),c.css.toColor("#3465a4"),c.css.toColor("#75507b"),c.css.toColor("#06989a"),c.css.toColor("#d3d7cf"),c.css.toColor("#555753"),c.css.toColor("#ef2929"),c.css.toColor("#8ae234"),c.css.toColor("#fce94f"),c.css.toColor("#729fcf"),c.css.toColor("#ad7fa8"),c.css.toColor("#34e2e2"),c.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let g=0;g<216;g++){const S=l[g/36%6|0],y=l[g/6%6|0],b=l[g%6];m.push({css:c.channels.toCss(S,y,b),rgba:c.channels.toRgba(S,y,b)})}for(let g=0;g<24;g++){const S=8+10*g;m.push({css:c.channels.toCss(S,S,S),rgba:c.channels.toRgba(S,S,S)})}return m})());let p=t.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:i,cursor:s,cursorAccent:r,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:c.color.blend(i,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:c.color.blend(i,_),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(m={}){const l=this._colors;if(l.foreground=u(m.foreground,e),l.background=u(m.background,i),l.cursor=u(m.cursor,s),l.cursorAccent=u(m.cursorAccent,r),l.selectionBackgroundTransparent=u(m.selectionBackground,_),l.selectionBackgroundOpaque=c.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=u(m.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=c.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=m.selectionForeground?u(m.selectionForeground,c.NULL_COLOR):void 0,l.selectionForeground===c.NULL_COLOR&&(l.selectionForeground=void 0),c.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=c.color.opacity(l.selectionBackgroundTransparent,.3)),c.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=c.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=t.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=u(m.black,t.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=u(m.red,t.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=u(m.green,t.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=u(m.yellow,t.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=u(m.blue,t.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=u(m.magenta,t.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=u(m.cyan,t.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=u(m.white,t.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=u(m.brightBlack,t.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=u(m.brightRed,t.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=u(m.brightGreen,t.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=u(m.brightYellow,t.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=u(m.brightBlue,t.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=u(m.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=u(m.brightCyan,t.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=u(m.brightWhite,t.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const g=Math.min(l.ansi.length-16,m.extendedAnsi.length);for(let S=0;S<g;S++)l.ansi[S+16]=u(m.extendedAnsi[S],t.DEFAULT_ANSI_COLORS[S+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let l=0;l<this._restoreColors.ansi.length;++l)this._colors.ansi[l]=this._restoreColors.ansi[l]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function u(m,l){if(m!==void 0)try{return c.css.toColor(m)}catch{}return l}t.ThemeService=p=h([d(0,o.IOptionsService)],p)},6349:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const h=a(8460),d=a(844);class n extends d.Disposable{constructor(f){super(),this._maxLength=f,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(f){if(this._maxLength===f)return;const v=new Array(f);for(let o=0;o<Math.min(f,this.length);o++)v[o]=this._array[this._getCyclicIndex(o)];this._array=v,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let v=this._length;v<f;v++)this._array[v]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,v){this._array[this._getCyclicIndex(f)]=v}push(f){this._array[this._getCyclicIndex(this._length)]=f,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(f,v,...o){if(v){for(let e=f;e<this._length-v;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+v)];this._length-=v,this.onDeleteEmitter.fire({index:f,amount:v})}for(let e=this._length-1;e>=f;e--)this._array[this._getCyclicIndex(e+o.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<o.length;e++)this._array[this._getCyclicIndex(f+e)]=o[e];if(o.length&&this.onInsertEmitter.fire({index:f,amount:o.length}),this._length+o.length>this._maxLength){const e=this._length+o.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=o.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,v,o){if(!(v<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+o<0)throw new Error("Cannot shift elements in list beyond index 0");if(o>0){for(let i=v-1;i>=0;i--)this.set(f+i+o,this.get(f+i));const e=f+v+o-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<v;e++)this.set(f+e+o,this.get(f+e))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}t.CircularList=n},1439:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function a(h,d=5){if(typeof h!="object")return h;const n=Array.isArray(h)?[]:{};for(const c in h)n[c]=d<=1?h[c]:h[c]&&a(h[c],d-1);return n}},8055:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,h=0,d=0,n=0;var c,f,v,o,e;function i(r){const _=r.toString(16);return _.length<2?"0"+_:_}function s(r,_){return r<_?(_+.05)/(r+.05):(r+.05)/(_+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(r){r.toCss=function(_,p,u,m){return m!==void 0?`#${i(_)}${i(p)}${i(u)}${i(m)}`:`#${i(_)}${i(p)}${i(u)}`},r.toRgba=function(_,p,u,m=255){return(_<<24|p<<16|u<<8|m)>>>0},r.toColor=function(_,p,u,m){return{css:r.toCss(_,p,u,m),rgba:r.toRgba(_,p,u,m)}}}(c||(t.channels=c={})),function(r){function _(p,u){return n=Math.round(255*u),[a,h,d]=e.toChannels(p.rgba),{css:c.toCss(a,h,d,n),rgba:c.toRgba(a,h,d,n)}}r.blend=function(p,u){if(n=(255&u.rgba)/255,n===1)return{css:u.css,rgba:u.rgba};const m=u.rgba>>24&255,l=u.rgba>>16&255,g=u.rgba>>8&255,S=p.rgba>>24&255,y=p.rgba>>16&255,b=p.rgba>>8&255;return a=S+Math.round((m-S)*n),h=y+Math.round((l-y)*n),d=b+Math.round((g-b)*n),{css:c.toCss(a,h,d),rgba:c.toRgba(a,h,d)}},r.isOpaque=function(p){return(255&p.rgba)==255},r.ensureContrastRatio=function(p,u,m){const l=e.ensureContrastRatio(p.rgba,u.rgba,m);if(l)return c.toColor(l>>24&255,l>>16&255,l>>8&255)},r.opaque=function(p){const u=(255|p.rgba)>>>0;return[a,h,d]=e.toChannels(u),{css:c.toCss(a,h,d),rgba:u}},r.opacity=_,r.multiplyOpacity=function(p,u){return n=255&p.rgba,_(p,n*u/255)},r.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(f||(t.color=f={})),function(r){let _,p;try{const u=document.createElement("canvas");u.width=1,u.height=1;const m=u.getContext("2d",{willReadFrequently:!0});m&&(_=m,_.globalCompositeOperation="copy",p=_.createLinearGradient(0,0,1,1))}catch{}r.toColor=function(u){if(u.match(/#[\da-f]{3,8}/i))switch(u.length){case 4:return a=parseInt(u.slice(1,2).repeat(2),16),h=parseInt(u.slice(2,3).repeat(2),16),d=parseInt(u.slice(3,4).repeat(2),16),c.toColor(a,h,d);case 5:return a=parseInt(u.slice(1,2).repeat(2),16),h=parseInt(u.slice(2,3).repeat(2),16),d=parseInt(u.slice(3,4).repeat(2),16),n=parseInt(u.slice(4,5).repeat(2),16),c.toColor(a,h,d,n);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}const m=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),h=parseInt(m[2]),d=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),c.toColor(a,h,d,n);if(!_||!p)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=p,_.fillStyle=u,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[a,h,d,n]=_.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(a,h,d,n),css:u}}}(v||(t.css=v={})),function(r){function _(p,u,m){const l=p/255,g=u/255,S=m/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}r.relativeLuminance=function(p){return _(p>>16&255,p>>8&255,255&p)},r.relativeLuminance2=_}(o||(t.rgb=o={})),function(r){function _(u,m,l){const g=u>>24&255,S=u>>16&255,y=u>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;k<l&&(b>0||w>0||x>0);)b-=Math.max(0,Math.ceil(.1*b)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}function p(u,m,l){const g=u>>24&255,S=u>>16&255,y=u>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;k<l&&(b<255||w<255||x<255);)b=Math.min(255,b+Math.ceil(.1*(255-b))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}r.blend=function(u,m){if(n=(255&m)/255,n===1)return m;const l=m>>24&255,g=m>>16&255,S=m>>8&255,y=u>>24&255,b=u>>16&255,w=u>>8&255;return a=y+Math.round((l-y)*n),h=b+Math.round((g-b)*n),d=w+Math.round((S-w)*n),c.toRgba(a,h,d)},r.ensureContrastRatio=function(u,m,l){const g=o.relativeLuminance(u>>8),S=o.relativeLuminance(m>>8);if(s(g,S)<l){if(S<g){const w=_(u,m,l),x=s(g,o.relativeLuminance(w>>8));if(x<l){const k=p(u,m,l);return x>s(g,o.relativeLuminance(k>>8))?w:k}return w}const y=p(u,m,l),b=s(g,o.relativeLuminance(y>>8));if(b<l){const w=_(u,m,l);return b>s(g,o.relativeLuminance(w>>8))?y:w}return y}},r.reduceLuminance=_,r.increaseLuminance=p,r.toChannels=function(u){return[u>>24&255,u>>16&255,u>>8&255,255&u]}}(e||(t.rgba=e={})),t.toPaddedHex=i,t.contrastRatio=s},8969:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const h=a(844),d=a(2585),n=a(4348),c=a(7866),f=a(744),v=a(7302),o=a(6975),e=a(8460),i=a(1753),s=a(1480),r=a(7994),_=a(9282),p=a(5435),u=a(5981),m=a(2660);let l=!1;class g extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(y=>{this._onScrollApi?.fire(y.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(y){for(const b in y)this.optionsService.options[b]=y[b]}constructor(y){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new v.OptionsService(y)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(c.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(r.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(b=>{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(b=>{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 u.WriteBuffer((b,w)=>this._inputHandler.parse(b,w))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(y,b){this._writeBuffer.write(y,b)}writeSync(y,b){this._logService.logLevel<=d.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(y,b)}input(y,b=!0){this.coreService.triggerDataEvent(y,b)}resize(y,b){isNaN(y)||isNaN(b)||(y=Math.max(y,f.MINIMUM_COLS),b=Math.max(b,f.MINIMUM_ROWS),this._bufferService.resize(y,b))}scroll(y,b=!1){this._bufferService.scroll(y,b)}scrollLines(y,b,w){this._bufferService.scrollLines(y,b,w)}scrollPages(y){this.scrollLines(y*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(y){const b=y-this._bufferService.buffer.ydisp;b!==0&&this.scrollLines(b)}registerEscHandler(y,b){return this._inputHandler.registerEscHandler(y,b)}registerDcsHandler(y,b){return this._inputHandler.registerDcsHandler(y,b)}registerCsiHandler(y,b){return this._inputHandler.registerCsiHandler(y,b)}registerOscHandler(y,b){return this._inputHandler.registerOscHandler(y,b)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let y=!1;const b=this.optionsService.rawOptions.windowsPty;b&&b.buildNumber!==void 0&&b.buildNumber!==void 0?y=b.backend==="conpty"&&b.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const y=[];y.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),y.push(this.registerCsiHandler({final:"H"},()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)(()=>{for(const b of y)b.dispose()})}}}t.CoreTerminal=g},8460:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const d=[];for(let n=0;n<this._listeners.length;n++)d.push(this._listeners[n]);for(let n=0;n<d.length;n++)d[n].call(void 0,a,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,h){return a(d=>h.fire(d))},t.runAndSubscribe=function(a,h){return h(void 0),a(d=>h(d))}},5435:function(O,t,a){var h=this&&this.__decorate||function(M,C,L,R){var D,I=arguments.length,H=I<3?C:R===null?R=Object.getOwnPropertyDescriptor(C,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(M,C,L,R);else for(var z=M.length-1;z>=0;z--)(D=M[z])&&(H=(I<3?D(H):I>3?D(C,L,H):D(C,L))||H);return I>3&&H&&Object.defineProperty(C,L,H),H},d=this&&this.__param||function(M,C){return function(L,R){C(L,R,M)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=a(2584),c=a(7116),f=a(2015),v=a(844),o=a(482),e=a(8437),i=a(8460),s=a(643),r=a(511),_=a(3734),p=a(2585),u=a(1480),m=a(6242),l=a(6351),g=a(5941),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function b(M,C){if(M>24)return C.setWinLines||!1;switch(M){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var w;(function(M){M[M.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",M[M.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(t.WindowsOptionsReportType=w={}));let x=0;class k extends v.Disposable{getAttrData(){return this._curAttrData}constructor(C,L,R,D,I,H,z,U,A=new f.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=L,this._coreService=R,this._logService=D,this._optionsService=I,this._oscLinkService=H,this._coreMouseService=z,this._unicodeService=U,this._parser=A,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o.StringToUtf32,this._utf8Decoder=new o.Utf8ToUtf32,this._workCell=new r.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._parser.setCsiHandlerFallback((E,P)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(E),params:P.toArray()})}),this._parser.setEscHandlerFallback(E=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(E)})}),this._parser.setExecuteHandlerFallback(E=>{this._logService.debug("Unknown EXECUTE code: ",{code:E})}),this._parser.setOscHandlerFallback((E,P,F)=>{this._logService.debug("Unknown OSC code: ",{identifier:E,action:P,data:F})}),this._parser.setDcsHandlerFallback((E,P,F)=>{P==="HOOK"&&(F=F.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(E),action:P,payload:F})}),this._parser.setPrintHandler((E,P,F)=>this.print(E,P,F)),this._parser.registerCsiHandler({final:"@"},E=>this.insertChars(E)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},E=>this.scrollLeft(E)),this._parser.registerCsiHandler({final:"A"},E=>this.cursorUp(E)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},E=>this.scrollRight(E)),this._parser.registerCsiHandler({final:"B"},E=>this.cursorDown(E)),this._parser.registerCsiHandler({final:"C"},E=>this.cursorForward(E)),this._parser.registerCsiHandler({final:"D"},E=>this.cursorBackward(E)),this._parser.registerCsiHandler({final:"E"},E=>this.cursorNextLine(E)),this._parser.registerCsiHandler({final:"F"},E=>this.cursorPrecedingLine(E)),this._parser.registerCsiHandler({final:"G"},E=>this.cursorCharAbsolute(E)),this._parser.registerCsiHandler({final:"H"},E=>this.cursorPosition(E)),this._parser.registerCsiHandler({final:"I"},E=>this.cursorForwardTab(E)),this._parser.registerCsiHandler({final:"J"},E=>this.eraseInDisplay(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},E=>this.eraseInDisplay(E,!0)),this._parser.registerCsiHandler({final:"K"},E=>this.eraseInLine(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},E=>this.eraseInLine(E,!0)),this._parser.registerCsiHandler({final:"L"},E=>this.insertLines(E)),this._parser.registerCsiHandler({final:"M"},E=>this.deleteLines(E)),this._parser.registerCsiHandler({final:"P"},E=>this.deleteChars(E)),this._parser.registerCsiHandler({final:"S"},E=>this.scrollUp(E)),this._parser.registerCsiHandler({final:"T"},E=>this.scrollDown(E)),this._parser.registerCsiHandler({final:"X"},E=>this.eraseChars(E)),this._parser.registerCsiHandler({final:"Z"},E=>this.cursorBackwardTab(E)),this._parser.registerCsiHandler({final:"`"},E=>this.charPosAbsolute(E)),this._parser.registerCsiHandler({final:"a"},E=>this.hPositionRelative(E)),this._parser.registerCsiHandler({final:"b"},E=>this.repeatPrecedingCharacter(E)),this._parser.registerCsiHandler({final:"c"},E=>this.sendDeviceAttributesPrimary(E)),this._parser.registerCsiHandler({prefix:">",final:"c"},E=>this.sendDeviceAttributesSecondary(E)),this._parser.registerCsiHandler({final:"d"},E=>this.linePosAbsolute(E)),this._parser.registerCsiHandler({final:"e"},E=>this.vPositionRelative(E)),this._parser.registerCsiHandler({final:"f"},E=>this.hVPosition(E)),this._parser.registerCsiHandler({final:"g"},E=>this.tabClear(E)),this._parser.registerCsiHandler({final:"h"},E=>this.setMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"h"},E=>this.setModePrivate(E)),this._parser.registerCsiHandler({final:"l"},E=>this.resetMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"l"},E=>this.resetModePrivate(E)),this._parser.registerCsiHandler({final:"m"},E=>this.charAttributes(E)),this._parser.registerCsiHandler({final:"n"},E=>this.deviceStatus(E)),this._parser.registerCsiHandler({prefix:"?",final:"n"},E=>this.deviceStatusPrivate(E)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},E=>this.softReset(E)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},E=>this.setCursorStyle(E)),this._parser.registerCsiHandler({final:"r"},E=>this.setScrollRegion(E)),this._parser.registerCsiHandler({final:"s"},E=>this.saveCursor(E)),this._parser.registerCsiHandler({final:"t"},E=>this.windowOptions(E)),this._parser.registerCsiHandler({final:"u"},E=>this.restoreCursor(E)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},E=>this.insertColumns(E)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},E=>this.deleteColumns(E)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},E=>this.selectProtected(E)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},E=>this.requestMode(E,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},E=>this.requestMode(E,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new m.OscHandler(E=>(this.setTitle(E),this.setIconName(E),!0))),this._parser.registerOscHandler(1,new m.OscHandler(E=>this.setIconName(E))),this._parser.registerOscHandler(2,new m.OscHandler(E=>this.setTitle(E))),this._parser.registerOscHandler(4,new m.OscHandler(E=>this.setOrReportIndexedColor(E))),this._parser.registerOscHandler(8,new m.OscHandler(E=>this.setHyperlink(E))),this._parser.registerOscHandler(10,new m.OscHandler(E=>this.setOrReportFgColor(E))),this._parser.registerOscHandler(11,new m.OscHandler(E=>this.setOrReportBgColor(E))),this._parser.registerOscHandler(12,new m.OscHandler(E=>this.setOrReportCursorColor(E))),this._parser.registerOscHandler(104,new m.OscHandler(E=>this.restoreIndexedColor(E))),this._parser.registerOscHandler(110,new m.OscHandler(E=>this.restoreFgColor(E))),this._parser.registerOscHandler(111,new m.OscHandler(E=>this.restoreBgColor(E))),this._parser.registerOscHandler(112,new m.OscHandler(E=>this.restoreCursorColor(E))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const E in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:E},()=>this.selectCharset("("+E)),this._parser.registerEscHandler({intermediates:")",final:E},()=>this.selectCharset(")"+E)),this._parser.registerEscHandler({intermediates:"*",final:E},()=>this.selectCharset("*"+E)),this._parser.registerEscHandler({intermediates:"+",final:E},()=>this.selectCharset("+"+E)),this._parser.registerEscHandler({intermediates:"-",final:E},()=>this.selectCharset("-"+E)),this._parser.registerEscHandler({intermediates:".",final:E},()=>this.selectCharset("."+E)),this._parser.registerEscHandler({intermediates:"/",final:E},()=>this.selectCharset("/"+E));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(E=>(this._logService.error("Parsing error: ",E),E)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((E,P)=>this.requestStatusString(E,P)))}_preserveStack(C,L,R,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=R,this._parseStack.position=D}_logSlowResolvingAsync(C){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([C,new Promise((L,R)=>setTimeout(()=>R("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,L){let R,D=this._activeBuffer.x,I=this._activeBuffer.y,H=0;const z=this._parseStack.paused;if(z){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(R),R;D=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>y&&(H=this._parseStack.position+y)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,E=>String.fromCharCode(E)).join("")}"`),typeof C=="string"?C.split("").map(E=>E.charCodeAt(0)):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(C.length,y))),z||this._dirtyRowTracker.clearRange(),C.length>y)for(let E=H;E<C.length;E+=y){const P=E+y<C.length?E+y:C.length,F=typeof C=="string"?this._stringDecoder.decode(C.substring(E,P),this._parseBuffer):this._utf8Decoder.decode(C.subarray(E,P),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,F))return this._preserveStack(D,I,F,E),this._logSlowResolvingAsync(R),R}else if(!z){const E=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,E))return this._preserveStack(D,I,E,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===D&&this._activeBuffer.y===I||this._onCursorMove.fire();const U=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),A=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);A<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(A,this._bufferService.rows-1),Math.min(U,this._bufferService.rows-1))}print(C,L,R){let D,I;const H=this._charsetService.charset,z=this._optionsService.rawOptions.screenReaderMode,U=this._bufferService.cols,A=this._coreService.decPrivateModes.wraparound,E=this._coreService.modes.insertMode,P=this._curAttrData;let F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-L>0&&F.getWidth(this._activeBuffer.x-1)===2&&F.setCellFromCodepoint(this._activeBuffer.x-1,0,1,P);let $=this._parser.precedingJoinState;for(let W=L;W<R;++W){if(D=C[W],D<127&&H){const se=H[String.fromCharCode(D)];se&&(D=se.charCodeAt(0))}const G=this._unicodeService.charProperties(D,$);I=u.UnicodeService.extractWidth(G);const j=u.UnicodeService.extractShouldJoin(G),Z=j?u.UnicodeService.extractWidth($):0;if($=G,z&&this._onA11yChar.fire((0,o.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Z>U){if(A){const se=F;let q=this._activeBuffer.x-Z;for(this._activeBuffer.x=Z,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),F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Z>0&&F instanceof e.BufferLine&&F.copyCellsFrom(se,q,0,Z,!1);q<U;)se.setCellFromCodepoint(q++,0,1,P)}else if(this._activeBuffer.x=U-1,I===2)continue}if(j&&this._activeBuffer.x){const se=F.getWidth(this._activeBuffer.x-1)?1:2;F.addCodepointToCell(this._activeBuffer.x-se,D,I);for(let q=I-Z;--q>=0;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,P)}else if(E&&(F.insertCells(this._activeBuffer.x,I-Z,this._activeBuffer.getNullCell(P)),F.getWidth(U-1)===2&&F.setCellFromCodepoint(U-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,P)),F.setCellFromCodepoint(this._activeBuffer.x++,D,I,P),I>0)for(;--I;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,P)}this._parser.precedingJoinState=$,this._activeBuffer.x<U&&R-L>0&&F.getWidth(this._activeBuffer.x)===0&&!F.hasContent(this._activeBuffer.x)&&F.setCellFromCodepoint(this._activeBuffer.x,0,1,P),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,L){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,L):this._parser.registerCsiHandler(C,R=>!b(R.params[0],this._optionsService.rawOptions.windowOptions)||L(R))}registerDcsHandler(C,L){return this._parser.registerDcsHandler(C,new l.DcsHandler(L))}registerEscHandler(C,L){return this._parser.registerEscHandler(C,L)}registerOscHandler(C,L){return this._parser.registerOscHandler(C,new m.OscHandler(L))}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(this._activeBuffer.x===0&&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 C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,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(C,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=C,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+L)}cursorUp(C){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){const L=C.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=C.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=C.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){const L=C.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,L,R,D=!1,I=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);H.replaceCells(L,R,this._activeBuffer.getNullCell(this._eraseAttrData()),I),D&&(H.isWrapped=!1)}_resetBufferLine(C,L=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),R.isWrapped=!1)}eraseInDisplay(C,L=!1){let R;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);R<this._bufferService.rows;R++)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(C,L=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let L=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;L--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(C){this._restrictCursor();let L=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;L--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let L=C.params[0]||1;for(;L--;)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(C){let L=C.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){const L=this._parser.precedingJoinState;if(!L)return!0;const R=C.params[0]||1,D=u.UnicodeService.extractWidth(L),I=this._activeBuffer.x-D,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),z=new Uint32Array(H.length*R);let U=0;for(let E=0;E<H.length;){const P=H.codePointAt(E)||0;z[U++]=P,E+=P>65535?2:1}let A=U;for(let E=1;E<R;++E)z.copyWithin(A,0,U),A+=U;return this.print(z,0,A),!0}sendDeviceAttributesPrimary(C){return C.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(C){return C.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.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(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let L=0;L<C.length;L++)switch(C.params[L]){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(),C.params[L]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(C,L){const R=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:I}=this._coreMouseService,H=this._coreService,{buffers:z,cols:U}=this._bufferService,{active:A,alt:E}=z,P=this._optionsService.rawOptions,F=j=>j?1:2,$=C.params[0];return W=$,G=L?$===2?4:$===4?F(H.modes.insertMode):$===12?3:$===20?F(P.convertEol):0:$===1?F(R.applicationCursorKeys):$===3?P.windowOptions.setWinLines?U===80?2:U===132?1:0:0:$===6?F(R.origin):$===7?F(R.wraparound):$===8?3:$===9?F(D==="X10"):$===12?F(P.cursorBlink):$===25?F(!H.isCursorHidden):$===45?F(R.reverseWraparound):$===66?F(R.applicationKeypad):$===67?4:$===1e3?F(D==="VT200"):$===1002?F(D==="DRAG"):$===1003?F(D==="ANY"):$===1004?F(R.sendFocus):$===1005?4:$===1006?F(I==="SGR"):$===1015?4:$===1016?F(I==="SGR_PIXELS"):$===1048?1:$===47||$===1047||$===1049?F(A===E):$===2004?F(R.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${L?"":"?"}${W};${G}$y`),!0;var W,G}_updateAttrColor(C,L,R,D,I){return L===2?(C|=50331648,C&=-16777216,C|=_.AttributeData.fromColorRGB([R,D,I])):L===5&&(C&=-50331904,C|=33554432|255&R),C}_extractColor(C,L,R){const D=[0,0,-1,0,0,0];let I=0,H=0;do{if(D[H+I]=C.params[L+H],C.hasSubParams(L+H)){const z=C.getSubParams(L+H);let U=0;do D[1]===5&&(I=1),D[H+U+1+I]=z[U];while(++U<z.length&&U+H+1+I<D.length);break}if(D[1]===5&&H+I>=2||D[1]===2&&H+I>=5)break;D[1]&&(I=1)}while(++H+L<C.length&&H+I<D.length);for(let z=2;z<D.length;++z)D[z]===-1&&(D[z]=0);switch(D[0]){case 38:R.fg=this._updateAttrColor(R.fg,D[1],D[3],D[4],D[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,D[1],D[3],D[4],D[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,D[1],D[3],D[4],D[5])}return H}_processUnderline(C,L){L.extended=L.extended.clone(),(!~C||C>5)&&(C=1),L.extended.underlineStyle=C,L.fg|=268435456,C===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(C){C.fg=e.DEFAULT_ATTR_DATA.fg,C.bg=e.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=C.length;let R;const D=this._curAttrData;for(let I=0;I<L;I++)R=C.params[I],R>=30&&R<=37?(D.fg&=-50331904,D.fg|=16777216|R-30):R>=40&&R<=47?(D.bg&=-50331904,D.bg|=16777216|R-40):R>=90&&R<=97?(D.fg&=-50331904,D.fg|=16777224|R-90):R>=100&&R<=107?(D.bg&=-50331904,D.bg|=16777224|R-100):R===0?this._processSGR0(D):R===1?D.fg|=134217728:R===3?D.bg|=67108864:R===4?(D.fg|=268435456,this._processUnderline(C.hasSubParams(I)?C.getSubParams(I)[0]:1,D)):R===5?D.fg|=536870912:R===7?D.fg|=67108864:R===8?D.fg|=1073741824:R===9?D.fg|=2147483648:R===2?D.bg|=134217728:R===21?this._processUnderline(2,D):R===22?(D.fg&=-134217729,D.bg&=-134217729):R===23?D.bg&=-67108865:R===24?(D.fg&=-268435457,this._processUnderline(0,D)):R===25?D.fg&=-536870913:R===27?D.fg&=-67108865:R===28?D.fg&=-1073741825:R===29?D.fg&=2147483647:R===39?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):R===49?(D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?I+=this._extractColor(C,I,D):R===53?D.bg|=1073741824:R===55?D.bg&=-1073741825:R===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):R===100?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${L};${R}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){const L=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${L};${R}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(C){const L=C.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const R=L%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(C){const L=C.params[0]||1;let R;return(C.length<2||(R=C.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(C){if(!b(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){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(C){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(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){const L=[],R=C.split(";");for(;R.length>1;){const D=R.shift(),I=R.shift();if(/^\d+$/.exec(D)){const H=parseInt(D);if(T(H))if(I==="?")L.push({type:0,index:H});else{const z=(0,g.parseColor)(I);z&&L.push({type:1,index:H,color:z})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(C){const L=C.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(C,L){this._getCurrentLinkId()&&this._finishHyperlink();const R=C.split(":");let D;const I=R.findIndex(H=>H.startsWith("id="));return I!==-1&&(D=R[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,L){const R=C.split(";");for(let D=0;D<R.length&&!(L>=this._specialColors.length);++D,++L)if(R[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const I=(0,g.parseColor)(R[D]);I&&this._onColor.fire([{type:1,index:this._specialColors[L],color:I}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;const L=[],R=C.split(";");for(let D=0;D<R.length;++D)if(/^\d+$/.exec(R[D])){const I=parseInt(R[D]);T(I)&&L.push({type:2,index:I})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){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,c.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(S[C[0]],c.CHARSETS[C[1]]||c.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){const C=new r.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const R=this._activeBuffer.ybase+this._activeBuffer.y+L,D=this._activeBuffer.lines.get(R);D&&(D.fill(C),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,L){const R=this._bufferService.buffer,D=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${I}${n.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,L){this._dirtyRowTracker.markRangeDirty(C,L)}}t.InputHandler=k;let B=class{constructor(M){this._bufferService=M,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(M){M<this.start?this.start=M:M>this.end&&(this.end=M)}markRangeDirty(M,C){M>C&&(x=M,M=C,C=x),M<this.start&&(this.start=M),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function T(M){return 0<=M&&M<256}B=h([d(0,p.IBufferService)],B)},844:(O,t)=>{function a(h){for(const d of h)d.dispose();h.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const d=this._disposables.indexOf(h);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(h){return{dispose:h}},t.disposeArray=a,t.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(d,n,c){this._data[d]||(this._data[d]={}),this._data[d][n]=c}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(h,d,n,c,f){this._data.get(h,d)||this._data.set(h,d,new a),this._data.get(h,d).set(n,c,f)}get(h,d,n,c){return this._data.get(h,d)?.get(n,c)}clear(){this._data.clear()}}},6114:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,h=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const d=a.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),t.isIpad=h==="iPad",t.isIphone=h==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),t.isLinux=h.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},6106:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let a=0;t.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(a=this._search(this._getKey(h)),this._array.splice(a,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const d=this._getKey(h);if(d===void 0||(a=this._search(d),a===-1)||this._getKey(this._array[a])!==d)return!1;do if(this._array[a]===h)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===d);return!1}*getKeyIterator(h){if(this._array.length!==0&&(a=this._search(h),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===h)}forEachByKey(h,d){if(this._array.length!==0&&(a=this._search(h),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do d(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return[...this._array].values()}_search(h){let d=0,n=this._array.length-1;for(;n>=d;){let c=d+n>>1;const f=this._getKey(this._array[c]);if(f>h)n=c-1;else{if(!(f<h)){for(;c>0&&this._getKey(this._array[c-1])===h;)c--;return c}d=c+1}}return d}}},7226:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const h=a(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let v=0,o=0,e=f.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),o=Math.max(v,o),i=f.timeRemaining(),1.5*o>i)return e-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-v))}ms`),void this._start();e=i}this.clear()}}class n extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},9282:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const h=a(643);t.updateWindowsModeWrappedState=function(d){const n=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),c=n?.get(d.cols-1),f=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);f&&c&&(f.isWrapped=c[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&c[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,c=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=c}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=h},9092:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const h=a(6349),d=a(7226),n=a(3734),c=a(8437),f=a(4634),v=a(511),o=a(643),e=a(4863),i=a(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(s,r,_){this._hasScrollback=s,this._optionsService=r,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=c.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.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(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,r){return new c.BufferLine(this._bufferService.cols,this.getNullCell(s),r)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const r=s+this._optionsService.rawOptions.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=c.DEFAULT_ATTR_DATA);let r=this._rows;for(;r--;)this.lines.push(this.getBlankLine(s))}}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(s,r){const _=this.getNullCell(c.DEFAULT_ATTR_DATA);let p=0;const u=this._getCorrectBufferLength(r);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols<s)for(let l=0;l<this.lines.length;l++)p+=+this.lines.get(l).resize(s,_);let m=0;if(this._rows<r)for(let l=this._rows;l<r;l++)this.lines.length<r+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new c.BufferLine(s,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new c.BufferLine(s,_)));else for(let l=this._rows;l>r;l--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u<this.lines.maxLength){const l=this.lines.length-u;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=u}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,r-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(s,r),this._cols>s))for(let m=0;m<this.lines.length;m++)p+=+this.lines.get(m).resize(s,_);this._cols=s,this._rows=r,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let r=0;for(;this._memoryCleanupPosition<this.lines.length;)if(r+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),r>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,r){this._cols!==s&&(s>this._cols?this._reflowLarger(s,r):this._reflowSmaller(s,r))}_reflowLarger(s,r){const _=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(c.DEFAULT_ATTR_DATA));if(_.length>0){const p=(0,f.reflowLargerCreateNewLayout)(this.lines,_);(0,f.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(s,r,p.countRemoved)}}_reflowLargerAdjustViewport(s,r,_){const p=this.getNullCell(c.DEFAULT_ATTR_DATA);let u=_;for(;u-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new c.BufferLine(s,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(s,r){const _=this.getNullCell(c.DEFAULT_ATTR_DATA),p=[];let u=0;for(let m=this.lines.length-1;m>=0;m--){let l=this.lines.get(m);if(!l||!l.isWrapped&&l.getTrimmedLength()<=s)continue;const g=[l];for(;l.isWrapped&&m>0;)l=this.lines.get(--m),g.unshift(l);const S=this.ybase+this.y;if(S>=m&&S<m+g.length)continue;const y=g[g.length-1].getTrimmedLength(),b=(0,f.reflowSmallerGetNewLineLengths)(g,this._cols,s),w=b.length-g.length;let x;x=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const k=[];for(let R=0;R<w;R++){const D=this.getBlankLine(c.DEFAULT_ATTR_DATA,!0);k.push(D)}k.length>0&&(p.push({start:m+g.length+u,newLines:k}),u+=k.length),g.push(...k);let B=b.length-1,T=b[B];T===0&&(B--,T=b[B]);let M=g.length-w-1,C=y;for(;M>=0;){const R=Math.min(C,T);if(g[B]===void 0)break;if(g[B].copyCellsFrom(g[M],C-R,T-R,R,!0),T-=R,T===0&&(B--,T=b[B]),C-=R,C===0){M--;const D=Math.max(M,0);C=(0,f.getWrappedLineTrimmedLength)(g,D,this._cols)}}for(let R=0;R<g.length;R++)b[R]<s&&g[R].setCell(b[R],_);let L=w-x;for(;L-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+u)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+r-1)}if(p.length>0){const m=[],l=[];for(let B=0;B<this.lines.length;B++)l.push(this.lines.get(B));const g=this.lines.length;let S=g-1,y=0,b=p[y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+u);let w=0;for(let B=Math.min(this.lines.maxLength-1,g+u-1);B>=0;B--)if(b&&b.start>S+w){for(let T=b.newLines.length-1;T>=0;T--)this.lines.set(B--,b.newLines[T]);B++,m.push({index:S+1,amount:b.newLines.length}),w+=b.newLines.length,b=p[++y]}else this.lines.set(B,l[S--]);let x=0;for(let B=m.length-1;B>=0;B--)m[B].index+=x,this.lines.onInsertEmitter.fire(m[B]),x+=m[B].amount;const k=Math.max(0,g+u-this.lines.maxLength);k>0&&this.lines.onTrimEmitter.fire(k)}}translateBufferLineToString(s,r,_=0,p){const u=this.lines.get(s);return u?u.translateToString(r,_,p):""}getWrappedRangeForLine(s){let r=s,_=s;for(;r>0&&this.lines.get(r).isWrapped;)r--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:r,last:_}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].line===s&&(this.markers[r].dispose(),this.markers.splice(r--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const r=new e.Marker(s);return this.markers.push(r),r.register(this.lines.onTrim(_=>{r.line-=_,r.line<0&&r.dispose()})),r.register(this.lines.onInsert(_=>{r.line>=_.index&&(r.line+=_.amount)})),r.register(this.lines.onDelete(_=>{r.line>=_.index&&r.line<_.index+_.amount&&r.dispose(),r.line>_.index&&(r.line-=_.amount)})),r.register(r.onDispose(()=>this._removeMarker(r))),r}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const h=a(3734),d=a(511),n=a(643),c=a(482);t.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let f=0;class v{constructor(e,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const r=i||d.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let _=0;_<e;++_)this.setCell(_,r);this.length=e}get(e){const i=this._data[3*e+0],s=2097151&i;return[this._data[3*e+1],2097152&i?this._combined[e]:s?(0,c.stringFromCodePoint)(s):"",i>>22,2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):s]}set(e,i){this._data[3*e+1]=i[n.CHAR_DATA_ATTR_INDEX],i[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=i[1],this._data[3*e+0]=2097152|e|i[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=i[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const i=this._data[3*e+0];return 2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&i}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const i=this._data[3*e+0];return 2097152&i?this._combined[e]:2097151&i?(0,c.stringFromCodePoint)(2097151&i):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,i){return f=3*e,i.content=this._data[f+0],i.fg=this._data[f+1],i.bg=this._data[f+2],2097152&i.content&&(i.combinedData=this._combined[e]),268435456&i.bg&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){2097152&i.content&&(this._combined[e]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=i.content,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}setCellFromCodepoint(e,i,s,r){268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=i|s<<22,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}addCodepointToCell(e,i,s){let r=this._data[3*e+0];2097152&r?this._combined[e]+=(0,c.stringFromCodePoint)(i):2097151&r?(this._combined[e]=(0,c.stringFromCodePoint)(2097151&r)+(0,c.stringFromCodePoint)(i),r&=-2097152,r|=2097152):r=i|4194304,s&&(r&=-12582913,r|=s<<22),this._data[3*e+0]=r}insertCells(e,i,s){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length-e){const r=new d.CellData;for(let _=this.length-e-i-1;_>=0;--_)this.setCell(e+i+_,this.loadCell(e+_,r));for(let _=0;_<i;++_)this.setCell(e+_,s)}else for(let r=e;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(e,i,s){if(e%=this.length,i<this.length-e){const r=new d.CellData;for(let _=0;_<this.length-e-i;++_)this.setCell(e+_,this.loadCell(e+i+_,r));for(let _=this.length-i;_<this.length;++_)this.setCell(_,s)}else for(let r=e;r<this.length;++r)this.setCell(r,s);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,s)}replaceCells(e,i,s,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,s),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);e<i&&e<this.length;)this.setCell(e++,s)}resize(e,i){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<e;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);const r=Object.keys(this._combined);for(let p=0;p<r.length;p++){const u=parseInt(r[p],10);u>=e&&delete this._combined[u]}const _=Object.keys(this._extendedAttrs);for(let p=0;p<_.length;p++){const u=parseInt(_[p],10);u>=e&&delete this._extendedAttrs[u]}}return this.length=e,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,e);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(const i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){const e=new v(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const i in this._combined)e._combined[i]=this._combined[i];for(const i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,i,s,r,_){const p=e._data;if(_)for(let m=r-1;m>=0;m--){for(let l=0;l<3;l++)this._data[3*(s+m)+l]=p[3*(i+m)+l];268435456&p[3*(i+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[i+m])}else for(let m=0;m<r;m++){for(let l=0;l<3;l++)this._data[3*(s+m)+l]=p[3*(i+m)+l];268435456&p[3*(i+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[i+m])}const u=Object.keys(e._combined);for(let m=0;m<u.length;m++){const l=parseInt(u[m],10);l>=i&&(this._combined[l-i+s]=e._combined[l])}}translateToString(e,i,s,r){i=i??0,s=s??this.length,e&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let _="";for(;i<s;){const p=this._data[3*i+0],u=2097151&p,m=2097152&p?this._combined[i]:u?(0,c.stringFromCodePoint)(u):n.WHITESPACE_CELL_CHAR;if(_+=m,r)for(let l=0;l<m.length;++l)r.push(i);i+=p>>22||1}return r&&r.push(i),_}}t.BufferLine=v},4841:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(a,h){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return h*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(O,t)=>{function a(h,d,n){if(d===h.length-1)return h[d].getTrimmedLength();const c=!h[d].hasContent(n-1)&&h[d].getWidth(n-1)===1,f=h[d+1].getWidth(0)===2;return c&&f?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(h,d,n,c,f){const v=[];for(let o=0;o<h.length-1;o++){let e=o,i=h.get(++e);if(!i.isWrapped)continue;const s=[h.get(o)];for(;e<h.length&&i.isWrapped;)s.push(i),i=h.get(++e);if(c>=o&&c<e){o+=s.length-1;continue}let r=0,_=a(s,r,d),p=1,u=0;for(;p<s.length;){const l=a(s,p,d),g=l-u,S=n-_,y=Math.min(g,S);s[r].copyCellsFrom(s[p],u,_,y,!1),_+=y,_===n&&(r++,_=0),u+=y,u===l&&(p++,u=0),_===0&&r!==0&&s[r-1].getWidth(n-1)===2&&(s[r].copyCellsFrom(s[r-1],n-1,_++,1,!1),s[r-1].setCell(n-1,f))}s[r].replaceCells(_,n,f);let m=0;for(let l=s.length-1;l>0&&(l>r||s[l].getTrimmedLength()===0);l--)m++;m>0&&(v.push(o+s.length-m),v.push(m)),o+=s.length-1}return v},t.reflowLargerCreateNewLayout=function(h,d){const n=[];let c=0,f=d[c],v=0;for(let o=0;o<h.length;o++)if(f===o){const e=d[++c];h.onDeleteEmitter.fire({index:o-v,amount:e}),o+=e-1,v+=e,f=d[++c]}else n.push(o);return{layout:n,countRemoved:v}},t.reflowLargerApplyNewLayout=function(h,d){const n=[];for(let c=0;c<d.length;c++)n.push(h.get(d[c]));for(let c=0;c<n.length;c++)h.set(c,n[c]);h.length=d.length},t.reflowSmallerGetNewLineLengths=function(h,d,n){const c=[],f=h.map((i,s)=>a(h,s,d)).reduce((i,s)=>i+s);let v=0,o=0,e=0;for(;e<f;){if(f-e<n){c.push(f-e);break}v+=n;const i=a(h,o,d);v>i&&(v-=i,o++);const s=h[o].getWidth(v-1)===2;s&&v--;const r=s?n-1:n;c.push(r),e+=r}return c},t.getWrappedLineTrimmedLength=a},5295:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const h=a(8460),d=a(844),n=a(9092);class c extends d.Disposable{constructor(v,o){super(),this._optionsService=v,this._bufferService=o,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 n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),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(v,o){this._normal.resize(v,o),this._alt.resize(v,o),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}t.BufferSet=c},511:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const h=a(482),d=a(643),n=a(3734);class c extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const o=new c;return o.setFromCharData(v),o}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(v){this.fg=v[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(v[d.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(v[d.CHAR_DATA_CHAR_INDEX].length===2){const e=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const i=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(e-55296)+i-56320+65536|v[d.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=v[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=c},643:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const h=a(8460),d=a(844);class n{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=n._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,d.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}t.Marker=n,n._nextId=1},7116:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,t)=>{var a,h,d;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
8
+ `,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(a||(t.C0=a={})),function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"}(h||(t.C1=h={})),function(n){n.ST=`${a.ESC}\\`}(d||(t.C1_ESCAPED=d={}))},7399:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const h=a(2584),d={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(n,c,f,v){const o={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?o.key=c?h.C0.ESC+"OA":h.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?o.key=c?h.C0.ESC+"OD":h.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?o.key=c?h.C0.ESC+"OC":h.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(o.key=c?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:o.key=n.ctrlKey?"\b":h.C0.DEL,n.altKey&&(o.key=h.C0.ESC+o.key);break;case 9:if(n.shiftKey){o.key=h.C0.ESC+"[Z";break}o.key=h.C0.HT,o.cancel=!0;break;case 13:o.key=n.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,o.cancel=!0;break;case 27:o.key=h.C0.ESC,n.altKey&&(o.key=h.C0.ESC+h.C0.ESC),o.cancel=!0;break;case 37:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"D",o.key===h.C0.ESC+"[1;3D"&&(o.key=h.C0.ESC+(f?"b":"[1;5D"))):o.key=c?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"C",o.key===h.C0.ESC+"[1;3C"&&(o.key=h.C0.ESC+(f?"f":"[1;5C"))):o.key=c?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"A",f||o.key!==h.C0.ESC+"[1;3A"||(o.key=h.C0.ESC+"[1;5A")):o.key=c?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"B",f||o.key!==h.C0.ESC+"[1;3B"||(o.key=h.C0.ESC+"[1;5B")):o.key=c?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(o.key=h.C0.ESC+"[2~");break;case 46:o.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:o.key=e?h.C0.ESC+"[1;"+(e+1)+"H":c?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:o.key=e?h.C0.ESC+"[1;"+(e+1)+"F":c?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:n.shiftKey?o.type=2:n.ctrlKey?o.key=h.C0.ESC+"[5;"+(e+1)+"~":o.key=h.C0.ESC+"[5~";break;case 34:n.shiftKey?o.type=3:n.ctrlKey?o.key=h.C0.ESC+"[6;"+(e+1)+"~":o.key=h.C0.ESC+"[6~";break;case 112:o.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:o.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:o.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:o.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:o.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:o.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:o.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:o.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:o.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:o.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:o.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:o.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!v||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?o.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(o.key=h.C0.US),n.key==="@"&&(o.key=h.C0.NUL)):n.keyCode===65&&(o.type=1);else{const i=d[n.keyCode],s=i?.[n.shiftKey?1:0];if(s)o.key=h.C0.ESC+s;else if(n.keyCode>=65&&n.keyCode<=90){const r=n.ctrlKey?n.keyCode-64:n.keyCode+32;let _=String.fromCharCode(r);n.shiftKey&&(_=_.toUpperCase()),o.key=h.C0.ESC+_}else if(n.keyCode===32)o.key=h.C0.ESC+(n.ctrlKey?h.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let r=n.code.slice(3,4);n.shiftKey||(r=r.toLowerCase()),o.key=h.C0.ESC+r,o.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?o.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?o.key=h.C0.NUL:n.keyCode>=51&&n.keyCode<=55?o.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?o.key=h.C0.DEL:n.keyCode===219?o.key=h.C0.ESC:n.keyCode===220?o.key=h.C0.FS:n.keyCode===221&&(o.key=h.C0.GS)}return o}},482:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,h=0,d=a.length){let n="";for(let c=h;c<d;++c){let f=a[c];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const d=a.length;if(!d)return 0;let n=0,c=0;if(this._interim){const f=a.charCodeAt(c++);56320<=f&&f<=57343?h[n++]=1024*(this._interim-55296)+f-56320+65536:(h[n++]=this._interim,h[n++]=f),this._interim=0}for(let f=c;f<d;++f){const v=a.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=d)return this._interim=v,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?h[n++]=1024*(v-55296)+o-56320+65536:(h[n++]=v,h[n++]=o)}else v!==65279&&(h[n++]=v)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const d=a.length;if(!d)return 0;let n,c,f,v,o=0,e=0,i=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let u,m=0;for(;(u=63&this.interim[++m])&&m<4;)p<<=6,p|=u;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=l-m;for(;i<g;){if(i>=d)return 0;if(u=a[i++],(192&u)!=128){i--,_=!0;break}this.interim[m++]=u,p<<=6,p|=63&u}_||(l===2?p<128?i--:h[o++]=p:l===3?p<2048||p>=55296&&p<=57343||p===65279||(h[o++]=p):p<65536||p>1114111||(h[o++]=p)),this.interim.fill(0)}const s=d-4;let r=i;for(;r<d;){for(;!(!(r<s)||128&(n=a[r])||128&(c=a[r+1])||128&(f=a[r+2])||128&(v=a[r+3]));)h[o++]=n,h[o++]=c,h[o++]=f,h[o++]=v,r+=4;if(n=a[r++],n<128)h[o++]=n;else if((224&n)==192){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(e=(31&n)<<6|63&c,e<128){r--;continue}h[o++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,o;if(f=a[r++],(192&f)!=128){r--;continue}if(e=(15&n)<<12|(63&c)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;h[o++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,o;if(f=a[r++],(192&f)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,this.interim[2]=f,o;if(v=a[r++],(192&v)!=128){r--;continue}if(e=(7&n)<<18|(63&c)<<12|(63&f)<<6|63&v,e<65536||e>1114111)continue;h[o++]=e}}return o}}},225:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const h=a(1480),d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let c;t.UnicodeV6=class{constructor(){if(this.version="6",!c){c=new Uint8Array(65536),c.fill(1),c[0]=0,c.fill(0,1,32),c.fill(0,127,160),c.fill(2,4352,4448),c[9001]=2,c[9002]=2,c.fill(2,11904,42192),c[12351]=1,c.fill(2,44032,55204),c.fill(2,63744,64256),c.fill(2,65040,65050),c.fill(2,65072,65136),c.fill(2,65280,65377),c.fill(2,65504,65511);for(let f=0;f<d.length;++f)c.fill(0,d[f][0],d[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?c[f]:function(v,o){let e,i=0,s=o.length-1;if(v<o[0][0]||v>o[s][1])return!1;for(;s>=i;)if(e=i+s>>1,v>o[e][1])i=e+1;else{if(!(v<o[e][0]))return!0;s=e-1}return!1}(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,v){let o=this.wcwidth(f),e=o===0&&v!==0;if(e){const i=h.UnicodeService.extractWidth(v);i===0?e=!1:i>o&&(o=i)}return h.UnicodeService.createPropertyValue(0,o,e)}}},5981:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const h=a(8460),d=a(844);class n extends d.Disposable{constructor(f){super(),this._action=f,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(f,v){if(v!==void 0&&this._syncCalls>v)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let o;for(this._isSyncWriting=!0;o=this._writeBuffer.shift();){this._action(o);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,v){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+=f.length,this._writeBuffer.push(f),this._callbacks.push(v),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v)}_innerWrite(f=0,v=!0){const o=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],i=this._action(e,v);if(i){const r=_=>Date.now()-o>=12?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(o,_);return void i.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(r)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-o>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=n},5941:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function d(n,c){const f=n.toString(16),v=f.length<2?"0"+f:f;switch(c){case 4:return f[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}t.parseColor=function(n){if(!n)return;let c=n.toLowerCase();if(c.indexOf("rgb:")===0){c=c.slice(4);const f=a.exec(c);if(f){const v=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/v*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/v*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/v*255)]}}else if(c.indexOf("#")===0&&(c=c.slice(1),h.exec(c)&&[3,6,9,12].includes(c.length))){const f=c.length/3,v=[0,0,0];for(let o=0;o<3;++o){const e=parseInt(c.slice(f*o,f*o+f),16);v[o]=f===1?e<<4:f===2?e:f===3?e>>4:e>>8}return v}},t.toRgbString=function(n,c=16){const[f,v,o]=n;return`rgb:${d(f,c)}/${d(v,c)}/${d(o,c)}`}},5770:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const h=a(482),d=a(8742),n=a(5770),c=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=c,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}registerHandler(v,o){this._handlers[v]===void 0&&(this._handlers[v]=[]);const e=this._handlers[v];return e.push(o),{dispose:()=>{const i=e.indexOf(o);i!==-1&&e.splice(i,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=c,this._ident=0}hook(v,o){if(this.reset(),this._ident=v,this._active=this._handlers[v]||c,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(o);else this._handlerFb(this._ident,"HOOK",o)}put(v,o,e){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(v,o,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(v,o,e))}unhook(v,o=!0){if(this._active.length){let e=!1,i=this._active.length-1,s=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,e=o,s=this._stack.fallThrough,this._stack.paused=!1),!s&&e===!1){for(;i>=0&&(e=this._active[i].unhook(v),e!==!0);i--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,e;i--}for(;i>=0;i--)if(e=this._active[i].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",v);this._active=c,this._ident=0}};const f=new d.Params;f.addParam(0),t.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=f,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():f,this._data="",this._hitLimit=!1}put(v,o,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(v,o,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let o=!1;if(this._hitLimit)o=!1;else if(v&&(o=this._handler(this._data,this._params),o instanceof Promise))return o.then(e=>(this._params=f,this._data="",this._hitLimit=!1,e));return this._params=f,this._data="",this._hitLimit=!1,o}}},2015:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const h=a(844),d=a(8742),n=a(6242),c=a(6351);class f{constructor(i){this.table=new Uint8Array(i)}setDefault(i,s){this.table.fill(i<<4|s)}add(i,s,r,_){this.table[s<<8|i]=r<<4|_}addMany(i,s,r,_){for(let p=0;p<i.length;p++)this.table[s<<8|i[p]]=r<<4|_}}t.TransitionTable=f;const v=160;t.VT500_TRANSITION_TABLE=function(){const e=new f(4095),i=Array.apply(null,Array(256)).map((m,l)=>l),s=(m,l)=>i.slice(m,l),r=s(32,127),_=s(0,24);_.push(25),_.push.apply(_,s(28,32));const p=s(0,14);let u;for(u in e.setDefault(1,0),e.addMany(r,0,2,0),p)e.addMany([24,26,153,154],u,3,0),e.addMany(s(128,144),u,3,0),e.addMany(s(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(_,0,3,0),e.addMany(_,1,3,1),e.add(127,1,0,1),e.addMany(_,8,0,8),e.addMany(_,3,3,3),e.add(127,3,0,3),e.addMany(_,4,3,4),e.add(127,4,0,4),e.addMany(_,6,3,6),e.addMany(_,5,3,5),e.add(127,5,0,5),e.addMany(_,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(_,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(_,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(_,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(_,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(_,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(_,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(v,0,2,0),e.add(v,8,5,8),e.add(v,6,0,6),e.add(v,11,0,11),e.add(v,13,13,13),e}();class o extends h.Disposable{constructor(i=t.VT500_TRANSITION_TABLE){super(),this._transitions=i,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,r,_)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,r)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new c.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,s=[64,126]){let r=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=i.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<i.intermediates.length;++p){const u=i.intermediates.charCodeAt(p);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=u}}if(i.final.length!==1)throw new Error("final must be a single byte");const _=i.final.charCodeAt(0);if(s[0]>_||_>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return r<<=8,r|=_,r}identToString(i){const s=[];for(;i;)s.push(String.fromCharCode(255&i)),i>>=8;return s.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,s){const r=this._identifier(i,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);const _=this._escHandlers[r];return _.push(s),{dispose:()=>{const p=_.indexOf(s);p!==-1&&_.splice(p,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,s){this._executeHandlers[i.charCodeAt(0)]=s}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,s){const r=this._identifier(i);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);const _=this._csiHandlers[r];return _.push(s),{dispose:()=>{const p=_.indexOf(s);p!==-1&&_.splice(p,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,s){return this._dcsParser.registerHandler(this._identifier(i),s)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,s){return this._oscParser.registerHandler(i,s)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(i,s,r,_,p){this._parseStack.state=i,this._parseStack.handlers=s,this._parseStack.handlerPos=r,this._parseStack.transition=_,this._parseStack.chunkPos=p}parse(i,s,r){let _,p=0,u=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const l=this._parseStack.handlers;let g=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&g>-1){for(;g>=0&&(_=l[g](this._params),_!==!0);g--)if(_ instanceof Promise)return this._parseStack.handlerPos=g,_}this._parseStack.handlers=[];break;case 4:if(r===!1&&g>-1){for(;g>=0&&(_=l[g](),_!==!0);g--)if(_ instanceof Promise)return this._parseStack.handlerPos=g,_}this._parseStack.handlers=[];break;case 6:if(p=i[this._parseStack.chunkPos],_=this._dcsParser.unhook(p!==24&&p!==26,r),_)return _;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=i[this._parseStack.chunkPos],_=this._oscParser.end(p!==24&&p!==26,r),_)return _;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=m;l<s;++l){switch(p=i[l],u=this._transitions.table[this.currentState<<8|(p<160?p:v)],u>>4){case 2:for(let w=l+1;;++w){if(w>=s||(p=i[w])<32||p>126&&p<v){this._printHandler(i,l,w),l=w-1;break}if(++w>=s||(p=i[w])<32||p>126&&p<v){this._printHandler(i,l,w),l=w-1;break}if(++w>=s||(p=i[w])<32||p>126&&p<v){this._printHandler(i,l,w),l=w-1;break}if(++w>=s||(p=i[w])<32||p>126&&p<v){this._printHandler(i,l,w),l=w-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const g=this._csiHandlers[this._collect<<8|p];let S=g?g.length-1:-1;for(;S>=0&&(_=g[S](this._params),_!==!0);S--)if(_ instanceof Promise)return this._preserveStack(3,g,S,u,l),_;S<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingJoinState=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++l<s&&(p=i[l])>47&&p<60);l--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:const y=this._escHandlers[this._collect<<8|p];let b=y?y.length-1:-1;for(;b>=0&&(_=y[b](),_!==!0);b--)if(_ instanceof Promise)return this._preserveStack(4,y,b,u,l),_;b<0&&this._escHandlerFb(this._collect<<8|p),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|p,this._params);break;case 13:for(let w=l+1;;++w)if(w>=s||(p=i[w])===24||p===26||p===27||p>127&&p<v){this._dcsParser.put(i,l,w),l=w-1;break}break;case 14:if(_=this._dcsParser.unhook(p!==24&&p!==26),_)return this._preserveStack(6,[],0,u,l),_;p===27&&(u|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let w=l+1;;w++)if(w>=s||(p=i[w])<32||p>127&&p<v){this._oscParser.put(i,l,w),l=w-1;break}break;case 6:if(_=this._oscParser.end(p!==24&&p!==26),_)return this._preserveStack(5,[],0,u,l),_;p===27&&(u|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&u}}}t.EscapeSequenceParser=o},6242:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const h=a(5770),d=a(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(c,f){this._handlers[c]===void 0&&(this._handlers[c]=[]);const v=this._handlers[c];return v.push(f),{dispose:()=>{const o=v.indexOf(f);o!==-1&&v.splice(o,1)}}}clearHandler(c){this._handlers[c]&&delete this._handlers[c]}setHandlerFallback(c){this._handlerFb=c}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let c=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;c>=0;--c)this._active[c].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].start();else this._handlerFb(this._id,"START")}_put(c,f,v){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(c,f,v);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(c,f,v))}start(){this.reset(),this._state=1}put(c,f,v){if(this._state!==3){if(this._state===1)for(;f<v;){const o=c[f++];if(o===59){this._state=2,this._start();break}if(o<48||57<o)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+o-48}this._state===2&&v-f>0&&this._put(c,f,v)}}end(c,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,o=this._active.length-1,e=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,v=f,e=this._stack.fallThrough,this._stack.paused=!1),!e&&v===!1){for(;o>=0&&(v=this._active[o].end(c),v!==!0);o--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,v;o--}for(;o>=0;o--)if(v=this._active[o].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",c);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(c){this._handler=c,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(c,f,v){this._hitLimit||(this._data+=(0,d.utf32ToString)(c,f,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(c){let f=!1;if(this._hitLimit)f=!1;else if(c&&(f=this._handler(this._data),f instanceof Promise))return f.then(v=>(this._data="",this._hitLimit=!1,v));return this._data="",this._hitLimit=!1,f}}},8742:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const a=2147483647;class h{static fromArray(n){const c=new h;if(!n.length)return c;for(let f=Array.isArray(n[0])?1:0;f<n.length;++f){const v=n[f];if(Array.isArray(v))for(let o=0;o<v.length;++o)c.addSubParam(v[o]);else c.addParam(v)}return c}constructor(n=32,c=32){if(this.maxLength=n,this.maxSubParamsLength=c,c>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(c),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new h(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let c=0;c<this.length;++c){n.push(this.params[c]);const f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,v))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const c=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-c>0?this._subParams.subarray(c,f):null}getSubParamsAll(){const n={};for(let c=0;c<this.length;++c){const f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&(n[c]=this._subParams.slice(f,v))}return n}addDigit(n){let c;if(this._rejectDigits||!(c=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,v=f[c-1];f[c-1]=~v?Math.min(10*v+n,a):n}}t.Params=h},5741:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,h){const d={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(d),h.dispose=()=>this._wrappedAddonDispose(d),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===a){h=d;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(h,1)}}},8771:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const h=a(3785),d=a(511);t.BufferApiView=class{constructor(n,c){this._buffer=n,this.type=c}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const c=this._buffer.lines.get(n);if(c)return new h.BufferLineApiView(c)}getNullCell(){return new d.CellData}}},3785:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const h=a(511);t.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,n){if(!(d<0||d>=this._line.length))return n?(this._line.loadCell(d,n),n):this._line.loadCell(d,new h.CellData)}translateToString(d,n,c){return this._line.translateToString(d,n,c)}}},8285:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const h=a(8771),d=a(8460),n=a(844);class c extends n.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new d.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)}}t.BufferNamespaceApi=c},7975:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,d=>h(d.toArray()))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,(d,n)=>h(d,n.toArray()))}addDcsHandler(a,h){return this.registerDcsHandler(a,h)}registerEscHandler(a,h){return this._core.registerEscHandler(a,h)}addEscHandler(a,h){return this.registerEscHandler(a,h)}registerOscHandler(a,h){return this._core.registerOscHandler(a,h)}addOscHandler(a,h){return this.registerOscHandler(a,h)}}},7090:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(O,t,a){var h=this&&this.__decorate||function(e,i,s,r){var _,p=arguments.length,u=p<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,s):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,i,s,r);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(u=(p<3?_(u):p>3?_(i,s,u):_(i,s))||u);return p>3&&u&&Object.defineProperty(i,s,u),u},d=this&&this.__param||function(e,i){return function(s,r){i(s,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=a(8460),c=a(844),f=a(5295),v=a(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let o=t.BufferService=class extends c.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(e,this))}resize(e,i){this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){const s=this.buffer;let r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=s.getBlankLine(e,i),this._cachedBlankLine=r),r.isWrapped=i;const _=s.ybase+s.scrollTop,p=s.ybase+s.scrollBottom;if(s.scrollTop===0){const u=s.lines.isFull;p===s.lines.length-1?u?s.lines.recycle().copyFrom(r):s.lines.push(r.clone()):s.lines.splice(p+1,0,r.clone()),u?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const u=p-_+1;s.lines.shiftElements(_+1,u-1,-1),s.lines.set(p,r.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,i,s){const r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);const _=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),_!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};t.BufferService=o=h([d(0,v.IOptionsService)],o)},7994:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(O,t,a){var h=this&&this.__decorate||function(r,_,p,u){var m,l=arguments.length,g=l<3?_:u===null?u=Object.getOwnPropertyDescriptor(_,p):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,_,p,u);else for(var S=r.length-1;S>=0;S--)(m=r[S])&&(g=(l<3?m(g):l>3?m(_,p,g):m(_,p))||g);return l>3&&g&&Object.defineProperty(_,p,g),g},d=this&&this.__param||function(r,_){return function(p,u){_(p,u,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=a(2585),c=a(8460),f=a(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:r=>r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)},VT200:{events:19,restrict:r=>r.action!==32},DRAG:{events:23,restrict:r=>r.action!==32||r.button!==3},ANY:{events:31,restrict:r=>!0}};function o(r,_){let p=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(p|=64,p|=r.action):(p|=3&r.button,4&r.button&&(p|=64),8&r.button&&(p|=128),r.action===32?p|=32:r.action!==0||_||(p|=3)),p}const e=String.fromCharCode,i={DEFAULT:r=>{const _=[o(r,!1)+32,r.col+32,r.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${e(_[0])}${e(_[1])}${e(_[2])}`},SGR:r=>{const _=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${o(r,!0)};${r.col};${r.row}${_}`},SGR_PIXELS:r=>{const _=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${o(r,!0)};${r.x};${r.y}${_}`}};let s=t.CoreMouseService=class extends f.Disposable{constructor(r,_){super(),this._bufferService=r,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new c.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const p of Object.keys(v))this.addProtocol(p,v[p]);for(const p of Object.keys(i))this.addEncoding(p,i[p]);this.reset()}addProtocol(r,_){this._protocols[r]=_}addEncoding(r,_){this._encodings[r]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(r){if(!this._protocols[r])throw new Error(`unknown protocol "${r}"`);this._activeProtocol=r,this._onProtocolChange.fire(this._protocols[r].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(r){if(!this._encodings[r])throw new Error(`unknown encoding "${r}"`);this._activeEncoding=r}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(r){if(r.col<0||r.col>=this._bufferService.cols||r.row<0||r.row>=this._bufferService.rows||r.button===4&&r.action===32||r.button===3&&r.action!==32||r.button!==4&&(r.action===2||r.action===3)||(r.col++,r.row++,r.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,r,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(r))return!1;const _=this._encodings[this._activeEncoding](r);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=r,!0}explainEvents(r){return{down:!!(1&r),up:!!(2&r),drag:!!(4&r),move:!!(8&r),wheel:!!(16&r)}}_equalEvents(r,_,p){if(p){if(r.x!==_.x||r.y!==_.y)return!1}else if(r.col!==_.col||r.row!==_.row)return!1;return r.button===_.button&&r.action===_.action&&r.ctrl===_.ctrl&&r.alt===_.alt&&r.shift===_.shift}};t.CoreMouseService=s=h([d(0,n.IBufferService),d(1,n.ICoreService)],s)},6975:function(O,t,a){var h=this&&this.__decorate||function(s,r,_,p){var u,m=arguments.length,l=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,r,_,p);else for(var g=s.length-1;g>=0;g--)(u=s[g])&&(l=(m<3?u(l):m>3?u(r,_,l):u(r,_))||l);return m>3&&l&&Object.defineProperty(r,_,l),l},d=this&&this.__param||function(s,r){return function(_,p){r(_,p,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=a(1439),c=a(8460),f=a(844),v=a(2585),o=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=t.CoreService=class extends f.Disposable{constructor(s,r,_){super(),this._bufferService=s,this._logService=r,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new c.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new c.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(o),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(o),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(s,r=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(p=>p.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(s))}};t.CoreService=i=h([d(0,v.IBufferService),d(1,v.ILogService),d(2,v.IOptionsService)],i)},9074:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const h=a(8055),d=a(8460),n=a(844),c=a(6106);let f=0,v=0;class o extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new c.SortedList(s=>s?.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const r=new e(s);if(r){const _=r.marker.onDispose(()=>r.dispose());r.onDispose(()=>{r&&(this._decorations.delete(r)&&this._onDecorationRemoved.fire(r),_.dispose())}),this._decorations.insert(r),this._onDecorationRegistered.fire(r)}return r}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,r,_){let p=0,u=0;for(const m of this._decorations.getKeyIterator(r))p=m.options.x??0,u=p+(m.options.width??1),s>=p&&s<u&&(!_||(m.options.layer??"bottom")===_)&&(yield m)}forEachDecorationAtCell(s,r,_,p){this._decorations.forEachByKey(r,u=>{f=u.options.x??0,v=f+(u.options.width??1),s>=f&&s<v&&(!_||(u.options.layer??"bottom")===_)&&p(u)})}}t.DecorationService=o;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const h=a(2585),d=a(8343);class n{constructor(...f){this._entries=new Map;for(const[v,o]of f)this.set(v,o)}set(f,v){const o=this._entries.get(f);return this._entries.set(f,v),o}forEach(f){for(const[v,o]of this._entries.entries())f(v,o)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(h.IInstantiationService,this)}setService(c,f){this._services.set(c,f)}getService(c){return this._services.get(c)}createInstance(c,...f){const v=(0,d.getServiceDependencies)(c).sort((i,s)=>i.index-s.index),o=[];for(const i of v){const s=this._services.get(i.id);if(!s)throw new Error(`[createInstance] ${c.name} depends on UNKNOWN service ${i.id}.`);o.push(s)}const e=v.length>0?v[0].index:f.length;if(f.length!==e)throw new Error(`[createInstance] First service dependency of ${c.name} at position ${e+1} conflicts with ${f.length} static arguments`);return new c(...f,...o)}}},7866:function(O,t,a){var h=this&&this.__decorate||function(e,i,s,r){var _,p=arguments.length,u=p<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,s):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,i,s,r);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(u=(p<3?_(u):p>3?_(i,s,u):_(i,s))||u);return p>3&&u&&Object.defineProperty(i,s,u),u},d=this&&this.__param||function(e,i){return function(s,r){i(s,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(844),c=a(2585),f={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF};let v,o=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...s)}trace(e,...i){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};t.LogService=o=h([d(0,c.IOptionsService)],o),t.setTraceLogger=function(e){v=e},t.traceCall=function(e,i,s){if(typeof s.value!="function")throw new Error("not supported");const r=s.value;s.value=function(..._){if(v.logLevel!==c.LogLevelEnum.TRACE)return r.apply(this,_);v.trace(`GlyphRenderer#${r.name}(${_.map(u=>JSON.stringify(u)).join(", ")})`);const p=r.apply(this,_);return v.trace(`GlyphRenderer#${r.name} return`,p),p}}},7302:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const h=a(8460),d=a(844),n=a(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const c=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends d.Disposable{constructor(o){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e={...t.DEFAULT_OPTIONS};for(const i in o)if(i in e)try{const s=o[i];e[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=e,this.options={...e},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(o,e){return this.onOptionChange(i=>{i===o&&e(this.rawOptions[o])})}onMultipleOptionChange(o,e){return this.onOptionChange(i=>{o.indexOf(i)!==-1&&e()})}_setupOptions(){const o=i=>{if(!(i in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},e=(i,s)=>{if(!(i in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const s={get:o.bind(this,i),set:e.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(o,e){switch(o){case"cursorStyle":if(e||(e=t.DEFAULT_OPTIONS[o]),!function(i){return i==="block"||i==="underline"||i==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${o}`);break;case"wordSeparator":e||(e=t.DEFAULT_OPTIONS[o]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=c.includes(e)?e:t.DEFAULT_OPTIONS[o];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${o} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${o} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${o} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${o} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}t.OptionsService=f},2660:function(O,t,a){var h=this&&this.__decorate||function(f,v,o,e){var i,s=arguments.length,r=s<3?v:e===null?e=Object.getOwnPropertyDescriptor(v,o):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(f,v,o,e);else for(var _=f.length-1;_>=0;_--)(i=f[_])&&(r=(s<3?i(r):s>3?i(v,o,r):i(v,o))||r);return s>3&&r&&Object.defineProperty(v,o,r),r},d=this&&this.__param||function(f,v){return function(o,e){v(o,e,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=a(2585);let c=t.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const v=this._bufferService.buffer;if(f.id===void 0){const _=v.addMarker(v.ybase+v.y),p={data:f,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(p,_)),this._dataByLinkId.set(p.id,p),p.id}const o=f,e=this._getEntryIdKey(o),i=this._entriesWithId.get(e);if(i)return this.addLineToLink(i.id,v.ybase+v.y),i.id;const s=v.addMarker(v.ybase+v.y),r={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(r,s)),this._entriesWithId.set(r.key,r),this._dataByLinkId.set(r.id,r),r.id}addLineToLink(f,v){const o=this._dataByLinkId.get(f);if(o&&o.lines.every(e=>e.line!==v)){const e=this._bufferService.buffer.addMarker(v);o.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(o,e))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,v){const o=f.lines.indexOf(v);o!==-1&&(f.lines.splice(o,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};t.OscLinkService=c=h([d(0,n.IBufferService)],c)},8343:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",h="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[h]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);const n=function(c,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,i){e[a]===e?e[h].push({id:o,index:i}):(e[h]=[{id:o,index:i}],e[a]=e)})(n,c,v)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},2585:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const h=a(8343);var d;t.IBufferService=(0,h.createDecorator)("BufferService"),t.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),t.ICoreService=(0,h.createDecorator)("CoreService"),t.ICharsetService=(0,h.createDecorator)("CharsetService"),t.IInstantiationService=(0,h.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,h.createDecorator)("LogService"),t.IOptionsService=(0,h.createDecorator)("OptionsService"),t.IOscLinkService=(0,h.createDecorator)("OscLinkService"),t.IUnicodeService=(0,h.createDecorator)("UnicodeService"),t.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const h=a(8460),d=a(225);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,v,o=!1){return(16777215&f)<<3|(3&v)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const f=new d.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let v=0,o=0;const e=f.length;for(let i=0;i<e;++i){let s=f.charCodeAt(i);if(55296<=s&&s<=56319){if(++i>=e)return v+this.wcwidth(s);const p=f.charCodeAt(i);56320<=p&&p<=57343?s=1024*(s-55296)+p-56320+65536:v+=this.wcwidth(p)}const r=this.charProperties(s,o);let _=n.extractWidth(r);n.extractShouldJoin(r)&&(_-=n.extractWidth(o)),v+=_,o=r}return v}charProperties(f,v){return this._activeProvider.charProperties(f,v)}}t.UnicodeService=n}},ne={};function Q(O){var t=ne[O];if(t!==void 0)return t.exports;var a=ne[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,Q),a.exports}var ae={};return(()=>{var O=ae;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const t=Q(9042),a=Q(3236),h=Q(844),d=Q(5741),n=Q(8285),c=Q(7975),f=Q(7090),v=["cols","rows"];class o extends h.Disposable{constructor(i){super(),this._core=this.register(new a.Terminal(i)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const s=_=>this._core.options[_],r=(_,p)=>{this._checkReadonlyOptions(_),this._core.options[_]=p};for(const _ in this._core.options){const p={get:s.bind(this,_),set:r.bind(this,_)};Object.defineProperty(this._publicOptions,_,p)}}_checkReadonlyOptions(i){if(v.includes(i))throw new Error(`Option "${i}" 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 f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=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:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const s in i)this._publicOptions[s]=i[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(i,s=!0){this._core.input(i,s)}resize(i,s){this._verifyIntegers(i,s),this._core.resize(i,s)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}attachCustomWheelEventHandler(i){this._core.attachCustomWheelEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){return this._checkProposedApi(),this._verifyPositiveIntegers(i.x??0,i.width??0,i.height??0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,s,r){this._verifyIntegers(i,s,r),this._core.select(i,s,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,s){this._verifyIntegers(i,s),this._core.selectLines(i,s)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,s){this._core.write(i,s)}writeln(i,s){this._core.write(i),this._core.write(`\r
9
+ `,s)}paste(i){this._core.paste(i)}refresh(i,s){this._verifyIntegers(i,s),this._core.refresh(i,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(i){this._addonManager.loadAddon(this,i)}static get strings(){return t}_verifyIntegers(...i){for(const s of i)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...i){for(const s of i)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}O.Terminal=o})(),ae})())}(Se)),Se.exports}var Ce={exports:{}},Re;function Oe(){return Re||(Re=1,function(ue,we){(function(ce,ne){ue.exports=ne()})(self,()=>(()=>{var ce={};return(()=>{var ne=ce;Object.defineProperty(ne,"__esModule",{value:!0}),ne.FitAddon=void 0,ne.FitAddon=class{activate(Q){this._terminal=Q}dispose(){}fit(){const Q=this.proposeDimensions();if(!Q||!this._terminal||isNaN(Q.cols)||isNaN(Q.rows))return;const ae=this._terminal._core;this._terminal.rows===Q.rows&&this._terminal.cols===Q.cols||(ae._renderService.clear(),this._terminal.resize(Q.cols,Q.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const Q=this._terminal._core,ae=Q._renderService.dimensions;if(ae.css.cell.width===0||ae.css.cell.height===0)return;const O=this._terminal.options.scrollback===0?0:Q.viewport.scrollBarWidth,t=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(t.getPropertyValue("height")),h=Math.max(0,parseInt(t.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),n=a-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),c=h-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-O;return{cols:Math.max(2,Math.floor(c/ae.css.cell.width)),rows:Math.max(1,Math.floor(n/ae.css.cell.height))}}}})(),ce})())}(Ce)),Ce.exports}var be={exports:{}},De;function Pe(){return De||(De=1,function(ue,we){(function(ce,ne){ue.exports=ne()})(self,()=>(()=>{var ce={965:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const h=a(374),d=a(509),n=a(855),c=a(859),f=a(381),v=11,o=v*Float32Array.BYTES_PER_ELEMENT;let e,i=0,s=0,r=0;class _ extends c.Disposable{constructor(u,m,l,g){super(),this._terminal=u,this._gl=m,this._dimensions=l,this._optionsService=g,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const S=this._gl;d.TextureAtlas.maxAtlasPages===void 0&&(d.TextureAtlas.maxAtlasPages=Math.min(32,(0,h.throwIfFalsy)(S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS))),d.TextureAtlas.maxTextureSize=(0,h.throwIfFalsy)(S.getParameter(S.MAX_TEXTURE_SIZE))),this._program=(0,h.throwIfFalsy)((0,f.createProgram)(S,`#version 300 es
10
+ layout (location = 0) in vec2 a_unitquad;
11
+ layout (location = 1) in vec2 a_cellpos;
12
+ layout (location = 2) in vec2 a_offset;
13
+ layout (location = 3) in vec2 a_size;
14
+ layout (location = 4) in float a_texpage;
15
+ layout (location = 5) in vec2 a_texcoord;
16
+ layout (location = 6) in vec2 a_texsize;
17
+
18
+ uniform mat4 u_projection;
19
+ uniform vec2 u_resolution;
20
+
21
+ out vec2 v_texcoord;
22
+ flat out int v_texpage;
23
+
24
+ void main() {
25
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
26
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
27
+ v_texpage = int(a_texpage);
28
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
29
+ }`,function(B){let T="";for(let M=1;M<B;M++)T+=` else if (v_texpage == ${M}) { outColor = texture(u_texture[${M}], v_texcoord); }`;return`#version 300 es
30
+ precision lowp float;
31
+
32
+ in vec2 v_texcoord;
33
+ flat in int v_texpage;
34
+
35
+ uniform sampler2D u_texture[${B}];
36
+
37
+ out vec4 outColor;
38
+
39
+ void main() {
40
+ if (v_texpage == 0) {
41
+ outColor = texture(u_texture[0], v_texcoord);
42
+ } ${T}
43
+ }`}(d.TextureAtlas.maxAtlasPages))),this.register((0,c.toDisposable)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);const y=new Float32Array([0,0,1,0,0,1,1,1]),b=S.createBuffer();this.register((0,c.toDisposable)(()=>S.deleteBuffer(b))),S.bindBuffer(S.ARRAY_BUFFER,b),S.bufferData(S.ARRAY_BUFFER,y,S.STATIC_DRAW),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const w=new Uint8Array([0,1,2,3]),x=S.createBuffer();this.register((0,c.toDisposable)(()=>S.deleteBuffer(x))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,x),S.bufferData(S.ELEMENT_ARRAY_BUFFER,w,S.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(S.createBuffer()),this.register((0,c.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,2,S.FLOAT,!1,o,0),S.vertexAttribDivisor(2,1),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,S.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(3,1),S.enableVertexAttribArray(4),S.vertexAttribPointer(4,1,S.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(4,1),S.enableVertexAttribArray(5),S.vertexAttribPointer(5,2,S.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(5,1),S.enableVertexAttribArray(6),S.vertexAttribPointer(6,2,S.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(6,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.useProgram(this._program);const k=new Int32Array(d.TextureAtlas.maxAtlasPages);for(let B=0;B<d.TextureAtlas.maxAtlasPages;B++)k[B]=B;S.uniform1iv(this._textureLocation,k),S.uniformMatrix4fv(this._projectionLocation,!1,f.PROJECTION_MATRIX),this._atlasTextures=[];for(let B=0;B<d.TextureAtlas.maxAtlasPages;B++){const T=new f.GLTexture((0,h.throwIfFalsy)(S.createTexture()));this.register((0,c.toDisposable)(()=>S.deleteTexture(T.texture))),S.activeTexture(S.TEXTURE0+B),S.bindTexture(S.TEXTURE_2D,T.texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[B]=T}S.enable(S.BLEND),S.blendFunc(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(u,m,l,g,S,y,b,w,x){this._updateCell(this._vertices.attributes,u,m,l,g,S,y,b,w,x)}_updateCell(u,m,l,g,S,y,b,w,x,k){i=(l*this._terminal.cols+m)*v,g!==n.NULL_CELL_CODE&&g!==void 0?this._atlas&&(e=w&&w.length>1?this._atlas.getRasterizedGlyphCombinedChar(w,S,y,b,!1):this._atlas.getRasterizedGlyph(g,S,y,b,!1),s=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),S!==k&&e.offset.x>s?(r=e.offset.x-s,u[i]=-(e.offset.x-r)+this._dimensions.device.char.left,u[i+1]=-e.offset.y+this._dimensions.device.char.top,u[i+2]=(e.size.x-r)/this._dimensions.device.canvas.width,u[i+3]=e.size.y/this._dimensions.device.canvas.height,u[i+4]=e.texturePage,u[i+5]=e.texturePositionClipSpace.x+r/this._atlas.pages[e.texturePage].canvas.width,u[i+6]=e.texturePositionClipSpace.y,u[i+7]=e.sizeClipSpace.x-r/this._atlas.pages[e.texturePage].canvas.width,u[i+8]=e.sizeClipSpace.y):(u[i]=-e.offset.x+this._dimensions.device.char.left,u[i+1]=-e.offset.y+this._dimensions.device.char.top,u[i+2]=e.size.x/this._dimensions.device.canvas.width,u[i+3]=e.size.y/this._dimensions.device.canvas.height,u[i+4]=e.texturePage,u[i+5]=e.texturePositionClipSpace.x,u[i+6]=e.texturePositionClipSpace.y,u[i+7]=e.sizeClipSpace.x,u[i+8]=e.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,h.allowRescaling)(g,x,e.size.x,this._dimensions.device.cell.width)&&(u[i+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):u.fill(0,i,i+v-1-2)}clear(){const u=this._terminal,m=u.cols*u.rows*v;this._vertices.count!==m?this._vertices.attributes=new Float32Array(m):this._vertices.attributes.fill(0);let l=0;for(;l<this._vertices.attributesBuffers.length;l++)this._vertices.count!==m?this._vertices.attributesBuffers[l]=new Float32Array(m):this._vertices.attributesBuffers[l].fill(0);this._vertices.count=m,l=0;for(let g=0;g<u.rows;g++)for(let S=0;S<u.cols;S++)this._vertices.attributes[l+9]=S/u.cols,this._vertices.attributes[l+10]=g/u.rows,l+=v}handleResize(){const u=this._gl;u.useProgram(this._program),u.viewport(0,0,u.canvas.width,u.canvas.height),u.uniform2f(this._resolutionLocation,u.canvas.width,u.canvas.height),this.clear()}render(u){if(!this._atlas)return;const m=this._gl;m.useProgram(this._program),m.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const l=this._vertices.attributesBuffers[this._activeBuffer];let g=0;for(let S=0;S<u.lineLengths.length;S++){const y=S*this._terminal.cols*v,b=this._vertices.attributes.subarray(y,y+u.lineLengths[S]*v);l.set(b,g),g+=b.length}m.bindBuffer(m.ARRAY_BUFFER,this._attributesBuffer),m.bufferData(m.ARRAY_BUFFER,l.subarray(0,g),m.STREAM_DRAW);for(let S=0;S<this._atlas.pages.length;S++)this._atlas.pages[S].version!==this._atlasTextures[S].version&&this._bindAtlasPageTexture(m,this._atlas,S);m.drawElementsInstanced(m.TRIANGLE_STRIP,4,m.UNSIGNED_BYTE,0,g/v)}setAtlas(u){this._atlas=u;for(const m of this._atlasTextures)m.version=-1}_bindAtlasPageTexture(u,m,l){u.activeTexture(u.TEXTURE0+l),u.bindTexture(u.TEXTURE_2D,this._atlasTextures[l].texture),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,m.pages[l].canvas),u.generateMipmap(u.TEXTURE_2D),this._atlasTextures[l].version=m.pages[l].version}setDimensions(u){this._dimensions=u}}t.GlyphRenderer=_},742:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const h=a(374),d=a(859),n=a(310),c=a(381),f=8*Float32Array.BYTES_PER_ELEMENT;class v{constructor(){this.attributes=new Float32Array(160),this.count=0}}let o=0,e=0,i=0,s=0,r=0,_=0,p=0;class u extends d.Disposable{constructor(l,g,S,y){super(),this._terminal=l,this._gl=g,this._dimensions=S,this._themeService=y,this._vertices=new v,this._verticesCursor=new v;const b=this._gl;this._program=(0,h.throwIfFalsy)((0,c.createProgram)(b,`#version 300 es
44
+ layout (location = 0) in vec2 a_position;
45
+ layout (location = 1) in vec2 a_size;
46
+ layout (location = 2) in vec4 a_color;
47
+ layout (location = 3) in vec2 a_unitquad;
48
+
49
+ uniform mat4 u_projection;
50
+
51
+ out vec4 v_color;
52
+
53
+ void main() {
54
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
55
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
56
+ v_color = a_color;
57
+ }`,`#version 300 es
58
+ precision lowp float;
59
+
60
+ in vec4 v_color;
61
+
62
+ out vec4 outColor;
63
+
64
+ void main() {
65
+ outColor = v_color;
66
+ }`)),this.register((0,d.toDisposable)(()=>b.deleteProgram(this._program))),this._projectionLocation=(0,h.throwIfFalsy)(b.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=b.createVertexArray(),b.bindVertexArray(this._vertexArrayObject);const w=new Float32Array([0,0,1,0,0,1,1,1]),x=b.createBuffer();this.register((0,d.toDisposable)(()=>b.deleteBuffer(x))),b.bindBuffer(b.ARRAY_BUFFER,x),b.bufferData(b.ARRAY_BUFFER,w,b.STATIC_DRAW),b.enableVertexAttribArray(3),b.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const k=new Uint8Array([0,1,2,3]),B=b.createBuffer();this.register((0,d.toDisposable)(()=>b.deleteBuffer(B))),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,B),b.bufferData(b.ELEMENT_ARRAY_BUFFER,k,b.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(b.createBuffer()),this.register((0,d.toDisposable)(()=>b.deleteBuffer(this._attributesBuffer))),b.bindBuffer(b.ARRAY_BUFFER,this._attributesBuffer),b.enableVertexAttribArray(0),b.vertexAttribPointer(0,2,b.FLOAT,!1,f,0),b.vertexAttribDivisor(0,1),b.enableVertexAttribArray(1),b.vertexAttribPointer(1,2,b.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),b.vertexAttribDivisor(1,1),b.enableVertexAttribArray(2),b.vertexAttribPointer(2,4,b.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),b.vertexAttribDivisor(2,1),this._updateCachedColors(y.colors),this.register(this._themeService.onChangeColors(T=>{this._updateCachedColors(T),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(l){const g=this._gl;g.useProgram(this._program),g.bindVertexArray(this._vertexArrayObject),g.uniformMatrix4fv(this._projectionLocation,!1,c.PROJECTION_MATRIX),g.bindBuffer(g.ARRAY_BUFFER,this._attributesBuffer),g.bufferData(g.ARRAY_BUFFER,l.attributes,g.DYNAMIC_DRAW),g.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,g.UNSIGNED_BYTE,0,l.count)}handleResize(){this._updateViewportRectangle()}setDimensions(l){this._dimensions=l}_updateCachedColors(l){this._bgFloat=this._colorToFloat32Array(l.background),this._cursorFloat=this._colorToFloat32Array(l.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(l){const g=this._terminal,S=this._vertices;let y,b,w,x,k,B,T,M,C,L,R,D=1;for(y=0;y<g.rows;y++){for(w=-1,x=0,k=0,B=!1,b=0;b<g.cols;b++)T=(y*g.cols+b)*n.RENDER_MODEL_INDICIES_PER_CELL,M=l.cells[T+n.RENDER_MODEL_BG_OFFSET],C=l.cells[T+n.RENDER_MODEL_FG_OFFSET],L=!!(67108864&C),(M!==x||C!==k&&(B||L))&&((x!==0||B&&k!==0)&&(R=8*D++,this._updateRectangle(S,R,k,x,w,b,y)),w=b,x=M,k=C,B=L);(x!==0||B&&k!==0)&&(R=8*D++,this._updateRectangle(S,R,k,x,w,g.cols,y))}S.count=D}updateCursor(l){const g=this._verticesCursor,S=l.cursor;if(!S||S.style==="block")return void(g.count=0);let y,b=0;S.style!=="bar"&&S.style!=="outline"||(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.style==="bar"?S.dpr*S.cursorWidth:S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),S.style!=="underline"&&S.style!=="outline"||(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,(S.y+1)*this._dimensions.device.cell.height-S.dpr,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat)),S.style==="outline"&&(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat),y=8*b++,this._addRectangleFloat(g.attributes,y,(S.x+S.width)*this._dimensions.device.cell.width-S.dpr,S.y*this._dimensions.device.cell.height,S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),g.count=b}_updateRectangle(l,g,S,y,b,w,x){if(67108864&S)switch(50331648&S){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&S].rgba;break;case 50331648:o=(16777215&S)<<8;break;default:o=this._themeService.colors.foreground.rgba}else switch(50331648&y){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&y].rgba;break;case 50331648:o=(16777215&y)<<8;break;default:o=this._themeService.colors.background.rgba}l.attributes.length<g+4&&(l.attributes=(0,c.expandFloat32Array)(l.attributes,this._terminal.rows*this._terminal.cols*8)),e=b*this._dimensions.device.cell.width,i=x*this._dimensions.device.cell.height,s=(o>>24&255)/255,r=(o>>16&255)/255,_=(o>>8&255)/255,p=1,this._addRectangle(l.attributes,g,e,i,(w-b)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,s,r,_,p)}_addRectangle(l,g,S,y,b,w,x,k,B,T){l[g]=S/this._dimensions.device.canvas.width,l[g+1]=y/this._dimensions.device.canvas.height,l[g+2]=b/this._dimensions.device.canvas.width,l[g+3]=w/this._dimensions.device.canvas.height,l[g+4]=x,l[g+5]=k,l[g+6]=B,l[g+7]=T}_addRectangleFloat(l,g,S,y,b,w,x){l[g]=S/this._dimensions.device.canvas.width,l[g+1]=y/this._dimensions.device.canvas.height,l[g+2]=b/this._dimensions.device.canvas.width,l[g+3]=w/this._dimensions.device.canvas.height,l[g+4]=x[0],l[g+5]=x[1],l[g+6]=x[2],l[g+7]=x[3]}_colorToFloat32Array(l){return new Float32Array([(l.rgba>>24&255)/255,(l.rgba>>16&255)/255,(l.rgba>>8&255)/255,(255&l.rgba)/255])}}t.RectangleRenderer=u},310:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const h=a(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,h.createSelectionRenderModel)()}resize(d,n){const c=d*n*t.RENDER_MODEL_INDICIES_PER_CELL;c!==this.cells.length&&(this.cells=new Uint32Array(c),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const h=a(820),d=a(274),n=a(627),c=a(457),f=a(56),v=a(374),o=a(345),e=a(859),i=a(147),s=a(782),r=a(855),_=a(965),p=a(742),u=a(310),m=a(733);class l extends e.Disposable{constructor(b,w,x,k,B,T,M,C,L){super(),this._terminal=b,this._characterJoinerService=w,this._charSizeService=x,this._coreBrowserService=k,this._coreService=B,this._decorationService=T,this._optionsService=M,this._themeService=C,this._cursorBlinkStateManager=new e.MutableDisposable,this._charAtlasDisposable=this.register(new e.MutableDisposable),this._observerDisposable=this.register(new e.MutableDisposable),this._model=new u.RenderModel,this._workCell=new s.CellData,this._workCell2=new s.CellData,this._rectangleRenderer=this.register(new e.MutableDisposable),this._glyphRenderer=this.register(new e.MutableDisposable),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new m.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,M,this._themeService)],this.dimensions=(0,v.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(M.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const R={antialias:!1,depth:!1,preserveDrawingBuffer:L};if(this._gl=this._canvas.getContext("webgl2",R),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextlost",D=>{console.log("webglcontextlost event received"),D.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(D)},3e3)})),this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextrestored",D=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(D,I)=>this._setCanvasDevicePixelDimensions(D,I)),this.register(this._coreBrowserService.onWindowChange(D=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,D,(I,H)=>this._setCanvasDevicePixelDimensions(I,H))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,e.toDisposable)(()=>{for(const D of this._renderLayers)D.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(b,w){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const x of this._renderLayers)x.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const b of this._renderLayers)b.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const b of this._renderLayers)b.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(b,w,x){for(const k of this._renderLayers)k.handleSelectionChanged(this._terminal,b,w,x);this._model.selection.update(this._core,b,w,x),this._requestRedrawViewport()}handleCursorMove(){for(const b of this._renderLayers)b.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new p.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new _.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const b=(0,n.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==b&&(this._onChangeTextureAtlas.fire(b.pages[0].canvas),this._charAtlasDisposable.value=(0,e.getDisposeArrayDisposable)([(0,o.forwardEvent)(b.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,o.forwardEvent)(b.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=b,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(b){this._model.clear(),b&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const b of this._renderLayers)b.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(b){return-1}deregisterCharacterJoiner(b){return!1}renderRows(b,w){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const x of this._renderLayers)x.handleGridChanged(this._terminal,b,w);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(b,w),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new c.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(b,w){const x=this._core;let k,B,T,M,C,L,R,D,I,H,z,U,A,E,P=this._workCell;b=S(b,x.rows-1,0),w=S(w,x.rows-1,0);const F=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,$=F-x.buffer.ydisp,W=Math.min(this._terminal.buffer.active.cursorX,x.cols-1);let G=-1;const j=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Z=!1;for(B=b;B<=w;B++)for(T=B+x.buffer.ydisp,M=x.buffer.lines.get(T),this._model.lineLengths[B]=0,C=this._characterJoinerService.getJoinedCharacters(T),A=0;A<x.cols;A++)if(k=this._cellColorResolver.result.bg,M.loadCell(A,P),A===0&&(k=this._cellColorResolver.result.bg),L=!1,R=A,C.length>0&&A===C[0][0]&&(L=!0,D=C.shift(),P=new g(P,M.translateToString(!0,D[0],D[1]),D[1]-D[0]),R=D[1]-1),I=P.getChars(),H=P.getCode(),U=(B*x.cols+A)*u.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(P,A,T,this.dimensions.device.cell.width),j&&T===F&&(A===W&&(this._model.cursor={x:W,y:$,width:P.getWidth(),style:this._coreBrowserService.isFocused?x.options.cursorStyle||"block":x.options.cursorInactiveStyle,cursorWidth:x.options.cursorWidth,dpr:this._devicePixelRatio},G=W+P.getWidth()-1),A>=W&&A<=G&&(this._coreBrowserService.isFocused&&(x.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&x.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),H!==r.NULL_CELL_CODE&&(this._model.lineLengths[B]=A+1),(this._model.cells[U]!==H||this._model.cells[U+u.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[U+u.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[U+u.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Z=!0,I.length>1&&(H|=u.COMBINED_CHAR_BIT_MASK),this._model.cells[U]=H,this._model.cells[U+u.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[U+u.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[U+u.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,z=P.getWidth(),this._glyphRenderer.value.updateCell(A,B,H,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,I,z,k),L))for(P=this._workCell,A++;A<R;A++)E=(B*x.cols+A)*u.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(A,B,r.NULL_CELL_CODE,0,0,0,r.NULL_CELL_CHAR,0,0),this._model.cells[E]=r.NULL_CELL_CODE,this._model.cells[E+u.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[E+u.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[E+u.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Z&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(b,w){this._canvas.width===b&&this._canvas.height===w||(this._canvas.width=b,this._canvas.height=w,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const b=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:b,end:b})}}t.WebglRenderer=l;class g extends i.AttributeData{constructor(b,w,x){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=w,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function S(y,b,w=0){return Math.max(Math.min(y,b),w)}t.JoinedCellData=g},381:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const h=a(374);function d(n,c,f){const v=(0,h.throwIfFalsy)(n.createShader(c));if(n.shaderSource(v,f),n.compileShader(v),n.getShaderParameter(v,n.COMPILE_STATUS))return v;console.error(n.getShaderInfoLog(v)),n.deleteShader(v)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,c,f){const v=(0,h.throwIfFalsy)(n.createProgram());if(n.attachShader(v,(0,h.throwIfFalsy)(d(n,n.VERTEX_SHADER,c))),n.attachShader(v,(0,h.throwIfFalsy)(d(n,n.FRAGMENT_SHADER,f))),n.linkProgram(v),n.getProgramParameter(v,n.LINK_STATUS))return v;console.error(n.getProgramInfoLog(v)),n.deleteProgram(v)},t.createShader=d,t.expandFloat32Array=function(n,c){const f=Math.min(2*n.length,c),v=new Float32Array(f);for(let o=0;o<n.length;o++)v[o]=n[o];return v},t.GLTexture=class{constructor(n){this.texture=n,this.version=-1}}},592:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const h=a(627),d=a(237),n=a(374),c=a(859);class f extends c.Disposable{constructor(o,e,i,s,r,_,p,u){super(),this._container=e,this._alpha=r,this._coreBrowserService=_,this._optionsService=p,this._themeService=u,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(m=>{this._refreshCharAtlas(o,m),this.reset(o)})),this.register((0,c.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(o){}handleFocus(o){}handleCursorMove(o){}handleGridChanged(o,e,i){}handleSelectionChanged(o,e,i,s=!1){}_setTransparency(o,e){if(e===this._alpha)return;const i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(o,this._themeService.colors),this.handleGridChanged(o,0,o.rows-1)}_refreshCharAtlas(o,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,h.acquireTextureAtlas)(o,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(o,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(o,this._themeService.colors)}_fillBottomLineAtCells(o,e,i=1){this._ctx.fillRect(o*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(o,e,i,s){this._alpha?this._ctx.clearRect(o*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(o*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(o,e,i,s){this._ctx.font=this._getFont(o,!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipCell(i,s,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(o,e,i){this._ctx.beginPath(),this._ctx.rect(o*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(o,e,i){return`${i?"italic":""} ${e?o.options.fontWeightBold:o.options.fontWeight} ${o.options.fontSize*this._coreBrowserService.dpr}px ${o.options.fontFamily}`}}t.BaseRenderLayer=f},733:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const h=a(197),d=a(237),n=a(592);class c extends n.BaseRenderLayer{constructor(v,o,e,i,s,r,_){super(e,v,"link",o,!0,s,r,_),this.register(i.onShowLinkUnderline(p=>this._handleShowLinkUnderline(p))),this.register(i.onHideLinkUnderline(p=>this._handleHideLinkUnderline(p)))}resize(v,o){super.resize(v,o),this._state=void 0}reset(v){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const v=this._state.y2-this._state.y1-1;v>0&&this._clearCells(0,this._state.y1+1,this._state.cols,v),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(v){if(v.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:v.fg!==void 0&&(0,h.is256Color)(v.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[v.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,v.y1===v.y2)this._fillBottomLineAtCells(v.x1,v.y1,v.x2-v.x1);else{this._fillBottomLineAtCells(v.x1,v.y1,v.cols-v.x1);for(let o=v.y1+1;o<v.y2;o++)this._fillBottomLineAtCells(0,o,v.cols);this._fillBottomLineAtCells(0,v.y2,v.x2)}this._state=v}_handleHideLinkUnderline(v){this._clearCurrentLink()}}t.LinkRenderLayer=c},820:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,h,d,n){a.addEventListener(h,d,n);let c=!1;return{dispose:()=>{c||(c=!0,a.removeEventListener(h,d,n))}}}},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const h=a(855),d=a(160),n=a(374);let c,f=0,v=0,o=!1,e=!1,i=!1,s=0;t.CellColorResolver=class{constructor(r,_,p,u,m,l){this._terminal=r,this._optionService=_,this._selectionRenderModel=p,this._decorationService=u,this._coreBrowserService=m,this._themeService=l,this.result={fg:0,bg:0,ext:0}}resolve(r,_,p,u){if(this.result.bg=r.bg,this.result.fg=r.fg,this.result.ext=268435456&r.bg?r.extended.ext:0,v=0,f=0,e=!1,o=!1,i=!1,c=this._themeService.colors,s=0,r.getCode()!==h.NULL_CELL_CODE&&r.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));s=_*u%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(_,p,"bottom",m=>{m.backgroundColorRGB&&(v=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,o=!0)}),i=this._selectionRenderModel.isCellSelected(this._terminal,_,p),i){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:v=(16777215&this.result.fg)<<8|255;break;default:v=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:v=(16777215&this.result.bg)<<8|255}v=d.rgba.blend(v,4294967040&(this._coreBrowserService.isFocused?c.selectionBackgroundOpaque:c.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else v=(this._coreBrowserService.isFocused?c.selectionBackgroundOpaque:c.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,c.selectionForeground&&(f=c.selectionForeground.rgba>>8&16777215,o=!0),(0,n.treatGlyphAsBackgroundColor)(r.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?c.selectionBackgroundOpaque:c.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=d.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?c.selectionBackgroundOpaque:c.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(_,p,"top",m=>{m.backgroundColorRGB&&(v=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,o=!0)}),e&&(v=i?-16777216&r.bg&-134217729|v|50331648:-16777216&r.bg|v|50331648),o&&(f=-16777216&r.fg&-67108865|f|50331648),67108864&this.result.fg&&(e&&!o&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&c.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!e&&o&&(v=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&c.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,e=!0)),c=void 0,this.result.bg=e?v:this.result.bg,this.result.fg=o?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=s<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const h=a(509),d=a(197),n=[];t.acquireTextureAtlas=function(c,f,v,o,e,i,s,r){const _=(0,d.generateConfig)(o,e,i,s,f,v,r);for(let m=0;m<n.length;m++){const l=n[m],g=l.ownedBy.indexOf(c);if(g>=0){if((0,d.configEquals)(l.config,_))return l.atlas;l.ownedBy.length===1?(l.atlas.dispose(),n.splice(m,1)):l.ownedBy.splice(g,1);break}}for(let m=0;m<n.length;m++){const l=n[m];if((0,d.configEquals)(l.config,_))return l.ownedBy.push(c),l.atlas}const p=c._core,u={atlas:new h.TextureAtlas(document,_,p.unicodeService),config:_,ownedBy:[c]};return n.push(u),u.atlas},t.removeTerminalFromCache=function(c){for(let f=0;f<n.length;f++){const v=n[f].ownedBy.indexOf(c);if(v!==-1){n[f].ownedBy.length===1?(n[f].atlas.dispose(),n.splice(f,1)):n[f].ownedBy.splice(v,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const h=a(160);t.generateConfig=function(d,n,c,f,v,o,e){const i={foreground:o.foreground,background:o.background,cursor:h.NULL_COLOR,cursorAccent:h.NULL_COLOR,selectionForeground:h.NULL_COLOR,selectionBackgroundTransparent:h.NULL_COLOR,selectionBackgroundOpaque:h.NULL_COLOR,selectionInactiveBackgroundTransparent:h.NULL_COLOR,selectionInactiveBackgroundOpaque:h.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:v.customGlyphs,devicePixelRatio:e,letterSpacing:v.letterSpacing,lineHeight:v.lineHeight,deviceCellWidth:d,deviceCellHeight:n,deviceCharWidth:c,deviceCharHeight:f,fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight,fontWeightBold:v.fontWeightBold,allowTransparency:v.allowTransparency,drawBoldTextInBrightColors:v.drawBoldTextInBrightColors,minimumContrastRatio:v.minimumContrastRatio,colors:i}},t.configEquals=function(d,n){for(let c=0;c<d.colors.ansi.length;c++)if(d.colors.ansi[c].rgba!==n.colors.ansi[c].rgba)return!1;return d.devicePixelRatio===n.devicePixelRatio&&d.customGlyphs===n.customGlyphs&&d.lineHeight===n.lineHeight&&d.letterSpacing===n.letterSpacing&&d.fontFamily===n.fontFamily&&d.fontSize===n.fontSize&&d.fontWeight===n.fontWeight&&d.fontWeightBold===n.fontWeightBold&&d.allowTransparency===n.allowTransparency&&d.deviceCharWidth===n.deviceCharWidth&&d.deviceCharHeight===n.deviceCharHeight&&d.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&d.minimumContrastRatio===n.minimumContrastRatio&&d.colors.foreground.rgba===n.colors.foreground.rgba&&d.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(d){return(50331648&d)==16777216||(50331648&d)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const h=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,h){this._renderCallback=a,this._coreBrowserService=h,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,h>0)return void this._restartInterval(h)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(h)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const h=a(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const d={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(o,e)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,e)=>`M1,${.5-e} L${.5-o},${.5-e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1`},"╕":{1:(o,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(o,e)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,e)=>`M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M0,${.5-e} L${.5+o},${.5-e} L${.5+o},1`},"╘":{1:(o,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(o,e)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,e)=>`M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0 M1,${.5+e} L${.5-o},${.5+e} L${.5-o},0`},"╛":{1:(o,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(o,e)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,e)=>`M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M0,${.5+e} L${.5+o},${.5+e} L${.5+o},0`},"╞":{1:(o,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╡":{1:(o,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(o,e)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,e)=>`M${.5+o},0 L${.5+o},1 M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0`},"╤":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1`},"╧":{1:(o,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╪":{1:(o,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,e)=>`M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1 M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(o,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(o,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(o,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(o,e,i,s,r,_,p,u){const m=t.blockElementDefinitions[e];if(m)return function(y,b,w,x,k,B){for(let T=0;T<b.length;T++){const M=b[T],C=k/8,L=B/8;y.fillRect(w+M.x*C,x+M.y*L,M.w*C,M.h*L)}}(o,m,i,s,r,_),!0;const l=d[e];if(l)return function(y,b,w,x,k,B){let T=n.get(b);T||(T=new Map,n.set(b,T));const M=y.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let C=T.get(M);if(!C){const L=b[0].length,R=b.length,D=y.canvas.ownerDocument.createElement("canvas");D.width=L,D.height=R;const I=(0,h.throwIfFalsy)(D.getContext("2d")),H=new ImageData(L,R);let z,U,A,E;if(M.startsWith("#"))z=parseInt(M.slice(1,3),16),U=parseInt(M.slice(3,5),16),A=parseInt(M.slice(5,7),16),E=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[z,U,A,E]=M.substring(5,M.length-1).split(",").map(P=>parseFloat(P))}for(let P=0;P<R;P++)for(let F=0;F<L;F++)H.data[4*(P*L+F)]=z,H.data[4*(P*L+F)+1]=U,H.data[4*(P*L+F)+2]=A,H.data[4*(P*L+F)+3]=b[P][F]*(255*E);I.putImageData(H,0,0),C=(0,h.throwIfFalsy)(y.createPattern(D,null)),T.set(M,C)}y.fillStyle=C,y.fillRect(w,x,k,B)}(o,l,i,s,r,_),!0;const g=t.boxDrawingDefinitions[e];if(g)return function(y,b,w,x,k,B,T){y.strokeStyle=y.fillStyle;for(const[M,C]of Object.entries(b)){let L;y.beginPath(),y.lineWidth=T*Number.parseInt(M),L=typeof C=="function"?C(.15,.15/B*k):C;for(const R of L.split(" ")){const D=R[0],I=f[D];if(!I){console.error(`Could not find drawing instructions for "${D}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(y,v(H,k,B,w,x,!0,T))}y.stroke(),y.closePath()}}(o,g,i,s,r,_,u),!0;const S=t.powerlineDefinitions[e];return!!S&&(function(y,b,w,x,k,B,T,M){const C=new Path2D;C.rect(w,x,k,B),y.clip(C),y.beginPath();const L=T/12;y.lineWidth=M*L;for(const R of b.d.split(" ")){const D=R[0],I=f[D];if(!I){console.error(`Could not find drawing instructions for "${D}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(y,v(H,k,B,w,x,!1,M,(b.leftPadding??0)*(L/2),(b.rightPadding??0)*(L/2)))}b.type===1?(y.strokeStyle=y.fillStyle,y.stroke()):y.fill(),y.closePath()}(o,S,i,s,r,_,p,u),!0)};const n=new Map;function c(o,e,i=0){return Math.max(Math.min(o,e),i)}const f={C:(o,e)=>o.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(o,e)=>o.lineTo(e[0],e[1]),M:(o,e)=>o.moveTo(e[0],e[1])};function v(o,e,i,s,r,_,p,u=0,m=0){const l=o.map(g=>parseFloat(g)||parseInt(g));if(l.length<2)throw new Error("Too few arguments for instruction");for(let g=0;g<l.length;g+=2)l[g]*=e-u*p-m*p,_&&l[g]!==0&&(l[g]=c(Math.round(l[g]+.5)-.5,e,0)),l[g]+=s+u*p;for(let g=1;g<l.length;g+=2)l[g]*=i,_&&l[g]!==0&&(l[g]=c(Math.round(l[g]+.5)-.5,i,0)),l[g]+=r;return l}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const h=a(859);t.observeDevicePixelDimensions=function(d,n,c){let f=new n.ResizeObserver(v=>{const o=v.find(s=>s.target===d);if(!o)return;if(!("devicePixelContentBoxSize"in o))return f?.disconnect(),void(f=void 0);const e=o.devicePixelContentBoxSize[0].inlineSize,i=o.devicePixelContentBoxSize[0].blockSize;e>0&&i>0&&c(e,i)});try{f.observe(d,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,h.toDisposable)(()=>f?.disconnect())}},374:(O,t)=>{function a(d){return 57508<=d&&d<=57558}function h(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},t.isEmoji=h,t.allowRescaling=function(d,n,c,f){return n===1&&c>Math.ceil(1.5*f)&&d!==void 0&&d>255&&!h(d)&&!a(d)&&!function(v){return 57344<=v&&v<=63743}(d)},t.treatGlyphAsBackgroundColor=function(d){return a(d)||function(n){return 9472<=n&&n<=9631}(d)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(d,n,c=0){return(d-(2*Math.round(n)-c))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(d,n,c,f=!1){if(this.selectionStart=n,this.selectionEnd=c,!n||!c||n[0]===c[0]&&n[1]===c[1])return void this.clear();const v=d.buffers.active.ydisp,o=n[1]-v,e=c[1]-v,i=Math.max(o,0),s=Math.min(e,d.rows-1);i>=d.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=i,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=c[0])}isCellSelected(d,n,c){return!!this.hasSelection&&(c-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&c>=this.viewportCappedStartRow&&n<this.endCol&&c<=this.viewportCappedEndRow:n<this.startCol&&c>=this.viewportCappedStartRow&&n>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const h=a(237),d=a(860),n=a(374),c=a(160),f=a(345),v=a(485),o=a(385),e=a(147),i=a(855),s={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let r;class _{get pages(){return this._pages}constructor(g,S,y){this._document=g,this._config=S,this._unicodeService=y,this._didWarmUp=!1,this._cacheMap=new v.FourKeyMap,this._cacheMapCombined=new v.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=m(g,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const g of this.pages)g.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const g=new o.IdleTaskQueue;for(let S=33;S<126;S++)g.enqueue(()=>{if(!this._cacheMap.get(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT)){const y=this._drawToCache(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT);this._cacheMap.set(S,i.DEFAULT_COLOR,i.DEFAULT_COLOR,i.DEFAULT_EXT,y)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const g of this._pages)g.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(_.maxAtlasPages&&this._pages.length>=Math.max(4,_.maxAtlasPages)){const S=this._pages.filter(T=>2*T.canvas.width<=(_.maxTextureSize||4096)).sort((T,M)=>M.canvas.width!==T.canvas.width?M.canvas.width-T.canvas.width:M.percentageUsed-T.percentageUsed);let y=-1,b=0;for(let T=0;T<S.length;T++)if(S[T].canvas.width!==b)y=T,b=S[T].canvas.width;else if(T-y==3)break;const w=S.slice(y,y+4),x=w.map(T=>T.glyphs[0].texturePage).sort((T,M)=>T>M?1:-1),k=this.pages.length-w.length,B=this._mergePages(w,k);B.version++;for(let T=x.length-1;T>=0;T--)this._deletePage(x[T]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const g=new p(this._document,this._textureSize);return this._pages.push(g),this._activePages.push(g),this._onAddTextureAtlasCanvas.fire(g.canvas),g}_mergePages(g,S){const y=2*g[0].canvas.width,b=new p(this._document,y,g);for(const[w,x]of g.entries()){const k=w*x.canvas.width%y,B=Math.floor(w/2)*x.canvas.height;b.ctx.drawImage(x.canvas,k,B);for(const M of x.glyphs)M.texturePage=S,M.sizeClipSpace.x=M.size.x/y,M.sizeClipSpace.y=M.size.y/y,M.texturePosition.x+=k,M.texturePosition.y+=B,M.texturePositionClipSpace.x=M.texturePosition.x/y,M.texturePositionClipSpace.y=M.texturePosition.y/y;this._onRemoveTextureAtlasCanvas.fire(x.canvas);const T=this._activePages.indexOf(x);T!==-1&&this._activePages.splice(T,1)}return b}_deletePage(g){this._pages.splice(g,1);for(let S=g;S<this._pages.length;S++){const y=this._pages[S];for(const b of y.glyphs)b.texturePage--;y.version++}}getRasterizedGlyphCombinedChar(g,S,y,b,w){return this._getFromCacheMap(this._cacheMapCombined,g,S,y,b,w)}getRasterizedGlyph(g,S,y,b,w){return this._getFromCacheMap(this._cacheMap,g,S,y,b,w)}_getFromCacheMap(g,S,y,b,w,x=!1){return r=g.get(S,y,b,w),r||(r=this._drawToCache(S,y,b,w,x),g.set(S,y,b,w,r)),r}_getColorFromAnsiIndex(g){if(g>=this._config.colors.ansi.length)throw new Error("No color found for idx "+g);return this._config.colors.ansi[g]}_getBackgroundColor(g,S,y,b){if(this._config.allowTransparency)return c.NULL_COLOR;let w;switch(g){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(S);break;case 50331648:const x=e.AttributeData.toColorRGB(S);w=c.channels.toColor(x[0],x[1],x[2]);break;default:w=y?c.color.opaque(this._config.colors.foreground):this._config.colors.background}return w}_getForegroundColor(g,S,y,b,w,x,k,B,T,M){const C=this._getMinimumContrastColor(g,S,y,b,w,x,k,T,B,M);if(C)return C;let L;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&x<8&&(x+=8),L=this._getColorFromAnsiIndex(x);break;case 50331648:const R=e.AttributeData.toColorRGB(x);L=c.channels.toColor(R[0],R[1],R[2]);break;default:L=k?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(L=c.color.opaque(L)),B&&(L=c.color.multiplyOpacity(L,h.DIM_OPACITY)),L}_resolveBackgroundRgba(g,S,y){switch(g){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return y?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(g,S,y,b){switch(g){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&b&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return y?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(g,S,y,b,w,x,k,B,T,M){if(this._config.minimumContrastRatio===1||M)return;const C=this._getContrastCache(T),L=C.getColor(g,b);if(L!==void 0)return L||void 0;const R=this._resolveBackgroundRgba(S,y,k),D=this._resolveForegroundRgba(w,x,k,B),I=c.rgba.ensureContrastRatio(R,D,this._config.minimumContrastRatio/(T?2:1));if(!I)return void C.setColor(g,b,null);const H=c.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return C.setColor(g,b,H),H}_getContrastCache(g){return g?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(g,S,y,b,w=!1){const x=typeof g=="number"?String.fromCharCode(g):g,k=Math.min(this._config.deviceCellWidth*Math.max(x.length,2)+4,this._textureSize);this._tmpCanvas.width<k&&(this._tmpCanvas.width=k);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=y,this._workAttributeData.bg=S,this._workAttributeData.extended.ext=b,this._workAttributeData.isInvisible())return s;const T=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),L=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),D=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let H=this._workAttributeData.getFgColor(),z=this._workAttributeData.getFgColorMode(),U=this._workAttributeData.getBgColor(),A=this._workAttributeData.getBgColorMode();if(M){const N=H;H=U,U=N;const Y=z;z=A,A=Y}const E=this._getBackgroundColor(A,U,M,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const P=T?this._config.fontWeightBold:this._config.fontWeight,F=L?"italic":"";this._tmpCtx.font=`${F} ${P} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=h.TEXT_BASELINE;const $=x.length===1&&(0,n.isPowerlineGlyph)(x.charCodeAt(0)),W=x.length===1&&(0,n.isRestrictedPowerlineGlyph)(x.charCodeAt(0)),G=this._getForegroundColor(S,A,U,y,z,H,M,C,T,(0,n.treatGlyphAsBackgroundColor)(x.charCodeAt(0)));this._tmpCtx.fillStyle=G.css;const j=W?0:4;let Z=!1;this._config.customGlyphs!==!1&&(Z=(0,d.tryDrawCustomChar)(this._tmpCtx,x,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let se,q=!$;if(se=typeof g=="number"?this._unicodeService.wcwidth(g):this._unicodeService.getStringCellWidth(g),R){this._tmpCtx.save();const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;if(this._tmpCtx.lineWidth=N,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())q=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{q=!1;let re=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&re<8&&(re+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(re).css}this._tmpCtx.beginPath();const ie=j,te=Math.ceil(j+this._config.deviceCharHeight)-Y-(w?2*N:0),de=te+N,oe=te+2*N;let he=this._workAttributeData.getUnderlineVariantOffset();for(let re=0;re<se;re++){this._tmpCtx.save();const ee=ie+re*this._config.deviceCellWidth,K=ie+(re+1)*this._config.deviceCellWidth,fe=ee+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(K,te),this._tmpCtx.moveTo(ee,oe),this._tmpCtx.lineTo(K,oe);break;case 3:const ve=N<=1?oe:Math.ceil(j+this._config.deviceCharHeight-N/2)-Y,ge=N<=1?te:Math.ceil(j+this._config.deviceCharHeight+N/2)-Y,ye=new Path2D;ye.rect(ee,te,this._config.deviceCellWidth,oe-te),this._tmpCtx.clip(ye),this._tmpCtx.moveTo(ee-this._config.deviceCellWidth/2,de),this._tmpCtx.bezierCurveTo(ee-this._config.deviceCellWidth/2,ge,ee,ge,ee,de),this._tmpCtx.bezierCurveTo(ee,ve,fe,ve,fe,de),this._tmpCtx.bezierCurveTo(fe,ge,K,ge,K,de),this._tmpCtx.bezierCurveTo(K,ve,K+this._config.deviceCellWidth/2,ve,K+this._config.deviceCellWidth/2,de);break;case 4:const pe=he===0?0:he>=N?2*N-he:N-he;he>=N||pe===0?(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ee+pe,te),this._tmpCtx.lineTo(K,te)):(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(ee+pe,te),this._tmpCtx.moveTo(ee+pe+N,te),this._tmpCtx.lineTo(K,te)),he=(0,n.computeNextVariantOffset)(K-ee,N,he);break;case 5:const Me=.6,ke=.3,me=K-ee,Ee=Math.floor(Me*me),Le=Math.floor(ke*me),Te=me-Ee-Le;this._tmpCtx.setLineDash([Ee,Le,Te]),this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(K,te);break;default:this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(K,te)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Z&&this._config.fontSize>=12&&!this._config.allowTransparency&&x!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const re=this._tmpCtx.measureText(x);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in re&&re.actualBoundingBoxDescent>0){this._tmpCtx.save();const ee=new Path2D;ee.rect(ie,te-Math.ceil(N/2),this._config.deviceCellWidth*se,oe-te+Math.ceil(N/2)),this._tmpCtx.clip(ee),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(x,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Y),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*se,j+Y),this._tmpCtx.stroke()}if(Z||this._tmpCtx.fillText(x,j,j+this._config.deviceCharHeight),x==="_"&&!this._config.allowTransparency){let N=u(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,G,q);if(N)for(let Y=1;Y<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(x,j,j+this._config.deviceCharHeight-Y),N=u(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,G,q),N);Y++);}if(D){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Y=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*se,j+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.stroke()}this._tmpCtx.restore();const le=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let _e;if(_e=this._config.allowTransparency?function(N){for(let Y=0;Y<N.data.length;Y+=4)if(N.data[Y+3]>0)return!1;return!0}(le):u(le,E,G,q),_e)return s;const J=this._findGlyphBoundingBox(le,this._workBoundingBox,k,W,Z,j);let V,X;for(;;){if(this._activePages.length===0){const N=this._createNewPage();V=N,X=N.currentRow,X.height=J.size.y;break}V=this._activePages[this._activePages.length-1],X=V.currentRow;for(const N of this._activePages)J.size.y<=N.currentRow.height&&(V=N,X=N.currentRow);for(let N=this._activePages.length-1;N>=0;N--)for(const Y of this._activePages[N].fixedRows)Y.height<=X.height&&J.size.y<=Y.height&&(V=this._activePages[N],X=Y);if(X.y+J.size.y>=V.canvas.height||X.height>J.size.y+2){let N=!1;if(V.currentRow.y+V.currentRow.height+J.size.y>=V.canvas.height){let Y;for(const ie of this._activePages)if(ie.currentRow.y+ie.currentRow.height+J.size.y<ie.canvas.height){Y=ie;break}if(Y)V=Y;else if(_.maxAtlasPages&&this._pages.length>=_.maxAtlasPages&&X.y+J.size.y<=V.canvas.height&&X.height>=J.size.y&&X.x+J.size.x<=V.canvas.width)N=!0;else{const ie=this._createNewPage();V=ie,X=ie.currentRow,X.height=J.size.y,N=!0}}N||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),X={x:0,y:V.currentRow.y+V.currentRow.height,height:J.size.y},V.fixedRows.push(X),V.currentRow={x:0,y:X.y+X.height,height:0})}if(X.x+J.size.x<=V.canvas.width)break;X===V.currentRow?(X.x=0,X.y+=X.height,X.height=0):V.fixedRows.splice(V.fixedRows.indexOf(X),1)}return J.texturePage=this._pages.indexOf(V),J.texturePosition.x=X.x,J.texturePosition.y=X.y,J.texturePositionClipSpace.x=X.x/V.canvas.width,J.texturePositionClipSpace.y=X.y/V.canvas.height,J.sizeClipSpace.x/=V.canvas.width,J.sizeClipSpace.y/=V.canvas.height,X.height=Math.max(X.height,J.size.y),X.x+=J.size.x,V.ctx.putImageData(le,J.texturePosition.x-this._workBoundingBox.left,J.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,J.size.x,J.size.y),V.addGlyph(J),V.version++,J}_findGlyphBoundingBox(g,S,y,b,w,x){S.top=0;const k=b?this._config.deviceCellHeight:this._tmpCanvas.height,B=b?this._config.deviceCellWidth:y;let T=!1;for(let M=0;M<k;M++){for(let C=0;C<B;C++){const L=M*this._tmpCanvas.width*4+4*C+3;if(g.data[L]!==0){S.top=M,T=!0;break}}if(T)break}S.left=0,T=!1;for(let M=0;M<x+B;M++){for(let C=0;C<k;C++){const L=C*this._tmpCanvas.width*4+4*M+3;if(g.data[L]!==0){S.left=M,T=!0;break}}if(T)break}S.right=B,T=!1;for(let M=x+B-1;M>=x;M--){for(let C=0;C<k;C++){const L=C*this._tmpCanvas.width*4+4*M+3;if(g.data[L]!==0){S.right=M,T=!0;break}}if(T)break}S.bottom=k,T=!1;for(let M=k-1;M>=0;M--){for(let C=0;C<B;C++){const L=M*this._tmpCanvas.width*4+4*C+3;if(g.data[L]!==0){S.bottom=M,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:S.right-S.left+1,y:S.bottom-S.top+1},sizeClipSpace:{x:S.right-S.left+1,y:S.bottom-S.top+1},offset:{x:-S.left+x+(b||w?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-S.top+x+(b||w?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=_;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(g){this._glyphs.push(g),this._usedPixels+=g.size.x*g.size.y}constructor(g,S,y){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],y)for(const b of y)this._glyphs.push(...b.glyphs),this._usedPixels+=b._usedPixels;this.canvas=m(g,S,S),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function u(l,g,S,y){const b=g.rgba>>>24,w=g.rgba>>>16&255,x=g.rgba>>>8&255,k=S.rgba>>>24,B=S.rgba>>>16&255,T=S.rgba>>>8&255,M=Math.floor((Math.abs(b-k)+Math.abs(w-B)+Math.abs(x-T))/12);let C=!0;for(let L=0;L<l.data.length;L+=4)l.data[L]===b&&l.data[L+1]===w&&l.data[L+2]===x||y&&Math.abs(l.data[L]-b)+Math.abs(l.data[L+1]-w)+Math.abs(l.data[L+2]-x)<M?l.data[L+3]=0:C=!1;return C}function m(l,g,S){const y=l.createElement("canvas");return y.width=g,y.height=S,y}},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,h=0,d=0,n=0;var c,f,v,o,e;function i(r){const _=r.toString(16);return _.length<2?"0"+_:_}function s(r,_){return r<_?(_+.05)/(r+.05):(r+.05)/(_+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(r){r.toCss=function(_,p,u,m){return m!==void 0?`#${i(_)}${i(p)}${i(u)}${i(m)}`:`#${i(_)}${i(p)}${i(u)}`},r.toRgba=function(_,p,u,m=255){return(_<<24|p<<16|u<<8|m)>>>0},r.toColor=function(_,p,u,m){return{css:r.toCss(_,p,u,m),rgba:r.toRgba(_,p,u,m)}}}(c||(t.channels=c={})),function(r){function _(p,u){return n=Math.round(255*u),[a,h,d]=e.toChannels(p.rgba),{css:c.toCss(a,h,d,n),rgba:c.toRgba(a,h,d,n)}}r.blend=function(p,u){if(n=(255&u.rgba)/255,n===1)return{css:u.css,rgba:u.rgba};const m=u.rgba>>24&255,l=u.rgba>>16&255,g=u.rgba>>8&255,S=p.rgba>>24&255,y=p.rgba>>16&255,b=p.rgba>>8&255;return a=S+Math.round((m-S)*n),h=y+Math.round((l-y)*n),d=b+Math.round((g-b)*n),{css:c.toCss(a,h,d),rgba:c.toRgba(a,h,d)}},r.isOpaque=function(p){return(255&p.rgba)==255},r.ensureContrastRatio=function(p,u,m){const l=e.ensureContrastRatio(p.rgba,u.rgba,m);if(l)return c.toColor(l>>24&255,l>>16&255,l>>8&255)},r.opaque=function(p){const u=(255|p.rgba)>>>0;return[a,h,d]=e.toChannels(u),{css:c.toCss(a,h,d),rgba:u}},r.opacity=_,r.multiplyOpacity=function(p,u){return n=255&p.rgba,_(p,n*u/255)},r.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(f||(t.color=f={})),function(r){let _,p;try{const u=document.createElement("canvas");u.width=1,u.height=1;const m=u.getContext("2d",{willReadFrequently:!0});m&&(_=m,_.globalCompositeOperation="copy",p=_.createLinearGradient(0,0,1,1))}catch{}r.toColor=function(u){if(u.match(/#[\da-f]{3,8}/i))switch(u.length){case 4:return a=parseInt(u.slice(1,2).repeat(2),16),h=parseInt(u.slice(2,3).repeat(2),16),d=parseInt(u.slice(3,4).repeat(2),16),c.toColor(a,h,d);case 5:return a=parseInt(u.slice(1,2).repeat(2),16),h=parseInt(u.slice(2,3).repeat(2),16),d=parseInt(u.slice(3,4).repeat(2),16),n=parseInt(u.slice(4,5).repeat(2),16),c.toColor(a,h,d,n);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}const m=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),h=parseInt(m[2]),d=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),c.toColor(a,h,d,n);if(!_||!p)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=p,_.fillStyle=u,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[a,h,d,n]=_.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(a,h,d,n),css:u}}}(v||(t.css=v={})),function(r){function _(p,u,m){const l=p/255,g=u/255,S=m/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}r.relativeLuminance=function(p){return _(p>>16&255,p>>8&255,255&p)},r.relativeLuminance2=_}(o||(t.rgb=o={})),function(r){function _(u,m,l){const g=u>>24&255,S=u>>16&255,y=u>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;k<l&&(b>0||w>0||x>0);)b-=Math.max(0,Math.ceil(.1*b)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}function p(u,m,l){const g=u>>24&255,S=u>>16&255,y=u>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;k<l&&(b<255||w<255||x<255);)b=Math.min(255,b+Math.ceil(.1*(255-b))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),k=s(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}r.blend=function(u,m){if(n=(255&m)/255,n===1)return m;const l=m>>24&255,g=m>>16&255,S=m>>8&255,y=u>>24&255,b=u>>16&255,w=u>>8&255;return a=y+Math.round((l-y)*n),h=b+Math.round((g-b)*n),d=w+Math.round((S-w)*n),c.toRgba(a,h,d)},r.ensureContrastRatio=function(u,m,l){const g=o.relativeLuminance(u>>8),S=o.relativeLuminance(m>>8);if(s(g,S)<l){if(S<g){const w=_(u,m,l),x=s(g,o.relativeLuminance(w>>8));if(x<l){const k=p(u,m,l);return x>s(g,o.relativeLuminance(k>>8))?w:k}return w}const y=p(u,m,l),b=s(g,o.relativeLuminance(y>>8));if(b<l){const w=_(u,m,l);return b>s(g,o.relativeLuminance(w>>8))?y:w}return y}},r.reduceLuminance=_,r.increaseLuminance=p,r.toChannels=function(u){return[u>>24&255,u>>16&255,u>>8&255,255&u]}}(e||(t.rgba=e={})),t.toPaddedHex=i,t.contrastRatio=s},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const d=[];for(let n=0;n<this._listeners.length;n++)d.push(this._listeners[n]);for(let n=0;n<d.length;n++)d[n].call(void 0,a,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,h){return a(d=>h.fire(d))},t.runAndSubscribe=function(a,h){return h(void 0),a(d=>h(d))}},859:(O,t)=>{function a(h){for(const d of h)d.dispose();h.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const d=this._disposables.indexOf(h);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(h){return{dispose:h}},t.disposeArray=a,t.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(d,n,c){this._data[d]||(this._data[d]={}),this._data[d][n]=c}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(h,d,n,c,f){this._data.get(h,d)||this._data.set(h,d,new a),this._data.get(h,d).set(n,c,f)}get(h,d,n,c){return this._data.get(h,d)?.get(n,c)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,h=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const d=a.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),t.isIpad=h==="iPad",t.isIphone=h==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),t.isLinux=h.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const h=a(399);class d{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let v=0,o=0,e=f.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),o=Math.max(v,o),i=f.timeRemaining(),1.5*o>i)return e-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-v))}ms`),void this._start();e=i}this.clear()}}class n extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=a;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,c=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=c}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=h},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const h=a(133),d=a(855),n=a(147);class c extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const o=new c;return o.setFromCharData(v),o}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(v){this.fg=v[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(v[d.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(v[d.CHAR_DATA_CHAR_INDEX].length===2){const e=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const i=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(e-55296)+i-56320+65536|v[d.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=v[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=c},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,h=0,d=a.length){let n="";for(let c=h;c<d;++c){let f=a[c];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const d=a.length;if(!d)return 0;let n=0,c=0;if(this._interim){const f=a.charCodeAt(c++);56320<=f&&f<=57343?h[n++]=1024*(this._interim-55296)+f-56320+65536:(h[n++]=this._interim,h[n++]=f),this._interim=0}for(let f=c;f<d;++f){const v=a.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=d)return this._interim=v,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?h[n++]=1024*(v-55296)+o-56320+65536:(h[n++]=v,h[n++]=o)}else v!==65279&&(h[n++]=v)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const d=a.length;if(!d)return 0;let n,c,f,v,o=0,e=0,i=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let u,m=0;for(;(u=63&this.interim[++m])&&m<4;)p<<=6,p|=u;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=l-m;for(;i<g;){if(i>=d)return 0;if(u=a[i++],(192&u)!=128){i--,_=!0;break}this.interim[m++]=u,p<<=6,p|=63&u}_||(l===2?p<128?i--:h[o++]=p:l===3?p<2048||p>=55296&&p<=57343||p===65279||(h[o++]=p):p<65536||p>1114111||(h[o++]=p)),this.interim.fill(0)}const s=d-4;let r=i;for(;r<d;){for(;!(!(r<s)||128&(n=a[r])||128&(c=a[r+1])||128&(f=a[r+2])||128&(v=a[r+3]));)h[o++]=n,h[o++]=c,h[o++]=f,h[o++]=v,r+=4;if(n=a[r++],n<128)h[o++]=n;else if((224&n)==192){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(e=(31&n)<<6|63&c,e<128){r--;continue}h[o++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,o;if(f=a[r++],(192&f)!=128){r--;continue}if(e=(15&n)<<12|(63&c)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;h[o++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,o;if(c=a[r++],(192&c)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,o;if(f=a[r++],(192&f)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=c,this.interim[2]=f,o;if(v=a[r++],(192&v)!=128){r--;continue}if(e=(7&n)<<18|(63&c)<<12|(63&f)<<6|63&v,e<65536||e>1114111)continue;h[o++]=e}}return o}}},776:function(O,t,a){var h=this&&this.__decorate||function(e,i,s,r){var _,p=arguments.length,u=p<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,s):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,i,s,r);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(u=(p<3?_(u):p>3?_(i,s,u):_(i,s))||u);return p>3&&u&&Object.defineProperty(i,s,u),u},d=this&&this.__param||function(e,i){return function(s,r){i(s,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),c=a(97),f={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF};let v,o=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...s)}trace(e,...i){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};t.LogService=o=h([d(0,c.IOptionsService)],o),t.setTraceLogger=function(e){v=e},t.traceCall=function(e,i,s){if(typeof s.value!="function")throw new Error("not supported");const r=s.value;s.value=function(..._){if(v.logLevel!==c.LogLevelEnum.TRACE)return r.apply(this,_);v.trace(`GlyphRenderer#${r.name}(${_.map(u=>JSON.stringify(u)).join(", ")})`);const p=r.apply(this,_);return v.trace(`GlyphRenderer#${r.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",h="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[h]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);const n=function(c,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,i){e[a]===e?e[h].push({id:o,index:i}):(e[h]=[{id:o,index:i}],e[a]=e)})(n,c,v)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const h=a(726);var d;t.IBufferService=(0,h.createDecorator)("BufferService"),t.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),t.ICoreService=(0,h.createDecorator)("CoreService"),t.ICharsetService=(0,h.createDecorator)("CharsetService"),t.IInstantiationService=(0,h.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,h.createDecorator)("LogService"),t.IOptionsService=(0,h.createDecorator)("OptionsService"),t.IOscLinkService=(0,h.createDecorator)("OscLinkService"),t.IUnicodeService=(0,h.createDecorator)("UnicodeService"),t.IDecorationService=(0,h.createDecorator)("DecorationService")}},ne={};function Q(O){var t=ne[O];if(t!==void 0)return t.exports;var a=ne[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,Q),a.exports}var ae={};return(()=>{var O=ae;Object.defineProperty(O,"__esModule",{value:!0}),O.WebglAddon=void 0;const t=Q(345),a=Q(859),h=Q(399),d=Q(666),n=Q(776);class c extends a.Disposable{constructor(v){if(h.isSafari&&(0,h.getSafariVersion)()<16){const o={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",o))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=v,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(v){const o=v._core;if(!v.element)return void this.register(o.onWillOpen(()=>this.activate(v)));this._terminal=v;const e=o.coreService,i=o.optionsService,s=o,r=s._renderService,_=s._characterJoinerService,p=s._charSizeService,u=s._coreBrowserService,m=s._decorationService,l=s._logService,g=s._themeService;(0,n.setTraceLogger)(l),this._renderer=this.register(new d.WebglRenderer(v,_,p,u,e,m,i,g,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const S=this._terminal._core._renderService;S.setRenderer(this._terminal._core._createRenderer()),S.handleResize(v.cols,v.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}O.WebglAddon=c})(),ae})())}(be)),be.exports}export{Oe as a,Pe as b,Be as r};