@overlordai/server 1.0.14 → 1.0.16

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 (57) hide show
  1. package/dist/common/error-filter.d.ts.map +1 -1
  2. package/dist/common/error-filter.js +16 -0
  3. package/dist/common/error-filter.js.map +1 -1
  4. package/dist/main.js +3 -2
  5. package/dist/main.js.map +1 -1
  6. package/package.json +4 -3
  7. package/public/assets/AccessTokensPage-D73_4hLR.js +1 -0
  8. package/public/assets/AdminPage-D6pFjGmN.js +1 -0
  9. package/public/assets/ApiReferencePage-Cr6xHbdi.js +1 -0
  10. package/public/assets/AuditLogPage-GREFjQX6.js +11 -0
  11. package/public/assets/BotManage-D9kc8BY5.js +6 -0
  12. package/public/assets/CliReferencePage-BIwVJvQK.js +4 -0
  13. package/public/assets/DeveloperManage-TJw3eF8S.js +16 -0
  14. package/public/assets/EditProjectPage-DwCS51Mo.js +2 -0
  15. package/public/assets/EmptyState-B5jMtmkr.js +6 -0
  16. package/public/assets/HomePage-Be7BEt8c.js +1 -0
  17. package/public/assets/LandingPage-B-3pUdk_.js +26 -0
  18. package/public/assets/LoginPage-Dstlxfad.js +1 -0
  19. package/public/assets/MachineDetailPage-C3AAUkBm.js +1 -0
  20. package/public/assets/MachineListPage-DYv4UXDO.js +6 -0
  21. package/public/assets/NotFoundPage-CRp_HeR8.js +1 -0
  22. package/public/assets/PipelineEditorPage-jSzry5nq.js +3 -0
  23. package/public/assets/ProfilePage-BjTXfqR-.js +1 -0
  24. package/public/assets/ProjectDetailPage-Dm8phZfW.js +7 -0
  25. package/public/assets/ProjectListPage-DxBqxFUe.js +6 -0
  26. package/public/assets/QuickAuth-BGJ9EbFe.js +1 -0
  27. package/public/assets/RemoveMemberConfirmDialog-Dpvy8p31.js +6 -0
  28. package/public/assets/Select-DobTn2ab.js +6 -0
  29. package/public/assets/SettingsPage-I5qaiH25.js +6 -0
  30. package/public/assets/Skeleton-D-ZoNR01.js +1 -0
  31. package/public/assets/TaskDetailPage-Beg8tuEN.css +32 -0
  32. package/public/assets/TaskDetailPage-Lqh5i3TN.js +44 -0
  33. package/public/assets/TaskListPage-BPHnFmpO.js +1 -0
  34. package/public/assets/TaskStatusBadge-RjE_jGwc.js +1 -0
  35. package/public/assets/TokenManage-CQqbOJcD.js +1 -0
  36. package/public/assets/TotpSetupPage-BNuui0Vg.js +9 -0
  37. package/public/assets/WorkerSetupGuidePage-jvt8Z6j1.js +16 -0
  38. package/public/assets/arrow-left-R4PVWL3u.js +6 -0
  39. package/public/assets/arrow-right-t-l7E3bV.js +6 -0
  40. package/public/assets/bot-KOWEPW_6.js +6 -0
  41. package/public/assets/copy-fRb9wi57.js +6 -0
  42. package/public/assets/external-link-CB9tx4V-.js +6 -0
  43. package/public/assets/index-BwfyjudA.css +1 -0
  44. package/public/assets/index-bdjBPTjT.js +207 -0
  45. package/public/assets/key-BZHp4zSH.js +6 -0
  46. package/public/assets/loader-circle-DyfiwA3n.js +6 -0
  47. package/public/assets/pencil-DgTA8lMR.js +6 -0
  48. package/public/assets/plus-CS3VSUw-.js +6 -0
  49. package/public/assets/protocol-C4f2G7mk.js +1 -0
  50. package/public/assets/rotate-ccw-e6dKDLQp.js +6 -0
  51. package/public/assets/scroll-text-DvCW6HuW.js +6 -0
  52. package/public/assets/settings-DDZ75kV_.js +6 -0
  53. package/public/assets/task.store-CDfQR9zk.js +1 -0
  54. package/public/assets/trash-2-Z9HHaMPB.js +6 -0
  55. package/public/assets/users-yEz_0v7L.js +6 -0
  56. package/public/favicon.svg +4 -0
  57. package/public/index.html +20 -0
@@ -0,0 +1,44 @@
1
+ var He=Object.defineProperty;var Fe=(G,$,F)=>$ in G?He(G,$,{enumerable:!0,configurable:!0,writable:!0,value:F}):G[$]=F;var ve=(G,$,F)=>Fe(G,typeof $!="symbol"?$+"":$,F);import{c as pe,r as z,u as We,f as ce,j as C,a as be,l as Ie,m as Ue,d as $e,n as ze,X as we,o as Ke,t as ke,i as qe}from"./index-bdjBPTjT.js";import{u as Ve}from"./task.store-CDfQR9zk.js";import{S as Ge}from"./Select-DobTn2ab.js";import{A as Xe}from"./arrow-left-R4PVWL3u.js";import{R as Je}from"./rotate-ccw-e6dKDLQp.js";import{E as Ye}from"./external-link-CB9tx4V-.js";import{L as Ee}from"./loader-circle-DyfiwA3n.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ze=pe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
7
+ * @license lucide-react v0.469.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Qe=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
12
+ * @license lucide-react v0.469.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Le=pe("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
17
+ * @license lucide-react v0.469.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const et=pe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
22
+ * @license lucide-react v0.469.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const tt=pe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
27
+ * @license lucide-react v0.469.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const st=pe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
32
+ * @license lucide-react v0.469.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const it=pe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);var Ce={exports:{}},De;function rt(){return De||(De=1,(function(G,$){(function(F,K){G.exports=K()})(self,(()=>(()=>{var F={4567:function(A,r,a){var h=this&&this.__decorate||function(t,o,c,f){var m,l=arguments.length,p=l<3?o:f===null?f=Object.getOwnPropertyDescriptor(o,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,o,c,f);else for(var x=t.length-1;x>=0;x--)(m=t[x])&&(p=(l<3?m(p):l>3?m(o,c,p):m(o,c))||p);return l>3&&p&&Object.defineProperty(o,c,p),p},_=this&&this.__param||function(t,o){return function(c,f){o(c,f,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),v=a(9924),g=a(844),u=a(5596),e=a(4725),i=a(3656);let s=r.AccessibilityManager=class extends g.Disposable{constructor(t,o){super(),this._terminal=t,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.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((c=>this._handleResize(c.rows)))),this.register(this._terminal.onRender((c=>this._refreshRows(c.start,c.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((c=>this._handleChar(c)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
37
+ `)))),this.register(this._terminal.onA11yTab((c=>this._handleTab(c)))),this.register(this._terminal.onKey((c=>this._handleKey(c.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new u.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,i.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(t){for(let o=0;o<t;o++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
38
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&this._liveRegion.remove()}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,o){this._liveRegionDebouncer.refresh(t,o,this._terminal.rows)}_renderRows(t,o){const c=this._terminal.buffer,f=c.lines.length.toString();for(let m=t;m<=o;m++){const l=c.translateBufferLineToString(c.ydisp+m,!0),p=(c.ydisp+m+1).toString(),x=this._rowElements[m];x&&(l.length===0?x.innerText=" ":x.textContent=l,x.setAttribute("aria-posinset",p),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,o){const c=t.target,f=this._rowElements[o===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==f)return;let m,l;if(o===0?(m=c,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(m=this._rowElements.shift(),l=c,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=h([_(1,e.IRenderService)],s)},3614:(A,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function h(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function _(d,v,g,u){d=h(d=a(d),g.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function n(d,v,g){const u=g.getBoundingClientRect(),e=d.clientX-u.left-10,i=d.clientY-u.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${e}px`,v.style.top=`${i}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=h,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,u){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),v,g,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,v,g,u,e){n(d,v,g),e&&u.rightClickSelect(d),v.value=u.selectionText,v.select()}},7239:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const h=a(1505);r.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,h,_,n){a.addEventListener(h,_,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(h,_,n))}}}},6465:function(A,r,a){var h=this&&this.__decorate||function(e,i,s,t){var o,c=arguments.length,f=c<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,s,t);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(f=(c<3?o(f):c>3?o(i,s,f):o(i,s))||f);return c>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(e,i){return function(s,t){i(s,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=a(3656),d=a(8460),v=a(844),g=a(2585);let u=r.Linkifier2=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const i=this._linkProviders.indexOf(e);i!==-1&&this._linkProviders.splice(i,1)}}}attachToDom(e,i,s){this._element=e,this._mouseService=i,this._renderService=s,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(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const s=e.composedPath();for(let t=0;t<s.length;t++){const o=s[t];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){var s,t;this._activeProviderReplies&&i||((s=this._activeProviderReplies)===null||s===void 0||s.forEach((c=>{c==null||c.forEach((f=>{f.link.dispose&&f.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let o=!1;for(const[c,f]of this._linkProviders.entries())i?!((t=this._activeProviderReplies)===null||t===void 0)&&t.get(c)&&(o=this._checkLinkProviderResult(c,e,o)):f.provideLinks(e.y,(m=>{var l,p;if(this._isMouseOut)return;const x=m==null?void 0:m.map((L=>({link:L})));(l=this._activeProviderReplies)===null||l===void 0||l.set(c,x),o=this._checkLinkProviderResult(c,e,o),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,i){const s=new Set;for(let t=0;t<i.size;t++){const o=i.get(t);if(o)for(let c=0;c<o.length;c++){const f=o[c],m=f.link.range.start.y<e?0:f.link.range.start.x,l=f.link.range.end.y>e?this._bufferService.cols:f.link.range.end.x;for(let p=m;p<=l;p++){if(s.has(p)){o.splice(c--,1);break}s.add(p)}}}}_checkLinkProviderResult(e,i,s){var t;if(!this._activeProviderReplies)return s;const o=this._activeProviderReplies.get(e);let c=!1;for(let f=0;f<e;f++)this._activeProviderReplies.has(f)&&!this._activeProviderReplies.get(f)||(c=!0);if(!c&&o){const f=o.find((m=>this._linkAtPosition(m.link,i)));f&&(s=!0,this._handleNewLink(f))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(let f=0;f<this._activeProviderReplies.size;f++){const m=(t=this._activeProviderReplies.get(f))===null||t===void 0?void 0:t.find((l=>this._linkAtPosition(l.link,i)));if(m){s=!0,this._handleNewLink(m);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var s,t;return(t=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||t===void 0?void 0:t.decorations.pointerCursor},set:s=>{var t,o;!((t=this._currentLink)===null||t===void 0)&&t.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&((o=this._element)===null||o===void 0||o.classList.toggle("xterm-cursor-pointer",s)))}},underline:{get:()=>{var s,t;return(t=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||t===void 0?void 0:t.decorations.underline},set:s=>{var t,o,c;!((t=this._currentLink)===null||t===void 0)&&t.state&&((c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((s=>{if(!this._currentLink)return;const t=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(t,o),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}}))))}_linkHover(e,i,s){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(s,i.text)}_fireUnderlineEvent(e,i){const s=e.range,t=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-t-1,s.end.x,s.end.y-t-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,s){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(s,i.text)}_linkAtPosition(e,i){const s=e.range.start.y*this._bufferService.cols+e.range.start.x,t=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return s<=o&&o<=t}_positionFromMouseEvent(e,i,s){const t=s.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(t)return{x:t[0],y:t[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,s,t,o){return{x1:e,y1:i,x2:s,y2:t,cols:this._bufferService.cols,fg:o}}};r.Linkifier2=u=h([_(0,g.IBufferService)],u)},9042:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(A,r,a){var h=this&&this.__decorate||function(u,e,i,s){var t,o=arguments.length,c=o<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(u,e,i,s);else for(var f=u.length-1;f>=0;f--)(t=u[f])&&(c=(o<3?t(c):o>3?t(e,i,c):t(e,i))||c);return o>3&&c&&Object.defineProperty(e,i,c),c},_=this&&this.__param||function(u,e){return function(i,s){e(i,s,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let v=r.OscLinkProvider=class{constructor(u,e,i){this._bufferService=u,this._optionsService=e,this._oscLinkService=i}provideLinks(u,e){var i;const s=this._bufferService.buffer.lines.get(u-1);if(!s)return void e(void 0);const t=[],o=this._optionsService.rawOptions.linkHandler,c=new n.CellData,f=s.getTrimmedLength();let m=-1,l=-1,p=!1;for(let x=0;x<f;x++)if(l!==-1||s.hasContent(x)){if(s.loadCell(x,c),c.hasExtendedAttrs()&&c.extended.urlId){if(l===-1){l=x,m=c.extended.urlId;continue}p=c.extended.urlId!==m}else l!==-1&&(p=!0);if(p||l!==-1&&x===f-1){const L=(i=this._oscLinkService.getLinkData(m))===null||i===void 0?void 0:i.uri;if(L){const y={start:{x:l+1,y:u},end:{x:x+(p||x!==f-1?0:1),y:u}};let E=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const B=new URL(L);["http:","https:"].includes(B.protocol)||(E=!0)}catch{E=!0}E||t.push({text:L,range:y,activate:(B,I)=>o?o.activate(B,I,y):g(0,I),hover:(B,I)=>{var H;return(H=o==null?void 0:o.hover)===null||H===void 0?void 0:H.call(o,B,I,y)},leave:(B,I)=>{var H;return(H=o==null?void 0:o.leave)===null||H===void 0?void 0:H.call(o,B,I,y)}})}p=!1,c.hasExtendedAttrs()&&c.extended.urlId?(l=x,m=c.extended.urlId):(l=-1,m=-1)}}e(t)}};function g(u,e){if(confirm(`Do you want to navigate to ${e}?
39
+
40
+ 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")}}r.OscLinkProvider=v=h([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],v)},6193:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,h){this._parentWindow=a,this._renderCallback=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,h,_){this._rowCount=_,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._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const 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=[]}}},5596:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const h=a(844);class _ extends h.Disposable{constructor(d){super(),this._parentWindow=d,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,h.toDisposable)((()=>{this.clearListener()})))}setListener(d){this._listener&&this.clearListener(),this._listener=d,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)===null||d===void 0||d.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=_},3236:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const h=a(3614),_=a(3656),n=a(6465),d=a(9042),v=a(3730),g=a(1680),u=a(3107),e=a(5744),i=a(2950),s=a(1296),t=a(428),o=a(4269),c=a(5114),f=a(8934),m=a(3230),l=a(9312),p=a(4725),x=a(6731),L=a(8055),y=a(8969),E=a(8460),B=a(844),I=a(6114),H=a(8437),j=a(2584),b=a(7399),w=a(5941),k=a(9074),D=a(2585),N=a(5435),W=a(4567),V=typeof window<"u"?window.document:null;class q extends y.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(S={}){super(S),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new E.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new E.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new E.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new E.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new E.EventEmitter),this._onBlur=this.register(new E.EventEmitter),this._onA11yCharEmitter=this.register(new E.EventEmitter),this._onA11yTabEmitter=this.register(new E.EventEmitter),this._onWillOpen=this.register(new E.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(k.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((R,M)=>this.refresh(R,M)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((R=>this._reportWindowsOptions(R)))),this.register(this._inputHandler.onColor((R=>this._handleColorEvent(R)))),this.register((0,E.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,E.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,E.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,E.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((R=>this._afterResize(R.cols,R.rows)))),this.register((0,B.toDisposable)((()=>{var R,M;this._customKeyEventHandler=void 0,(M=(R=this.element)===null||R===void 0?void 0:R.parentNode)===null||M===void 0||M.removeChild(this.element)})))}_handleColorEvent(S){if(this._themeService)for(const R of S){let M,O="";switch(R.index){case 256:M="foreground",O="10";break;case 257:M="background",O="11";break;case 258:M="cursor",O="12";break;default:M="ansi",O="4;"+R.index}switch(R.type){case 0:const Y=L.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${O};${(0,w.toRgbString)(Y)}${j.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors((U=>U.ansi[R.index]=L.rgba.toColor(...R.color)));else{const U=M;this._themeService.modifyColors((Q=>Q[U]=L.rgba.toColor(...R.color)))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(S){S?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(S){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.updateCursorStyle(S),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var S;return(S=this.textarea)===null||S===void 0?void 0:S.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.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 S=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(S);if(!R)return;const M=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,Y=R.getWidth(M),U=this._renderService.dimensions.css.cell.width*Y,Q=this.buffer.y*this._renderService.dimensions.css.cell.height,ie=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ie+"px",this.textarea.style.top=Q+"px",this.textarea.style.width=U+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(R=>{this.hasSelection()&&(0,h.copyHandler)(R,this._selectionService)})));const S=R=>(0,h.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",S)),this.register((0,_.addDisposableDomListener)(this.element,"paste",S)),I.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(R=>{R.button===2&&(0,h.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(R=>{(0,h.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),I.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(R=>{R.button===1&&(0,h.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(S=>this._keyUp(S)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(S=>this._keyDown(S)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(S=>this._keyPress(S)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(S=>this._compositionHelper.compositionupdate(S)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(S=>this._inputEvent(S)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(S){var R;if(!S)throw new Error("Terminal requires a parent element.");S.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=S.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),S.appendChild(this.element);const M=V.createDocumentFragment();this._viewportElement=V.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),M.appendChild(this._viewportElement),this._viewportScrollArea=V.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=V.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=V.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),M.appendChild(this.screenElement),this.textarea=V.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),I.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._instantiationService.createInstance(c.CoreBrowserService,this.textarea,(R=this._document.defaultView)!==null&&R!==void 0?R:window),this._instantiationService.setService(p.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(O=>this._handleTextAreaFocus(O)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(p.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(x.ThemeService),this._instantiationService.setService(p.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(o.CharacterJoinerService),this._instantiationService.setService(p.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(p.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((O=>this._onRender.fire(O)))),this.onResize((O=>this._renderService.resize(O.cols,O.rows))),this._compositionView=V.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.element.appendChild(M);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(f.MouseService),this._instantiationService.setService(p.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((O=>this.scrollLines(O.amount,O.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.linkifier2)),this._instantiationService.setService(p.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((O=>this.scrollLines(O.amount,O.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((O=>this._renderService.handleSelectionChanged(O.start,O.end,O.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((O=>{this.textarea.value=O,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((O=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(O=>this._selectionService.handleMouseDown(O)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(O=>this._handleScreenReaderModeOptionChange(O)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(O=>{!this._overviewRulerRenderer&&O&&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.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const S=this,R=this.element;function M(U){const Q=S._mouseService.getMouseReportCoords(U,S.screenElement);if(!Q)return!1;let ie,ne;switch(U.overrideType||U.type){case"mousemove":ne=32,U.buttons===void 0?(ie=3,U.button!==void 0&&(ie=U.button<3?U.button:3)):ie=1&U.buttons?0:4&U.buttons?1:2&U.buttons?2:3;break;case"mouseup":ne=0,ie=U.button<3?U.button:3;break;case"mousedown":ne=1,ie=U.button<3?U.button:3;break;case"wheel":if(S.viewport.getLinesScrolled(U)===0)return!1;ne=U.deltaY<0?0:1,ie=4;break;default:return!1}return!(ne===void 0||ie===void 0||ie>4)&&S.coreMouseService.triggerMouseEvent({col:Q.col,row:Q.row,x:Q.x,y:Q.y,button:ie,action:ne,ctrl:U.ctrlKey,alt:U.altKey,shift:U.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:U=>(M(U),U.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel(U)),wheel:U=>(M(U),this.cancel(U,!0)),mousedrag:U=>{U.buttons&&M(U)},mousemove:U=>{U.buttons||M(U)}};this.register(this.coreMouseService.onProtocolChange((U=>{U?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(U)),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&U?O.mousemove||(R.addEventListener("mousemove",Y.mousemove),O.mousemove=Y.mousemove):(R.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&U?O.wheel||(R.addEventListener("wheel",Y.wheel,{passive:!1}),O.wheel=Y.wheel):(R.removeEventListener("wheel",O.wheel),O.wheel=null),2&U?O.mouseup||(R.addEventListener("mouseup",Y.mouseup),O.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),R.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&U?O.mousedrag||(O.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(R,"mousedown",(U=>{if(U.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(U))return M(U),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel(U)}))),this.register((0,_.addDisposableDomListener)(R,"wheel",(U=>{if(!O.wheel){if(!this.buffer.hasScrollback){const Q=this.viewport.getLinesScrolled(U);if(Q===0)return;const ie=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(U.deltaY<0?"A":"B");let ne="";for(let ue=0;ue<Math.abs(Q);ue++)ne+=ie;return this.coreService.triggerDataEvent(ne,!0),this.cancel(U,!0)}return this.viewport.handleWheel(U)?this.cancel(U):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(R,"touchstart",(U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(U),this.cancel(U)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(R,"touchmove",(U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(U)?void 0:this.cancel(U)}),{passive:!1}))}refresh(S,R){var M;(M=this._renderService)===null||M===void 0||M.refreshRows(S,R)}updateCursorStyle(S){var R;!((R=this._selectionService)===null||R===void 0)&&R.shouldColumnSelect(S)?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(S,R,M=0){var O;M===1?(super.scrollLines(S,R,M),this.refresh(0,this.rows-1)):(O=this.viewport)===null||O===void 0||O.scrollLines(S)}paste(S){(0,h.paste)(S,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(S){this._customKeyEventHandler=S}registerLinkProvider(S){return this.linkifier2.registerLinkProvider(S)}registerCharacterJoiner(S){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(S);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(S){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(S)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(S){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+S)}registerDecoration(S){return this._decorationService.registerDecoration(S)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(S,R,M){this._selectionService.setSelection(S,R,M)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var S;(S=this._selectionService)===null||S===void 0||S.clearSelection()}selectAll(){var S;(S=this._selectionService)===null||S===void 0||S.selectAll()}selectLines(S,R){var M;(M=this._selectionService)===null||M===void 0||M.selectLines(S,R)}_keyDown(S){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&S.altKey;if(!R&&!this._compositionHelper.keydown(S))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||S.key!=="Dead"&&S.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,b.evaluateKeyboardEvent)(S,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(S),M.type===3||M.type===2){const O=this.rows-1;return this.scrollLines(M.type===2?-O:O),this.cancel(S,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,S)||(M.cancel&&this.cancel(S,!0),!M.key||!!(S.key&&!S.ctrlKey&&!S.altKey&&!S.metaKey&&S.key.length===1&&S.key.charCodeAt(0)>=65&&S.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==j.C0.ETX&&M.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:S}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||S.altKey||S.ctrlKey?this.cancel(S,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(S,R){const M=S.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||S.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||S.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?M:M&&(!R.keyCode||R.keyCode>47)}_keyUp(S){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1||((function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18})(S)||this.focus(),this.updateCursorStyle(S),this._keyPressHandled=!1)}_keyPress(S){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1)return!1;if(this.cancel(S),S.charCode)R=S.charCode;else if(S.which===null||S.which===void 0)R=S.keyCode;else{if(S.which===0||S.charCode===0)return!1;R=S.which}return!(!R||(S.altKey||S.ctrlKey||S.metaKey)&&!this._isThirdLevelShift(this.browser,S)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:S}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(S){if(S.data&&S.inputType==="insertText"&&(!S.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=S.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(S),!0}return!1}resize(S,R){S!==this.cols||R!==this.rows?super.resize(S,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(S,R){var M,O;(M=this._charSizeService)===null||M===void 0||M.measure(),(O=this.viewport)===null||O===void 0||O.syncScrollArea(!0)}clear(){var S;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(S=this.viewport)===null||S===void 0||S.reset(),this.refresh(0,this.rows-1)}}reset(){var S,R;this.options.rows=this.rows,this.options.cols=this.cols;const M=this._customKeyEventHandler;this._setup(),super.reset(),(S=this._selectionService)===null||S===void 0||S.reset(),this._decorationService.reset(),(R=this.viewport)===null||R===void 0||R.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){var S;(S=this._renderService)===null||S===void 0||S.clearTextureAtlas()}_reportFocus(){var S;!((S=this.element)===null||S===void 0)&&S.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(S){if(this._renderService)switch(S){case N.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),M=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${M};${R}t`);break;case N.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${Y};${O}t`)}}cancel(S,R){if(this.options.cancelEvents||R)return S.preventDefault(),S.stopPropagation(),!1}}r.Terminal=q},9924:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.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,_){this._rowCount=_,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 d=n-this._lastRefreshMs,v=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h)}}},1680:function(A,r,a){var h=this&&this.__decorate||function(i,s,t,o){var c,f=arguments.length,m=f<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,t,o);else for(var l=i.length-1;l>=0;l--)(c=i[l])&&(m=(f<3?c(m):f>3?c(s,t,m):c(s,t))||m);return f>3&&m&&Object.defineProperty(s,t,m),m},_=this&&this.__param||function(i,s){return function(t,o){s(t,o,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=a(3656),d=a(4725),v=a(8460),g=a(844),u=a(2585);let e=r.Viewport=class extends g.Disposable{constructor(i,s,t,o,c,f,m,l){super(),this._viewportElement=i,this._scrollArea=s,this._bufferService=t,this._optionsService=o,this._charSizeService=c,this._renderService=f,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((p=>this._activeBuffer=p.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((p=>this._renderDimensions=p))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((p=>this._handleThemeChange(p)))),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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.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 t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&t<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){var t;let o,c="";const f=[],m=s??this._bufferService.buffer.lines.length,l=this._bufferService.buffer.lines;for(let p=i;p<m;p++){const x=l.get(p);if(!x)continue;const L=(t=l.get(p+1))===null||t===void 0?void 0:t.isWrapped;if(c+=x.translateToString(!L),!L||p===l.length-1){const y=document.createElement("div");y.textContent=c,f.push(y),c.length>0&&(o=y),c=""}}return{bufferElements:f,cursorElement:o}}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 t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&s.altKey||t==="ctrl"&&s.ctrlKey||t==="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))}};r.Viewport=e=h([_(2,u.IBufferService),_(3,u.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],e)},3107:function(A,r,a){var h=this&&this.__decorate||function(e,i,s,t){var o,c=arguments.length,f=c<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,s,t);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(f=(c<3?o(f):c>3?o(i,s,f):o(i,s))||f);return c>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(e,i){return function(s,t){i(s,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=a(3656),d=a(4725),v=a(844),g=a(2585);let u=r.BufferDecorationRenderer=class extends v.Disposable{constructor(e,i,s,t){super(),this._screenElement=e,this._bufferService=i,this._decorationService=s,this._renderService=t,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((0,n.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((o=>this._removeDecoration(o)))),this.register((0,v.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 e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var i,s;const t=document.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)===null||i===void 0?void 0:i.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=(s=e.options.x)!==null&&s!==void 0?s:0;return o&&o>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose((()=>{this._decorationElements.delete(e),s.remove()}))),s.style.top=i*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(s)}}_refreshXPosition(e,i=e.element){var s;if(!i)return;const t=(s=e.options.x)!==null&&s!==void 0?s:0;(e.options.anchor||"left")==="right"?i.style.right=t?t*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=t?t*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))===null||i===void 0||i.remove(),this._decorationElements.delete(e),e.dispose()}};r.BufferDecorationRenderer=u=h([_(1,g.IBufferService),_(2,g.IDecorationService),_(3,d.IRenderService)],u)},5871:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(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,_){return h>=a.startBufferLine-this._linePadding[_||"full"]&&h<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,h){a.startBufferLine=Math.min(a.startBufferLine,h),a.endBufferLine=Math.max(a.endBufferLine,h)}}},5744:function(A,r,a){var h=this&&this.__decorate||function(o,c,f,m){var l,p=arguments.length,x=p<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,c,f,m);else for(var L=o.length-1;L>=0;L--)(l=o[L])&&(x=(p<3?l(x):p>3?l(c,f,x):l(c,f))||x);return p>3&&x&&Object.defineProperty(c,f,x),x},_=this&&this.__param||function(o,c){return function(f,m){c(f,m,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=a(5871),d=a(3656),v=a(4725),g=a(844),u=a(2585),e={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let t=r.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,c,f,m,l,p,x){var L;super(),this._viewportElement=o,this._screenElement=c,this._bufferService=f,this._decorationService=m,this._renderService=l,this._optionsService=p,this._coreBrowseService=x,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)===null||L===void 0||L.insertBefore(this._canvas,this._viewportElement);const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var E;(E=this._canvas)===null||E===void 0||E.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((0,d.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const o=Math.floor(this._canvas.width/3),c=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=o,i.center=c,i.right=o,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=i.left,s.right=i.left+i.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,c=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowseService.dpr);e.left=c,e.center=c,e.right=c}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const c of this._decorationService.decorations)this._colorZoneStore.addDecoration(c);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const c of o)c.position!=="full"&&this._renderColorZone(c);for(const c of o)c.position==="full"&&this._renderColorZone(c);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(s[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-e[o.position||"full"]/2),i[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[o.position||"full"]))}_queueRefresh(o,c){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=c||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=t=h([_(2,u.IBufferService),_(3,u.IDecorationService),_(4,v.IRenderService),_(5,u.IOptionsService),_(6,v.ICoreBrowserService)],t)},2950:function(A,r,a){var h=this&&this.__decorate||function(u,e,i,s){var t,o=arguments.length,c=o<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(u,e,i,s);else for(var f=u.length-1;f>=0;f--)(t=u[f])&&(c=(o<3?t(c):o>3?t(e,i,c):t(e,i))||c);return o>3&&c&&Object.defineProperty(e,i,c),c},_=this&&this.__param||function(u,e){return function(i,s){e(i,s,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=a(4725),d=a(2585),v=a(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,e,i,s,t,o){this._textarea=u,this._compositionView=e,this._bufferService=i,this._optionsService=s,this._coreService=t,this._renderService=o,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){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 u=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const e=this._textarea.value,i=e.replace(u,"");this._dataAlreadySent=i,e.length>u.length?this._coreService.triggerDataEvent(i,!0):e.length<u.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):e.length===u.length&&e!==u&&this._coreService.triggerDataEvent(e,!0)}}),0)}updateCompositionElements(u){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,t=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"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 o=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}u||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=g=h([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,n.IRenderService)],g)},9806:(A,r)=>{function a(h,_,n){const d=n.getBoundingClientRect(),v=h.getComputedStyle(n),g=parseInt(v.getPropertyValue("padding-left")),u=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-d.left-g,_.clientY-d.top-u]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(h,_,n,d,v,g,u,e,i){if(!g)return;const s=a(h,_,n);return s?(s[0]=Math.ceil((s[0]+(i?u/2:0))/u),s[1]=Math.ceil(s[1]/e),s[0]=Math.min(Math.max(s[0],1),d+(i?1:0)),s[1]=Math.min(Math.max(s[1],1),v),s):void 0}},9504:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const h=a(2584);function _(e,i,s,t){const o=e-n(e,s),c=i-n(i,s),f=Math.abs(o-c)-(function(m,l,p){let x=0;const L=m-n(m,p),y=l-n(l,p);for(let E=0;E<Math.abs(L-y);E++){const B=d(m,l)==="A"?-1:1,I=p.buffer.lines.get(L+B*E);I!=null&&I.isWrapped&&x++}return x})(e,i,s);return u(f,g(d(e,i),t))}function n(e,i){let s=0,t=i.buffer.lines.get(e),o=t==null?void 0:t.isWrapped;for(;o&&e>=0&&e<i.rows;)s++,t=i.buffer.lines.get(--e),o=t==null?void 0:t.isWrapped;return s}function d(e,i){return e>i?"A":"B"}function v(e,i,s,t,o,c){let f=e,m=i,l="";for(;f!==s||m!==t;)f+=o?1:-1,o&&f>c.cols-1?(l+=c.buffer.translateBufferLineToString(m,!1,e,f),f=0,e=0,m++):!o&&f<0&&(l+=c.buffer.translateBufferLineToString(m,!1,0,e+1),f=c.cols-1,e=f,m--);return l+c.buffer.translateBufferLineToString(m,!1,e,f)}function g(e,i){const s=i?"O":"[";return h.C0.ESC+s+e}function u(e,i){e=Math.floor(e);let s="";for(let t=0;t<e;t++)s+=i;return s}r.moveToCellSequence=function(e,i,s,t){const o=s.buffer.x,c=s.buffer.y;if(!s.buffer.hasScrollback)return(function(l,p,x,L,y,E){return _(p,L,y,E).length===0?"":u(v(l,p,l,p-n(p,y),!1,y).length,g("D",E))})(o,c,0,i,s,t)+_(c,i,s,t)+(function(l,p,x,L,y,E){let B;B=_(p,L,y,E).length>0?L-n(L,y):p;const I=L,H=(function(j,b,w,k,D,N){let W;return W=_(w,k,D,N).length>0?k-n(k,D):b,j<w&&W<=k||j>=w&&W<k?"C":"D"})(l,p,x,L,y,E);return u(v(l,B,x,I,H==="C",y).length,g(H,E))})(o,c,e,i,s,t);let f;if(c===i)return f=o>e?"D":"C",u(Math.abs(o-e),g(f,t));f=c>i?"D":"C";const m=Math.abs(c-i);return u((function(l,p){return p.cols-l})(c>i?e:o,s)+(m-1)*s.cols+1+((c>i?o:e)-1),g(f,t))}},1296:function(A,r,a){var h=this&&this.__decorate||function(y,E,B,I){var H,j=arguments.length,b=j<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,E,B,I);else for(var w=y.length-1;w>=0;w--)(H=y[w])&&(b=(j<3?H(b):j>3?H(E,B,b):H(E,B))||b);return j>3&&b&&Object.defineProperty(E,B,b),b},_=this&&this.__param||function(y,E){return function(B,I){E(B,I,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=a(3787),d=a(2550),v=a(2223),g=a(6171),u=a(4725),e=a(8055),i=a(8460),s=a(844),t=a(2585),o="xterm-dom-renderer-owner-",c="xterm-rows",f="xterm-fg-",m="xterm-bg-",l="xterm-focus",p="xterm-selection";let x=1,L=r.DomRenderer=class extends s.Disposable{constructor(y,E,B,I,H,j,b,w,k,D){super(),this._element=y,this._screenElement=E,this._viewportElement=B,this._linkifier2=I,this._charSizeService=j,this._optionsService=b,this._bufferService=w,this._coreBrowserService=k,this._themeService=D,this._terminalClass=x++,this._rowElements=[],this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(c),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(p),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((N=>this._injectCss(N)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(o+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((N=>this._handleLinkHover(N)))),this.register(this._linkifier2.onHideLinkUnderline((N=>this._handleLinkLeave(N)))),this.register((0,s.toDisposable)((()=>{this._element.classList.remove(o+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const y=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*y,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*y),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/y),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/y),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 B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const E=`${this._terminalSelector} .${c} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=E,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(y){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let E=`${this._terminalSelector} .${c} { color: ${y.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;E+=`${this._terminalSelector} .${c} .xterm-dim { color: ${e.color.multiplyOpacity(y.foreground,.5).css};}`,E+=`${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;}`,E+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",E+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css}; } 50% { background-color: inherit; color: ${y.cursor.css}; }}`,E+=`${this._terminalSelector} .${c}.${l} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c}.${l} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-block { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css};}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${y.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${y.cursor.css} inset;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${y.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,E+=`${this._terminalSelector} .${p} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${p} div { position: absolute; background-color: ${y.selectionBackgroundOpaque.css};}${this._terminalSelector} .${p} div { position: absolute; background-color: ${y.selectionInactiveBackgroundOpaque.css};}`;for(const[B,I]of y.ansi.entries())E+=`${this._terminalSelector} .${f}${B} { color: ${I.css}; }${this._terminalSelector} .${f}${B}.xterm-dim { color: ${e.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${m}${B} { background-color: ${I.css}; }`;E+=`${this._terminalSelector} .${f}${v.INVERTED_DEFAULT_COLOR} { color: ${e.color.opaque(y.background).css}; }${this._terminalSelector} .${f}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${e.color.multiplyOpacity(e.color.opaque(y.background),.5).css}; }${this._terminalSelector} .${m}${v.INVERTED_DEFAULT_COLOR} { background-color: ${y.foreground.css}; }`,this._themeStyleElement.textContent=E}_setDefaultSpacing(){const y=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${y}px`,this._rowFactory.defaultSpacing=y}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(y,E){for(let B=this._rowElements.length;B<=E;B++){const I=document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>E;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(y,E){this._refreshRowElements(y,E),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(l)}handleFocus(){this._rowContainer.classList.add(l),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(y,E,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(y,E,B),this.renderRows(0,this._bufferService.rows-1),!y||!E)return;const I=y[1]-this._bufferService.buffer.ydisp,H=E[1]-this._bufferService.buffer.ydisp,j=Math.max(I,0),b=Math.min(H,this._bufferService.rows-1);if(j>=this._bufferService.rows||b<0)return;const w=document.createDocumentFragment();if(B){const k=y[0]>E[0];w.appendChild(this._createSelectionElement(j,k?E[0]:y[0],k?y[0]:E[0],b-j+1))}else{const k=I===j?y[0]:0,D=j===H?E[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(j,k,D));const N=b-j-1;if(w.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,N)),j!==b){const W=H===b?E[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(b,0,W))}}this._selectionContainer.appendChild(w)}_createSelectionElement(y,E,B,I=1){const H=document.createElement("div");return H.style.height=I*this.dimensions.css.cell.height+"px",H.style.top=y*this.dimensions.css.cell.height+"px",H.style.left=E*this.dimensions.css.cell.width+"px",H.style.width=this.dimensions.css.cell.width*(B-E)+"px",H}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 y of this._rowElements)y.replaceChildren()}renderRows(y,E){const B=this._bufferService.buffer,I=B.ybase+B.y,H=Math.min(B.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,w=this._optionsService.rawOptions.cursorInactiveStyle;for(let k=y;k<=E;k++){const D=k+B.ydisp,N=this._rowElements[k],W=B.lines.get(D);if(!N||!W)break;N.replaceChildren(...this._rowFactory.createRow(W,D,D===I,b,w,H,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${o}${this._terminalClass}`}_handleLinkHover(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!0)}_handleLinkLeave(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!1)}_setCellUnderline(y,E,B,I,H,j){B<0&&(y=0),I<0&&(E=0);const b=this._bufferService.rows-1;B=Math.max(Math.min(B,b),0),I=Math.max(Math.min(I,b),0),H=Math.min(H,this._bufferService.cols);const w=this._bufferService.buffer,k=w.ybase+w.y,D=Math.min(w.x,H-1),N=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=B;q<=I;++q){const ee=q+w.ydisp,S=this._rowElements[q],R=w.lines.get(ee);if(!S||!R)break;S.replaceChildren(...this._rowFactory.createRow(R,ee,ee===k,W,V,D,N,this.dimensions.css.cell.width,this._widthCache,j?q===B?y:0:-1,j?(q===I?E:H)-1:-1))}}};r.DomRenderer=L=h([_(4,t.IInstantiationService),_(5,u.ICharSizeService),_(6,t.IOptionsService),_(7,t.IBufferService),_(8,u.ICoreBrowserService),_(9,u.IThemeService)],L)},3787:function(A,r,a){var h=this&&this.__decorate||function(f,m,l,p){var x,L=arguments.length,y=L<3?m:p===null?p=Object.getOwnPropertyDescriptor(m,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,m,l,p);else for(var E=f.length-1;E>=0;E--)(x=f[E])&&(y=(L<3?x(y):L>3?x(m,l,y):x(m,l))||y);return L>3&&y&&Object.defineProperty(m,l,y),y},_=this&&this.__param||function(f,m){return function(l,p){m(l,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),v=a(511),g=a(2585),u=a(8055),e=a(4725),i=a(4269),s=a(6171),t=a(3734);let o=r.DomRendererRowFactory=class{constructor(f,m,l,p,x,L,y){this._document=f,this._characterJoinerService=m,this._optionsService=l,this._coreBrowserService=p,this._coreService=x,this._decorationService=L,this._themeService=y,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(f,m,l){this._selectionStart=f,this._selectionEnd=m,this._columnSelectMode=l}createRow(f,m,l,p,x,L,y,E,B,I,H){const j=[],b=this._characterJoinerService.getJoinedCharacters(m),w=this._themeService.colors;let k,D=f.getNoBgTrimmedLength();l&&D<L+1&&(D=L+1);let N=0,W="",V=0,q=0,ee=0,S=!1,R=0,M=!1,O=0;const Y=[],U=I!==-1&&H!==-1;for(let Q=0;Q<D;Q++){f.loadCell(Q,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let ne=!1,ue=Q,X=this._workCell;if(b.length>0&&Q===b[0][0]){ne=!0;const se=b.shift();X=new i.JoinedCellData(this._workCell,f.translateToString(!0,se[0],se[1]),se[1]-se[0]),ue=se[1]-1,ie=X.getWidth()}const de=this._isCellInSelection(Q,m),ge=l&&Q===L,fe=U&&Q>=I&&Q<=H;let me=!1;this._decorationService.forEachDecorationAtCell(Q,m,void 0,(se=>{me=!0}));let Se=X.getChars()||d.WHITESPACE_CELL_CHAR;if(Se===" "&&(X.isUnderline()||X.isOverline())&&(Se=" "),O=ie*E-B.get(Se,X.isBold(),X.isItalic()),k){if(N&&(de&&M||!de&&!M&&X.bg===V)&&(de&&M&&w.selectionForeground||X.fg===q)&&X.extended.ext===ee&&fe===S&&O===R&&!ge&&!ne&&!me){W+=Se,N++;continue}N&&(k.textContent=W),k=this._document.createElement("span"),N=0,W=""}else k=this._document.createElement("span");if(V=X.bg,q=X.fg,ee=X.extended.ext,S=fe,R=O,M=de,ne&&L>=Q&&L<=ue&&(L=Q),!this._coreService.isCursorHidden&&ge){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)y&&Y.push("xterm-cursor-blink"),Y.push(p==="bar"?"xterm-cursor-bar":p==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(x)switch(x){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(X.isBold()&&Y.push("xterm-bold"),X.isItalic()&&Y.push("xterm-italic"),X.isDim()&&Y.push("xterm-dim"),W=X.isInvisible()?d.WHITESPACE_CELL_CHAR:X.getChars()||d.WHITESPACE_CELL_CHAR,X.isUnderline()&&(Y.push(`xterm-underline-${X.extended.underlineStyle}`),W===" "&&(W=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())k.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let se=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&se<8&&(se+=8),k.style.textDecorationColor=w.ansi[se].css}X.isOverline()&&(Y.push("xterm-overline"),W===" "&&(W=" ")),X.isStrikethrough()&&Y.push("xterm-strikethrough"),fe&&(k.style.textDecoration="underline");let oe=X.getFgColor(),_e=X.getFgColorMode(),le=X.getBgColor(),P=X.getBgColorMode();const Z=!!X.isInverse();if(Z){const se=oe;oe=le,le=se;const je=_e;_e=P,P=je}let te,re,ae,he=!1;switch(this._decorationService.forEachDecorationAtCell(Q,m,void 0,(se=>{se.options.layer!=="top"&&he||(se.backgroundColorRGB&&(P=50331648,le=se.backgroundColorRGB.rgba>>8&16777215,te=se.backgroundColorRGB),se.foregroundColorRGB&&(_e=50331648,oe=se.foregroundColorRGB.rgba>>8&16777215,re=se.foregroundColorRGB),he=se.options.layer==="top")})),!he&&de&&(te=this._coreBrowserService.isFocused?w.selectionBackgroundOpaque:w.selectionInactiveBackgroundOpaque,le=te.rgba>>8&16777215,P=50331648,he=!0,w.selectionForeground&&(_e=50331648,oe=w.selectionForeground.rgba>>8&16777215,re=w.selectionForeground)),he&&Y.push("xterm-decoration-top"),P){case 16777216:case 33554432:ae=w.ansi[le],Y.push(`xterm-bg-${le}`);break;case 50331648:ae=u.rgba.toColor(le>>16,le>>8&255,255&le),this._addStyle(k,`background-color:#${c((le>>>0).toString(16),"0",6)}`);break;default:Z?(ae=w.foreground,Y.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):ae=w.background}switch(te||X.isDim()&&(te=u.color.multiplyOpacity(ae,.5)),_e){case 16777216:case 33554432:X.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(k,ae,w.ansi[oe],X,te,void 0)||Y.push(`xterm-fg-${oe}`);break;case 50331648:const se=u.rgba.toColor(oe>>16&255,oe>>8&255,255&oe);this._applyMinimumContrast(k,ae,se,X,te,re)||this._addStyle(k,`color:#${c(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(k,ae,w.foreground,X,te,void 0)||Z&&Y.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}Y.length&&(k.className=Y.join(" "),Y.length=0),ge||ne||me?k.textContent=W:N++,O!==this.defaultSpacing&&(k.style.letterSpacing=`${O}px`),j.push(k),Q=ue}return k&&N&&(k.textContent=W),j}_applyMinimumContrast(f,m,l,p,x,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.excludeFromContrastRatioDemands)(p.getCode()))return!1;const y=this._getContrastCache(p);let E;if(x||L||(E=y.getColor(m.rgba,l.rgba)),E===void 0){const B=this._optionsService.rawOptions.minimumContrastRatio/(p.isDim()?2:1);E=u.color.ensureContrastRatio(x||m,L||l,B),y.setColor((x||m).rgba,(L||l).rgba,E??null)}return!!E&&(this._addStyle(f,`color:${E.css}`),!0)}_getContrastCache(f){return f.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(f,m){f.setAttribute("style",`${f.getAttribute("style")||""}${m};`)}_isCellInSelection(f,m){const l=this._selectionStart,p=this._selectionEnd;return!(!l||!p)&&(this._columnSelectMode?l[0]<=p[0]?f>=l[0]&&m>=l[1]&&f<p[0]&&m<=p[1]:f<l[0]&&m>=l[1]&&f>=p[0]&&m<=p[1]:m>l[1]&&m<p[1]||l[1]===p[1]&&m===l[1]&&f>=l[0]&&f<p[0]||l[1]<p[1]&&m===p[1]&&f<p[0]||l[1]<p[1]&&m===l[1]&&f>=l[0])}};function c(f,m,l){for(;f.length<l;)f=m+f;return f}r.DomRendererRowFactory=o=h([_(1,e.ICharacterJoinerService),_(2,g.IOptionsService),_(3,e.ICoreBrowserService),_(4,g.ICoreService),_(5,g.IDecorationService),_(6,e.IThemeService)],o)},2550:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(a){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.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const h=a.createElement("span"),_=a.createElement("span");_.style.fontWeight="bold";const n=a.createElement("span");n.style.fontStyle="italic";const d=a.createElement("span");d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[h,_,n,d],this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(n),this._container.appendChild(d),a.body.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,_,n){a===this._font&&h===this._fontSize&&_===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=h,this._weight=_,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,h,_){let n=0;if(!h&&!_&&a.length===1&&(n=a.charCodeAt(0))<256)return this._flat[n]!==-9999?this._flat[n]:this._flat[n]=this._measure(a,0);let d=a;h&&(d+="B"),_&&(d+="I");let v=this._holey.get(d);if(v===void 0){let g=0;h&&(g|=1),_&&(g|=2),v=this._measure(a,g),this._holey.set(d,v)}return v}_measure(a,h){const _=this._measureElements[h];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const h=a(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(A,r)=>{function a(h){return 57508<=h&&h<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},r.isPowerlineGlyph=a,r.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},r.excludeFromContrastRatioDemands=function(h){return a(h)||(function(_){return 9472<=_&&_<=9631})(h)},r.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}}}}},456:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.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(A,r,a){var h=this&&this.__decorate||function(e,i,s,t){var o,c=arguments.length,f=c<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,s,t);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(f=(c<3?o(f):c>3?o(i,s,f):o(i,s))||f);return c>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(e,i){return function(s,t){i(s,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=a(2585),d=a(8460),v=a(844);let g=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,i,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new u(e,i,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};r.CharSizeService=g=h([_(2,n.IOptionsService)],g);class u{constructor(i,s,t){this._document=i,this._parentElement=s,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const i={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return i.width!==0&&i.height!==0&&(this._result.width=i.width/32,this._result.height=Math.ceil(i.height)),this._result}}},4269:function(A,r,a){var h=this&&this.__decorate||function(i,s,t,o){var c,f=arguments.length,m=f<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,t,o);else for(var l=i.length-1;l>=0;l--)(c=i[l])&&(m=(f<3?c(m):f>3?c(s,t,m):c(s,t))||m);return f>3&&m&&Object.defineProperty(s,t,m),m},_=this&&this.__param||function(i,s){return function(t,o){s(t,o,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=a(3734),d=a(643),v=a(511),g=a(2585);class u extends n.AttributeData{constructor(s,t,o){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=t,this._width=o}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=u;let e=r.CharacterJoinerService=class Ne{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(s){const t={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(t),t.id}deregister(s){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===s)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(s);if(!t||t.length===0)return[];const o=[],c=t.translateToString(!0);let f=0,m=0,l=0,p=t.getFg(0),x=t.getBg(0);for(let L=0;L<t.getTrimmedLength();L++)if(t.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==x){if(L-f>1){const y=this._getJoinedRanges(c,l,m,t,f);for(let E=0;E<y.length;E++)o.push(y[E])}f=L,l=m,p=this._workCell.fg,x=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const L=this._getJoinedRanges(c,l,m,t,f);for(let y=0;y<L.length;y++)o.push(L[y])}return o}_getJoinedRanges(s,t,o,c,f){const m=s.substring(t,o);let l=[];try{l=this._characterJoiners[0].handler(m)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const x=this._characterJoiners[p].handler(m);for(let L=0;L<x.length;L++)Ne._mergeRanges(l,x[L])}catch(x){console.error(x)}return this._stringRangesToCellRanges(l,c,f),l}_stringRangesToCellRanges(s,t,o){let c=0,f=!1,m=0,l=s[c];if(l){for(let p=o;p<this._bufferService.cols;p++){const x=t.getWidth(p),L=t.getString(p).length||d.WHITESPACE_CELL_CHAR.length;if(x!==0){if(!f&&l[0]<=m&&(l[0]=p,f=!0),l[1]<=m){if(l[1]=p,l=s[++c],!l)break;l[0]<=m?(l[0]=p,f=!0):f=!1}m+=L}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(s,t){let o=!1;for(let c=0;c<s.length;c++){const f=s[c];if(o){if(t[1]<=f[0])return s[c-1][1]=t[1],s;if(t[1]<=f[1])return s[c-1][1]=Math.max(t[1],f[1]),s.splice(c,1),s;s.splice(c,1),c--}else{if(t[1]<=f[0])return s.splice(c,0,t),s;if(t[1]<=f[1])return f[0]=Math.min(t[0],f[0]),s;t[0]<f[1]&&(f[0]=Math.min(t[0],f[0]),o=!0)}}return o?s[s.length-1][1]=t[1]:s.push(t),s}};r.CharacterJoinerService=e=h([_(0,g.IBufferService)],e)},5114:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(a,h){this._textarea=a,this.window=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}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}}},8934:function(A,r,a){var h=this&&this.__decorate||function(g,u,e,i){var s,t=arguments.length,o=t<3?u:i===null?i=Object.getOwnPropertyDescriptor(u,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(g,u,e,i);else for(var c=g.length-1;c>=0;c--)(s=g[c])&&(o=(t<3?s(o):t>3?s(u,e,o):s(u,e))||o);return t>3&&o&&Object.defineProperty(u,e,o),o},_=this&&this.__param||function(g,u){return function(e,i){u(e,i,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=a(4725),d=a(9806);let v=r.MouseService=class{constructor(g,u){this._renderService=g,this._charSizeService=u}getCoords(g,u,e,i,s){return(0,d.getCoords)(window,g,u,e,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(g,u){const e=(0,d.getCoordsRelativeToElement)(window,g,u);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])}}};r.MouseService=v=h([_(0,n.IRenderService),_(1,n.ICharSizeService)],v)},3230:function(A,r,a){var h=this&&this.__decorate||function(o,c,f,m){var l,p=arguments.length,x=p<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,c,f,m);else for(var L=o.length-1;L>=0;L--)(l=o[L])&&(x=(p<3?l(x):p>3?l(c,f,x):l(c,f))||x);return p>3&&x&&Object.defineProperty(c,f,x),x},_=this&&this.__param||function(o,c){return function(f,m){c(f,m,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=a(3656),d=a(6193),v=a(5596),g=a(4725),u=a(8460),e=a(844),i=a(7226),s=a(2585);let t=r.RenderService=class extends e.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,c,f,m,l,p,x,L){if(super(),this._rowCount=o,this._charSizeService=m,this._renderer=this.register(new e.MutableDisposable),this._pausedResizeTask=new i.DebouncedIdleTask,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 u.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new u.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new u.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new u.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(x.window,((y,E)=>this._renderRows(y,E))),this.register(this._renderDebouncer),this._screenDprMonitor=new v.ScreenDprMonitor(x.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(p.onResize((()=>this._fullRefresh()))),this.register(p.buffers.onBufferActivate((()=>{var y;return(y=this._renderer.value)===null||y===void 0?void 0:y.clear()}))),this.register(f.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(l.onDecorationRegistered((()=>this._fullRefresh()))),this.register(l.onDecorationRemoved((()=>this._fullRefresh()))),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()}))),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(p.buffer.y,p.buffer.y,!0)))),this.register((0,n.addDisposableDomListener)(x.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(L.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in x.window){const y=new x.window.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});y.observe(c),this.register({dispose:()=>y.disconnect()})}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,c,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,c,this._rowCount))}_renderRows(o,c){this._renderer.value&&(o=Math.min(o,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(o,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:c}),this._onRender.fire({start:o,end:c}),this._isNextRenderRedrawOnly=!0)}resize(o,c){this._rowCount=c,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(o){this._renderer.value=o,this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,c;this._renderer.value&&((c=(o=this._renderer.value).clearTextureAtlas)===null||c===void 0||c.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(o,c))):this._renderer.value.handleResize(o,c),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)===null||o===void 0||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)===null||o===void 0||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)===null||o===void 0||o.handleFocus()}handleSelectionChanged(o,c,f){var m;this._selectionState.start=o,this._selectionState.end=c,this._selectionState.columnSelectMode=f,(m=this._renderer.value)===null||m===void 0||m.handleSelectionChanged(o,c,f)}handleCursorMove(){var o;(o=this._renderer.value)===null||o===void 0||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)===null||o===void 0||o.clear()}};r.RenderService=t=h([_(2,s.IOptionsService),_(3,g.ICharSizeService),_(4,s.IDecorationService),_(5,s.IBufferService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],t)},9312:function(A,r,a){var h=this&&this.__decorate||function(l,p,x,L){var y,E=arguments.length,B=E<3?p:L===null?L=Object.getOwnPropertyDescriptor(p,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(l,p,x,L);else for(var I=l.length-1;I>=0;I--)(y=l[I])&&(B=(E<3?y(B):E>3?y(p,x,B):y(p,x))||B);return E>3&&B&&Object.defineProperty(p,x,B),B},_=this&&this.__param||function(l,p){return function(x,L){p(x,L,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=a(9806),d=a(9504),v=a(456),g=a(4725),u=a(8460),e=a(844),i=a(6114),s=a(4841),t=a(511),o=a(2585),c=" ",f=new RegExp(c,"g");let m=r.SelectionService=class extends e.Disposable{constructor(l,p,x,L,y,E,B,I,H){super(),this._element=l,this._screenElement=p,this._linkifier=x,this._bufferService=L,this._coreService=y,this._mouseService=E,this._optionsService=B,this._renderService=I,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((j=>this._handleTrim(j))),this.register(this._bufferService.buffers.onBufferActivate((j=>this._handleBufferActivate(j)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;return!(!l||!p||l[0]===p[0]&&l[1]===p[1])}get selectionText(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;if(!l||!p)return"";const x=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(l[0]===p[0])return"";const y=l[0]<p[0]?l[0]:p[0],E=l[0]<p[0]?p[0]:l[0];for(let B=l[1];B<=p[1];B++){const I=x.translateBufferLineToString(B,!0,y,E);L.push(I)}}else{const y=l[1]===p[1]?p[0]:void 0;L.push(x.translateBufferLineToString(l[1],!0,l[0],y));for(let E=l[1]+1;E<=p[1]-1;E++){const B=x.lines.get(E),I=x.translateBufferLineToString(E,!0);B!=null&&B.isWrapped?L[L.length-1]+=I:L.push(I)}if(l[1]!==p[1]){const E=x.lines.get(p[1]),B=x.translateBufferLineToString(p[1],!0,0,p[0]);E&&E.isWrapped?L[L.length-1]+=B:L.push(B)}}return L.map((y=>y.replace(f," "))).join(i.isWindows?`\r
41
+ `:`
42
+ `)}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 p=this._getMouseBufferCoords(l),x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(x&&L&&p)&&this._areCoordsInSelection(p,x,L)}isCellInSelection(l,p){const x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!x||!L)&&this._areCoordsInSelection([l,p],x,L)}_areCoordsInSelection(l,p,x){return l[1]>p[1]&&l[1]<x[1]||p[1]===x[1]&&l[1]===p[1]&&l[0]>=p[0]&&l[0]<x[0]||p[1]<x[1]&&l[1]===x[1]&&l[0]<x[0]||p[1]<x[1]&&l[1]===p[1]&&l[0]>=p[0]}_selectWordAtCursor(l,p){var x,L;const y=(L=(x=this._linkifier.currentLink)===null||x===void 0?void 0:x.link)===null||L===void 0?void 0:L.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const E=this._getMouseBufferCoords(l);return!!E&&(this._selectWordAt(E,p),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,p){this._model.clearSelection(),l=Math.max(l,0),p=Math.min(p,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,p],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const p=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(p)return p[0]--,p[1]--,p[1]+=this._bufferService.buffer.ydisp,p}_getMouseEventScrollAmount(l){let p=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const x=this._renderService.dimensions.css.canvas.height;return p>=0&&p<=x?0:(p>x&&(p-=x),p=Math.min(Math.max(p,-50),50),p/=50,p/Math.abs(p)+Math.round(14*p))}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 p=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);p&&p.length!==this._model.selectionStart[0]&&p.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const p=this._getMouseBufferCoords(l);p&&(this._activeSelectionMode=2,this._selectLineAt(p[1]))}shouldColumnSelect(l){return l.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const p=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 x=this._bufferService.buffer;if(this._model.selectionEnd[1]<x.lines.length){const L=x.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}p&&p[0]===this._model.selectionEnd[0]&&p[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 p=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&p<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const x=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(x&&x[0]!==void 0&&x[1]!==void 0){const L=(0,d.moveToCellSequence)(x[0]-1,x[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd,x=!(!l||!p||l[0]===p[0]&&l[1]===p[1]);x?l&&p&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&p[0]===this._oldSelectionEnd[0]&&p[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,p,x)):this._oldHasSelection&&this._fireOnSelectionChange(l,p,x)}_fireOnSelectionChange(l,p,x){this._oldSelectionStart=l,this._oldSelectionEnd=p,this._oldHasSelection=x,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim((p=>this._handleTrim(p)))}_convertViewportColToCharacterIndex(l,p){let x=p;for(let L=0;p>=L;L++){const y=l.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?x--:y>1&&p!==L&&(x+=y-1)}return x}setSelection(l,p,x){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,p],this._model.selectionStartLength=x,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,p,x=!0,L=!0){if(l[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,E=y.lines.get(l[1]);if(!E)return;const B=y.translateBufferLineToString(l[1],!1);let I=this._convertViewportColToCharacterIndex(E,l[0]),H=I;const j=l[0]-I;let b=0,w=0,k=0,D=0;if(B.charAt(I)===" "){for(;I>0&&B.charAt(I-1)===" ";)I--;for(;H<B.length&&B.charAt(H+1)===" ";)H++}else{let V=l[0],q=l[0];E.getWidth(V)===0&&(b++,V--),E.getWidth(q)===2&&(w++,q++);const ee=E.getString(q).length;for(ee>1&&(D+=ee-1,H+=ee-1);V>0&&I>0&&!this._isCharWordSeparator(E.loadCell(V-1,this._workCell));){E.loadCell(V-1,this._workCell);const S=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,V--):S>1&&(k+=S-1,I-=S-1),I--,V--}for(;q<E.length&&H+1<B.length&&!this._isCharWordSeparator(E.loadCell(q+1,this._workCell));){E.loadCell(q+1,this._workCell);const S=this._workCell.getChars().length;this._workCell.getWidth()===2?(w++,q++):S>1&&(D+=S-1,H+=S-1),H++,q++}}H++;let N=I+j-b+k,W=Math.min(this._bufferService.cols,H-I+b+w-k-D);if(p||B.slice(I,H).trim()!==""){if(x&&N===0&&E.getCodePoint(0)!==32){const V=y.lines.get(l[1]-1);if(V&&E.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(q){const ee=this._bufferService.cols-q.start;N-=ee,W+=ee}}}if(L&&N+W===this._bufferService.cols&&E.getCodePoint(this._bufferService.cols-1)!==32){const V=y.lines.get(l[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const q=this._getWordAt([0,l[1]+1],!1,!1,!0);q&&(W+=q.length)}}return{start:N,length:W}}}_selectWordAt(l,p){const x=this._getWordAt(l,p);if(x){for(;x.start<0;)x.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[x.start,l[1]],this._model.selectionStartLength=x.length}}_selectToWordAt(l){const p=this._getWordAt(l,!0);if(p){let x=l[1];for(;p.start<0;)p.start+=this._bufferService.cols,x--;if(!this._model.areSelectionValuesReversed())for(;p.start+p.length>this._bufferService.cols;)p.length-=this._bufferService.cols,x++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?p.start:p.start+p.length,x]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const p=this._bufferService.buffer.getWrappedRangeForLine(l),x={start:{x:0,y:p.first},end:{x:this._bufferService.cols-1,y:p.last}};this._model.selectionStart=[0,p.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(x,this._bufferService.cols)}};r.SelectionService=m=h([_(3,o.IBufferService),_(4,o.ICoreService),_(5,g.IMouseService),_(6,o.IOptionsService),_(7,g.IRenderService),_(8,g.ICoreBrowserService)],m)},4725:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const h=a(8343);r.ICharSizeService=(0,h.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),r.IMouseService=(0,h.createDecorator)("MouseService"),r.IRenderService=(0,h.createDecorator)("RenderService"),r.ISelectionService=(0,h.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,h.createDecorator)("ThemeService")},6731:function(A,r,a){var h=this&&this.__decorate||function(m,l,p,x){var L,y=arguments.length,E=y<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,l,p,x);else for(var B=m.length-1;B>=0;B--)(L=m[B])&&(E=(y<3?L(E):y>3?L(l,p,E):L(l,p))||E);return y>3&&E&&Object.defineProperty(l,p,E),E},_=this&&this.__param||function(m,l){return function(p,x){l(p,x,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),v=a(8460),g=a(844),u=a(2585),e=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),s=d.css.toColor("#ffffff"),t=d.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let p=0;p<216;p++){const x=l[p/36%6|0],L=l[p/6%6|0],y=l[p%6];m.push({css:d.channels.toCss(x,L,y),rgba:d.channels.toRgba(x,L,y)})}for(let p=0;p<24;p++){const x=8+10*p;m.push({css:d.channels.toCss(x,x,x),rgba:d.channels.toRgba(x,x,x)})}return m})());let c=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:i,cursor:s,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:o,selectionBackgroundOpaque:d.color.blend(i,o),selectionInactiveBackgroundTransparent:o,selectionInactiveBackgroundOpaque:d.color.blend(i,o),ansi:r.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=f(m.foreground,e),l.background=f(m.background,i),l.cursor=f(m.cursor,s),l.cursorAccent=f(m.cursorAccent,t),l.selectionBackgroundTransparent=f(m.selectionBackground,o),l.selectionBackgroundOpaque=d.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=f(m.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=d.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=m.selectionForeground?f(m.selectionForeground,d.NULL_COLOR):void 0,l.selectionForeground===d.NULL_COLOR&&(l.selectionForeground=void 0),d.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=d.color.opacity(l.selectionBackgroundTransparent,.3)),d.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=d.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=r.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=f(m.black,r.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=f(m.red,r.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=f(m.green,r.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=f(m.yellow,r.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=f(m.blue,r.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=f(m.magenta,r.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=f(m.cyan,r.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=f(m.white,r.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=f(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=f(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=f(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=f(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=f(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=f(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=f(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=f(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const p=Math.min(l.ansi.length-16,m.extendedAnsi.length);for(let x=0;x<p;x++)l.ansi[x+16]=f(m.extendedAnsi[x],r.DEFAULT_ANSI_COLORS[x+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 f(m,l){if(m!==void 0)try{return d.css.toColor(m)}catch{}return l}r.ThemeService=c=h([_(0,u.IOptionsService)],c)},6349:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const h=a(8460),_=a(844);class n extends _.Disposable{constructor(v){super(),this._maxLength=v,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(v){if(this._maxLength===v)return;const g=new Array(v);for(let u=0;u<Math.min(v,this.length);u++)g[u]=this._array[this._getCyclicIndex(u)];this._array=g,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let g=this._length;g<v;g++)this._array[g]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,g){this._array[this._getCyclicIndex(v)]=g}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,g,...u){if(g){for(let e=v;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:v,amount:g})}for(let e=this._length-1;e>=v;e--)this._array[this._getCyclicIndex(e+u.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<u.length;e++)this._array[this._getCyclicIndex(v+e)]=u[e];if(u.length&&this.onInsertEmitter.fire({index:v,amount:u.length}),this._length+u.length>this._maxLength){const e=this._length+u.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=u.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,g,u){if(!(g<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let i=g-1;i>=0;i--)this.set(v+i+u,this.get(v+i));const e=v+g+u-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(v+e+u,this.get(v+e))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=n},1439:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(h,_=5){if(typeof h!="object")return h;const n=Array.isArray(h)?[]:{};for(const d in h)n[d]=_<=1?h[d]:h[d]&&a(h[d],_-1);return n}},8055:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const h=a(6114);let _=0,n=0,d=0,v=0;var g,u,e,i,s;function t(c){const f=c.toString(16);return f.length<2?"0"+f:f}function o(c,f){return c<f?(f+.05)/(c+.05):(c+.05)/(f+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(f,m,l,p){return p!==void 0?`#${t(f)}${t(m)}${t(l)}${t(p)}`:`#${t(f)}${t(m)}${t(l)}`},c.toRgba=function(f,m,l,p=255){return(f<<24|m<<16|l<<8|p)>>>0}})(g||(r.channels=g={})),(function(c){function f(m,l){return v=Math.round(255*l),[_,n,d]=s.toChannels(m.rgba),{css:g.toCss(_,n,d,v),rgba:g.toRgba(_,n,d,v)}}c.blend=function(m,l){if(v=(255&l.rgba)/255,v===1)return{css:l.css,rgba:l.rgba};const p=l.rgba>>24&255,x=l.rgba>>16&255,L=l.rgba>>8&255,y=m.rgba>>24&255,E=m.rgba>>16&255,B=m.rgba>>8&255;return _=y+Math.round((p-y)*v),n=E+Math.round((x-E)*v),d=B+Math.round((L-B)*v),{css:g.toCss(_,n,d),rgba:g.toRgba(_,n,d)}},c.isOpaque=function(m){return(255&m.rgba)==255},c.ensureContrastRatio=function(m,l,p){const x=s.ensureContrastRatio(m.rgba,l.rgba,p);if(x)return s.toColor(x>>24&255,x>>16&255,x>>8&255)},c.opaque=function(m){const l=(255|m.rgba)>>>0;return[_,n,d]=s.toChannels(l),{css:g.toCss(_,n,d),rgba:l}},c.opacity=f,c.multiplyOpacity=function(m,l){return v=255&m.rgba,f(m,v*l/255)},c.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}})(u||(r.color=u={})),(function(c){let f,m;if(!h.isNode){const l=document.createElement("canvas");l.width=1,l.height=1;const p=l.getContext("2d",{willReadFrequently:!0});p&&(f=p,f.globalCompositeOperation="copy",m=f.createLinearGradient(0,0,1,1))}c.toColor=function(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return _=parseInt(l.slice(1,2).repeat(2),16),n=parseInt(l.slice(2,3).repeat(2),16),d=parseInt(l.slice(3,4).repeat(2),16),s.toColor(_,n,d);case 5:return _=parseInt(l.slice(1,2).repeat(2),16),n=parseInt(l.slice(2,3).repeat(2),16),d=parseInt(l.slice(3,4).repeat(2),16),v=parseInt(l.slice(4,5).repeat(2),16),s.toColor(_,n,d,v);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}const p=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return _=parseInt(p[1]),n=parseInt(p[2]),d=parseInt(p[3]),v=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),s.toColor(_,n,d,v);if(!f||!m)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=m,f.fillStyle=l,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[_,n,d,v]=f.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(_,n,d,v),css:l}}})(e||(r.css=e={})),(function(c){function f(m,l,p){const x=m/255,L=l/255,y=p/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))}c.relativeLuminance=function(m){return f(m>>16&255,m>>8&255,255&m)},c.relativeLuminance2=f})(i||(r.rgb=i={})),(function(c){function f(l,p,x){const L=l>>24&255,y=l>>16&255,E=l>>8&255;let B=p>>24&255,I=p>>16&255,H=p>>8&255,j=o(i.relativeLuminance2(B,I,H),i.relativeLuminance2(L,y,E));for(;j<x&&(B>0||I>0||H>0);)B-=Math.max(0,Math.ceil(.1*B)),I-=Math.max(0,Math.ceil(.1*I)),H-=Math.max(0,Math.ceil(.1*H)),j=o(i.relativeLuminance2(B,I,H),i.relativeLuminance2(L,y,E));return(B<<24|I<<16|H<<8|255)>>>0}function m(l,p,x){const L=l>>24&255,y=l>>16&255,E=l>>8&255;let B=p>>24&255,I=p>>16&255,H=p>>8&255,j=o(i.relativeLuminance2(B,I,H),i.relativeLuminance2(L,y,E));for(;j<x&&(B<255||I<255||H<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),I=Math.min(255,I+Math.ceil(.1*(255-I))),H=Math.min(255,H+Math.ceil(.1*(255-H))),j=o(i.relativeLuminance2(B,I,H),i.relativeLuminance2(L,y,E));return(B<<24|I<<16|H<<8|255)>>>0}c.ensureContrastRatio=function(l,p,x){const L=i.relativeLuminance(l>>8),y=i.relativeLuminance(p>>8);if(o(L,y)<x){if(y<L){const I=f(l,p,x),H=o(L,i.relativeLuminance(I>>8));if(H<x){const j=m(l,p,x);return H>o(L,i.relativeLuminance(j>>8))?I:j}return I}const E=m(l,p,x),B=o(L,i.relativeLuminance(E>>8));if(B<x){const I=f(l,p,x);return B>o(L,i.relativeLuminance(I>>8))?E:I}return E}},c.reduceLuminance=f,c.increaseLuminance=m,c.toChannels=function(l){return[l>>24&255,l>>16&255,l>>8&255,255&l]},c.toColor=function(l,p,x,L){return{css:g.toCss(l,p,x,L),rgba:g.toRgba(l,p,x,L)}}})(s||(r.rgba=s={})),r.toPaddedHex=t,r.contrastRatio=o},8969:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const h=a(844),_=a(2585),n=a(4348),d=a(7866),v=a(744),g=a(7302),u=a(6975),e=a(8460),i=a(1753),s=a(1480),t=a(7994),o=a(9282),c=a(5435),f=a(5981),m=a(2660);let l=!1;class p extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event((L=>{var y;(y=this._onScrollApi)===null||y===void 0||y.fire(L.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(L){for(const y in L)this.optionsService.options[y]=L[y]}constructor(L){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 g.OptionsService(L)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.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((y=>{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((y=>{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 f.WriteBuffer(((y,E)=>this._inputHandler.parse(y,E)))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,y){this._writeBuffer.write(L,y)}writeSync(L,y){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(L,y)}resize(L,y){isNaN(L)||isNaN(y)||(L=Math.max(L,v.MINIMUM_COLS),y=Math.max(y,v.MINIMUM_ROWS),this._bufferService.resize(L,y))}scroll(L,y=!1){this._bufferService.scroll(L,y)}scrollLines(L,y,E){this._bufferService.scrollLines(L,y,E)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const y=L-this._bufferService.buffer.ydisp;y!==0&&this.scrollLines(y)}registerEscHandler(L,y){return this._inputHandler.registerEscHandler(L,y)}registerDcsHandler(L,y){return this._inputHandler.registerDcsHandler(L,y)}registerCsiHandler(L,y){return this._inputHandler.registerCsiHandler(L,y)}registerOscHandler(L,y){return this._inputHandler.registerOscHandler(L,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const y=this.optionsService.rawOptions.windowsPty;y&&y.buildNumber!==void 0&&y.buildNumber!==void 0?L=y.backend==="conpty"&&y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(o.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,o.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const y of L)y.dispose()}))}}}r.CoreTerminal=p},8460:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=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 _=[];for(let n=0;n<this._listeners.length;n++)_.push(this._listeners[n]);for(let n=0;n<_.length;n++)_[n].call(void 0,a,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(a,h){return a((_=>h.fire(_)))}},5435:function(A,r,a){var h=this&&this.__decorate||function(j,b,w,k){var D,N=arguments.length,W=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(j,b,w,k);else for(var V=j.length-1;V>=0;V--)(D=j[V])&&(W=(N<3?D(W):N>3?D(b,w,W):D(b,w))||W);return N>3&&W&&Object.defineProperty(b,w,W),W},_=this&&this.__param||function(j,b){return function(w,k){b(w,k,j)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),v=a(2015),g=a(844),u=a(482),e=a(8437),i=a(8460),s=a(643),t=a(511),o=a(3734),c=a(2585),f=a(6242),m=a(6351),l=a(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function L(j,b){if(j>24)return b.setWinLines||!1;switch(j){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var y;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y||(r.WindowsOptionsReportType=y={}));let E=0;class B extends g.Disposable{getAttrData(){return this._curAttrData}constructor(b,w,k,D,N,W,V,q,ee=new v.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=w,this._coreService=k,this._logService=D,this._optionsService=N,this._oscLinkService=W,this._coreMouseService=V,this._unicodeService=q,this._parser=ee,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new t.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._parser.setCsiHandlerFallback(((S,R)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(S),params:R.toArray()})})),this._parser.setEscHandlerFallback((S=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(S)})})),this._parser.setExecuteHandlerFallback((S=>{this._logService.debug("Unknown EXECUTE code: ",{code:S})})),this._parser.setOscHandlerFallback(((S,R,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:S,action:R,data:M})})),this._parser.setDcsHandlerFallback(((S,R,M)=>{R==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(S),action:R,payload:M})})),this._parser.setPrintHandler(((S,R,M)=>this.print(S,R,M))),this._parser.registerCsiHandler({final:"@"},(S=>this.insertChars(S))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(S=>this.scrollLeft(S))),this._parser.registerCsiHandler({final:"A"},(S=>this.cursorUp(S))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(S=>this.scrollRight(S))),this._parser.registerCsiHandler({final:"B"},(S=>this.cursorDown(S))),this._parser.registerCsiHandler({final:"C"},(S=>this.cursorForward(S))),this._parser.registerCsiHandler({final:"D"},(S=>this.cursorBackward(S))),this._parser.registerCsiHandler({final:"E"},(S=>this.cursorNextLine(S))),this._parser.registerCsiHandler({final:"F"},(S=>this.cursorPrecedingLine(S))),this._parser.registerCsiHandler({final:"G"},(S=>this.cursorCharAbsolute(S))),this._parser.registerCsiHandler({final:"H"},(S=>this.cursorPosition(S))),this._parser.registerCsiHandler({final:"I"},(S=>this.cursorForwardTab(S))),this._parser.registerCsiHandler({final:"J"},(S=>this.eraseInDisplay(S,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(S=>this.eraseInDisplay(S,!0))),this._parser.registerCsiHandler({final:"K"},(S=>this.eraseInLine(S,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(S=>this.eraseInLine(S,!0))),this._parser.registerCsiHandler({final:"L"},(S=>this.insertLines(S))),this._parser.registerCsiHandler({final:"M"},(S=>this.deleteLines(S))),this._parser.registerCsiHandler({final:"P"},(S=>this.deleteChars(S))),this._parser.registerCsiHandler({final:"S"},(S=>this.scrollUp(S))),this._parser.registerCsiHandler({final:"T"},(S=>this.scrollDown(S))),this._parser.registerCsiHandler({final:"X"},(S=>this.eraseChars(S))),this._parser.registerCsiHandler({final:"Z"},(S=>this.cursorBackwardTab(S))),this._parser.registerCsiHandler({final:"`"},(S=>this.charPosAbsolute(S))),this._parser.registerCsiHandler({final:"a"},(S=>this.hPositionRelative(S))),this._parser.registerCsiHandler({final:"b"},(S=>this.repeatPrecedingCharacter(S))),this._parser.registerCsiHandler({final:"c"},(S=>this.sendDeviceAttributesPrimary(S))),this._parser.registerCsiHandler({prefix:">",final:"c"},(S=>this.sendDeviceAttributesSecondary(S))),this._parser.registerCsiHandler({final:"d"},(S=>this.linePosAbsolute(S))),this._parser.registerCsiHandler({final:"e"},(S=>this.vPositionRelative(S))),this._parser.registerCsiHandler({final:"f"},(S=>this.hVPosition(S))),this._parser.registerCsiHandler({final:"g"},(S=>this.tabClear(S))),this._parser.registerCsiHandler({final:"h"},(S=>this.setMode(S))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(S=>this.setModePrivate(S))),this._parser.registerCsiHandler({final:"l"},(S=>this.resetMode(S))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(S=>this.resetModePrivate(S))),this._parser.registerCsiHandler({final:"m"},(S=>this.charAttributes(S))),this._parser.registerCsiHandler({final:"n"},(S=>this.deviceStatus(S))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(S=>this.deviceStatusPrivate(S))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(S=>this.softReset(S))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(S=>this.setCursorStyle(S))),this._parser.registerCsiHandler({final:"r"},(S=>this.setScrollRegion(S))),this._parser.registerCsiHandler({final:"s"},(S=>this.saveCursor(S))),this._parser.registerCsiHandler({final:"t"},(S=>this.windowOptions(S))),this._parser.registerCsiHandler({final:"u"},(S=>this.restoreCursor(S))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(S=>this.insertColumns(S))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(S=>this.deleteColumns(S))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(S=>this.selectProtected(S))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(S=>this.requestMode(S,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(S=>this.requestMode(S,!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 f.OscHandler((S=>(this.setTitle(S),this.setIconName(S),!0)))),this._parser.registerOscHandler(1,new f.OscHandler((S=>this.setIconName(S)))),this._parser.registerOscHandler(2,new f.OscHandler((S=>this.setTitle(S)))),this._parser.registerOscHandler(4,new f.OscHandler((S=>this.setOrReportIndexedColor(S)))),this._parser.registerOscHandler(8,new f.OscHandler((S=>this.setHyperlink(S)))),this._parser.registerOscHandler(10,new f.OscHandler((S=>this.setOrReportFgColor(S)))),this._parser.registerOscHandler(11,new f.OscHandler((S=>this.setOrReportBgColor(S)))),this._parser.registerOscHandler(12,new f.OscHandler((S=>this.setOrReportCursorColor(S)))),this._parser.registerOscHandler(104,new f.OscHandler((S=>this.restoreIndexedColor(S)))),this._parser.registerOscHandler(110,new f.OscHandler((S=>this.restoreFgColor(S)))),this._parser.registerOscHandler(111,new f.OscHandler((S=>this.restoreBgColor(S)))),this._parser.registerOscHandler(112,new f.OscHandler((S=>this.restoreCursorColor(S)))),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 S in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:S},(()=>this.selectCharset("("+S))),this._parser.registerEscHandler({intermediates:")",final:S},(()=>this.selectCharset(")"+S))),this._parser.registerEscHandler({intermediates:"*",final:S},(()=>this.selectCharset("*"+S))),this._parser.registerEscHandler({intermediates:"+",final:S},(()=>this.selectCharset("+"+S))),this._parser.registerEscHandler({intermediates:"-",final:S},(()=>this.selectCharset("-"+S))),this._parser.registerEscHandler({intermediates:".",final:S},(()=>this.selectCharset("."+S))),this._parser.registerEscHandler({intermediates:"/",final:S},(()=>this.selectCharset("/"+S)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((S=>(this._logService.error("Parsing error: ",S),S))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((S,R)=>this.requestStatusString(S,R))))}_preserveStack(b,w,k,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=w,this._parseStack.decodedLength=k,this._parseStack.position=D}_logSlowResolvingAsync(b){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([b,new Promise(((w,k)=>setTimeout((()=>k("#SLOW_TIMEOUT")),5e3)))]).catch((w=>{if(w!=="#SLOW_TIMEOUT")throw w;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,w){let k,D=this._activeBuffer.x,N=this._activeBuffer.y,W=0;const V=this._parseStack.paused;if(V){if(k=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,w))return this._logSlowResolvingAsync(k),k;D=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>x&&(W=this._parseStack.position+x)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,(q=>String.fromCharCode(q))).join("")}"`),typeof b=="string"?b.split("").map((q=>q.charCodeAt(0))):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(b.length,x))),V||this._dirtyRowTracker.clearRange(),b.length>x)for(let q=W;q<b.length;q+=x){const ee=q+x<b.length?q+x:b.length,S=typeof b=="string"?this._stringDecoder.decode(b.substring(q,ee),this._parseBuffer):this._utf8Decoder.decode(b.subarray(q,ee),this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,S))return this._preserveStack(D,N,S,q),this._logSlowResolvingAsync(k),k}else if(!V){const q=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,q))return this._preserveStack(D,N,q,0),this._logSlowResolvingAsync(k),k}this._activeBuffer.x===D&&this._activeBuffer.y===N||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(b,w,k){let D,N;const W=this._charsetService.charset,V=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,ee=this._coreService.decPrivateModes.wraparound,S=this._coreService.modes.insertMode,R=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&k-w>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodePoint(this._activeBuffer.x-1,0,1,R.fg,R.bg,R.extended);for(let O=w;O<k;++O){if(D=b[O],N=this._unicodeService.wcwidth(D),D<127&&W){const Y=W[String.fromCharCode(D)];Y&&(D=Y.charCodeAt(0))}if(V&&this._onA11yChar.fire((0,u.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),N||!this._activeBuffer.x){if(this._activeBuffer.x+N-1>=q){if(ee){for(;this._activeBuffer.x<q;)M.setCellFromCodePoint(this._activeBuffer.x++,0,1,R.fg,R.bg,R.extended);this._activeBuffer.x=0,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),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=q-1,N===2)continue}if(S&&(M.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(R),R),M.getWidth(q-1)===2&&M.setCellFromCodePoint(q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,R.fg,R.bg,R.extended)),M.setCellFromCodePoint(this._activeBuffer.x++,D,N,R.fg,R.bg,R.extended),N>0)for(;--N;)M.setCellFromCodePoint(this._activeBuffer.x++,0,0,R.fg,R.bg,R.extended)}else M.getWidth(this._activeBuffer.x-1)?M.addCodepointToCell(this._activeBuffer.x-1,D):M.addCodepointToCell(this._activeBuffer.x-2,D)}k-w>0&&(M.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<q&&k-w>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodePoint(this._activeBuffer.x,0,1,R.fg,R.bg,R.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,w){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,w):this._parser.registerCsiHandler(b,(k=>!L(k.params[0],this._optionsService.rawOptions.windowOptions)||w(k)))}registerDcsHandler(b,w){return this._parser.registerDcsHandler(b,new m.DcsHandler(w))}registerEscHandler(b,w){return this._parser.registerEscHandler(b,w)}registerOscHandler(b,w){return this._parser.registerOscHandler(b,new f.OscHandler(w))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;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&&(!((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||b===void 0)&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);w.hasWidth(this._activeBuffer.x)&&!w.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,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(b,w){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+w):(this._activeBuffer.x=b,this._activeBuffer.y=w),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,w){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+w)}cursorUp(b){const w=this._activeBuffer.y-this._activeBuffer.scrollTop;return w>=0?this._moveCursor(0,-Math.min(w,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const w=this._activeBuffer.scrollBottom-this._activeBuffer.y;return w>=0?this._moveCursor(0,Math.min(w,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const w=b.params[0];return w===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:w===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=b.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=b.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const w=b.params[0];return w===1&&(this._curAttrData.bg|=536870912),w!==2&&w!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,w,k,D=!1,N=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);W.replaceCells(w,k,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),N),D&&(W.isWrapped=!1)}_resetBufferLine(b,w=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);k&&(k.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),w),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),k.isWrapped=!1)}eraseInDisplay(b,w=!1){let k;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);k<this._bufferService.rows;k++)this._resetBufferLine(k,w);this._dirtyRowTracker.markDirty(k);break;case 1:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k,0,this._activeBuffer.x+1,!0,w),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(k+1).isWrapped=!1);k--;)this._resetBufferLine(k,w);this._dirtyRowTracker.markDirty(0);break;case 2:for(k=this._bufferService.rows,this._dirtyRowTracker.markDirty(k-1);k--;)this._resetBufferLine(k,w);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(b,w=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,w);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,w)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let w=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;w--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let w=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=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;w--;)this._activeBuffer.lines.splice(k,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(b){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let w=b.params[0]||1;for(;w--;)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(b){let w=b.params[0]||1;for(;w--;)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(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.deleteCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.insertCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.insertCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=b.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);D.deleteCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){if(!this._parser.precedingCodepoint)return!0;const w=b.params[0]||1,k=new Uint32Array(w);for(let D=0;D<w;++D)k[D]=this._parser.precedingCodepoint;return this.print(k,0,k.length),!0}sendDeviceAttributesPrimary(b){return b.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(b){return b.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(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let w=0;w<b.length;w++)switch(b.params[w]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let w=0;w<b.length;w++)switch(b.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(b){for(let w=0;w<b.length;w++)switch(b.params[w]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let w=0;w<b.length;w++)switch(b.params[w]){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(),b.params[w]===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(b,w){const k=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:N}=this._coreMouseService,W=this._coreService,{buffers:V,cols:q}=this._bufferService,{active:ee,alt:S}=V,R=this._optionsService.rawOptions,M=Q=>Q?1:2,O=b.params[0];return Y=O,U=w?O===2?4:O===4?M(W.modes.insertMode):O===12?3:O===20?M(R.convertEol):0:O===1?M(k.applicationCursorKeys):O===3?R.windowOptions.setWinLines?q===80?2:q===132?1:0:0:O===6?M(k.origin):O===7?M(k.wraparound):O===8?3:O===9?M(D==="X10"):O===12?M(R.cursorBlink):O===25?M(!W.isCursorHidden):O===45?M(k.reverseWraparound):O===66?M(k.applicationKeypad):O===67?4:O===1e3?M(D==="VT200"):O===1002?M(D==="DRAG"):O===1003?M(D==="ANY"):O===1004?M(k.sendFocus):O===1005?4:O===1006?M(N==="SGR"):O===1015?4:O===1016?M(N==="SGR_PIXELS"):O===1048?1:O===47||O===1047||O===1049?M(ee===S):O===2004?M(k.bracketedPasteMode):0,W.triggerDataEvent(`${n.C0.ESC}[${w?"":"?"}${Y};${U}$y`),!0;var Y,U}_updateAttrColor(b,w,k,D,N){return w===2?(b|=50331648,b&=-16777216,b|=o.AttributeData.fromColorRGB([k,D,N])):w===5&&(b&=-50331904,b|=33554432|255&k),b}_extractColor(b,w,k){const D=[0,0,-1,0,0,0];let N=0,W=0;do{if(D[W+N]=b.params[w+W],b.hasSubParams(w+W)){const V=b.getSubParams(w+W);let q=0;do D[1]===5&&(N=1),D[W+q+1+N]=V[q];while(++q<V.length&&q+W+1+N<D.length);break}if(D[1]===5&&W+N>=2||D[1]===2&&W+N>=5)break;D[1]&&(N=1)}while(++W+w<b.length&&W+N<D.length);for(let V=2;V<D.length;++V)D[V]===-1&&(D[V]=0);switch(D[0]){case 38:k.fg=this._updateAttrColor(k.fg,D[1],D[3],D[4],D[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,D[1],D[3],D[4],D[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,D[1],D[3],D[4],D[5])}return W}_processUnderline(b,w){w.extended=w.extended.clone(),(!~b||b>5)&&(b=1),w.extended.underlineStyle=b,w.fg|=268435456,b===0&&(w.fg&=-268435457),w.updateExtended()}_processSGR0(b){b.fg=e.DEFAULT_ATTR_DATA.fg,b.bg=e.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const w=b.length;let k;const D=this._curAttrData;for(let N=0;N<w;N++)k=b.params[N],k>=30&&k<=37?(D.fg&=-50331904,D.fg|=16777216|k-30):k>=40&&k<=47?(D.bg&=-50331904,D.bg|=16777216|k-40):k>=90&&k<=97?(D.fg&=-50331904,D.fg|=16777224|k-90):k>=100&&k<=107?(D.bg&=-50331904,D.bg|=16777224|k-100):k===0?this._processSGR0(D):k===1?D.fg|=134217728:k===3?D.bg|=67108864:k===4?(D.fg|=268435456,this._processUnderline(b.hasSubParams(N)?b.getSubParams(N)[0]:1,D)):k===5?D.fg|=536870912:k===7?D.fg|=67108864:k===8?D.fg|=1073741824:k===9?D.fg|=2147483648:k===2?D.bg|=134217728:k===21?this._processUnderline(2,D):k===22?(D.fg&=-134217729,D.bg&=-134217729):k===23?D.bg&=-67108865:k===24?(D.fg&=-268435457,this._processUnderline(0,D)):k===25?D.fg&=-536870913:k===27?D.fg&=-67108865:k===28?D.fg&=-1073741825:k===29?D.fg&=2147483647:k===39?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):k===49?(D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):k===38||k===48||k===58?N+=this._extractColor(b,N,D):k===53?D.bg|=1073741824:k===55?D.bg&=-1073741825:k===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):k===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.",k);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const w=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${w};${k}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const w=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${w};${k}R`)}return!0}softReset(b){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(b){const w=b.params[0]||1;switch(w){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 k=w%2==1;return this._optionsService.options.cursorBlink=k,!0}setScrollRegion(b){const w=b.params[0]||1;let k;return(b.length<2||(k=b.params[1])>this._bufferService.rows||k===0)&&(k=this._bufferService.rows),k>w&&(this._activeBuffer.scrollTop=w-1,this._activeBuffer.scrollBottom=k-1,this._setCursor(0,0)),!0}windowOptions(b){if(!L(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const w=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:w!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.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:w!==0&&w!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),w!==0&&w!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:w!==0&&w!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),w!==0&&w!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){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(b){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(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const w=[],k=b.split(";");for(;k.length>1;){const D=k.shift(),N=k.shift();if(/^\d+$/.exec(D)){const W=parseInt(D);if(H(W))if(N==="?")w.push({type:0,index:W});else{const V=(0,l.parseColor)(N);V&&w.push({type:1,index:W,color:V})}}}return w.length&&this._onColor.fire(w),!0}setHyperlink(b){const w=b.split(";");return!(w.length<2)&&(w[1]?this._createHyperlink(w[0],w[1]):!w[0]&&this._finishHyperlink())}_createHyperlink(b,w){this._getCurrentLinkId()&&this._finishHyperlink();const k=b.split(":");let D;const N=k.findIndex((W=>W.startsWith("id=")));return N!==-1&&(D=k[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:w}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,w){const k=b.split(";");for(let D=0;D<k.length&&!(w>=this._specialColors.length);++D,++w)if(k[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[w]}]);else{const N=(0,l.parseColor)(k[D]);N&&this._onColor.fire([{type:1,index:this._specialColors[w],color:N}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const w=[],k=b.split(";");for(let D=0;D<k.length;++D)if(/^\d+$/.exec(k[D])){const N=parseInt(k[D]);H(N)&&w.push({type:2,index:N})}return w.length&&this._onColor.fire(w),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(p[b[0]],d.CHARSETS[b[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,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(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new t.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let w=0;w<this._bufferService.rows;++w){const k=this._activeBuffer.ybase+this._activeBuffer.y+w,D=this._activeBuffer.lines.get(k);D&&(D.fill(b),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,w){const k=this._bufferService.buffer,D=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${N}${n.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${k.scrollTop+1};${k.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,w){this._dirtyRowTracker.markRangeDirty(b,w)}}r.InputHandler=B;let I=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,b){j>b&&(E=j,j=b,b=E),j<this.start&&(this.start=j),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(j){return 0<=j&&j<256}I=h([_(0,c.IBufferService)],I)},844:(A,r)=>{function a(h){for(const _ of h)_.dispose();h.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.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 _=this._disposables.indexOf(h);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var _;this._isDisposed||h===this._value||((_=this._value)===null||_===void 0||_.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)===null||h===void 0||h.dispose(),this._value=void 0}},r.toDisposable=function(h){return{dispose:h}},r.disposeArray=a,r.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,n,d){this._data[_]||(this._data[_]={}),this._data[_][n]=d}get(_,n){return this._data[_]?this._data[_][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(h,_,n,d,v){this._data.get(h,_)||this._data.set(h,_,new a),this._data.get(h,_).set(n,d,v)}get(h,_,n,d){var v;return(v=this._data.get(h,_))===null||v===void 0?void 0:v.get(n,d)}clear(){this._data.clear()}}},6114:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const a=r.isNode?"node":navigator.userAgent,h=r.isNode?"node":navigator.platform;r.isFirefox=a.includes("Firefox"),r.isLegacyEdge=a.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(a),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),r.isIpad=h==="iPad",r.isIphone=h==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),r.isLinux=h.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(a)},6106:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.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 _=this._getKey(h);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)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])===_);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,_){if(this._array.length!==0&&(a=this._search(h),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return[...this._array].values()}_search(h){let _=0,n=this._array.length-1;for(;n>=_;){let d=_+n>>1;const v=this._getKey(this._array[d]);if(v>h)n=d-1;else{if(!(v<h)){for(;d>0&&this._getKey(this._array[d-1])===h;)d--;return d}_=d+1}}return _}}},7226:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const h=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,u=0,e=v.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),u=Math.max(g,u),i=v.timeRemaining(),1.5*u>i)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=i}this.clear()}}class n extends _{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const h=a(643);r.updateWindowsModeWrappedState=function(_){const n=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=n==null?void 0:n.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&d&&(v.isWrapped=d[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&d[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.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}}r.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}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=h},9092:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const h=a(6349),_=a(7226),n=a(3734),d=a(8437),v=a(4634),g=a(511),u=a(643),e=a(4863),i=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(s,t,o){this._hasScrollback=s,this._optionsService=t,this._bufferService=o,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.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,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(s),t)}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 t=s+this._optionsService.rawOptions.scrollback;return t>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:t}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=d.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)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,t){const o=this.getNullCell(d.DEFAULT_ATTR_DATA);let c=0;const f=this._getCorrectBufferLength(t);if(f>this.lines.maxLength&&(this.lines.maxLength=f),this.lines.length>0){if(this._cols<s)for(let l=0;l<this.lines.length;l++)c+=+this.lines.get(l).resize(s,o);let m=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(s,o)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(s,o)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(f<this.lines.maxLength){const l=this.lines.length-f;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=f}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,t-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(s,t),this._cols>s))for(let m=0;m<this.lines.length;m++)c+=+this.lines.get(m).resize(s,o);this._cols=s,this._rows=t,this._memoryCleanupQueue.clear(),c>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==s&&(s>this._cols?this._reflowLarger(s,t):this._reflowSmaller(s,t))}_reflowLarger(s,t){const o=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(o.length>0){const c=(0,v.reflowLargerCreateNewLayout)(this.lines,o);(0,v.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(s,t,c.countRemoved)}}_reflowLargerAdjustViewport(s,t,o){const c=this.getNullCell(d.DEFAULT_ATTR_DATA);let f=o;for(;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new d.BufferLine(s,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-o,0)}_reflowSmaller(s,t){const o=this.getNullCell(d.DEFAULT_ATTR_DATA),c=[];let f=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 p=[l];for(;l.isWrapped&&m>0;)l=this.lines.get(--m),p.unshift(l);const x=this.ybase+this.y;if(x>=m&&x<m+p.length)continue;const L=p[p.length-1].getTrimmedLength(),y=(0,v.reflowSmallerGetNewLineLengths)(p,this._cols,s),E=y.length-p.length;let B;B=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+E):Math.max(0,this.lines.length-this.lines.maxLength+E);const I=[];for(let D=0;D<E;D++){const N=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);I.push(N)}I.length>0&&(c.push({start:m+p.length+f,newLines:I}),f+=I.length),p.push(...I);let H=y.length-1,j=y[H];j===0&&(H--,j=y[H]);let b=p.length-E-1,w=L;for(;b>=0;){const D=Math.min(w,j);if(p[H]===void 0)break;if(p[H].copyCellsFrom(p[b],w-D,j-D,D,!0),j-=D,j===0&&(H--,j=y[H]),w-=D,w===0){b--;const N=Math.max(b,0);w=(0,v.getWrappedLineTrimmedLength)(p,N,this._cols)}}for(let D=0;D<p.length;D++)y[D]<s&&p[D].setCell(y[D],o);let k=E-B;for(;k-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+E,this.ybase+t-1)}if(c.length>0){const m=[],l=[];for(let H=0;H<this.lines.length;H++)l.push(this.lines.get(H));const p=this.lines.length;let x=p-1,L=0,y=c[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);let E=0;for(let H=Math.min(this.lines.maxLength-1,p+f-1);H>=0;H--)if(y&&y.start>x+E){for(let j=y.newLines.length-1;j>=0;j--)this.lines.set(H--,y.newLines[j]);H++,m.push({index:x+1,amount:y.newLines.length}),E+=y.newLines.length,y=c[++L]}else this.lines.set(H,l[x--]);let B=0;for(let H=m.length-1;H>=0;H--)m[H].index+=B,this.lines.onInsertEmitter.fire(m[H]),B+=m[H].amount;const I=Math.max(0,p+f-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(s,t,o=0,c){const f=this.lines.get(s);return f?f.translateToString(t,o,c):""}getWrappedRangeForLine(s){let t=s,o=s;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;o+1<this.lines.length&&this.lines.get(o+1).isWrapped;)o++;return{first:t,last:o}}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 t=0;t<this.markers.length;t++)this.markers[t].line===s&&(this.markers[t].dispose(),this.markers.splice(t--,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 t=new e.Marker(s);return this.markers.push(t),t.register(this.lines.onTrim((o=>{t.line-=o,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((o=>{t.line>=o.index&&(t.line+=o.amount)}))),t.register(this.lines.onDelete((o=>{t.line>=o.index&&t.line<o.index+o.amount&&t.dispose(),t.line>o.index&&(t.line-=o.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const h=a(3734),_=a(511),n=a(643),d=a(482);r.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let v=0;class g{constructor(e,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const t=i||_.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let o=0;o<e;++o)this.setCell(o,t);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,d.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,d.stringFromCodePoint)(2097151&i):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,i){return v=3*e,i.content=this._data[v+0],i.fg=this._data[v+1],i.bg=this._data[v+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,t,o,c){268435456&o&&(this._extendedAttrs[e]=c),this._data[3*e+0]=i|s<<22,this._data[3*e+1]=t,this._data[3*e+2]=o}addCodepointToCell(e,i){let s=this._data[3*e+0];2097152&s?this._combined[e]+=(0,d.stringFromCodePoint)(i):(2097151&s?(this._combined[e]=(0,d.stringFromCodePoint)(2097151&s)+(0,d.stringFromCodePoint)(i),s&=-2097152,s|=2097152):s=i|4194304,this._data[3*e+0]=s)}insertCells(e,i,s,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs),i<this.length-e){const o=new _.CellData;for(let c=this.length-e-i-1;c>=0;--c)this.setCell(e+i+c,this.loadCell(e+c,o));for(let c=0;c<i;++c)this.setCell(e+c,s)}else for(let o=e;o<this.length;++o)this.setCell(o,s);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs)}deleteCells(e,i,s,t){if(e%=this.length,i<this.length-e){const o=new _.CellData;for(let c=0;c<this.length-e-i;++c)this.setCell(e+c,this.loadCell(e+i+c,o));for(let c=this.length-i;c<this.length;++c)this.setCell(c,s)}else for(let o=e;o<this.length;++o)this.setCell(o,s);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs)}replaceCells(e,i,s,t,o=!1){if(o)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodePoint(i,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs);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,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodePoint(i,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new h.ExtendedAttrs);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 t=new Uint32Array(s);t.set(this._data),this._data=t}for(let t=this.length;t<e;++t)this.setCell(t,i)}else{this._data=this._data.subarray(0,s);const t=Object.keys(this._combined);for(let c=0;c<t.length;c++){const f=parseInt(t[c],10);f>=e&&delete this._combined[f]}const o=Object.keys(this._extendedAttrs);for(let c=0;c<o.length;c++){const f=parseInt(o[c],10);f>=e&&delete this._extendedAttrs[f]}}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 g(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,t,o){const c=e._data;if(o)for(let m=t-1;m>=0;m--){for(let l=0;l<3;l++)this._data[3*(s+m)+l]=c[3*(i+m)+l];268435456&c[3*(i+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[i+m])}else for(let m=0;m<t;m++){for(let l=0;l<3;l++)this._data[3*(s+m)+l]=c[3*(i+m)+l];268435456&c[3*(i+m)+2]&&(this._extendedAttrs[s+m]=e._extendedAttrs[i+m])}const f=Object.keys(e._combined);for(let m=0;m<f.length;m++){const l=parseInt(f[m],10);l>=i&&(this._combined[l-i+s]=e._combined[l])}}translateToString(e=!1,i=0,s=this.length){e&&(s=Math.min(s,this.getTrimmedLength()));let t="";for(;i<s;){const o=this._data[3*i+0],c=2097151&o;t+=2097152&o?this._combined[i]:c?(0,d.stringFromCodePoint)(c):n.WHITESPACE_CELL_CHAR,i+=o>>22||1}return t}}r.BufferLine=g},4841:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.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:(A,r)=>{function a(h,_,n){if(_===h.length-1)return h[_].getTrimmedLength();const d=!h[_].hasContent(n-1)&&h[_].getWidth(n-1)===1,v=h[_+1].getWidth(0)===2;return d&&v?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(h,_,n,d,v){const g=[];for(let u=0;u<h.length-1;u++){let e=u,i=h.get(++e);if(!i.isWrapped)continue;const s=[h.get(u)];for(;e<h.length&&i.isWrapped;)s.push(i),i=h.get(++e);if(d>=u&&d<e){u+=s.length-1;continue}let t=0,o=a(s,t,_),c=1,f=0;for(;c<s.length;){const l=a(s,c,_),p=l-f,x=n-o,L=Math.min(p,x);s[t].copyCellsFrom(s[c],f,o,L,!1),o+=L,o===n&&(t++,o=0),f+=L,f===l&&(c++,f=0),o===0&&t!==0&&s[t-1].getWidth(n-1)===2&&(s[t].copyCellsFrom(s[t-1],n-1,o++,1,!1),s[t-1].setCell(n-1,v))}s[t].replaceCells(o,n,v);let m=0;for(let l=s.length-1;l>0&&(l>t||s[l].getTrimmedLength()===0);l--)m++;m>0&&(g.push(u+s.length-m),g.push(m)),u+=s.length-1}return g},r.reflowLargerCreateNewLayout=function(h,_){const n=[];let d=0,v=_[d],g=0;for(let u=0;u<h.length;u++)if(v===u){const e=_[++d];h.onDeleteEmitter.fire({index:u-g,amount:e}),u+=e-1,g+=e,v=_[++d]}else n.push(u);return{layout:n,countRemoved:g}},r.reflowLargerApplyNewLayout=function(h,_){const n=[];for(let d=0;d<_.length;d++)n.push(h.get(_[d]));for(let d=0;d<n.length;d++)h.set(d,n[d]);h.length=_.length},r.reflowSmallerGetNewLineLengths=function(h,_,n){const d=[],v=h.map(((i,s)=>a(h,s,_))).reduce(((i,s)=>i+s));let g=0,u=0,e=0;for(;e<v;){if(v-e<n){d.push(v-e);break}g+=n;const i=a(h,u,_);g>i&&(g-=i,u++);const s=h[u].getWidth(g-1)===2;s&&g--;const t=s?n-1:n;d.push(t),e+=t}return d},r.getWrappedLineTrimmedLength=a},5295:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const h=a(8460),_=a(844),n=a(9092);class d extends _.Disposable{constructor(g,u){super(),this._optionsService=g,this._bufferService=u,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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,u){this._normal.resize(g,u),this._alt.resize(g,u),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=d},511:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const h=a(482),_=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const u=new d;return u.setFromCharData(g),u}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(g){this.fg=g[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(g[_.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(g[_.CHAR_DATA_CHAR_INDEX].length===2){const e=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const i=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(e-55296)+i-56320+65536|g[_.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[_.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=g[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=d},643:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const h=a(8460),_=a(844);class n{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=n,n._nextId=1},7116:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(A,r)=>{var a,h,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.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=`
43
+ `,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||(r.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||(r.C1=h={})),(function(n){n.ST=`${a.ESC}\\`})(_||(r.C1_ESCAPED=_={}))},7399:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const h=a(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(n,d,v,g){const u={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"?u.key=d?h.C0.ESC+"OA":h.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?u.key=d?h.C0.ESC+"OD":h.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?u.key=d?h.C0.ESC+"OC":h.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(u.key=d?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(n.altKey){u.key=h.C0.ESC+h.C0.DEL;break}u.key=h.C0.DEL;break;case 9:if(n.shiftKey){u.key=h.C0.ESC+"[Z";break}u.key=h.C0.HT,u.cancel=!0;break;case 13:u.key=n.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,u.cancel=!0;break;case 27:u.key=h.C0.ESC,n.altKey&&(u.key=h.C0.ESC+h.C0.ESC),u.cancel=!0;break;case 37:if(n.metaKey)break;e?(u.key=h.C0.ESC+"[1;"+(e+1)+"D",u.key===h.C0.ESC+"[1;3D"&&(u.key=h.C0.ESC+(v?"b":"[1;5D"))):u.key=d?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(u.key=h.C0.ESC+"[1;"+(e+1)+"C",u.key===h.C0.ESC+"[1;3C"&&(u.key=h.C0.ESC+(v?"f":"[1;5C"))):u.key=d?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(u.key=h.C0.ESC+"[1;"+(e+1)+"A",v||u.key!==h.C0.ESC+"[1;3A"||(u.key=h.C0.ESC+"[1;5A")):u.key=d?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(u.key=h.C0.ESC+"[1;"+(e+1)+"B",v||u.key!==h.C0.ESC+"[1;3B"||(u.key=h.C0.ESC+"[1;5B")):u.key=d?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(u.key=h.C0.ESC+"[2~");break;case 46:u.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:u.key=e?h.C0.ESC+"[1;"+(e+1)+"H":d?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:u.key=e?h.C0.ESC+"[1;"+(e+1)+"F":d?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:n.shiftKey?u.type=2:n.ctrlKey?u.key=h.C0.ESC+"[5;"+(e+1)+"~":u.key=h.C0.ESC+"[5~";break;case 34:n.shiftKey?u.type=3:n.ctrlKey?u.key=h.C0.ESC+"[6;"+(e+1)+"~":u.key=h.C0.ESC+"[6~";break;case 112:u.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:u.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:u.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:u.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:u.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:u.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:u.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:u.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:u.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:u.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:u.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:u.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(v&&!g||!n.altKey||n.metaKey)!v||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?u.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(u.key=h.C0.US),n.key==="@"&&(u.key=h.C0.NUL)):n.keyCode===65&&(u.type=1);else{const i=_[n.keyCode],s=i==null?void 0:i[n.shiftKey?1:0];if(s)u.key=h.C0.ESC+s;else if(n.keyCode>=65&&n.keyCode<=90){const t=n.ctrlKey?n.keyCode-64:n.keyCode+32;let o=String.fromCharCode(t);n.shiftKey&&(o=o.toUpperCase()),u.key=h.C0.ESC+o}else if(n.keyCode===32)u.key=h.C0.ESC+(n.ctrlKey?h.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let t=n.code.slice(3,4);n.shiftKey||(t=t.toLowerCase()),u.key=h.C0.ESC+t,u.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?u.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?u.key=h.C0.NUL:n.keyCode>=51&&n.keyCode<=55?u.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?u.key=h.C0.DEL:n.keyCode===219?u.key=h.C0.ESC:n.keyCode===220?u.key=h.C0.FS:n.keyCode===221&&(u.key=h.C0.GS)}return u}},482:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,h=0,_=a.length){let n="";for(let d=h;d<_;++d){let v=a[d];v>65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const _=a.length;if(!_)return 0;let n=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?h[n++]=1024*(this._interim-55296)+v-56320+65536:(h[n++]=this._interim,h[n++]=v),this._interim=0}for(let v=d;v<_;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=_)return this._interim=g,n;const u=a.charCodeAt(v);56320<=u&&u<=57343?h[n++]=1024*(g-55296)+u-56320+65536:(h[n++]=g,h[n++]=u)}else g!==65279&&(h[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const _=a.length;if(!_)return 0;let n,d,v,g,u=0,e=0,i=0;if(this.interim[0]){let o=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let f,m=0;for(;(f=63&this.interim[++m])&&m<4;)c<<=6,c|=f;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=l-m;for(;i<p;){if(i>=_)return 0;if(f=a[i++],(192&f)!=128){i--,o=!0;break}this.interim[m++]=f,c<<=6,c|=63&f}o||(l===2?c<128?i--:h[u++]=c:l===3?c<2048||c>=55296&&c<=57343||c===65279||(h[u++]=c):c<65536||c>1114111||(h[u++]=c)),this.interim.fill(0)}const s=_-4;let t=i;for(;t<_;){for(;!(!(t<s)||128&(n=a[t])||128&(d=a[t+1])||128&(v=a[t+2])||128&(g=a[t+3]));)h[u++]=n,h[u++]=d,h[u++]=v,h[u++]=g,t+=4;if(n=a[t++],n<128)h[u++]=n;else if((224&n)==192){if(t>=_)return this.interim[0]=n,u;if(d=a[t++],(192&d)!=128){t--;continue}if(e=(31&n)<<6|63&d,e<128){t--;continue}h[u++]=e}else if((240&n)==224){if(t>=_)return this.interim[0]=n,u;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,u;if(v=a[t++],(192&v)!=128){t--;continue}if(e=(15&n)<<12|(63&d)<<6|63&v,e<2048||e>=55296&&e<=57343||e===65279)continue;h[u++]=e}else if((248&n)==240){if(t>=_)return this.interim[0]=n,u;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,u;if(v=a[t++],(192&v)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=v,u;if(g=a[t++],(192&g)!=128){t--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&v)<<6|63&g,e<65536||e>1114111)continue;h[u++]=e}}return u}}},225:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const a=[[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]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;r.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let n=0;n<a.length;++n)_.fill(0,a[n][0],a[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?_[n]:(function(d,v){let g,u=0,e=v.length-1;if(d<v[0][0]||d>v[e][1])return!1;for(;e>=u;)if(g=u+e>>1,d>v[g][1])u=g+1;else{if(!(d<v[g][0]))return!0;e=g-1}return!1})(n,h)?0:n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}}},5981:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const h=a(8460),_=a(844);class n extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g)}_innerWrite(v=0,g=!0){const u=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],i=this._action(e,g);if(i){const t=o=>Date.now()-u>=12?setTimeout((()=>this._innerWrite(0,o))):this._innerWrite(u,o);return void i.catch((o=>(queueMicrotask((()=>{throw o})),Promise.resolve(!1)))).then(t)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-u>=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()}}r.WriteBuffer=n},5941:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.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 _(n,d){const v=n.toString(16),g=v.length<2?"0"+v:v;switch(d){case 4:return v[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const v=a.exec(d);if(v){const g=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/g*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/g*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),h.exec(d)&&[3,6,9,12].includes(d.length))){const v=d.length/3,g=[0,0,0];for(let u=0;u<3;++u){const e=parseInt(d.slice(v*u,v*u+v),16);g[u]=v===1?e<<4:v===2?e:v===3?e>>4:e>>8}return g}},r.toRgbString=function(n,d=16){const[v,g,u]=n;return`rgb:${_(v,d)}/${_(g,d)}/${_(u,d)}`}},5770:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const h=a(482),_=a(8742),n=a(5770),d=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,u){this._handlers[g]===void 0&&(this._handlers[g]=[]);const e=this._handlers[g];return e.push(u),{dispose:()=>{const i=e.indexOf(u);i!==-1&&e.splice(i,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,u){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(g,u,e){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(g,u,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(g,u,e))}unhook(g,u=!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=u,s=this._stack.fallThrough,this._stack.paused=!1),!s&&e===!1){for(;i>=0&&(e=this._active[i].unhook(g),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",g);this._active=d,this._ident=0}};const v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=v,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():v,this._data="",this._hitLimit=!1}put(g,u,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(g,u,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let u=!1;if(this._hitLimit)u=!1;else if(g&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then((e=>(this._params=v,this._data="",this._hitLimit=!1,e)));return this._params=v,this._data="",this._hitLimit=!1,u}}},2015:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const h=a(844),_=a(8742),n=a(6242),d=a(6351);class v{constructor(i){this.table=new Uint8Array(i)}setDefault(i,s){this.table.fill(i<<4|s)}add(i,s,t,o){this.table[s<<8|i]=t<<4|o}addMany(i,s,t,o){for(let c=0;c<i.length;c++)this.table[s<<8|i[c]]=t<<4|o}}r.TransitionTable=v;const g=160;r.VT500_TRANSITION_TABLE=(function(){const e=new v(4095),i=Array.apply(null,Array(256)).map(((m,l)=>l)),s=(m,l)=>i.slice(m,l),t=s(32,127),o=s(0,24);o.push(25),o.push.apply(o,s(28,32));const c=s(0,14);let f;for(f in e.setDefault(1,0),e.addMany(t,0,2,0),c)e.addMany([24,26,153,154],f,3,0),e.addMany(s(128,144),f,3,0),e.addMany(s(144,152),f,3,0),e.add(156,f,0,0),e.add(27,f,11,1),e.add(157,f,4,8),e.addMany([152,158,159],f,0,7),e.add(155,f,11,3),e.add(144,f,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(t,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(t,7,0,7),e.addMany(o,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(o,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(o,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(o,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(o,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(o,13,13,13),e.addMany(t,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(g,0,2,0),e.add(g,8,5,8),e.add(g,6,0,6),e.add(g,11,0,11),e.add(g,13,13,13),e})();class u extends h.Disposable{constructor(i=r.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 _.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(s,t,o)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,t)=>{},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 d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(i,s=[64,126]){let t=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=i.prefix.charCodeAt(0),t&&60>t||t>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 c=0;c<i.intermediates.length;++c){const f=i.intermediates.charCodeAt(c);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=f}}if(i.final.length!==1)throw new Error("final must be a single byte");const o=i.final.charCodeAt(0);if(s[0]>o||o>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return t<<=8,t|=o,t}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 t=this._identifier(i,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const o=this._escHandlers[t];return o.push(s),{dispose:()=>{const c=o.indexOf(s);c!==-1&&o.splice(c,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 t=this._identifier(i);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const o=this._csiHandlers[t];return o.push(s),{dispose:()=>{const c=o.indexOf(s);c!==-1&&o.splice(c,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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(i,s,t,o,c){this._parseStack.state=i,this._parseStack.handlers=s,this._parseStack.handlerPos=t,this._parseStack.transition=o,this._parseStack.chunkPos=c}parse(i,s,t){let o,c=0,f=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(t===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 p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&p>-1){for(;p>=0&&(o=l[p](this._params),o!==!0);p--)if(o instanceof Promise)return this._parseStack.handlerPos=p,o}this._parseStack.handlers=[];break;case 4:if(t===!1&&p>-1){for(;p>=0&&(o=l[p](),o!==!0);p--)if(o instanceof Promise)return this._parseStack.handlerPos=p,o}this._parseStack.handlers=[];break;case 6:if(c=i[this._parseStack.chunkPos],o=this._dcsParser.unhook(c!==24&&c!==26,t),o)return o;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=i[this._parseStack.chunkPos],o=this._oscParser.end(c!==24&&c!==26,t),o)return o;c===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.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let l=m;l<s;++l){switch(c=i[l],f=this._transitions.table[this.currentState<<8|(c<160?c:g)],f>>4){case 2:for(let E=l+1;;++E){if(E>=s||(c=i[E])<32||c>126&&c<g){this._printHandler(i,l,E),l=E-1;break}if(++E>=s||(c=i[E])<32||c>126&&c<g){this._printHandler(i,l,E),l=E-1;break}if(++E>=s||(c=i[E])<32||c>126&&c<g){this._printHandler(i,l,E),l=E-1;break}if(++E>=s||(c=i[E])<32||c>126&&c<g){this._printHandler(i,l,E),l=E-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const p=this._csiHandlers[this._collect<<8|c];let x=p?p.length-1:-1;for(;x>=0&&(o=p[x](this._params),o!==!0);x--)if(o instanceof Promise)return this._preserveStack(3,p,x,f,l),o;x<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++l<s&&(c=i[l])>47&&c<60);l--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const L=this._escHandlers[this._collect<<8|c];let y=L?L.length-1:-1;for(;y>=0&&(o=L[y](),o!==!0);y--)if(o instanceof Promise)return this._preserveStack(4,L,y,f,l),o;y<0&&this._escHandlerFb(this._collect<<8|c),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|c,this._params);break;case 13:for(let E=l+1;;++E)if(E>=s||(c=i[E])===24||c===26||c===27||c>127&&c<g){this._dcsParser.put(i,l,E),l=E-1;break}break;case 14:if(o=this._dcsParser.unhook(c!==24&&c!==26),o)return this._preserveStack(6,[],0,f,l),o;c===27&&(f|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let E=l+1;;E++)if(E>=s||(c=i[E])<32||c>127&&c<g){this._oscParser.put(i,l,E),l=E-1;break}break;case 6:if(o=this._oscParser.end(c!==24&&c!==26),o)return this._preserveStack(5,[],0,f,l),o;c===27&&(f|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&f}}}r.EscapeSequenceParser=u},6242:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const h=a(5770),_=a(482),n=[];r.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,v){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(v),{dispose:()=>{const u=g.indexOf(v);u!==-1&&g.splice(u,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,v,g){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(d,v,g);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(d,v,g))}start(){this.reset(),this._state=1}put(d,v,g){if(this._state!==3){if(this._state===1)for(;v<g;){const u=d[v++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&g-v>0&&this._put(d,v,g)}}end(d,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,u=this._active.length-1,e=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,g=v,e=this._stack.fallThrough,this._stack.paused=!1),!e&&g===!1){for(;u>=0&&(g=this._active[u].end(d),g!==!0);u--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,g;u--}for(;u>=0;u--)if(g=this._active[u].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,v,g){this._hitLimit||(this._data+=(0,_.utf32ToString)(d,v,g),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let v=!1;if(this._hitLimit)v=!1;else if(d&&(v=this._handler(this._data),v instanceof Promise))return v.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,v}}},8742:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const a=2147483647;class h{static fromArray(n){const d=new h;if(!n.length)return d;for(let v=Array.isArray(n[0])?1:0;v<n.length;++v){const g=n[v];if(Array.isArray(g))for(let u=0;u<g.length;++u)d.addSubParam(g[u]);else d.addParam(g)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new 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 d=0;d<this.length;++d){n.push(this.params[d]);const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&n.push(Array.prototype.slice.call(this._subParams,v,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,v=255&this._subParamsIdx[n];return v-d>0?this._subParams.subarray(d,v):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&(n[d]=this._subParams.slice(v,g))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,g=v[d-1];v[d-1]=~g?Math.min(10*g+n,a):n}}r.Params=h},5741:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.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 _={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(_),h.dispose=()=>this._wrappedAddonDispose(_),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){h=_;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:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const h=a(3785),_=a(511);r.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const d=this._buffer.lines.get(n);if(d)return new h.BufferLineApiView(d)}getNullCell(){return new _.CellData}}},3785:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const h=a(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,n){if(!(_<0||_>=this._line.length))return n?(this._line.loadCell(_,n),n):this._line.loadCell(_,new h.CellData)}translateToString(_,n,d){return this._line.translateToString(_,n,d)}}},8285:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const h=a(8771),_=a(8460),n=a(844);class d extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new _.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)}}r.BufferNamespaceApi=d},7975:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,(_=>h(_.toArray())))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,((_,n)=>h(_,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:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.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(A,r,a){var h=this&&this.__decorate||function(e,i,s,t){var o,c=arguments.length,f=c<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,s,t);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(f=(c<3?o(f):c>3?o(i,s,f):o(i,s))||f);return c>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(e,i){return function(s,t){i(s,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),v=a(5295),g=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let u=r.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.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 t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===e.fg&&t.getBg(0)===e.bg||(t=s.getBlankLine(e,i),this._cachedBlankLine=t),t.isWrapped=i;const o=s.ybase+s.scrollTop,c=s.ybase+s.scrollBottom;if(s.scrollTop===0){const f=s.lines.isFull;c===s.lines.length-1?f?s.lines.recycle().copyFrom(t):s.lines.push(t.clone()):s.lines.splice(c+1,0,t.clone()),f?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const f=c-o+1;s.lines.shiftElements(o+1,f-1,-1),s.lines.set(c,t.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,i,s){const t=this.buffer;if(e<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else e+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const o=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+e,t.ybase),0),o!==t.ydisp&&(i||this._onScroll.fire(t.ydisp))}};r.BufferService=u=h([_(0,g.IOptionsService)],u)},7994:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(A,r,a){var h=this&&this.__decorate||function(t,o,c,f){var m,l=arguments.length,p=l<3?o:f===null?f=Object.getOwnPropertyDescriptor(o,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,o,c,f);else for(var x=t.length-1;x>=0;x--)(m=t[x])&&(p=(l<3?m(p):l>3?m(o,c,p):m(o,c))||p);return l>3&&p&&Object.defineProperty(o,c,p),p},_=this&&this.__param||function(t,o){return function(c,f){o(c,f,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const n=a(2585),d=a(8460),v=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function u(t,o){let c=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(c|=64,c|=t.action):(c|=3&t.button,4&t.button&&(c|=64),8&t.button&&(c|=128),t.action===32?c|=32:t.action!==0||o||(c|=3)),c}const e=String.fromCharCode,i={DEFAULT:t=>{const o=[u(t,!1)+32,t.col+32,t.row+32];return o[0]>255||o[1]>255||o[2]>255?"":`\x1B[M${e(o[0])}${e(o[1])}${e(o[2])}`},SGR:t=>{const o=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.col};${t.row}${o}`},SGR_PIXELS:t=>{const o=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.x};${t.y}${o}`}};let s=r.CoreMouseService=class extends v.Disposable{constructor(t,o){super(),this._bufferService=t,this._coreService=o,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(g))this.addProtocol(c,g[c]);for(const c of Object.keys(i))this.addEncoding(c,i[c]);this.reset()}addProtocol(t,o){this._protocols[t]=o}addEncoding(t,o){this._encodings[t]=o}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const o=this._encodings[this._activeEncoding](t);return o&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(o):this._coreService.triggerDataEvent(o,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,o,c){if(c){if(t.x!==o.x||t.y!==o.y)return!1}else if(t.col!==o.col||t.row!==o.row)return!1;return t.button===o.button&&t.action===o.action&&t.ctrl===o.ctrl&&t.alt===o.alt&&t.shift===o.shift}};r.CoreMouseService=s=h([_(0,n.IBufferService),_(1,n.ICoreService)],s)},6975:function(A,r,a){var h=this&&this.__decorate||function(s,t,o,c){var f,m=arguments.length,l=m<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,t,o,c);else for(var p=s.length-1;p>=0;p--)(f=s[p])&&(l=(m<3?f(l):m>3?f(t,o,l):f(t,o))||l);return m>3&&l&&Object.defineProperty(t,o,l),l},_=this&&this.__param||function(s,t){return function(o,c){t(o,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const n=a(1439),d=a(8460),v=a(844),g=a(2585),u=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=r.CoreService=class extends v.Disposable{constructor(s,t,o){super(),this._bufferService=s,this._logService=t,this._optionsService=o,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(u),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(u),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(s,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const o=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&o.ybase!==o.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((c=>c.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(s))}};r.CoreService=i=h([_(0,g.IBufferService),_(1,g.ILogService),_(2,g.IOptionsService)],i)},9074:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const h=a(8055),_=a(8460),n=a(844),d=a(6106);let v=0,g=0;class u extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const t=new e(s);if(t){const o=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),o.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,t,o){var c,f,m;let l=0,p=0;for(const x of this._decorations.getKeyIterator(t))l=(c=x.options.x)!==null&&c!==void 0?c:0,p=l+((f=x.options.width)!==null&&f!==void 0?f:1),s>=l&&s<p&&(!o||((m=x.options.layer)!==null&&m!==void 0?m:"bottom")===o)&&(yield x)}forEachDecorationAtCell(s,t,o,c){this._decorations.forEachByKey(t,(f=>{var m,l,p;v=(m=f.options.x)!==null&&m!==void 0?m:0,g=v+((l=f.options.width)!==null&&l!==void 0?l:1),s>=v&&s<g&&(!o||((p=f.options.layer)!==null&&p!==void 0?p:"bottom")===o)&&c(f)}))}}r.DecorationService=u;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 _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.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:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const h=a(2585),_=a(8343);class n{constructor(...v){this._entries=new Map;for(const[g,u]of v)this.set(g,u)}set(v,g){const u=this._entries.get(v);return this._entries.set(v,g),u}forEach(v){for(const[g,u]of this._entries.entries())v(g,u)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=n,r.InstantiationService=class{constructor(){this._services=new n,this._services.set(h.IInstantiationService,this)}setService(d,v){this._services.set(d,v)}getService(d){return this._services.get(d)}createInstance(d,...v){const g=(0,_.getServiceDependencies)(d).sort(((i,s)=>i.index-s.index)),u=[];for(const i of g){const s=this._services.get(i.id);if(!s)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${i.id}.`);u.push(s)}const e=g.length>0?g[0].index:v.length;if(v.length!==e)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${e+1} conflicts with ${v.length} static arguments`);return new d(...v,...u)}}},7866:function(A,r,a){var h=this&&this.__decorate||function(e,i,s,t){var o,c=arguments.length,f=c<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,s,t);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(f=(c<3?o(f):c>3?o(i,s,f):o(i,s))||f);return c>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(e,i){return function(s,t){i(s,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=a(844),d=a(2585),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,u=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let 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){var s,t;this._logLevel<=d.LogLevelEnum.TRACE&&this._log((t=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.trace.bind(this._optionsService.options.logger))!==null&&t!==void 0?t:console.log,e,i)}debug(e,...i){var s,t;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log((t=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.debug.bind(this._optionsService.options.logger))!==null&&t!==void 0?t:console.log,e,i)}info(e,...i){var s,t;this._logLevel<=d.LogLevelEnum.INFO&&this._log((t=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.info.bind(this._optionsService.options.logger))!==null&&t!==void 0?t:console.info,e,i)}warn(e,...i){var s,t;this._logLevel<=d.LogLevelEnum.WARN&&this._log((t=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.warn.bind(this._optionsService.options.logger))!==null&&t!==void 0?t:console.warn,e,i)}error(e,...i){var s,t;this._logLevel<=d.LogLevelEnum.ERROR&&this._log((t=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.error.bind(this._optionsService.options.logger))!==null&&t!==void 0?t:console.error,e,i)}};r.LogService=u=h([_(0,d.IOptionsService)],u),r.setTraceLogger=function(e){g=e},r.traceCall=function(e,i,s){if(typeof s.value!="function")throw new Error("not supported");const t=s.value;s.value=function(...o){if(g.logLevel!==d.LogLevelEnum.TRACE)return t.apply(this,o);g.trace(`GlyphRenderer#${t.name}(${o.map((f=>JSON.stringify(f))).join(", ")})`);const c=t.apply(this,o);return g.trace(`GlyphRenderer#${t.name} return`,c),c}}},7302:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const h=a(8460),_=a(844),n=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(u){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},r.DEFAULT_OPTIONS);for(const i in u)if(i in e)try{const s=u[i];e[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(u,e){return this.onOptionChange((i=>{i===u&&e(this.rawOptions[u])}))}onMultipleOptionChange(u,e){return this.onOptionChange((i=>{u.indexOf(i)!==-1&&e()}))}_setupOptions(){const u=i=>{if(!(i in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},e=(i,s)=>{if(!(i in r.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:u.bind(this,i),set:e.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(u,e){switch(u){case"cursorStyle":if(e||(e=r.DEFAULT_OPTIONS[u]),!(function(i){return i==="block"||i==="underline"||i==="bar"})(e))throw new Error(`"${e}" is not a valid value for ${u}`);break;case"wordSeparator":e||(e=r.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=d.includes(e)?e:r.DEFAULT_OPTIONS[u];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${u} 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(`${u} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${u} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}r.OptionsService=v},2660:function(A,r,a){var h=this&&this.__decorate||function(v,g,u,e){var i,s=arguments.length,t=s<3?g:e===null?e=Object.getOwnPropertyDescriptor(g,u):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(v,g,u,e);else for(var o=v.length-1;o>=0;o--)(i=v[o])&&(t=(s<3?i(t):s>3?i(g,u,t):i(g,u))||t);return s>3&&t&&Object.defineProperty(g,u,t),t},_=this&&this.__param||function(v,g){return function(u,e){g(u,e,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const n=a(2585);let d=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const g=this._bufferService.buffer;if(v.id===void 0){const o=g.addMarker(g.ybase+g.y),c={data:v,id:this._nextId++,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(c,o))),this._dataByLinkId.set(c.id,c),c.id}const u=v,e=this._getEntryIdKey(u),i=this._entriesWithId.get(e);if(i)return this.addLineToLink(i.id,g.ybase+g.y),i.id;const s=g.addMarker(g.ybase+g.y),t={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(t,s))),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(v,g){const u=this._dataByLinkId.get(v);if(u&&u.lines.every((e=>e.line!==g))){const e=this._bufferService.buffer.addMarker(g);u.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(u,e)))}}getLinkData(v){var g;return(g=this._dataByLinkId.get(v))===null||g===void 0?void 0:g.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,g){const u=v.lines.indexOf(g);u!==-1&&(v.lines.splice(u,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=d=h([_(0,n.IBufferService)],d)},8343:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const a="di$target",h="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[h]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const n=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,e,i){e[a]===e?e[h].push({id:u,index:i}):(e[h]=[{id:u,index:i}],e[a]=e)})(n,d,g)};return n.toString=()=>_,r.serviceRegistry.set(_,n),n}},2585:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const h=a(8343);var _;r.IBufferService=(0,h.createDecorator)("BufferService"),r.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),r.ICoreService=(0,h.createDecorator)("CoreService"),r.ICharsetService=(0,h.createDecorator)("CharsetService"),r.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"})(_||(r.LogLevelEnum=_={})),r.ILogService=(0,h.createDecorator)("LogService"),r.IOptionsService=(0,h.createDecorator)("OptionsService"),r.IOscLinkService=(0,h.createDecorator)("OscLinkService"),r.IUnicodeService=(0,h.createDecorator)("UnicodeService"),r.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(A,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const h=a(8460),_=a(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const n=new _.UnicodeV6;this.register(n),this._active=n.version,this._activeProvider=n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(n){if(!this._providers[n])throw new Error(`unknown Unicode version "${n}"`);this._active=n,this._activeProvider=this._providers[n],this._onChange.fire(n)}register(n){this._providers[n.version]=n}wcwidth(n){return this._activeProvider.wcwidth(n)}getStringCellWidth(n){let d=0;const v=n.length;for(let g=0;g<v;++g){let u=n.charCodeAt(g);if(55296<=u&&u<=56319){if(++g>=v)return d+this.wcwidth(u);const e=n.charCodeAt(g);56320<=e&&e<=57343?u=1024*(u-55296)+e-56320+65536:d+=this.wcwidth(e)}d+=this.wcwidth(u)}return d}}}},K={};function T(A){var r=K[A];if(r!==void 0)return r.exports;var a=K[A]={exports:{}};return F[A].call(a.exports,a,a.exports,T),a.exports}var J={};return(()=>{var A=J;Object.defineProperty(A,"__esModule",{value:!0}),A.Terminal=void 0;const r=T(9042),a=T(3236),h=T(844),_=T(5741),n=T(8285),d=T(7975),v=T(7090),g=["cols","rows"];class u extends h.Disposable{constructor(i){super(),this._core=this.register(new a.Terminal(i)),this._addonManager=this.register(new _.AddonManager),this._publicOptions=Object.assign({},this._core.options);const s=o=>this._core.options[o],t=(o,c)=>{this._checkReadonlyOptions(o),this._core.options[o]=c};for(const o in this._core.options){const c={get:s.bind(this,o),set:t.bind(this,o)};Object.defineProperty(this._publicOptions,o,c)}}_checkReadonlyOptions(i){if(g.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 d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const 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()}resize(i,s){this._verifyIntegers(i,s),this._core.resize(i,s)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(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){var s,t,o;return this._checkProposedApi(),this._verifyPositiveIntegers((s=i.x)!==null&&s!==void 0?s:0,(t=i.width)!==null&&t!==void 0?t:0,(o=i.height)!==null&&o!==void 0?o:0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,s,t){this._verifyIntegers(i,s,t),this._core.select(i,s,t)}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
44
+ `,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 r}_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")}}A.Terminal=u})(),J})()))})(Ce)),Ce.exports}var nt=rt(),xe={exports:{}},Re;function ot(){return Re||(Re=1,(function(G,$){(function(F,K){G.exports=K()})(self,(()=>(()=>{var F={};return(()=>{var K=F;Object.defineProperty(K,"__esModule",{value:!0}),K.FitAddon=void 0,K.FitAddon=class{activate(T){this._terminal=T}dispose(){}fit(){const T=this.proposeDimensions();if(!T||!this._terminal||isNaN(T.cols)||isNaN(T.rows))return;const J=this._terminal._core;this._terminal.rows===T.rows&&this._terminal.cols===T.cols||(J._renderService.clear(),this._terminal.resize(T.cols,T.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const T=this._terminal._core,J=T._renderService.dimensions;if(J.css.cell.width===0||J.css.cell.height===0)return;const A=this._terminal.options.scrollback===0?0:T.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(r.getPropertyValue("height")),h=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),n=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),d=h-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-A;return{cols:Math.max(2,Math.floor(d/J.css.cell.width)),rows:Math.max(1,Math.floor(n/J.css.cell.height))}}}})(),F})()))})(xe)),xe.exports}var at=ot();class lt{constructor($){ve(this,"ws",null);ve(this,"reconnectAttempts",0);ve(this,"maxReconnectAttempts",10);ve(this,"reconnectTimer",null);ve(this,"disposed",!1);ve(this,"options");this.options=$}getLocation(){return window.location}connect(){var J,A;if(this.disposed)return;const{taskId:$}=this.options,F=this.getLocation(),T=`${F.protocol==="https:"?"wss:":"ws:"}//${F.host}/ws/pty/${$}`;(A=(J=this.options).onStatus)==null||A.call(J,"connecting"),this.ws=new WebSocket(T),this.ws.onopen=()=>{var r,a;this.reconnectAttempts=0,this.send({type:"auth",token:this.options.accessToken,channelToken:this.options.channelToken}),(a=(r=this.options).onStatus)==null||a.call(r,"connected")},this.ws.onmessage=r=>{var a,h;try{const _=JSON.parse(r.data);_.type==="data"&&this.options.onData&&this.options.onData(_.data),(h=(a=this.options).onMessage)==null||h.call(a,_)}catch{}},this.ws.onclose=()=>{var r,a;(a=(r=this.options).onStatus)==null||a.call(r,"disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var r;(r=this.ws)==null||r.close()}}send($){var F;((F=this.ws)==null?void 0:F.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify($))}sendData($){this.send({type:"data",data:$})}sendResize($,F){this.send({type:"resize",cols:$,rows:F})}requestTakeover($){this.send({type:"request_takeover",sessionId:$})}releaseTakeover(){this.send({type:"release_takeover"})}updateAuth($,F){this.options.accessToken=$,this.options.channelToken=F}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const $=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(async()=>{if(!this.disposed){if(this.options.getChannelToken)try{this.options.channelToken=await this.options.getChannelToken()}catch{this.scheduleReconnect();return}this.connect()}},$)}dispose(){var $;this.disposed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),($=this.ws)==null||$.close(),this.ws=null}}const Ae=z.forwardRef(function({taskId:$,sessionId:F,taskFinished:K,onStatusChange:T,onTakeoverChange:J},A){const r=z.useRef(null),a=z.useRef(null),h=z.useRef(null),_=z.useRef(null),[n,d]=z.useState("observer"),[v,g]=z.useState(!1),[u,e]=z.useState(0),i=We(t=>t.accessToken);z.useImperativeHandle(A,()=>({requestTakeover(){var t;(t=_.current)==null||t.send({type:"force_takeover"}),g(!0)},releaseTakeover(){var t;(t=_.current)==null||t.releaseTakeover(),d("observer")}}),[]),z.useEffect(()=>{const t=u>0&&n==="observer"?"denied":v?"requesting":n==="writer"?"manual":"auto";J==null||J(t)},[n,v,u,J]);const s=z.useCallback(async()=>(await ce.post(`web/tasks/${$}/pty-token`).json()).channelToken,[$]);return z.useEffect(()=>{if(!r.current)return;const t=new nt.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Fira Code", "Cascadia Code", Menlo, monospace',theme:{background:"#0c0c0c",foreground:"#d4d4d4",cursor:"#d4d4d4"},scrollback:5e3,convertEol:!0}),o=new at.FitAddon;t.loadAddon(o),t.open(r.current);try{o.fit()}catch{}a.current=t,h.current=o;const c=new ResizeObserver(()=>{try{o.fit()}catch{}});return c.observe(r.current),()=>{c.disconnect(),t.dispose(),a.current=null,h.current=null}},[]),z.useEffect(()=>{if(!i||K)return;let t=!1;async function o(){try{const c=await s();if(t)return;const f=new lt({taskId:$,accessToken:i,channelToken:c,getChannelToken:s,onData:m=>{var l;(l=a.current)==null||l.write(m)},onMessage:m=>{switch(m.type){case"takeover_granted":d("writer"),g(!1),e(0);break;case"takeover_denied":g(!1),e(p=>p+1);break;case"writer_revoked":d("observer"),e(0);break}},onStatus:m=>{if(t||T==null||T(m),m==="connected"){const l=a.current;l&&f.sendResize(l.cols,l.rows)}}});_.current=f,f.connect()}catch{}}return o(),()=>{var c;t=!0,(c=_.current)==null||c.dispose(),_.current=null}},[$,i,K,s,T]),z.useEffect(()=>{const t=a.current;if(!t)return;const o=t.onData(f=>{const m=_.current;m&&(n==="writer"?m.sendData(f):!v&&F&&(g(!0),m.requestTakeover(F)))}),c=t.onResize(({cols:f,rows:m})=>{var l;(l=_.current)==null||l.sendResize(f,m)});return()=>{o.dispose(),c.dispose()}},[n,v,F]),C.jsx("div",{ref:r,className:"h-full w-full bg-[#0c0c0c] p-1"})});function Te({isOpen:G,onClose:$,taskId:F,stageIndex:K,stageName:T,mode:J,prompt:A,choices:r,defaultChoice:a,timeoutSeconds:h,onSubmitted:_}){const{t:n}=be(),[d,v]=z.useState(h),[g,u]=z.useState(a??""),[e,i]=z.useState(""),[s,t]=z.useState(!1);z.useEffect(()=>{if(!G)return;v(h);const f=setInterval(()=>{v(m=>m<=1?(clearInterval(f),0):m-1)},1e3);return()=>clearInterval(f)},[G,h]),z.useEffect(()=>{d===0&&G&&$()},[d,G,$]);const o=z.useCallback(async f=>{t(!0);try{await ce.post(`web/tasks/${F}/confirm-stage`,{json:{stageIndex:K,result:f}}),_==null||_(),$()}catch{}finally{t(!1)}},[F,K,$,_]);function c(f){const m=Math.floor(f/60),l=f%60;return`${m}:${l.toString().padStart(2,"0")}`}return G?C.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[C.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),C.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[C.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(tt,{className:"h-4 w-4 text-[var(--accent)]"}),C.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",T??`stage_${K}`]})]}),C.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[C.jsx(Qe,{className:"h-3.5 w-3.5"}),c(d)]})]}),C.jsxs("div",{className:"space-y-4 px-5 py-5",children:[A&&C.jsx("p",{className:"whitespace-pre-wrap text-xs text-[var(--text-primary)]",children:A}),J==="choice"&&r&&C.jsxs("div",{className:"space-y-2",children:[C.jsx("label",{className:"block text-xs text-[var(--text-muted)]",children:n("tasks.stage_choose_option")}),r.map(f=>C.jsxs("label",{className:`flex cursor-pointer items-center gap-2 rounded-[4px] border px-3 py-2 text-xs transition-colors ${g===f.value?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-secondary)] hover:border-[var(--accent)]/50"}`,children:[C.jsx("input",{type:"radio",name:"stage-choice",value:f.value,checked:g===f.value,onChange:()=>u(f.value),className:"accent-[var(--accent)]"}),f.label]},f.value))]}),J==="input"&&C.jsxs("div",{children:[C.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("tasks.stage_your_response")}),C.jsx("input",{type:"text",placeholder:n("tasks.stage_type_answer"),value:e,onChange:f=>i(f.target.value),autoFocus:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),C.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[J==="confirm"&&C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:s,onClick:()=>o("cancel"),children:n("common.cancel")}),C.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:s,onClick:()=>o("continue"),children:n(s?"tasks.stage_submitting":"tasks.stage_continue")})]}),J==="choice"&&C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:s,onClick:$,children:n("common.cancel")}),C.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:s||!g,onClick:()=>o(g),children:n(s?"tasks.stage_submitting":"common.confirm")})]}),J==="input"&&C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:s,onClick:$,children:n("common.cancel")}),C.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:s||!e.trim(),onClick:()=>o(e),children:n(s?"tasks.stage_submitting":"tasks.stage_submit")})]})]})]})]}):null}function ct(G,$){const F=new Date(G).getTime()-Date.now();if(F<=0)return $("tasks.tunnel_expired");const K=Math.floor(F/36e5),T=Math.floor(F%36e5/6e4);return K>0?$("tasks.tunnel_expires_hm",{h:K,m:T}):$("tasks.tunnel_expires_m",{m:T})}function Be(G){switch(G){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function Me(G,$){switch(G){case"IDLE":case"CLOSED":return $("tasks.tunnel_idle");case"STARTING":return $("tasks.tunnel_starting");case"CONNECTED":return $("tasks.tunnel_connected");case"EXPIRED":return $("tasks.tunnel_expired");case"CLOSING":return $("tasks.tunnel_closing");default:return String(G).toLowerCase()}}function ht({taskId:G,taskFinished:$,compact:F}){const{t:K}=be(),[T,J]=z.useState("IDLE"),[A,r]=z.useState(null),[a,h]=z.useState(null),[_,n]=z.useState(""),[d,v]=z.useState(!1),[g,u]=z.useState(!1),e=z.useRef(null),i=z.useCallback(async()=>{try{const m=await ce.get(`web/workspace-tunnel/${G}/status`).json();J(m.status),r(m.tunnelUrl??null),h(m.expiresAt??null),(m.status==="EXPIRED"||m.status==="IDLE"||m.status==="CLOSED")&&t()}catch{}},[G]);function s(){t(),e.current=setInterval(i,5e3)}function t(){e.current&&(clearInterval(e.current),e.current=null)}z.useEffect(()=>{$&&(T==="STARTING"||T==="CONNECTED")&&(J("IDLE"),r(null),t())},[$,T]),z.useEffect(()=>{if(T!=="CONNECTED"||!a)return;const m=()=>{const p=ct(a,K);n(p),p===K("tasks.tunnel_expired")&&(J("EXPIRED"),r(null),t())};m();const l=setInterval(m,3e4);return()=>clearInterval(l)},[T,a]),z.useEffect(()=>()=>t(),[]),z.useEffect(()=>{i()},[i]);async function o(){v(!0);try{await ce.post(`web/workspace-tunnel/${G}/start`),J("STARTING"),s()}catch{}finally{v(!1)}}async function c(){v(!0);try{await ce.post(`web/workspace-tunnel/${G}/stop`),J("IDLE"),r(null),t()}catch{}finally{v(!1)}}async function f(){A&&(await navigator.clipboard.writeText(A),u(!0),setTimeout(()=>u(!1),2e3))}return F?C.jsxs("div",{className:"flex items-center gap-2 font-mono lowercase text-xs",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"cursor_tunnel:"}),C.jsx("span",{style:{color:Be(T)},children:Me(T,K)}),(T==="IDLE"||T==="CLOSED"||T==="EXPIRED")&&C.jsx("button",{onClick:o,disabled:d,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:K(d?"tasks.tunnel_starting":"tasks.tunnel_start")}),T==="CONNECTED"&&A&&C.jsx("a",{href:A.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:K("tasks.tunnel_open_in_cursor")})]}):C.jsxs("div",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase",children:[C.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:K("tasks.tunnel_header")}),C.jsxs("span",{className:"text-xs",style:{color:Be(T)},children:["● ",Me(T,K)]})]}),T==="CONNECTED"&&a&&C.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",_]}),T==="CONNECTED"&&A&&C.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[C.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:A}),C.jsxs("button",{onClick:f,className:"shrink-0 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":K("tasks.tunnel_copy_url"),children:["[",K("common.copy"),"]"]})]}),g&&C.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:K("tasks.tunnel_copied")}),T==="STARTING"&&C.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:K("tasks.tunnel_waiting")}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(T==="IDLE"||T==="CLOSED")&&C.jsx("button",{onClick:o,disabled:d,className:"rounded border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:K(d?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),T==="STARTING"&&C.jsx("button",{onClick:c,disabled:d,className:"rounded border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:K(d?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),T==="CONNECTED"&&A&&C.jsxs(C.Fragment,{children:[C.jsx("a",{href:A.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:K("tasks.tunnel_open_cursor")}),C.jsx("a",{href:A.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:K("tasks.tunnel_open_vscode")}),C.jsx("button",{onClick:c,disabled:d,className:"rounded border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:K(d?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),T==="EXPIRED"&&C.jsx("button",{onClick:o,disabled:d,className:"rounded border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:K(d?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function dt({isOpen:G,onClose:$,onConfirm:F,taskId:K,isLoading:T}){const{t:J}=be();return C.jsx(Ie,{isOpen:G,onClose:$,onConfirm:F,title:J("tasks.cancel_task_title"),message:J("tasks.cancel_task_message",{id:String(K)}),confirmLabel:J("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:T})}function ut({isOpen:G,onClose:$,onConfirm:F,taskId:K,mrUrl:T,isLoading:J}){const{t:A}=be(),r=T?A("tasks.retry_message_with_mr",{id:String(K),url:T}):A("tasks.retry_message_without_mr",{id:String(K)});return C.jsx(Ie,{isOpen:G,onClose:$,onConfirm:F,title:A("tasks.retry_title"),message:r,confirmLabel:A("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:J})}function _t(G){switch(G){case"stage_change":return"text-[var(--accent)]";case"info":return"text-[var(--text-secondary)]";case"warning":return"text-[var(--warning)]";case"error":return"text-[var(--destructive)]";case"system":return"text-[var(--info)]";default:return"text-[var(--text-muted)]"}}function Oe(G){switch(G){case"RUNNING":return"var(--accent)";case"COMPLETED":return"var(--accent)";case"FAILED":return"var(--destructive)";case"CANCELLED":return"var(--text-muted)";case"SUSPENDED":return"var(--warning)";case"ASSIGNED":return"#60a5fa";default:return"var(--text-muted)"}}function Pe({status:G}){return C.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:Oe(G)},children:[C.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:Oe(G)}}),G.toLowerCase()]})}function ye(G){const $=Date.now()-new Date(G).getTime(),F=Math.floor($/6e4);if(F<1)return"just now";if(F<60)return`${F}m ago`;const K=Math.floor(F/60);return K<24?`${K}h ago`:`${Math.floor(K/24)}d ago`}function ft(G){let F=["clone_repository","analyze_issue","develop","test","submit_mr"];if(G.configSnapshot)try{const T=JSON.parse(G.configSnapshot);if(T.pipeline){const J=JSON.parse(T.pipeline);Array.isArray(J.stages)&&J.stages.length>0&&(F=J.stages.map(A=>A.name))}}catch{}const K=G.currentStage?F.indexOf(G.currentStage):-1;return F.map((T,J)=>{let A="pending";return G.status==="COMPLETED"?A="completed":G.status==="FAILED"&&J<=K?A=J===K?"failed":"completed":K>=0&&(J<K?A="completed":J===K&&(A="running")),{name:T,status:A}})}const vt=["COMPLETED","FAILED","CANCELLED"];function wt(){var _e,le;const{id:G}=Ue(),$=$e(),{t:F}=be(),K=Ve(P=>P.cancelTask),[T,J]=z.useState(null),[A,r]=z.useState([]),[a,h]=z.useState(!0),[_,n]=z.useState(null),[d,v]=z.useState(!1),[g,u]=z.useState(!1),[e,i]=z.useState(!1),[s,t]=z.useState(!1),[o,c]=z.useState("terminal"),[f,m]=z.useState([]),[l,p]=z.useState(0),[x,L]=z.useState(0),[y,E]=z.useState(""),[B,I]=z.useState(""),[H,j]=z.useState(!1),[b,w]=z.useState(!1),[k,D]=z.useState(null),[N,W]=z.useState("disconnected"),[V,q]=z.useState("auto"),ee=z.useRef(null),S=Number(G),R=T?vt.includes(T.status):!1;ze(T?`#${T.id} ${T.description}`:null);const M=z.useCallback(async()=>{try{const P=await ce.get(`web/tasks/${S}`).json();J(P)}catch{}},[S]),O=z.useCallback(async()=>{try{const P=await ce.get(`web/tasks/${S}/logs`).json();r(P.lines)}catch{}},[S]),Y=z.useCallback(async()=>{try{const P=await ce.get(`web/tasks/${S}/pending-confirm`).json();n(P.confirm)}catch{n(null)}},[S]),U=z.useCallback(async()=>{j(!0);try{const P=new URLSearchParams;P.set("limit","50"),P.set("offset",String(x*50)),y&&P.set("type",y),B&&P.set("search",B);const Z=await ce.get(`web/tasks/${S}/events?${P}`).json();m(Z.events),p(Z.total)}catch{}finally{j(!1)}},[S,x,y,B]);z.useEffect(()=>{o==="logs"&&U()},[o,U]),z.useEffect(()=>{o==="pipeline"&&ce.get(`web/workspaces/${S}`).json().then(D).catch(()=>{})},[o,S]),z.useEffect(()=>{h(!0),Promise.all([M(),O(),Y()]).finally(()=>h(!1))},[M,O,Y]),z.useEffect(()=>{if(R)return;const P=setInterval(()=>{M(),O(),Y()},5e3);return()=>clearInterval(P)},[R,M,O,Y]);const Q=z.useCallback(()=>n(null),[]),ie=z.useCallback(()=>{n(null),M()},[M]);async function ne(){i(!0);try{await K(S),v(!1),await M()}finally{i(!1)}}async function ue(){t(!0);try{const P=await ce.post(`web/tasks/${S}/retry`).json();u(!1),$(`/tasks/${P.task.id}`)}finally{t(!1)}}if(a)return C.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:C.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:F("tasks.loading_task")})});if(!T)return C.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[C.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:F("tasks.task_not_found")}),C.jsxs("button",{onClick:()=>$("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",F("tasks.back_to_tasks")]})]});const X=ft(T),de=X.findIndex(P=>P.status==="running"),ge=C.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[C.jsx("button",{onClick:()=>$("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:C.jsx(Xe,{className:"h-4 w-4"})}),C.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:["#",T.id," ",T.description]})]}),fe=C.jsxs("div",{className:"hidden md:flex items-center gap-4 border-b border-[var(--border)] bg-[var(--bg-primary)] px-5 shrink-0",style:{height:44},children:[C.jsx(Pe,{status:T.status}),C.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),C.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["project: ",C.jsx("span",{className:"text-[var(--text-primary)]",children:T.projectKey})]}),T.branch&&C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),C.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["branch: ",C.jsx("span",{className:"text-[var(--text-primary)]",children:T.branch})]})]}),T.mrUrl&&C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),C.jsxs("a",{href:T.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((_e=T.mrUrl.match(/!?\d+$/))==null?void 0:_e[0])??"view"]})]})]}),me=C.jsxs("div",{className:"flex items-center gap-3 border-t border-[var(--border)] bg-[var(--bg-primary)] px-4 md:px-5 shrink-0",style:{height:48},children:[!R&&C.jsxs("button",{onClick:()=>v(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:[C.jsx(we,{className:"h-3 w-3"}),F("tasks.cancel_task")]}),T.status==="FAILED"&&C.jsxs("button",{onClick:()=>u(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[#171717] px-3 h-8 text-[11px] text-[var(--text-muted)]",children:[C.jsx(Je,{className:"h-3 w-3"}),F("tasks.retry_task")]}),T.machineId&&!R&&C.jsxs("button",{onClick:()=>{},className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[C.jsx(Ye,{className:"h-3 w-3"}),F("tasks.cursor_tunnel")]})]}),Se=C.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-6 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-4 lg:flex",children:[C.jsxs("div",{className:"flex flex-col gap-3",children:[C.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:F("tasks.pipeline_stages")}),X.map(P=>{const Z=P.status==="completed",te=P.status==="running",re=P.status==="failed";return C.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${te?"bg-[#1a1a1a]":""}`,children:[Z&&C.jsx(Ke,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),te&&C.jsx(Ee,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),re&&C.jsx(we,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),P.status==="pending"&&C.jsx(Ze,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),C.jsx("span",{className:"text-xs",style:{color:Z?"var(--accent)":te?"#e5e5e5":re?"var(--destructive)":"#525252",fontWeight:te?500:400},children:te?`> ${P.name}`:P.name})]},P.name)})]}),C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:F("tasks.activity_log")}),A.length>0?C.jsx("div",{className:"flex flex-col gap-1.5",children:A.slice(0,8).map((P,Z)=>C.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:P},Z))}):C.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:F("tasks.no_activity")})]})]}),oe=C.jsxs(C.Fragment,{children:[C.jsx(dt,{isOpen:d,onClose:()=>v(!1),onConfirm:ne,taskId:S,isLoading:e}),C.jsx(ut,{isOpen:g,onClose:()=>u(!1),onConfirm:ue,taskId:S,mrUrl:T.mrUrl??void 0,isLoading:s})]});return b&&o==="terminal"?C.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--bg-primary)] font-mono lowercase",children:[fe,C.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:F("tasks.pty_terminal")}),C.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] ${N==="connected"?"text-[var(--accent)]":N==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[C.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${N==="connected"?"bg-[var(--accent)]":N==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),F(`tasks.${N}`)]})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[!R&&V==="auto"&&C.jsxs("button",{onClick:()=>{var P;return(P=ee.current)==null?void 0:P.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-6 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[C.jsx(Le,{className:"h-3 w-3"}),F("tasks.take_over")]}),!R&&V==="manual"&&C.jsx("button",{onClick:()=>{var P;return(P=ee.current)==null?void 0:P.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-6 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:F("tasks.restore_auto")}),T.currentStage&&C.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[F("tasks.stage"),": ",T.currentStage]}),C.jsx("button",{onClick:()=>w(!1),className:"flex items-center rounded-[4px] bg-[#171717] px-2.5 py-1 text-[var(--text-muted)]",children:C.jsx(st,{className:"h-3 w-3"})})]})]}),C.jsx("div",{className:"min-h-0 flex-1",children:C.jsx(Ae,{ref:ee,taskId:S,sessionId:T.currentSessionId??void 0,taskFinished:R,onStatusChange:W,onTakeoverChange:q})}),me,oe]}):T.status==="SUSPENDED"?C.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[ge,fe,C.jsx("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(245,158,11,0.08)",borderColor:"rgba(245,158,11,0.2)",color:"var(--warning)"},children:F("tasks.task_suspended_banner")}),C.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[C.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[C.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[C.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",T.id]}),C.jsx("span",{className:"text-base text-[var(--text-secondary)]",children:T.description}),C.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:F("tasks.status_suspended")})]}),C.jsx("div",{className:"flex items-center gap-2 md:hidden",children:C.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:F("tasks.status_suspended")})}),_&&C.jsxs("div",{className:"rounded-[4px] border p-4",style:{borderColor:"rgba(245,158,11,0.27)",backgroundColor:"#1a1a1a"},children:[C.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:F("tasks.pending_confirmation")}),C.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:_.prompt??F("tasks.pipeline_requires_confirmation")}),_.stageName&&C.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:_.stageName})]})}),C.jsx("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:_.choices?_.choices.map((P,Z)=>C.jsx("button",{onClick:async()=>{try{await ce.post(`web/tasks/${S}/confirm-stage`,{json:{stageIndex:_.stageIndex,result:P.value}}),ie()}catch{ke.error(F("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] px-4 py-2.5 md:py-2 text-[11px] font-bold",style:Z===0?{backgroundColor:"var(--accent)",color:"#0c0c0c"}:{backgroundColor:"#1a1a1a",border:"1px solid var(--border)",color:"var(--text-primary)"},children:P.label},P.value)):C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:async()=>{try{await ce.post(`web/tasks/${S}/confirm-stage`,{json:{stageIndex:_.stageIndex,result:"retry"}}),ie()}catch{ke.error(F("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[var(--accent)] px-4 py-2.5 md:py-2 text-[11px] font-bold text-[#0c0c0c]",children:F("tasks.confirm_and_proceed")}),C.jsx("button",{onClick:()=>v(!0),className:"flex-1 md:flex-none rounded-[4px] bg-[#1a1a1a] px-4 py-2.5 md:py-2 text-[11px] text-[var(--destructive)]",style:{border:"1px solid rgba(239,68,68,0.27)"},children:F("tasks.reject")})]})})]}),C.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:X.map((P,Z)=>{const te=P.status==="failed",re=P.status==="completed",ae=P.status==="running"&&T.status==="SUSPENDED",he=te?"var(--destructive)":re?"var(--accent)":ae?"var(--warning)":"#525252",se=te?"rgba(239,68,68,0.12)":re?"rgba(34,197,94,0.12)":ae?"rgba(245,158,11,0.12)":"transparent";return C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px]",style:{color:he,backgroundColor:se,fontWeight:ae?700:400,border:ae?`1px solid ${he}`:void 0},children:ae?"confirm":`${P.name}${re?" ✓":te?" ✗":""}`}),Z<X.length-1&&C.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},P.name)})}),C.jsxs("div",{className:"hidden md:block min-h-[200px] flex-1 rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4",children:[C.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:F("tasks.pty_output")}),C.jsxs("div",{className:"flex flex-col gap-1",children:[A.slice(-10).map((P,Z)=>C.jsx("p",{className:"text-[10px] leading-relaxed text-[var(--text-secondary)]",children:P},Z)),A.length===0&&C.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:F("tasks.no_output")})]})]})]}),C.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-4 rounded-[4px] border border-[var(--border)] bg-[#171717] p-4 lg:flex",children:[C.jsx("span",{className:"text-[13px] font-bold text-[var(--accent)]",children:F("tasks.task_info")}),C.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),C.jsx("span",{className:"font-bold text-[var(--warning)]",children:"suspended"})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.projectKey})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.machineName??"-"})]})]}),C.jsx("div",{className:"h-px bg-[var(--border)]"}),C.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:F("tasks.stage_timeline")}),C.jsx("div",{className:"flex flex-col gap-2",children:X.map(P=>{const Z=P.status==="completed"?"var(--accent)":P.status==="failed"?"var(--destructive)":P.status==="running"?"var(--warning)":"#525252",te=P.status==="failed"?"var(--destructive)":P.status==="running"?"var(--warning)":"#a3a3a3",re=P.status==="completed"?"completed":P.status==="running"?"suspended":P.status==="failed"?"failed":"pending";return C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:Z}}),C.jsxs("span",{className:"text-[10px]",style:{color:te,fontWeight:P.status==="running"?700:400},children:[P.name," ",re]})]},P.name)})}),C.jsx("div",{className:"h-px bg-[var(--border)]"}),C.jsx("div",{className:"flex flex-col gap-1.5 text-[11px]",children:C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:ye(T.createdAt)})]})})]})]}),_&&C.jsx(Te,{isOpen:!!_,onClose:Q,taskId:S,stageIndex:_.stageIndex,stageName:_.stageName??(T==null?void 0:T.currentStage)??void 0,mode:_.mode,prompt:_.prompt,choices:_.choices,defaultChoice:_.defaultChoice,timeoutSeconds:Math.ceil(_.timeout/1e3),onSubmitted:ie}),oe]}):C.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[ge,fe,T.errorMessage&&C.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(239,68,68,0.08)",borderColor:"rgba(239,68,68,0.2)",color:"var(--destructive)"},children:["// error: ",T.errorMessage]}),_&&C.jsx(Te,{isOpen:!!_,onClose:Q,taskId:S,stageIndex:_.stageIndex,stageName:_.stageName??(T==null?void 0:T.currentStage)??void 0,mode:_.mode,prompt:_.prompt,choices:_.choices,defaultChoice:_.defaultChoice,timeoutSeconds:Math.ceil(_.timeout/1e3),onSubmitted:ie}),C.jsxs("div",{className:"flex min-h-0 flex-1",children:[C.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[C.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0",children:["terminal","pipeline","logs"].map(P=>C.jsx("button",{onClick:()=>c(P),className:`px-4 py-2.5 text-xs transition-colors ${o===P?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:F(P==="terminal"?"tasks.terminal":P==="pipeline"?"tasks.pipeline_tab":"tasks.logs")},P))}),o==="terminal"&&C.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[C.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 md:px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[C.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[C.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:F("tasks.pty_terminal")}),C.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] ${N==="connected"?"text-[var(--accent)]":N==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[C.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${N==="connected"?"bg-[var(--accent)]":N==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),F(`tasks.${N}`)]})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[!R&&V==="auto"&&C.jsxs("button",{onClick:()=>{var P;return(P=ee.current)==null?void 0:P.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-6 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[C.jsx(Le,{className:"h-3 w-3"}),F("tasks.take_over")]}),!R&&V==="manual"&&C.jsx("button",{onClick:()=>{var P;return(P=ee.current)==null?void 0:P.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-6 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:F("tasks.restore_auto")}),!R&&V==="requesting"&&C.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 h-6 text-[11px] text-[var(--warning)]",children:[C.jsx(Ee,{className:"h-3 w-3 animate-spin"}),F("tasks.requesting_takeover")]}),!R&&T.currentStage&&C.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[#171717] px-2.5 h-6 text-[11px] text-[var(--text-muted)]",children:[C.jsx(it,{className:"h-3 w-3"}),F("tasks.skip_stage")]}),C.jsx("button",{onClick:()=>w(!0),className:"hidden md:flex items-center rounded-[4px] bg-[#171717] px-2.5 h-6 text-[var(--text-muted)]",children:C.jsx(et,{className:"h-3 w-3"})})]})]}),C.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-4 py-2 shrink-0 md:hidden",children:[C.jsx(Pe,{status:T.status}),T.machineName&&C.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:["on ",T.machineName]})]}),C.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[C.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:F("tasks.stage_progress")}),C.jsx("div",{className:"mt-2 flex items-center gap-1 overflow-x-auto no-scrollbar",children:X.map((P,Z)=>{const te=P.status==="completed",re=P.status==="running",he=P.status==="failed"?"var(--destructive)":te||re?"var(--accent)":"#525252";return C.jsxs("div",{className:"flex items-center",children:[C.jsxs("span",{className:"shrink-0 text-[10px] whitespace-nowrap",style:{color:he,fontWeight:re?600:400},children:[P.name,te?" ✓":re?" ...":""]}),Z<X.length-1&&C.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:he}})]},P.name)})})]}),C.jsx("div",{className:"px-4 pt-3 pb-1 shrink-0 md:hidden",children:C.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:F("tasks.pty_output")})}),C.jsx("div",{className:"min-h-0 flex-1",children:C.jsx(Ae,{ref:ee,taskId:S,sessionId:T.currentSessionId??void 0,taskFinished:R,onStatusChange:W,onTakeoverChange:q})}),me]}),o==="pipeline"&&C.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[C.jsx("div",{className:"flex items-center py-4 mb-4 md:mb-5 overflow-x-auto no-scrollbar",children:X.map((P,Z)=>{const te=P.status==="completed",re=P.status==="running",se=P.status==="failed"?"var(--destructive)":te||re?"var(--accent)":"#525252";return C.jsxs("div",{className:"flex items-center",style:{flex:Z<X.length-1?1:void 0},children:[C.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[C.jsxs("div",{className:"flex h-6 w-6 md:h-7 md:w-7 items-center justify-center rounded-full shrink-0",style:{backgroundColor:se},children:[te&&C.jsx("span",{className:"text-[10px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),re&&C.jsx("span",{className:"h-2 w-2 md:h-2.5 md:w-2.5 rounded-full bg-[#0c0c0c]"})]}),C.jsx("span",{className:"text-[9px] md:text-[11px] font-medium whitespace-nowrap",style:{color:se},children:P.name})]}),Z<X.length-1&&C.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:Z<(de>=0?de:0)?"var(--accent)":"#525252"}})]},P.name)})}),T.currentStage&&C.jsxs("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[#171717] p-3 text-xs leading-relaxed",children:[C.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// stage: ",T.currentStage," (",de+1,"/",X.length,")"]}),T.startedAt&&C.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",ye(T.startedAt).replace(" ago","")]}),C.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",T.retryCount,"/2"]})]}),C.jsx("button",{onClick:()=>c("terminal"),className:"flex-1 min-h-[100px] rounded-[4px] border border-dashed border-[var(--border)] flex items-center justify-center gap-2 text-[11px] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] transition-colors",children:C.jsxs("span",{children:["// ",F("tasks.view_terminal")]})}),C.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:hidden",children:[C.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:F("tasks.task_info")}),C.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 text-[11px]",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.projectKey})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.machineName??"-"})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.branch??"-"})]})]})]})]}),o==="logs"&&C.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[C.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children:F("tasks.task_logs")}),C.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:gap-3",children:[C.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar md:hidden",children:["","error","system"].map(P=>C.jsx("button",{onClick:()=>{E(P),L(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[10px] ${y===P?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:P||"all"},P))}),C.jsx("div",{className:"hidden md:block",children:C.jsx(Ge,{value:y,onChange:P=>{E(P),L(0)},options:[{value:"",label:"all"},{value:"stage_change",label:"stage_change"},{value:"info",label:"info"},{value:"warning",label:"warning"},{value:"error",label:"error"},{value:"system",label:"system"}],className:"w-36"})}),C.jsxs("div",{className:"flex flex-1 items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[C.jsx(qe,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),C.jsx("input",{type:"text",placeholder:F("tasks.search_logs"),value:B,onChange:P=>{I(P.target.value),L(0)},className:"flex-1 bg-transparent text-xs text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]"})]})]}),C.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.map((P,Z)=>C.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${Z%2===0?"bg-[var(--bg-card)]":""}`,children:[C.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(P.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),C.jsx("span",{className:`shrink-0 font-medium ${_t(P.type)}`,children:P.type}),C.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:P.message})]},P.id)),f.length===0&&!H&&C.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:F("tasks.no_log_entries")})]}),l>50&&C.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(l/50)}).slice(0,5).map((P,Z)=>C.jsx("button",{onClick:()=>L(Z),className:`rounded-[4px] px-2 py-1 text-xs ${x===Z?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:Z+1},Z)),Math.ceil(l/50)>5&&C.jsx("button",{onClick:()=>L(x+1),disabled:x>=Math.ceil(l/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]})]}),o==="terminal"&&Se,o==="pipeline"&&C.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:F("tasks.task_info")}),C.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.projectKey})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"creator"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.creatorName??"-"})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"machine"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.machineName??"-"})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"created_at"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:ye(T.createdAt)})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"agent_type"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.agentType??"cursor"})]})]})]}),C.jsx("div",{className:"h-px bg-[var(--border)]"}),C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:F("tasks.workspace_section")}),C.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),C.jsx("span",{className:"text-[var(--text-primary)]",children:T.branch??(k==null?void 0:k.branch)??"-"})]}),C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"worktree"}),C.jsx("span",{className:"ml-4 truncate text-[var(--text-primary)]",children:(k==null?void 0:k.path)??"-"})]}),T.mrUrl&&C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-[var(--text-muted)]",children:"mr_link"}),C.jsx("a",{href:T.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((le=T.mrUrl.match(/!?\d+$/))==null?void 0:le[0])??"view"})]})]})]}),C.jsx("div",{className:"h-px bg-[var(--border)]"}),C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:F("tasks.cursor_tunnel_section")}),T.machineId?C.jsx(ht,{taskId:S,taskFinished:R,compact:!0}):C.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:F("tasks.no_machine_assigned")})]}),C.jsx("div",{className:"h-px bg-[var(--border)]"}),C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:F("tasks.stage_timeline")}),C.jsx("div",{className:"flex flex-col gap-2 text-xs",children:X.map(P=>{const Z=P.status==="completed"?"✓":P.status==="running"?"→":"·",te=P.status==="completed"||P.status==="running"?"var(--accent)":P.status==="failed"?"var(--destructive)":"#525252",re=P.status==="completed"?"done":P.status==="running"?"running...":P.status==="failed"?"failed":"pending";return C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"font-semibold",style:{color:te},children:Z}),C.jsx("span",{className:P.status==="running"?"font-medium":"",style:{color:te},children:P.name}),C.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",re]})]},P.name)})})]})]})]}),oe]})}export{wt as default};