termbeam 1.22.4 → 1.22.5

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 (59) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +1 -1
  3. package/public/assets/{_basePickBy-Q45O29Rp.js → _basePickBy-BVpLYhzg.js} +1 -1
  4. package/public/assets/{_baseUniq-DveOFRWk.js → _baseUniq-DaqR6KGr.js} +1 -1
  5. package/public/assets/{arc-BxuxWgHK.js → arc-CssCqhYD.js} +1 -1
  6. package/public/assets/{architectureDiagram-Q4EWVU46-ByQ5j_Jw.js → architectureDiagram-Q4EWVU46-l3JVHnV_.js} +1 -1
  7. package/public/assets/{blockDiagram-DXYQGD6D-DrElm25z.js → blockDiagram-DXYQGD6D-CrM8tY-y.js} +1 -1
  8. package/public/assets/{c4Diagram-AHTNJAMY-BATf25U2.js → c4Diagram-AHTNJAMY-DzCXv9Rz.js} +1 -1
  9. package/public/assets/channel-Bku-_pPd.js +1 -0
  10. package/public/assets/{chunk-4BX2VUAB-BksLrXVs.js → chunk-4BX2VUAB-Cj-mftSP.js} +1 -1
  11. package/public/assets/{chunk-4TB4RGXK-D5KX6fMH.js → chunk-4TB4RGXK-CY9HfBo4.js} +1 -1
  12. package/public/assets/{chunk-55IACEB6-DLtS129C.js → chunk-55IACEB6-Cx1Dq9yx.js} +1 -1
  13. package/public/assets/{chunk-EDXVE4YY-CtqMCguR.js → chunk-EDXVE4YY-Iexo9A1J.js} +1 -1
  14. package/public/assets/{chunk-FMBD7UC4-BkeSsxqP.js → chunk-FMBD7UC4-BPUhRKwW.js} +1 -1
  15. package/public/assets/{chunk-OYMX7WX6-Dl4p17KI.js → chunk-OYMX7WX6-maeGBOv5.js} +1 -1
  16. package/public/assets/{chunk-QZHKN3VN-CBMUqRwi.js → chunk-QZHKN3VN-mlmLwtof.js} +1 -1
  17. package/public/assets/{chunk-YZCP3GAM-D4sWv3YN.js → chunk-YZCP3GAM-y3qVUM7A.js} +1 -1
  18. package/public/assets/classDiagram-6PBFFD2Q-ClceLk7l.js +1 -0
  19. package/public/assets/classDiagram-v2-HSJHXN6E-ClceLk7l.js +1 -0
  20. package/public/assets/clone-D1rcmopg.js +1 -0
  21. package/public/assets/{cose-bilkent-S5V4N54A-BW1nNLLk.js → cose-bilkent-S5V4N54A-C1mk64VU.js} +1 -1
  22. package/public/assets/{dagre-KV5264BT-CDXKs5yo.js → dagre-KV5264BT-BSL5FMc3.js} +1 -1
  23. package/public/assets/{diagram-5BDNPKRD-DfSZsVAD.js → diagram-5BDNPKRD-DG9c1zKo.js} +1 -1
  24. package/public/assets/{diagram-G4DWMVQ6-CIKqapDb.js → diagram-G4DWMVQ6-D7mtSUWN.js} +1 -1
  25. package/public/assets/{diagram-MMDJMWI5-CWwOGFbE.js → diagram-MMDJMWI5-oWVftPim.js} +1 -1
  26. package/public/assets/{diagram-TYMM5635-CAMd8OZP.js → diagram-TYMM5635-BlD2XrpC.js} +1 -1
  27. package/public/assets/{erDiagram-SMLLAGMA-BCpXZJei.js → erDiagram-SMLLAGMA-CbMPq8iC.js} +1 -1
  28. package/public/assets/{flowDiagram-DWJPFMVM-DpRY38iu.js → flowDiagram-DWJPFMVM-DwB23P40.js} +1 -1
  29. package/public/assets/{ganttDiagram-T4ZO3ILL-DJrwFHlO.js → ganttDiagram-T4ZO3ILL-CvrFWOtX.js} +1 -1
  30. package/public/assets/{gitGraphDiagram-UUTBAWPF-CpEmQcDN.js → gitGraphDiagram-UUTBAWPF-BbYP2iH_.js} +1 -1
  31. package/public/assets/{graph-C-meUi4Z.js → graph-Z41TsCiA.js} +1 -1
  32. package/public/assets/{index-Do67tk4s.js → index-Cl6Jk3oo.js} +4 -4
  33. package/public/assets/{infoDiagram-42DDH7IO-sXN9f7L8.js → infoDiagram-42DDH7IO-ngTxsXzv.js} +1 -1
  34. package/public/assets/{ishikawaDiagram-UXIWVN3A-D_2gGEMI.js → ishikawaDiagram-UXIWVN3A-BBNbsPSu.js} +1 -1
  35. package/public/assets/{journeyDiagram-VCZTEJTY-CUv-hh0I.js → journeyDiagram-VCZTEJTY-BoXoPVa_.js} +1 -1
  36. package/public/assets/{kanban-definition-6JOO6SKY-Cx3Plwl2.js → kanban-definition-6JOO6SKY-D0b2gEsK.js} +1 -1
  37. package/public/assets/{layout-CpGcFwHw.js → layout-Be1CCXXU.js} +1 -1
  38. package/public/assets/{linear-Bw9XpXJW.js → linear-BdRCYHk_.js} +1 -1
  39. package/public/assets/{mindmap-definition-QFDTVHPH-Swj4jh3Z.js → mindmap-definition-QFDTVHPH-DdfcmeNI.js} +1 -1
  40. package/public/assets/{pieDiagram-DEJITSTG-Ck2h10zd.js → pieDiagram-DEJITSTG-D3Z4P9gD.js} +1 -1
  41. package/public/assets/{quadrantDiagram-34T5L4WZ-B1ZrruGm.js → quadrantDiagram-34T5L4WZ-CQDIQCh0.js} +1 -1
  42. package/public/assets/{requirementDiagram-MS252O5E-B8JKwgDX.js → requirementDiagram-MS252O5E-Wmr4p5Qx.js} +1 -1
  43. package/public/assets/{sankeyDiagram-XADWPNL6-b442XRH8.js → sankeyDiagram-XADWPNL6-BuyeAyf9.js} +1 -1
  44. package/public/assets/{sequenceDiagram-FGHM5R23-DY9IFA-F.js → sequenceDiagram-FGHM5R23-BTfkp-Sc.js} +1 -1
  45. package/public/assets/{stateDiagram-FHFEXIEX-IGjwW9Pw.js → stateDiagram-FHFEXIEX-Bawg9xGH.js} +1 -1
  46. package/public/assets/stateDiagram-v2-QKLJ7IA2-XEPIytdt.js +1 -0
  47. package/public/assets/{timeline-definition-GMOUNBTQ-B0JwGAT7.js → timeline-definition-GMOUNBTQ-DX9pgCZO.js} +1 -1
  48. package/public/assets/{vennDiagram-DHZGUBPP-DKLiidvh.js → vennDiagram-DHZGUBPP-cOITHLkN.js} +1 -1
  49. package/public/assets/{wardley-RL74JXVD-C1HnYfXI.js → wardley-RL74JXVD-DAj0-CeY.js} +1 -1
  50. package/public/assets/{wardleyDiagram-NUSXRM2D-BhbO6L2Q.js → wardleyDiagram-NUSXRM2D-BK2TsVYj.js} +1 -1
  51. package/public/assets/{xychartDiagram-5P7HB3ND-CSZSmQ9N.js → xychartDiagram-5P7HB3ND-C3j-s6OI.js} +1 -1
  52. package/public/index.html +1 -1
  53. package/public/sw.js +1 -1
  54. package/src/server/websocket.js +29 -21
  55. package/public/assets/channel-RrT8pJmM.js +0 -1
  56. package/public/assets/classDiagram-6PBFFD2Q-BaJ5lA7J.js +0 -1
  57. package/public/assets/classDiagram-v2-HSJHXN6E-BaJ5lA7J.js +0 -1
  58. package/public/assets/clone-BFbWnZ1G.js +0 -1
  59. package/public/assets/stateDiagram-v2-QKLJ7IA2-2xQCbec6.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-KV5264BT-CDXKs5yo.js","assets/graph-C-meUi4Z.js","assets/_baseUniq-DveOFRWk.js","assets/layout-CpGcFwHw.js","assets/_basePickBy-Q45O29Rp.js","assets/clone-BFbWnZ1G.js","assets/cose-bilkent-S5V4N54A-BW1nNLLk.js","assets/cytoscape.esm-BQaXIfA_.js","assets/c4Diagram-AHTNJAMY-BATf25U2.js","assets/chunk-YZCP3GAM-D4sWv3YN.js","assets/flowDiagram-DWJPFMVM-DpRY38iu.js","assets/chunk-FMBD7UC4-BkeSsxqP.js","assets/chunk-55IACEB6-DLtS129C.js","assets/chunk-EDXVE4YY-CtqMCguR.js","assets/channel-RrT8pJmM.js","assets/erDiagram-SMLLAGMA-BCpXZJei.js","assets/gitGraphDiagram-UUTBAWPF-CpEmQcDN.js","assets/chunk-4BX2VUAB-BksLrXVs.js","assets/chunk-QZHKN3VN-CBMUqRwi.js","assets/wardley-RL74JXVD-C1HnYfXI.js","assets/ganttDiagram-T4ZO3ILL-DJrwFHlO.js","assets/linear-Bw9XpXJW.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-42DDH7IO-sXN9f7L8.js","assets/pieDiagram-DEJITSTG-Ck2h10zd.js","assets/arc-BxuxWgHK.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-34T5L4WZ-B1ZrruGm.js","assets/xychartDiagram-5P7HB3ND-CSZSmQ9N.js","assets/requirementDiagram-MS252O5E-B8JKwgDX.js","assets/sequenceDiagram-FGHM5R23-DY9IFA-F.js","assets/classDiagram-6PBFFD2Q-BaJ5lA7J.js","assets/chunk-4TB4RGXK-D5KX6fMH.js","assets/classDiagram-v2-HSJHXN6E-BaJ5lA7J.js","assets/stateDiagram-FHFEXIEX-IGjwW9Pw.js","assets/chunk-OYMX7WX6-Dl4p17KI.js","assets/stateDiagram-v2-QKLJ7IA2-2xQCbec6.js","assets/journeyDiagram-VCZTEJTY-CUv-hh0I.js","assets/timeline-definition-GMOUNBTQ-B0JwGAT7.js","assets/mindmap-definition-QFDTVHPH-Swj4jh3Z.js","assets/kanban-definition-6JOO6SKY-Cx3Plwl2.js","assets/sankeyDiagram-XADWPNL6-b442XRH8.js","assets/diagram-TYMM5635-CAMd8OZP.js","assets/diagram-MMDJMWI5-CWwOGFbE.js","assets/blockDiagram-DXYQGD6D-DrElm25z.js","assets/diagram-5BDNPKRD-DfSZsVAD.js","assets/architectureDiagram-Q4EWVU46-ByQ5j_Jw.js","assets/diagram-G4DWMVQ6-CIKqapDb.js","assets/wardleyDiagram-NUSXRM2D-BhbO6L2Q.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-KV5264BT-BSL5FMc3.js","assets/graph-Z41TsCiA.js","assets/_baseUniq-DaqR6KGr.js","assets/layout-Be1CCXXU.js","assets/_basePickBy-BVpLYhzg.js","assets/clone-D1rcmopg.js","assets/cose-bilkent-S5V4N54A-C1mk64VU.js","assets/cytoscape.esm-BQaXIfA_.js","assets/c4Diagram-AHTNJAMY-DzCXv9Rz.js","assets/chunk-YZCP3GAM-y3qVUM7A.js","assets/flowDiagram-DWJPFMVM-DwB23P40.js","assets/chunk-FMBD7UC4-BPUhRKwW.js","assets/chunk-55IACEB6-Cx1Dq9yx.js","assets/chunk-EDXVE4YY-Iexo9A1J.js","assets/channel-Bku-_pPd.js","assets/erDiagram-SMLLAGMA-CbMPq8iC.js","assets/gitGraphDiagram-UUTBAWPF-BbYP2iH_.js","assets/chunk-4BX2VUAB-Cj-mftSP.js","assets/chunk-QZHKN3VN-mlmLwtof.js","assets/wardley-RL74JXVD-DAj0-CeY.js","assets/ganttDiagram-T4ZO3ILL-CvrFWOtX.js","assets/linear-BdRCYHk_.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-42DDH7IO-ngTxsXzv.js","assets/pieDiagram-DEJITSTG-D3Z4P9gD.js","assets/arc-CssCqhYD.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-34T5L4WZ-CQDIQCh0.js","assets/xychartDiagram-5P7HB3ND-C3j-s6OI.js","assets/requirementDiagram-MS252O5E-Wmr4p5Qx.js","assets/sequenceDiagram-FGHM5R23-BTfkp-Sc.js","assets/classDiagram-6PBFFD2Q-ClceLk7l.js","assets/chunk-4TB4RGXK-CY9HfBo4.js","assets/classDiagram-v2-HSJHXN6E-ClceLk7l.js","assets/stateDiagram-FHFEXIEX-Bawg9xGH.js","assets/chunk-OYMX7WX6-maeGBOv5.js","assets/stateDiagram-v2-QKLJ7IA2-XEPIytdt.js","assets/journeyDiagram-VCZTEJTY-BoXoPVa_.js","assets/timeline-definition-GMOUNBTQ-DX9pgCZO.js","assets/mindmap-definition-QFDTVHPH-DdfcmeNI.js","assets/kanban-definition-6JOO6SKY-D0b2gEsK.js","assets/sankeyDiagram-XADWPNL6-BuyeAyf9.js","assets/diagram-TYMM5635-BlD2XrpC.js","assets/diagram-MMDJMWI5-oWVftPim.js","assets/blockDiagram-DXYQGD6D-CrM8tY-y.js","assets/diagram-5BDNPKRD-DG9c1zKo.js","assets/architectureDiagram-Q4EWVU46-l3JVHnV_.js","assets/diagram-G4DWMVQ6-D7mtSUWN.js","assets/wardleyDiagram-NUSXRM2D-BK2TsVYj.js"])))=>i.map(i=>d[i]);
2
2
  var i9=Object.defineProperty;var n9=(e,t,r)=>t in e?i9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Nr=(e,t,r)=>n9(e,typeof t!="symbol"?t+"":t,r);function s9(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();const a9="modulepreload",o9=function(e){return"/"+e},NT={},er=function(t,r,i){let n=Promise.resolve();if(r&&r.length>0){let l=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));n=l(r.map(u=>{if(u=o9(u),u in NT)return;NT[u]=!0;const f=u.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":a9,f||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((p,x)=>{g.addEventListener("load",p),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return n.then(l=>{for(const s of l||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};function Ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Owe(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),r}var e_={exports:{}},kh={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -99,7 +99,7 @@ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v)
99
99
  `:`
100
100
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.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 R=this._getMouseBufferCoords(L),D=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!!(D&&N&&R)&&this._areCoordsInSelection(R,D,N)}isCellInSelection(L,R){const D=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!D||!N)&&this._areCoordsInSelection([L,R],D,N)}_areCoordsInSelection(L,R,D){return L[1]>R[1]&&L[1]<D[1]||R[1]===D[1]&&L[1]===R[1]&&L[0]>=R[0]&&L[0]<D[0]||R[1]<D[1]&&L[1]===D[1]&&L[0]<D[0]||R[1]<D[1]&&L[1]===R[1]&&L[0]>=R[0]}_selectWordAtCursor(L,R){var $,H;const D=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(D)return this._model.selectionStart=[D.start.x-1,D.start.y-1],this._model.selectionStartLength=(0,y.getRangeLength)(D,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const N=this._getMouseBufferCoords(L);return!!N&&(this._selectWordAt(N,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,R){this._model.clearSelection(),L=Math.max(L,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const R=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(L){let R=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,L,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=D?0:(R>D&&(R-=D),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(L){return v.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 R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const R=this._getMouseBufferCoords(L);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(L){return L.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.stopImmediatePropagation(),!this._model.selectionStart)return;const R=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 D=this._bufferService.buffer;if(this._model.selectionEnd[1]<D.lines.length){const N=D.lines.get(this._model.selectionEnd[1]);N&&N.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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 R=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const N=(0,g.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(N,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,D=!(!L||!R||L[0]===R[0]&&L[1]===R[1]);D?L&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,R,D)):this._oldHasSelection&&this._fireOnSelectionChange(L,R,D)}_fireOnSelectionChange(L,R,D){this._oldSelectionStart=L,this._oldSelectionEnd=R,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(L,R){let D=R;for(let N=0;R>=N;N++){const $=L.loadCell(N,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:$>1&&R!==N&&(D+=$-1)}return D}setSelection(L,R,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,R],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,R,D=!0,N=!0){if(L[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(L[1]);if(!H)return;const W=$.translateBufferLineToString(L[1],!1);let Z=this._convertViewportColToCharacterIndex(H,L[0]),P=Z;const G=L[0]-Z;let X=0,j=0,I=0,z=0;if(W.charAt(Z)===" "){for(;Z>0&&W.charAt(Z-1)===" ";)Z--;for(;P<W.length&&W.charAt(P+1)===" ";)P++}else{let Q=L[0],ee=L[0];H.getWidth(Q)===0&&(X++,Q--),H.getWidth(ee)===2&&(j++,ee++);const te=H.getString(ee).length;for(te>1&&(z+=te-1,P+=te-1);Q>0&&Z>0&&!this._isCharWordSeparator(H.loadCell(Q-1,this._workCell));){H.loadCell(Q-1,this._workCell);const re=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,Q--):re>1&&(I+=re-1,Z-=re-1),Z--,Q--}for(;ee<H.length&&P+1<W.length&&!this._isCharWordSeparator(H.loadCell(ee+1,this._workCell));){H.loadCell(ee+1,this._workCell);const re=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ee++):re>1&&(z+=re-1,P+=re-1),P++,ee++}}P++;let Y=Z+G-X+I,q=Math.min(this._bufferService.cols,P-Z+X+j-I-z);if(R||W.slice(Z,P).trim()!==""){if(D&&Y===0&&H.getCodePoint(0)!==32){const Q=$.lines.get(L[1]-1);if(Q&&H.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(ee){const te=this._bufferService.cols-ee.start;Y-=te,q+=te}}}if(N&&Y+q===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Q=$.lines.get(L[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const ee=this._getWordAt([0,L[1]+1],!1,!1,!0);ee&&(q+=ee.length)}}return{start:Y,length:q}}}_selectWordAt(L,R){const D=this._getWordAt(L,R);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[D.start,L[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(L){const R=this._getWordAt(L,!0);if(R){let D=L[1];for(;R.start<0;)R.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,D]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const R=this._bufferService.buffer.getWrappedRangeForLine(L),D={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,y.getRangeLength)(D,this._bufferService.cols)}};s.SelectionService=E=u([f(3,w.IBufferService),f(4,w.ICoreService),f(5,x.IMouseService),f(6,w.IOptionsService),f(7,x.IRenderService),f(8,x.ICoreBrowserService)],E)},4725:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const u=c(8343);s.ICharSizeService=(0,u.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),s.IMouseService=(0,u.createDecorator)("MouseService"),s.IRenderService=(0,u.createDecorator)("RenderService"),s.ISelectionService=(0,u.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,u.createDecorator)("ThemeService"),s.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(l,s,c){var u=this&&this.__decorate||function(E,L,R,D){var N,$=arguments.length,H=$<3?L:D===null?D=Object.getOwnPropertyDescriptor(L,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(E,L,R,D);else for(var W=E.length-1;W>=0;W--)(N=E[W])&&(H=($<3?N(H):$>3?N(L,R,H):N(L,R))||H);return $>3&&H&&Object.defineProperty(L,R,H),H},f=this&&this.__param||function(E,L){return function(R,D){L(R,D,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),g=c(8055),p=c(8460),x=c(844),b=c(2585),_=g.css.toColor("#ffffff"),v=g.css.toColor("#000000"),y=g.css.toColor("#ffffff"),C=g.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],L=[0,95,135,175,215,255];for(let R=0;R<216;R++){const D=L[R/36%6|0],N=L[R/6%6|0],$=L[R%6];E.push({css:g.channels.toCss(D,N,$),rgba:g.channels.toRgba(D,N,$)})}for(let R=0;R<24;R++){const D=8+10*R;E.push({css:g.channels.toCss(D,D,D),rgba:g.channels.toRgba(D,D,D)})}return E})());let A=s.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:v,cursor:y,cursorAccent:C,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:g.color.blend(v,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:g.color.blend(v,w),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(E={}){const L=this._colors;if(L.foreground=T(E.foreground,_),L.background=T(E.background,v),L.cursor=T(E.cursor,y),L.cursorAccent=T(E.cursorAccent,C),L.selectionBackgroundTransparent=T(E.selectionBackground,w),L.selectionBackgroundOpaque=g.color.blend(L.background,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundTransparent=T(E.selectionInactiveBackground,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundOpaque=g.color.blend(L.background,L.selectionInactiveBackgroundTransparent),L.selectionForeground=E.selectionForeground?T(E.selectionForeground,g.NULL_COLOR):void 0,L.selectionForeground===g.NULL_COLOR&&(L.selectionForeground=void 0),g.color.isOpaque(L.selectionBackgroundTransparent)&&(L.selectionBackgroundTransparent=g.color.opacity(L.selectionBackgroundTransparent,.3)),g.color.isOpaque(L.selectionInactiveBackgroundTransparent)&&(L.selectionInactiveBackgroundTransparent=g.color.opacity(L.selectionInactiveBackgroundTransparent,.3)),L.ansi=s.DEFAULT_ANSI_COLORS.slice(),L.ansi[0]=T(E.black,s.DEFAULT_ANSI_COLORS[0]),L.ansi[1]=T(E.red,s.DEFAULT_ANSI_COLORS[1]),L.ansi[2]=T(E.green,s.DEFAULT_ANSI_COLORS[2]),L.ansi[3]=T(E.yellow,s.DEFAULT_ANSI_COLORS[3]),L.ansi[4]=T(E.blue,s.DEFAULT_ANSI_COLORS[4]),L.ansi[5]=T(E.magenta,s.DEFAULT_ANSI_COLORS[5]),L.ansi[6]=T(E.cyan,s.DEFAULT_ANSI_COLORS[6]),L.ansi[7]=T(E.white,s.DEFAULT_ANSI_COLORS[7]),L.ansi[8]=T(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),L.ansi[9]=T(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),L.ansi[10]=T(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),L.ansi[11]=T(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),L.ansi[12]=T(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),L.ansi[13]=T(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),L.ansi[14]=T(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),L.ansi[15]=T(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const R=Math.min(L.ansi.length-16,E.extendedAnsi.length);for(let D=0;D<R;D++)L.ansi[D+16]=T(E.extendedAnsi[D],s.DEFAULT_ANSI_COLORS[D+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){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[E]=this._restoreColors.ansi[E]}else for(let L=0;L<this._restoreColors.ansi.length;++L)this._colors.ansi[L]=this._restoreColors.ansi[L]}modifyColors(E){E(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 T(E,L){if(E!==void 0)try{return g.css.toColor(E)}catch{}return L}s.ThemeService=A=u([f(0,b.IOptionsService)],A)},6349:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const u=c(8460),f=c(844);class d extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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(p){if(this._maxLength===p)return;const x=new Array(p);for(let b=0;b<Math.min(p,this.length);b++)x[b]=this._array[this._getCyclicIndex(b)];this._array=x,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let x=this._length;x<p;x++)this._array[x]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,x){this._array[this._getCyclicIndex(p)]=x}push(p){this._array[this._getCyclicIndex(this._length)]=p,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(p,x,...b){if(x){for(let _=p;_<this._length-x;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+x)];this._length-=x,this.onDeleteEmitter.fire({index:p,amount:x})}for(let _=this._length-1;_>=p;_--)this._array[this._getCyclicIndex(_+b.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<b.length;_++)this._array[this._getCyclicIndex(p+_)]=b[_];if(b.length&&this.onInsertEmitter.fire({index:p,amount:b.length}),this._length+b.length>this._maxLength){const _=this._length+b.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=b.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,x,b){if(!(x<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let v=x-1;v>=0;v--)this.set(p+v+b,this.get(p+v));const _=p+x+b-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<x;_++)this.set(p+_+b,this.get(p+_))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}s.CircularList=d},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function c(u,f=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const g in u)d[g]=f<=1?u[g]:u[g]&&c(u[g],f-1);return d}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,u=0,f=0,d=0;var g,p,x,b,_;function v(C){const w=C.toString(16);return w.length<2?"0"+w:w}function y(C,w){return C<w?(w+.05)/(C+.05):(C+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(C){C.toCss=function(w,A,T,E){return E!==void 0?`#${v(w)}${v(A)}${v(T)}${v(E)}`:`#${v(w)}${v(A)}${v(T)}`},C.toRgba=function(w,A,T,E=255){return(w<<24|A<<16|T<<8|E)>>>0},C.toColor=function(w,A,T,E){return{css:C.toCss(w,A,T,E),rgba:C.toRgba(w,A,T,E)}}})(g||(s.channels=g={})),(function(C){function w(A,T){return d=Math.round(255*T),[c,u,f]=_.toChannels(A.rgba),{css:g.toCss(c,u,f,d),rgba:g.toRgba(c,u,f,d)}}C.blend=function(A,T){if(d=(255&T.rgba)/255,d===1)return{css:T.css,rgba:T.rgba};const E=T.rgba>>24&255,L=T.rgba>>16&255,R=T.rgba>>8&255,D=A.rgba>>24&255,N=A.rgba>>16&255,$=A.rgba>>8&255;return c=D+Math.round((E-D)*d),u=N+Math.round((L-N)*d),f=$+Math.round((R-$)*d),{css:g.toCss(c,u,f),rgba:g.toRgba(c,u,f)}},C.isOpaque=function(A){return(255&A.rgba)==255},C.ensureContrastRatio=function(A,T,E){const L=_.ensureContrastRatio(A.rgba,T.rgba,E);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},C.opaque=function(A){const T=(255|A.rgba)>>>0;return[c,u,f]=_.toChannels(T),{css:g.toCss(c,u,f),rgba:T}},C.opacity=w,C.multiplyOpacity=function(A,T){return d=255&A.rgba,w(A,d*T/255)},C.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(p||(s.color=p={})),(function(C){let w,A;try{const T=document.createElement("canvas");T.width=1,T.height=1;const E=T.getContext("2d",{willReadFrequently:!0});E&&(w=E,w.globalCompositeOperation="copy",A=w.createLinearGradient(0,0,1,1))}catch{}C.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),g.toColor(c,u,f);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),d=parseInt(T.slice(4,5).repeat(2),16),g.toColor(c,u,f,d);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const E=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),u=parseInt(E[2]),f=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),g.toColor(c,u,f,d);if(!w||!A)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=A,w.fillStyle=T,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[c,u,f,d]=w.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,u,f,d),css:T}}})(x||(s.css=x={})),(function(C){function w(A,T,E){const L=A/255,R=T/255,D=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}C.relativeLuminance=function(A){return w(A>>16&255,A>>8&255,255&A)},C.relativeLuminance2=w})(b||(s.rgb=b={})),(function(C){function w(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($>0||H>0||W>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),W-=Math.max(0,Math.ceil(.1*W)),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}function A(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($<255||H<255||W<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),H=Math.min(255,H+Math.ceil(.1*(255-H))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}C.blend=function(T,E){if(d=(255&E)/255,d===1)return E;const L=E>>24&255,R=E>>16&255,D=E>>8&255,N=T>>24&255,$=T>>16&255,H=T>>8&255;return c=N+Math.round((L-N)*d),u=$+Math.round((R-$)*d),f=H+Math.round((D-H)*d),g.toRgba(c,u,f)},C.ensureContrastRatio=function(T,E,L){const R=b.relativeLuminance(T>>8),D=b.relativeLuminance(E>>8);if(y(R,D)<L){if(D<R){const H=w(T,E,L),W=y(R,b.relativeLuminance(H>>8));if(W<L){const Z=A(T,E,L);return W>y(R,b.relativeLuminance(Z>>8))?H:Z}return H}const N=A(T,E,L),$=y(R,b.relativeLuminance(N>>8));if($<L){const H=w(T,E,L);return $>y(R,b.relativeLuminance(H>>8))?N:H}return N}},C.reduceLuminance=w,C.increaseLuminance=A,C.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(_||(s.rgba=_={})),s.toPaddedHex=v,s.contrastRatio=y},8969:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const u=c(844),f=c(2585),d=c(4348),g=c(7866),p=c(744),x=c(7302),b=c(6975),_=c(8460),v=c(1753),y=c(1480),C=c(7994),w=c(9282),A=c(5435),T=c(5981),E=c(2660);let L=!1;class R extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((N=>{var $;($=this._onScrollApi)==null||$.fire(N.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(N){for(const $ in N)this.optionsService.options[$]=N[$]}constructor(N){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(N)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(y.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(C.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new T.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(N,$){this._writeBuffer.write(N,$)}writeSync(N,$){this._logService.logLevel<=f.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(N,$)}input(N,$=!0){this.coreService.triggerDataEvent(N,$)}resize(N,$){isNaN(N)||isNaN($)||(N=Math.max(N,p.MINIMUM_COLS),$=Math.max($,p.MINIMUM_ROWS),this._bufferService.resize(N,$))}scroll(N,$=!1){this._bufferService.scroll(N,$)}scrollLines(N,$,H){this._bufferService.scrollLines(N,$,H)}scrollPages(N){this.scrollLines(N*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(N){const $=N-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(N,$){return this._inputHandler.registerEscHandler(N,$)}registerDcsHandler(N,$){return this._inputHandler.registerDcsHandler(N,$)}registerCsiHandler(N,$){return this._inputHandler.registerCsiHandler(N,$)}registerOscHandler(N,$){return this._inputHandler.registerOscHandler(N,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let N=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?N=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(N=!0),N?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const N=[];N.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),N.push(this.registerCsiHandler({final:"H"},(()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of N)$.dispose()}))}}}s.CoreTerminal=R},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,u){return c((f=>u.fire(f)))},s.runAndSubscribe=function(c,u){return u(void 0),c((f=>u(f)))}},5435:function(l,s,c){var u=this&&this.__decorate||function(X,j,I,z){var Y,q=arguments.length,Q=q<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,I):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(X,j,I,z);else for(var ee=X.length-1;ee>=0;ee--)(Y=X[ee])&&(Q=(q<3?Y(Q):q>3?Y(j,I,Q):Y(j,I))||Q);return q>3&&Q&&Object.defineProperty(j,I,Q),Q},f=this&&this.__param||function(X,j){return function(I,z){j(I,z,X)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const d=c(2584),g=c(7116),p=c(2015),x=c(844),b=c(482),_=c(8437),v=c(8460),y=c(643),C=c(511),w=c(3734),A=c(2585),T=c(1480),E=c(6242),L=c(6351),R=c(5941),D={"(":0,")":1,"*":2,"+":3,"-":1,".":2},N=131072;function $(X,j){if(X>24)return j.setWinLines||!1;switch(X){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var H;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(s.WindowsOptionsReportType=H={}));let W=0;class Z extends x.Disposable{getAttrData(){return this._curAttrData}constructor(j,I,z,Y,q,Q,ee,te,re=new p.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=I,this._coreService=z,this._logService=Y,this._optionsService=q,this._oscLinkService=Q,this._coreMouseService=ee,this._unicodeService=te,this._parser=re,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new C.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((K=>this._activeBuffer=K.activeBuffer))),this._parser.setCsiHandlerFallback(((K,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(K),params:ce.toArray()})})),this._parser.setEscHandlerFallback((K=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(K)})})),this._parser.setExecuteHandlerFallback((K=>{this._logService.debug("Unknown EXECUTE code: ",{code:K})})),this._parser.setOscHandlerFallback(((K,ce,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:K,action:ce,data:ne})})),this._parser.setDcsHandlerFallback(((K,ce,ne)=>{ce==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(K),action:ce,payload:ne})})),this._parser.setPrintHandler(((K,ce,ne)=>this.print(K,ce,ne))),this._parser.registerCsiHandler({final:"@"},(K=>this.insertChars(K))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(K=>this.scrollLeft(K))),this._parser.registerCsiHandler({final:"A"},(K=>this.cursorUp(K))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(K=>this.scrollRight(K))),this._parser.registerCsiHandler({final:"B"},(K=>this.cursorDown(K))),this._parser.registerCsiHandler({final:"C"},(K=>this.cursorForward(K))),this._parser.registerCsiHandler({final:"D"},(K=>this.cursorBackward(K))),this._parser.registerCsiHandler({final:"E"},(K=>this.cursorNextLine(K))),this._parser.registerCsiHandler({final:"F"},(K=>this.cursorPrecedingLine(K))),this._parser.registerCsiHandler({final:"G"},(K=>this.cursorCharAbsolute(K))),this._parser.registerCsiHandler({final:"H"},(K=>this.cursorPosition(K))),this._parser.registerCsiHandler({final:"I"},(K=>this.cursorForwardTab(K))),this._parser.registerCsiHandler({final:"J"},(K=>this.eraseInDisplay(K,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(K=>this.eraseInDisplay(K,!0))),this._parser.registerCsiHandler({final:"K"},(K=>this.eraseInLine(K,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(K=>this.eraseInLine(K,!0))),this._parser.registerCsiHandler({final:"L"},(K=>this.insertLines(K))),this._parser.registerCsiHandler({final:"M"},(K=>this.deleteLines(K))),this._parser.registerCsiHandler({final:"P"},(K=>this.deleteChars(K))),this._parser.registerCsiHandler({final:"S"},(K=>this.scrollUp(K))),this._parser.registerCsiHandler({final:"T"},(K=>this.scrollDown(K))),this._parser.registerCsiHandler({final:"X"},(K=>this.eraseChars(K))),this._parser.registerCsiHandler({final:"Z"},(K=>this.cursorBackwardTab(K))),this._parser.registerCsiHandler({final:"`"},(K=>this.charPosAbsolute(K))),this._parser.registerCsiHandler({final:"a"},(K=>this.hPositionRelative(K))),this._parser.registerCsiHandler({final:"b"},(K=>this.repeatPrecedingCharacter(K))),this._parser.registerCsiHandler({final:"c"},(K=>this.sendDeviceAttributesPrimary(K))),this._parser.registerCsiHandler({prefix:">",final:"c"},(K=>this.sendDeviceAttributesSecondary(K))),this._parser.registerCsiHandler({final:"d"},(K=>this.linePosAbsolute(K))),this._parser.registerCsiHandler({final:"e"},(K=>this.vPositionRelative(K))),this._parser.registerCsiHandler({final:"f"},(K=>this.hVPosition(K))),this._parser.registerCsiHandler({final:"g"},(K=>this.tabClear(K))),this._parser.registerCsiHandler({final:"h"},(K=>this.setMode(K))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(K=>this.setModePrivate(K))),this._parser.registerCsiHandler({final:"l"},(K=>this.resetMode(K))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(K=>this.resetModePrivate(K))),this._parser.registerCsiHandler({final:"m"},(K=>this.charAttributes(K))),this._parser.registerCsiHandler({final:"n"},(K=>this.deviceStatus(K))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(K=>this.deviceStatusPrivate(K))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(K=>this.softReset(K))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(K=>this.setCursorStyle(K))),this._parser.registerCsiHandler({final:"r"},(K=>this.setScrollRegion(K))),this._parser.registerCsiHandler({final:"s"},(K=>this.saveCursor(K))),this._parser.registerCsiHandler({final:"t"},(K=>this.windowOptions(K))),this._parser.registerCsiHandler({final:"u"},(K=>this.restoreCursor(K))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(K=>this.insertColumns(K))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(K=>this.deleteColumns(K))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(K=>this.selectProtected(K))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(K=>this.requestMode(K,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(K=>this.requestMode(K,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((K=>(this.setTitle(K),this.setIconName(K),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((K=>this.setIconName(K)))),this._parser.registerOscHandler(2,new E.OscHandler((K=>this.setTitle(K)))),this._parser.registerOscHandler(4,new E.OscHandler((K=>this.setOrReportIndexedColor(K)))),this._parser.registerOscHandler(8,new E.OscHandler((K=>this.setHyperlink(K)))),this._parser.registerOscHandler(10,new E.OscHandler((K=>this.setOrReportFgColor(K)))),this._parser.registerOscHandler(11,new E.OscHandler((K=>this.setOrReportBgColor(K)))),this._parser.registerOscHandler(12,new E.OscHandler((K=>this.setOrReportCursorColor(K)))),this._parser.registerOscHandler(104,new E.OscHandler((K=>this.restoreIndexedColor(K)))),this._parser.registerOscHandler(110,new E.OscHandler((K=>this.restoreFgColor(K)))),this._parser.registerOscHandler(111,new E.OscHandler((K=>this.restoreBgColor(K)))),this._parser.registerOscHandler(112,new E.OscHandler((K=>this.restoreCursorColor(K)))),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 K in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:K},(()=>this.selectCharset("("+K))),this._parser.registerEscHandler({intermediates:")",final:K},(()=>this.selectCharset(")"+K))),this._parser.registerEscHandler({intermediates:"*",final:K},(()=>this.selectCharset("*"+K))),this._parser.registerEscHandler({intermediates:"+",final:K},(()=>this.selectCharset("+"+K))),this._parser.registerEscHandler({intermediates:"-",final:K},(()=>this.selectCharset("-"+K))),this._parser.registerEscHandler({intermediates:".",final:K},(()=>this.selectCharset("."+K))),this._parser.registerEscHandler({intermediates:"/",final:K},(()=>this.selectCharset("/"+K)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((K=>(this._logService.error("Parsing error: ",K),K))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((K,ce)=>this.requestStatusString(K,ce))))}_preserveStack(j,I,z,Y){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=z,this._parseStack.position=Y}_logSlowResolvingAsync(j){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([j,new Promise(((I,z)=>setTimeout((()=>z("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,I){let z,Y=this._activeBuffer.x,q=this._activeBuffer.y,Q=0;const ee=this._parseStack.paused;if(ee){if(z=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(z),z;Y=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>N&&(Q=this._parseStack.position+N)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(K=>String.fromCharCode(K))).join("")}"`),typeof j=="string"?j.split("").map((K=>K.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<N&&(this._parseBuffer=new Uint32Array(Math.min(j.length,N))),ee||this._dirtyRowTracker.clearRange(),j.length>N)for(let K=Q;K<j.length;K+=N){const ce=K+N<j.length?K+N:j.length,ne=typeof j=="string"?this._stringDecoder.decode(j.substring(K,ce),this._parseBuffer):this._utf8Decoder.decode(j.subarray(K,ce),this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(Y,q,ne,K),this._logSlowResolvingAsync(z),z}else if(!ee){const K=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,K))return this._preserveStack(Y,q,K,0),this._logSlowResolvingAsync(z),z}this._activeBuffer.x===Y&&this._activeBuffer.y===q||this._onCursorMove.fire();const te=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),re=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);re<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(re,this._bufferService.rows-1),Math.min(te,this._bufferService.rows-1))}print(j,I,z){let Y,q;const Q=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,re=this._coreService.decPrivateModes.wraparound,K=this._coreService.modes.insertMode,ce=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&z-I>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let de=this._parser.precedingJoinState;for(let _e=I;_e<z;++_e){if(Y=j[_e],Y<127&&Q){const kt=Q[String.fromCharCode(Y)];kt&&(Y=kt.charCodeAt(0))}const Be=this._unicodeService.charProperties(Y,de);q=T.UnicodeService.extractWidth(Be);const De=T.UnicodeService.extractShouldJoin(Be),Ze=De?T.UnicodeService.extractWidth(de):0;if(de=Be,ee&&this._onA11yChar.fire((0,b.stringFromCodePoint)(Y)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+q-Ze>te){if(re){const kt=ne;let Je=this._activeBuffer.x-Ze;for(this._activeBuffer.x=Ze,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ze>0&&ne instanceof _.BufferLine&&ne.copyCellsFrom(kt,Je,0,Ze,!1);Je<te;)kt.setCellFromCodepoint(Je++,0,1,ce)}else if(this._activeBuffer.x=te-1,q===2)continue}if(De&&this._activeBuffer.x){const kt=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-kt,Y,q);for(let Je=q-Ze;--Je>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(K&&(ne.insertCells(this._activeBuffer.x,q-Ze,this._activeBuffer.getNullCell(ce)),ne.getWidth(te-1)===2&&ne.setCellFromCodepoint(te-1,y.NULL_CELL_CODE,y.NULL_CELL_WIDTH,ce)),ne.setCellFromCodepoint(this._activeBuffer.x++,Y,q,ce),q>0)for(;--q;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=de,this._activeBuffer.x<te&&z-I>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,I){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,I):this._parser.registerCsiHandler(j,(z=>!$(z.params[0],this._optionsService.rawOptions.windowOptions)||I(z)))}registerDcsHandler(j,I){return this._parser.registerDcsHandler(j,new L.DcsHandler(I))}registerEscHandler(j,I){return this._parser.registerEscHandler(j,I)}registerOscHandler(j,I){return this._parser.registerOscHandler(j,new E.OscHandler(I))}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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=j,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+I)}cursorUp(j){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const I=j.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=j.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=j.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const I=j.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,I,z,Y=!1,q=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);Q.replaceCells(I,z,this._activeBuffer.getNullCell(this._eraseAttrData()),q),Y&&(Q.isWrapped=!1)}_resetBufferLine(j,I=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z&&(z.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),z.isWrapped=!1)}eraseInDisplay(j,I=!1){let z;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);z<this._bufferService.rows;z++)this._resetBufferLine(z,I);this._dirtyRowTracker.markDirty(z);break;case 1:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z,0,this._activeBuffer.x+1,!0,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(z+1).isWrapped=!1);z--;)this._resetBufferLine(z,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(z=this._bufferService.rows,this._dirtyRowTracker.markDirty(z-1);z--;)this._resetBufferLine(z,I);this._dirtyRowTracker.markDirty(0);break;case 3:const Y=this._activeBuffer.lines.length-this._bufferService.rows;Y>0&&(this._activeBuffer.lines.trimStart(Y),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Y,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Y,0),this._onScroll.fire(0))}return!0}eraseInLine(j,I=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let I=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y,Y=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-Y+1;for(;I--;)this._activeBuffer.lines.splice(q-1,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let I=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y;let Y;for(Y=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-Y;I--;)this._activeBuffer.lines.splice(z,1),this._activeBuffer.lines.splice(Y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let I=j.params[0]||1;for(;I--;)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(j){let I=j.params[0]||1;for(;I--;)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(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Y.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),Y.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Y.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),Y.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Y.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),Y.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);Y.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),Y.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const I=this._parser.precedingJoinState;if(!I)return!0;const z=j.params[0]||1,Y=T.UnicodeService.extractWidth(I),q=this._activeBuffer.x-Y,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(q),ee=new Uint32Array(Q.length*z);let te=0;for(let K=0;K<Q.length;){const ce=Q.codePointAt(K)||0;ee[te++]=ce,K+=ce>65535?2:1}let re=te;for(let K=1;K<z;++K)ee.copyWithin(re,0,te),re+=te;return this.print(ee,0,re),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let I=0;I<j.length;I++)switch(j.params[I]){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(),j.params[I]===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(j,I){const z=this._coreService.decPrivateModes,{activeProtocol:Y,activeEncoding:q}=this._coreMouseService,Q=this._coreService,{buffers:ee,cols:te}=this._bufferService,{active:re,alt:K}=ee,ce=this._optionsService.rawOptions,ne=De=>De?1:2,de=j.params[0];return _e=de,Be=I?de===2?4:de===4?ne(Q.modes.insertMode):de===12?3:de===20?ne(ce.convertEol):0:de===1?ne(z.applicationCursorKeys):de===3?ce.windowOptions.setWinLines?te===80?2:te===132?1:0:0:de===6?ne(z.origin):de===7?ne(z.wraparound):de===8?3:de===9?ne(Y==="X10"):de===12?ne(ce.cursorBlink):de===25?ne(!Q.isCursorHidden):de===45?ne(z.reverseWraparound):de===66?ne(z.applicationKeypad):de===67?4:de===1e3?ne(Y==="VT200"):de===1002?ne(Y==="DRAG"):de===1003?ne(Y==="ANY"):de===1004?ne(z.sendFocus):de===1005?4:de===1006?ne(q==="SGR"):de===1015?4:de===1016?ne(q==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ne(re===K):de===2004?ne(z.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${I?"":"?"}${_e};${Be}$y`),!0;var _e,Be}_updateAttrColor(j,I,z,Y,q){return I===2?(j|=50331648,j&=-16777216,j|=w.AttributeData.fromColorRGB([z,Y,q])):I===5&&(j&=-50331904,j|=33554432|255&z),j}_extractColor(j,I,z){const Y=[0,0,-1,0,0,0];let q=0,Q=0;do{if(Y[Q+q]=j.params[I+Q],j.hasSubParams(I+Q)){const ee=j.getSubParams(I+Q);let te=0;do Y[1]===5&&(q=1),Y[Q+te+1+q]=ee[te];while(++te<ee.length&&te+Q+1+q<Y.length);break}if(Y[1]===5&&Q+q>=2||Y[1]===2&&Q+q>=5)break;Y[1]&&(q=1)}while(++Q+I<j.length&&Q+q<Y.length);for(let ee=2;ee<Y.length;++ee)Y[ee]===-1&&(Y[ee]=0);switch(Y[0]){case 38:z.fg=this._updateAttrColor(z.fg,Y[1],Y[3],Y[4],Y[5]);break;case 48:z.bg=this._updateAttrColor(z.bg,Y[1],Y[3],Y[4],Y[5]);break;case 58:z.extended=z.extended.clone(),z.extended.underlineColor=this._updateAttrColor(z.extended.underlineColor,Y[1],Y[3],Y[4],Y[5])}return Q}_processUnderline(j,I){I.extended=I.extended.clone(),(!~j||j>5)&&(j=1),I.extended.underlineStyle=j,I.fg|=268435456,j===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(j){j.fg=_.DEFAULT_ATTR_DATA.fg,j.bg=_.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=j.length;let z;const Y=this._curAttrData;for(let q=0;q<I;q++)z=j.params[q],z>=30&&z<=37?(Y.fg&=-50331904,Y.fg|=16777216|z-30):z>=40&&z<=47?(Y.bg&=-50331904,Y.bg|=16777216|z-40):z>=90&&z<=97?(Y.fg&=-50331904,Y.fg|=16777224|z-90):z>=100&&z<=107?(Y.bg&=-50331904,Y.bg|=16777224|z-100):z===0?this._processSGR0(Y):z===1?Y.fg|=134217728:z===3?Y.bg|=67108864:z===4?(Y.fg|=268435456,this._processUnderline(j.hasSubParams(q)?j.getSubParams(q)[0]:1,Y)):z===5?Y.fg|=536870912:z===7?Y.fg|=67108864:z===8?Y.fg|=1073741824:z===9?Y.fg|=2147483648:z===2?Y.bg|=134217728:z===21?this._processUnderline(2,Y):z===22?(Y.fg&=-134217729,Y.bg&=-134217729):z===23?Y.bg&=-67108865:z===24?(Y.fg&=-268435457,this._processUnderline(0,Y)):z===25?Y.fg&=-536870913:z===27?Y.fg&=-67108865:z===28?Y.fg&=-1073741825:z===29?Y.fg&=2147483647:z===39?(Y.fg&=-67108864,Y.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):z===49?(Y.bg&=-67108864,Y.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?q+=this._extractColor(j,q,Y):z===53?Y.bg|=1073741824:z===55?Y.bg&=-1073741825:z===59?(Y.extended=Y.extended.clone(),Y.extended.underlineColor=-1,Y.updateExtended()):z===100?(Y.fg&=-67108864,Y.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,Y.bg&=-67108864,Y.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${I};${z}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const I=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${I};${z}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.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(j){const I=j.params[0]||1;switch(I){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 z=I%2==1;return this._optionsService.options.cursorBlink=z,!0}setScrollRegion(j){const I=j.params[0]||1;let z;return(j.length<2||(z=j.params[1])>this._bufferService.rows||z===0)&&(z=this._bufferService.rows),z>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=z-1,this._setCursor(0,0)),!0}windowOptions(j){if(!$(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:I!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const I=[],z=j.split(";");for(;z.length>1;){const Y=z.shift(),q=z.shift();if(/^\d+$/.exec(Y)){const Q=parseInt(Y);if(G(Q))if(q==="?")I.push({type:0,index:Q});else{const ee=(0,R.parseColor)(q);ee&&I.push({type:1,index:Q,color:ee})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(j){const I=j.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(j,I){this._getCurrentLinkId()&&this._finishHyperlink();const z=j.split(":");let Y;const q=z.findIndex((Q=>Q.startsWith("id=")));return q!==-1&&(Y=z[q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Y,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,I){const z=j.split(";");for(let Y=0;Y<z.length&&!(I>=this._specialColors.length);++Y,++I)if(z[Y]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const q=(0,R.parseColor)(z[Y]);q&&this._onColor.fire([{type:1,index:this._specialColors[I],color:q}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const I=[],z=j.split(";");for(let Y=0;Y<z.length;++Y)if(/^\d+$/.exec(z[Y])){const q=parseInt(z[Y]);G(q)&&I.push({type:2,index:q})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,g.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(D[j[0]],g.CHARSETS[j[1]]||g.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new C.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const z=this._activeBuffer.ybase+this._activeBuffer.y+I,Y=this._activeBuffer.lines.get(z);Y&&(Y.fill(j),Y.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,I){const z=this._bufferService.buffer,Y=this._optionsService.rawOptions;return(q=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${q}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${z.scrollTop+1};${z.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[Y.cursorStyle]-(Y.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,I){this._dirtyRowTracker.markRangeDirty(j,I)}}s.InputHandler=Z;let P=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,j){X>j&&(W=X,X=j,j=W),X<this.start&&(this.start=X),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(X){return 0<=X&&X<256}P=u([f(0,A.IBufferService)],P)},844:(l,s)=>{function c(u){for(const f of u)f.dispose();u.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const f=this._disposables.indexOf(u);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var f;this._isDisposed||u===this._value||((f=this._value)==null||f.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},s.toDisposable=function(u){return{dispose:u}},s.disposeArray=c,s.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,d,g){this._data[f]||(this._data[f]={}),this._data[f][d]=g}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(u,f,d,g,p){this._data.get(u,f)||this._data.set(u,f,new c),this._data.get(u,f).set(d,g,p)}get(u,f,d,g){var p;return(p=this._data.get(u,f))==null?void 0:p.get(d,g)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,u=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=c.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),s.isIpad=u==="iPad",s.isIphone=u==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),s.isLinux=u.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let c=0;s.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const f=this._getKey(u);if(f===void 0||(c=this._search(f),c===-1)||this._getKey(this._array[c])!==f)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===f);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,f){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do f(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let f=0,d=this._array.length-1;for(;d>=f;){let g=f+d>>1;const p=this._getKey(this._array[g]);if(p>u)d=g-1;else{if(!(p<u)){for(;g>0&&this._getKey(this._array[g-1])===u;)g--;return g}f=g+1}}return f}}},7226:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const u=c(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let x=0,b=0,_=p.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),b=Math.max(x,b),v=p.timeRemaining(),1.5*b>v)return _-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-x))}ms`),void this._start();_=v}this.clear()}}class d extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const x=Date.now()+p;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const u=c(643);s.updateWindowsModeWrappedState=function(f){const d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),g=d==null?void 0:d.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&g&&(p.isWrapped=g[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&g[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,g=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=g}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=u},9092:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const u=c(6349),f=c(7226),d=c(3734),g=c(8437),p=c(4634),x=c(511),b=c(643),_=c(4863),v=c(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(y,C,w){this._hasScrollback=y,this._optionsService=C,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(y){return y?(this._nullCell.fg=y.fg,this._nullCell.bg=y.bg,this._nullCell.extended=y.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(y){return y?(this._whitespaceCell.fg=y.fg,this._whitespaceCell.bg=y.bg,this._whitespaceCell.extended=y.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(y,C){return new g.BufferLine(this._bufferService.cols,this.getNullCell(y),C)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const y=this.ybase+this.y-this.ydisp;return y>=0&&y<this._rows}_getCorrectBufferLength(y){if(!this._hasScrollback)return y;const C=y+this._optionsService.rawOptions.scrollback;return C>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:C}fillViewportRows(y){if(this.lines.length===0){y===void 0&&(y=g.DEFAULT_ATTR_DATA);let C=this._rows;for(;C--;)this.lines.push(this.getBlankLine(y))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(y,C){const w=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=0;const T=this._getCorrectBufferLength(C);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols<y)for(let L=0;L<this.lines.length;L++)A+=+this.lines.get(L).resize(y,w);let E=0;if(this._rows<C)for(let L=this._rows;L<C;L++)this.lines.length<C+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(y,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(y,w)));else for(let L=this._rows;L>C;L--)this.lines.length>C+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T<this.lines.maxLength){const L=this.lines.length-T;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=T}this.x=Math.min(this.x,y-1),this.y=Math.min(this.y,C-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,y-1),this.scrollTop=0}if(this.scrollBottom=C-1,this._isReflowEnabled&&(this._reflow(y,C),this._cols>y))for(let E=0;E<this.lines.length;E++)A+=+this.lines.get(E).resize(y,w);this._cols=y,this._rows=C,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let y=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,y=!1);let C=0;for(;this._memoryCleanupPosition<this.lines.length;)if(C+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),C>100)return!0;return y}get _isReflowEnabled(){const y=this._optionsService.rawOptions.windowsPty;return y&&y.buildNumber?this._hasScrollback&&y.backend==="conpty"&&y.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(y,C){this._cols!==y&&(y>this._cols?this._reflowLarger(y,C):this._reflowSmaller(y,C))}_reflowLarger(y,C){const w=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,y,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(w.length>0){const A=(0,p.reflowLargerCreateNewLayout)(this.lines,w);(0,p.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(y,C,A.countRemoved)}}_reflowLargerAdjustViewport(y,C,w){const A=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=w;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<C&&this.lines.push(new g.BufferLine(y,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(y,C){const w=this.getNullCell(g.DEFAULT_ATTR_DATA),A=[];let T=0;for(let E=this.lines.length-1;E>=0;E--){let L=this.lines.get(E);if(!L||!L.isWrapped&&L.getTrimmedLength()<=y)continue;const R=[L];for(;L.isWrapped&&E>0;)L=this.lines.get(--E),R.unshift(L);const D=this.ybase+this.y;if(D>=E&&D<E+R.length)continue;const N=R[R.length-1].getTrimmedLength(),$=(0,p.reflowSmallerGetNewLineLengths)(R,this._cols,y),H=$.length-R.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const Z=[];for(let z=0;z<H;z++){const Y=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);Z.push(Y)}Z.length>0&&(A.push({start:E+R.length+T,newLines:Z}),T+=Z.length),R.push(...Z);let P=$.length-1,G=$[P];G===0&&(P--,G=$[P]);let X=R.length-H-1,j=N;for(;X>=0;){const z=Math.min(j,G);if(R[P]===void 0)break;if(R[P].copyCellsFrom(R[X],j-z,G-z,z,!0),G-=z,G===0&&(P--,G=$[P]),j-=z,j===0){X--;const Y=Math.max(X,0);j=(0,p.getWrappedLineTrimmedLength)(R,Y,this._cols)}}for(let z=0;z<R.length;z++)$[z]<y&&R[z].setCell($[z],w);let I=H-W;for(;I-- >0;)this.ybase===0?this.y<C-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+T)-C&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+C-1)}if(A.length>0){const E=[],L=[];for(let P=0;P<this.lines.length;P++)L.push(this.lines.get(P));const R=this.lines.length;let D=R-1,N=0,$=A[N];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+T);let H=0;for(let P=Math.min(this.lines.maxLength-1,R+T-1);P>=0;P--)if($&&$.start>D+H){for(let G=$.newLines.length-1;G>=0;G--)this.lines.set(P--,$.newLines[G]);P++,E.push({index:D+1,amount:$.newLines.length}),H+=$.newLines.length,$=A[++N]}else this.lines.set(P,L[D--]);let W=0;for(let P=E.length-1;P>=0;P--)E[P].index+=W,this.lines.onInsertEmitter.fire(E[P]),W+=E[P].amount;const Z=Math.max(0,R+T-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}}translateBufferLineToString(y,C,w=0,A){const T=this.lines.get(y);return T?T.translateToString(C,w,A):""}getWrappedRangeForLine(y){let C=y,w=y;for(;C>0&&this.lines.get(C).isWrapped;)C--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:C,last:w}}setupTabStops(y){for(y!=null?this.tabs[y]||(y=this.prevStop(y)):(this.tabs={},y=0);y<this._cols;y+=this._optionsService.rawOptions.tabStopWidth)this.tabs[y]=!0}prevStop(y){for(y==null&&(y=this.x);!this.tabs[--y]&&y>0;);return y>=this._cols?this._cols-1:y<0?0:y}nextStop(y){for(y==null&&(y=this.x);!this.tabs[++y]&&y<this._cols;);return y>=this._cols?this._cols-1:y<0?0:y}clearMarkers(y){this._isClearing=!0;for(let C=0;C<this.markers.length;C++)this.markers[C].line===y&&(this.markers[C].dispose(),this.markers.splice(C--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].dispose(),this.markers.splice(y--,1);this._isClearing=!1}addMarker(y){const C=new _.Marker(y);return this.markers.push(C),C.register(this.lines.onTrim((w=>{C.line-=w,C.line<0&&C.dispose()}))),C.register(this.lines.onInsert((w=>{C.line>=w.index&&(C.line+=w.amount)}))),C.register(this.lines.onDelete((w=>{C.line>=w.index&&C.line<w.index+w.amount&&C.dispose(),C.line>w.index&&(C.line-=w.amount)}))),C.register(C.onDispose((()=>this._removeMarker(C)))),C}_removeMarker(y){this._isClearing||this.markers.splice(this.markers.indexOf(y),1)}}},8437:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const u=c(3734),f=c(511),d=c(643),g=c(482);s.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let p=0;class x{constructor(_,v,y=!1){this.isWrapped=y,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const C=v||f.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let w=0;w<_;++w)this.setCell(w,C);this.length=_}get(_){const v=this._data[3*_+0],y=2097151&v;return[this._data[3*_+1],2097152&v?this._combined[_]:y?(0,g.stringFromCodePoint)(y):"",v>>22,2097152&v?this._combined[_].charCodeAt(this._combined[_].length-1):y]}set(_,v){this._data[3*_+1]=v[d.CHAR_DATA_ATTR_INDEX],v[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=v[1],this._data[3*_+0]=2097152|_|v[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const v=this._data[3*_+0];return 2097152&v?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&v}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const v=this._data[3*_+0];return 2097152&v?this._combined[_]:2097151&v?(0,g.stringFromCodePoint)(2097151&v):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,v){return p=3*_,v.content=this._data[p+0],v.fg=this._data[p+1],v.bg=this._data[p+2],2097152&v.content&&(v.combinedData=this._combined[_]),268435456&v.bg&&(v.extended=this._extendedAttrs[_]),v}setCell(_,v){2097152&v.content&&(this._combined[_]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[_]=v.extended),this._data[3*_+0]=v.content,this._data[3*_+1]=v.fg,this._data[3*_+2]=v.bg}setCellFromCodepoint(_,v,y,C){268435456&C.bg&&(this._extendedAttrs[_]=C.extended),this._data[3*_+0]=v|y<<22,this._data[3*_+1]=C.fg,this._data[3*_+2]=C.bg}addCodepointToCell(_,v,y){let C=this._data[3*_+0];2097152&C?this._combined[_]+=(0,g.stringFromCodePoint)(v):2097151&C?(this._combined[_]=(0,g.stringFromCodePoint)(2097151&C)+(0,g.stringFromCodePoint)(v),C&=-2097152,C|=2097152):C=v|4194304,y&&(C&=-12582913,C|=y<<22),this._data[3*_+0]=C}insertCells(_,v,y){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,y),v<this.length-_){const C=new f.CellData;for(let w=this.length-_-v-1;w>=0;--w)this.setCell(_+v+w,this.loadCell(_+w,C));for(let w=0;w<v;++w)this.setCell(_+w,y)}else for(let C=_;C<this.length;++C)this.setCell(C,y);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,y)}deleteCells(_,v,y){if(_%=this.length,v<this.length-_){const C=new f.CellData;for(let w=0;w<this.length-_-v;++w)this.setCell(_+w,this.loadCell(_+v+w,C));for(let w=this.length-v;w<this.length;++w)this.setCell(w,y)}else for(let C=_;C<this.length;++C)this.setCell(C,y);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,y),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,y)}replaceCells(_,v,y,C=!1){if(C)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,y),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,y);_<v&&_<this.length;)this.isProtected(_)||this.setCell(_,y),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,y),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,y);_<v&&_<this.length;)this.setCell(_++,y)}resize(_,v){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const y=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*y)this._data=new Uint32Array(this._data.buffer,0,y);else{const C=new Uint32Array(y);C.set(this._data),this._data=C}for(let C=this.length;C<_;++C)this.setCell(C,v)}else{this._data=this._data.subarray(0,y);const C=Object.keys(this._combined);for(let A=0;A<C.length;A++){const T=parseInt(C[A],10);T>=_&&delete this._combined[T]}const w=Object.keys(this._extendedAttrs);for(let A=0;A<w.length;A++){const T=parseInt(w[A],10);T>=_&&delete this._extendedAttrs[T]}}return this.length=_,4*y*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,v=!1){if(v)for(let y=0;y<this.length;++y)this.isProtected(y)||this.setCell(y,_);else{this._combined={},this._extendedAttrs={};for(let y=0;y<this.length;++y)this.setCell(y,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const v in _._combined)this._combined[v]=_._combined[v];this._extendedAttrs={};for(const v in _._extendedAttrs)this._extendedAttrs[v]=_._extendedAttrs[v];this.isWrapped=_.isWrapped}clone(){const _=new x(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const v in this._combined)_._combined[v]=this._combined[v];for(const v in this._extendedAttrs)_._extendedAttrs[v]=this._extendedAttrs[v];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,v,y,C,w){const A=_._data;if(w)for(let E=C-1;E>=0;E--){for(let L=0;L<3;L++)this._data[3*(y+E)+L]=A[3*(v+E)+L];268435456&A[3*(v+E)+2]&&(this._extendedAttrs[y+E]=_._extendedAttrs[v+E])}else for(let E=0;E<C;E++){for(let L=0;L<3;L++)this._data[3*(y+E)+L]=A[3*(v+E)+L];268435456&A[3*(v+E)+2]&&(this._extendedAttrs[y+E]=_._extendedAttrs[v+E])}const T=Object.keys(_._combined);for(let E=0;E<T.length;E++){const L=parseInt(T[E],10);L>=v&&(this._combined[L-v+y]=_._combined[L])}}translateToString(_,v,y,C){v=v??0,y=y??this.length,_&&(y=Math.min(y,this.getTrimmedLength())),C&&(C.length=0);let w="";for(;v<y;){const A=this._data[3*v+0],T=2097151&A,E=2097152&A?this._combined[v]:T?(0,g.stringFromCodePoint)(T):d.WHITESPACE_CELL_CHAR;if(w+=E,C)for(let L=0;L<E.length;++L)C.push(v);v+=A>>22||1}return C&&C.push(v),w}}s.BufferLine=x},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,s)=>{function c(u,f,d){if(f===u.length-1)return u[f].getTrimmedLength();const g=!u[f].hasContent(d-1)&&u[f].getWidth(d-1)===1,p=u[f+1].getWidth(0)===2;return g&&p?d-1:d}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(u,f,d,g,p){const x=[];for(let b=0;b<u.length-1;b++){let _=b,v=u.get(++_);if(!v.isWrapped)continue;const y=[u.get(b)];for(;_<u.length&&v.isWrapped;)y.push(v),v=u.get(++_);if(g>=b&&g<_){b+=y.length-1;continue}let C=0,w=c(y,C,f),A=1,T=0;for(;A<y.length;){const L=c(y,A,f),R=L-T,D=d-w,N=Math.min(R,D);y[C].copyCellsFrom(y[A],T,w,N,!1),w+=N,w===d&&(C++,w=0),T+=N,T===L&&(A++,T=0),w===0&&C!==0&&y[C-1].getWidth(d-1)===2&&(y[C].copyCellsFrom(y[C-1],d-1,w++,1,!1),y[C-1].setCell(d-1,p))}y[C].replaceCells(w,d,p);let E=0;for(let L=y.length-1;L>0&&(L>C||y[L].getTrimmedLength()===0);L--)E++;E>0&&(x.push(b+y.length-E),x.push(E)),b+=y.length-1}return x},s.reflowLargerCreateNewLayout=function(u,f){const d=[];let g=0,p=f[g],x=0;for(let b=0;b<u.length;b++)if(p===b){const _=f[++g];u.onDeleteEmitter.fire({index:b-x,amount:_}),b+=_-1,x+=_,p=f[++g]}else d.push(b);return{layout:d,countRemoved:x}},s.reflowLargerApplyNewLayout=function(u,f){const d=[];for(let g=0;g<f.length;g++)d.push(u.get(f[g]));for(let g=0;g<d.length;g++)u.set(g,d[g]);u.length=f.length},s.reflowSmallerGetNewLineLengths=function(u,f,d){const g=[],p=u.map(((v,y)=>c(u,y,f))).reduce(((v,y)=>v+y));let x=0,b=0,_=0;for(;_<p;){if(p-_<d){g.push(p-_);break}x+=d;const v=c(u,b,f);x>v&&(x-=v,b++);const y=u[b].getWidth(x-1)===2;y&&x--;const C=y?d-1:d;g.push(C),_+=C}return g},s.getWrappedLineTrimmedLength=c},5295:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const u=c(8460),f=c(844),d=c(9092);class g extends f.Disposable{constructor(x,b){super(),this._optionsService=x,this._bufferService=b,this._onBufferActivate=this.register(new u.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,b){this._normal.resize(x,b),this._alt.resize(x,b),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}s.BufferSet=g},511:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const u=c(482),f=c(643),d=c(3734);class g extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const b=new g;return b.setFromCharData(x),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(x[f.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(x[f.CHAR_DATA_CHAR_INDEX].length===2){const _=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const v=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(_-55296)+v-56320+65536|x[f.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=x[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=g},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const u=c(8460),f=c(844);class d{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}s.Marker=d,d._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var c,u,f;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
101
101
  `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(s.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(s.C1=u={})),(function(d){d.ST=`${c.ESC}\\`})(f||(s.C1_ESCAPED=f={}))},7399:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const u=c(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(d,g,p,x){const b={type:0,cancel:!1,key:void 0},_=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?b.key=g?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?b.key=g?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?b.key=g?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(b.key=g?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:b.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(b.key=u.C0.ESC+b.key);break;case 9:if(d.shiftKey){b.key=u.C0.ESC+"[Z";break}b.key=u.C0.HT,b.cancel=!0;break;case 13:b.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,b.cancel=!0;break;case 27:b.key=u.C0.ESC,d.altKey&&(b.key=u.C0.ESC+u.C0.ESC),b.cancel=!0;break;case 37:if(d.metaKey)break;_?(b.key=u.C0.ESC+"[1;"+(_+1)+"D",b.key===u.C0.ESC+"[1;3D"&&(b.key=u.C0.ESC+(p?"b":"[1;5D"))):b.key=g?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;_?(b.key=u.C0.ESC+"[1;"+(_+1)+"C",b.key===u.C0.ESC+"[1;3C"&&(b.key=u.C0.ESC+(p?"f":"[1;5C"))):b.key=g?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;_?(b.key=u.C0.ESC+"[1;"+(_+1)+"A",p||b.key!==u.C0.ESC+"[1;3A"||(b.key=u.C0.ESC+"[1;5A")):b.key=g?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;_?(b.key=u.C0.ESC+"[1;"+(_+1)+"B",p||b.key!==u.C0.ESC+"[1;3B"||(b.key=u.C0.ESC+"[1;5B")):b.key=g?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(b.key=u.C0.ESC+"[2~");break;case 46:b.key=_?u.C0.ESC+"[3;"+(_+1)+"~":u.C0.ESC+"[3~";break;case 36:b.key=_?u.C0.ESC+"[1;"+(_+1)+"H":g?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:b.key=_?u.C0.ESC+"[1;"+(_+1)+"F":g?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?b.type=2:d.ctrlKey?b.key=u.C0.ESC+"[5;"+(_+1)+"~":b.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?b.type=3:d.ctrlKey?b.key=u.C0.ESC+"[6;"+(_+1)+"~":b.key=u.C0.ESC+"[6~";break;case 112:b.key=_?u.C0.ESC+"[1;"+(_+1)+"P":u.C0.ESC+"OP";break;case 113:b.key=_?u.C0.ESC+"[1;"+(_+1)+"Q":u.C0.ESC+"OQ";break;case 114:b.key=_?u.C0.ESC+"[1;"+(_+1)+"R":u.C0.ESC+"OR";break;case 115:b.key=_?u.C0.ESC+"[1;"+(_+1)+"S":u.C0.ESC+"OS";break;case 116:b.key=_?u.C0.ESC+"[15;"+(_+1)+"~":u.C0.ESC+"[15~";break;case 117:b.key=_?u.C0.ESC+"[17;"+(_+1)+"~":u.C0.ESC+"[17~";break;case 118:b.key=_?u.C0.ESC+"[18;"+(_+1)+"~":u.C0.ESC+"[18~";break;case 119:b.key=_?u.C0.ESC+"[19;"+(_+1)+"~":u.C0.ESC+"[19~";break;case 120:b.key=_?u.C0.ESC+"[20;"+(_+1)+"~":u.C0.ESC+"[20~";break;case 121:b.key=_?u.C0.ESC+"[21;"+(_+1)+"~":u.C0.ESC+"[21~";break;case 122:b.key=_?u.C0.ESC+"[23;"+(_+1)+"~":u.C0.ESC+"[23~";break;case 123:b.key=_?u.C0.ESC+"[24;"+(_+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(p&&!x||!d.altKey||d.metaKey)!p||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?b.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(b.key=u.C0.US),d.key==="@"&&(b.key=u.C0.NUL)):d.keyCode===65&&(b.type=1);else{const v=f[d.keyCode],y=v==null?void 0:v[d.shiftKey?1:0];if(y)b.key=u.C0.ESC+y;else if(d.keyCode>=65&&d.keyCode<=90){const C=d.ctrlKey?d.keyCode-64:d.keyCode+32;let w=String.fromCharCode(C);d.shiftKey&&(w=w.toUpperCase()),b.key=u.C0.ESC+w}else if(d.keyCode===32)b.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let C=d.code.slice(3,4);d.shiftKey||(C=C.toLowerCase()),b.key=u.C0.ESC+C,b.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?b.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?b.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?b.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?b.key=u.C0.DEL:d.keyCode===219?b.key=u.C0.ESC:d.keyCode===220?b.key=u.C0.FS:d.keyCode===221&&(b.key=u.C0.GS)}return b}},482:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,u=0,f=c.length){let d="";for(let g=u;g<f;++g){let p=c[g];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const f=c.length;if(!f)return 0;let d=0,g=0;if(this._interim){const p=c.charCodeAt(g++);56320<=p&&p<=57343?u[d++]=1024*(this._interim-55296)+p-56320+65536:(u[d++]=this._interim,u[d++]=p),this._interim=0}for(let p=g;p<f;++p){const x=c.charCodeAt(p);if(55296<=x&&x<=56319){if(++p>=f)return this._interim=x,d;const b=c.charCodeAt(p);56320<=b&&b<=57343?u[d++]=1024*(x-55296)+b-56320+65536:(u[d++]=x,u[d++]=b)}else x!==65279&&(u[d++]=x)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const f=c.length;if(!f)return 0;let d,g,p,x,b=0,_=0,v=0;if(this.interim[0]){let w=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let T,E=0;for(;(T=63&this.interim[++E])&&E<4;)A<<=6,A|=T;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=L-E;for(;v<R;){if(v>=f)return 0;if(T=c[v++],(192&T)!=128){v--,w=!0;break}this.interim[E++]=T,A<<=6,A|=63&T}w||(L===2?A<128?v--:u[b++]=A:L===3?A<2048||A>=55296&&A<=57343||A===65279||(u[b++]=A):A<65536||A>1114111||(u[b++]=A)),this.interim.fill(0)}const y=f-4;let C=v;for(;C<f;){for(;!(!(C<y)||128&(d=c[C])||128&(g=c[C+1])||128&(p=c[C+2])||128&(x=c[C+3]));)u[b++]=d,u[b++]=g,u[b++]=p,u[b++]=x,C+=4;if(d=c[C++],d<128)u[b++]=d;else if((224&d)==192){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(_=(31&d)<<6|63&g,_<128){C--;continue}u[b++]=_}else if((240&d)==224){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(_=(15&d)<<12|(63&g)<<6|63&p,_<2048||_>=55296&&_<=57343||_===65279)continue;u[b++]=_}else if((248&d)==240){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,this.interim[2]=p,b;if(x=c[C++],(192&x)!=128){C--;continue}if(_=(7&d)<<18|(63&g)<<12|(63&p)<<6|63&x,_<65536||_>1114111)continue;u[b++]=_}}return b}}},225:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const u=c(1480),f=[[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]],d=[[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 g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let p=0;p<f.length;++p)g.fill(0,f[p][0],f[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?g[p]:(function(x,b){let _,v=0,y=b.length-1;if(x<b[0][0]||x>b[y][1])return!1;for(;y>=v;)if(_=v+y>>1,x>b[_][1])v=_+1;else{if(!(x<b[_][0]))return!0;y=_-1}return!1})(p,d)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}charProperties(p,x){let b=this.wcwidth(p),_=b===0&&x!==0;if(_){const v=u.UnicodeService.extractWidth(x);v===0?_=!1:v>b&&(b=v)}return u.UnicodeService.createPropertyValue(0,b,_)}}},5981:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const u=c(8460),f=c(844);class d extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,x){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+=p.length,this._writeBuffer.push(p),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(x)}_innerWrite(p=0,x=!0){const b=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],v=this._action(_,x);if(v){const C=w=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,w))):this._innerWrite(b,w);return void v.catch((w=>(queueMicrotask((()=>{throw w})),Promise.resolve(!1)))).then(C)}const y=this._callbacks[this._bufferOffset];if(y&&y(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-b>=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()}}s.WriteBuffer=d},5941:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const c=/^([\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})$/,u=/^[\da-f]+$/;function f(d,g){const p=d.toString(16),x=p.length<2?"0"+p:p;switch(g){case 4:return p[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}s.parseColor=function(d){if(!d)return;let g=d.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const p=c.exec(g);if(p){const x=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/x*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/x*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/x*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),u.exec(g)&&[3,6,9,12].includes(g.length))){const p=g.length/3,x=[0,0,0];for(let b=0;b<3;++b){const _=parseInt(g.slice(p*b,p*b+p),16);x[b]=p===1?_<<4:p===2?_:p===3?_>>4:_>>8}return x}},s.toRgbString=function(d,g=16){const[p,x,b]=d;return`rgb:${f(p,g)}/${f(x,g)}/${f(b,g)}`}},5770:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const u=c(482),f=c(8742),d=c(5770),g=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(x,b){this._handlers[x]===void 0&&(this._handlers[x]=[]);const _=this._handlers[x];return _.push(b),{dispose:()=>{const v=_.indexOf(b);v!==-1&&_.splice(v,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(x,b){if(this.reset(),this._ident=x,this._active=this._handlers[x]||g,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(x,b,_){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(x,b,_);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,b,_))}unhook(x,b=!0){if(this._active.length){let _=!1,v=this._active.length-1,y=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,_=b,y=this._stack.fallThrough,this._stack.paused=!1),!y&&_===!1){for(;v>=0&&(_=this._active[v].unhook(x),_!==!0);v--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,_;v--}for(;v>=0;v--)if(_=this._active[v].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",x);this._active=g,this._ident=0}};const p=new f.Params;p.addParam(0),s.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=p,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():p,this._data="",this._hitLimit=!1}put(x,b,_){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,b,_),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let b=!1;if(this._hitLimit)b=!1;else if(x&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((_=>(this._params=p,this._data="",this._hitLimit=!1,_)));return this._params=p,this._data="",this._hitLimit=!1,b}}},2015:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const u=c(844),f=c(8742),d=c(6242),g=c(6351);class p{constructor(v){this.table=new Uint8Array(v)}setDefault(v,y){this.table.fill(v<<4|y)}add(v,y,C,w){this.table[y<<8|v]=C<<4|w}addMany(v,y,C,w){for(let A=0;A<v.length;A++)this.table[y<<8|v[A]]=C<<4|w}}s.TransitionTable=p;const x=160;s.VT500_TRANSITION_TABLE=(function(){const _=new p(4095),v=Array.apply(null,Array(256)).map(((E,L)=>L)),y=(E,L)=>v.slice(E,L),C=y(32,127),w=y(0,24);w.push(25),w.push.apply(w,y(28,32));const A=y(0,14);let T;for(T in _.setDefault(1,0),_.addMany(C,0,2,0),A)_.addMany([24,26,153,154],T,3,0),_.addMany(y(128,144),T,3,0),_.addMany(y(144,152),T,3,0),_.add(156,T,0,0),_.add(27,T,11,1),_.add(157,T,4,8),_.addMany([152,158,159],T,0,7),_.add(155,T,11,3),_.add(144,T,11,9);return _.addMany(w,0,3,0),_.addMany(w,1,3,1),_.add(127,1,0,1),_.addMany(w,8,0,8),_.addMany(w,3,3,3),_.add(127,3,0,3),_.addMany(w,4,3,4),_.add(127,4,0,4),_.addMany(w,6,3,6),_.addMany(w,5,3,5),_.add(127,5,0,5),_.addMany(w,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(C,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(y(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(C,7,0,7),_.addMany(w,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(y(64,127),3,7,0),_.addMany(y(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(y(48,60),4,8,4),_.addMany(y(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(y(32,64),6,0,6),_.add(127,6,0,6),_.addMany(y(64,127),6,0,0),_.addMany(y(32,48),3,9,5),_.addMany(y(32,48),5,9,5),_.addMany(y(48,64),5,0,6),_.addMany(y(64,127),5,7,0),_.addMany(y(32,48),4,9,5),_.addMany(y(32,48),1,9,2),_.addMany(y(32,48),2,9,2),_.addMany(y(48,127),2,10,0),_.addMany(y(48,80),1,10,0),_.addMany(y(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(y(96,127),1,10,0),_.add(80,1,11,9),_.addMany(w,9,0,9),_.add(127,9,0,9),_.addMany(y(28,32),9,0,9),_.addMany(y(32,48),9,9,12),_.addMany(y(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(w,11,0,11),_.addMany(y(32,128),11,0,11),_.addMany(y(28,32),11,0,11),_.addMany(w,10,0,10),_.add(127,10,0,10),_.addMany(y(28,32),10,0,10),_.addMany(y(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(y(32,48),10,9,12),_.addMany(w,12,0,12),_.add(127,12,0,12),_.addMany(y(28,32),12,0,12),_.addMany(y(32,48),12,9,12),_.addMany(y(48,64),12,0,11),_.addMany(y(64,127),12,12,13),_.addMany(y(64,127),10,12,13),_.addMany(y(64,127),9,12,13),_.addMany(w,13,13,13),_.addMany(C,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(x,0,2,0),_.add(x,8,5,8),_.add(x,6,0,6),_.add(x,11,0,11),_.add(x,13,13,13),_})();class b extends u.Disposable{constructor(v=s.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(y,C,w)=>{},this._executeHandlerFb=y=>{},this._csiHandlerFb=(y,C)=>{},this._escHandlerFb=y=>{},this._errorHandlerFb=y=>y,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,y=[64,126]){let C=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(C=v.prefix.charCodeAt(0),C&&60>C||C>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<v.intermediates.length;++A){const T=v.intermediates.charCodeAt(A);if(32>T||T>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");C<<=8,C|=T}}if(v.final.length!==1)throw new Error("final must be a single byte");const w=v.final.charCodeAt(0);if(y[0]>w||w>y[1])throw new Error(`final must be in range ${y[0]} .. ${y[1]}`);return C<<=8,C|=w,C}identToString(v){const y=[];for(;v;)y.push(String.fromCharCode(255&v)),v>>=8;return y.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,y){const C=this._identifier(v,[48,126]);this._escHandlers[C]===void 0&&(this._escHandlers[C]=[]);const w=this._escHandlers[C];return w.push(y),{dispose:()=>{const A=w.indexOf(y);A!==-1&&w.splice(A,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,y){this._executeHandlers[v.charCodeAt(0)]=y}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,y){const C=this._identifier(v);this._csiHandlers[C]===void 0&&(this._csiHandlers[C]=[]);const w=this._csiHandlers[C];return w.push(y),{dispose:()=>{const A=w.indexOf(y);A!==-1&&w.splice(A,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,y){return this._dcsParser.registerHandler(this._identifier(v),y)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,y){return this._oscParser.registerHandler(v,y)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,y,C,w,A){this._parseStack.state=v,this._parseStack.handlers=y,this._parseStack.handlerPos=C,this._parseStack.transition=w,this._parseStack.chunkPos=A}parse(v,y,C){let w,A=0,T=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(C===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 R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(C===!1&&R>-1){for(;R>=0&&(w=L[R](this._params),w!==!0);R--)if(w instanceof Promise)return this._parseStack.handlerPos=R,w}this._parseStack.handlers=[];break;case 4:if(C===!1&&R>-1){for(;R>=0&&(w=L[R](),w!==!0);R--)if(w instanceof Promise)return this._parseStack.handlerPos=R,w}this._parseStack.handlers=[];break;case 6:if(A=v[this._parseStack.chunkPos],w=this._dcsParser.unhook(A!==24&&A!==26,C),w)return w;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=v[this._parseStack.chunkPos],w=this._oscParser.end(A!==24&&A!==26,C),w)return w;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let L=E;L<y;++L){switch(A=v[L],T=this._transitions.table[this.currentState<<8|(A<160?A:x)],T>>4){case 2:for(let H=L+1;;++H){if(H>=y||(A=v[H])<32||A>126&&A<x){this._printHandler(v,L,H),L=H-1;break}if(++H>=y||(A=v[H])<32||A>126&&A<x){this._printHandler(v,L,H),L=H-1;break}if(++H>=y||(A=v[H])<32||A>126&&A<x){this._printHandler(v,L,H),L=H-1;break}if(++H>=y||(A=v[H])<32||A>126&&A<x){this._printHandler(v,L,H),L=H-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:L,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|A];let D=R?R.length-1:-1;for(;D>=0&&(w=R[D](this._params),w!==!0);D--)if(w instanceof Promise)return this._preserveStack(3,R,D,T,L),w;D<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++L<y&&(A=v[L])>47&&A<60);L--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const N=this._escHandlers[this._collect<<8|A];let $=N?N.length-1:-1;for(;$>=0&&(w=N[$](),w!==!0);$--)if(w instanceof Promise)return this._preserveStack(4,N,$,T,L),w;$<0&&this._escHandlerFb(this._collect<<8|A),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|A,this._params);break;case 13:for(let H=L+1;;++H)if(H>=y||(A=v[H])===24||A===26||A===27||A>127&&A<x){this._dcsParser.put(v,L,H),L=H-1;break}break;case 14:if(w=this._dcsParser.unhook(A!==24&&A!==26),w)return this._preserveStack(6,[],0,T,L),w;A===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=L+1;;H++)if(H>=y||(A=v[H])<32||A>127&&A<x){this._oscParser.put(v,L,H),L=H-1;break}break;case 6:if(w=this._oscParser.end(A!==24&&A!==26),w)return this._preserveStack(5,[],0,T,L),w;A===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&T}}}s.EscapeSequenceParser=b},6242:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const u=c(5770),f=c(482),d=[];s.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,p){this._handlers[g]===void 0&&(this._handlers[g]=[]);const x=this._handlers[g];return x.push(p),{dispose:()=>{const b=x.indexOf(p);b!==-1&&x.splice(b,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,p,x){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(g,p,x);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(g,p,x))}start(){this.reset(),this._state=1}put(g,p,x){if(this._state!==3){if(this._state===1)for(;p<x;){const b=g[p++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&x-p>0&&this._put(g,p,x)}}end(g,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,b=this._active.length-1,_=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,x=p,_=this._stack.fallThrough,this._stack.paused=!1),!_&&x===!1){for(;b>=0&&(x=this._active[b].end(g),x!==!0);b--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,x;b--}for(;b>=0;b--)if(x=this._active[b].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",g);this._active=d,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,p,x){this._hitLimit||(this._data+=(0,f.utf32ToString)(g,p,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let p=!1;if(this._hitLimit)p=!1;else if(g&&(p=this._handler(this._data),p instanceof Promise))return p.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,p}}},8742:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const c=2147483647;class u{static fromArray(d){const g=new u;if(!d.length)return g;for(let p=Array.isArray(d[0])?1:0;p<d.length;++p){const x=d[p];if(Array.isArray(x))for(let b=0;b<x.length;++b)g.addSubParam(x[b]);else g.addParam(x)}return g}constructor(d=32,g=32){if(this.maxLength=d,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let g=0;g<this.length;++g){d.push(this.params[g]);const p=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-p>0&&d.push(Array.prototype.slice.call(this._subParams,p,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const g=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];return p-g>0?this._subParams.subarray(g,p):null}getSubParamsAll(){const d={};for(let g=0;g<this.length;++g){const p=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-p>0&&(d[g]=this._subParams.slice(p,x))}return d}addDigit(d){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,x=p[g-1];p[g-1]=~x?Math.min(10*x+d,c):d}}s.Params=u},5741:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const f={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(f),u.dispose=()=>this._wrappedAddonDispose(f),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===c){u=f;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const u=c(3785),f=c(511);s.BufferApiView=class{constructor(d,g){this._buffer=d,this.type=g}init(d){return this._buffer=d,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(d){const g=this._buffer.lines.get(d);if(g)return new u.BufferLineApiView(g)}getNullCell(){return new f.CellData}}},3785:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const u=c(511);s.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,d){if(!(f<0||f>=this._line.length))return d?(this._line.loadCell(f,d),d):this._line.loadCell(f,new u.CellData)}translateToString(f,d,g){return this._line.translateToString(f,d,g)}}},8285:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const u=c(8771),f=c(8460),d=c(844);class g extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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)}}s.BufferNamespaceApi=g},7975:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(f=>u(f.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((f,d)=>u(f,d.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,s,c){var u=this&&this.__decorate||function(_,v,y,C){var w,A=arguments.length,T=A<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,v,y,C);else for(var E=_.length-1;E>=0;E--)(w=_[E])&&(T=(A<3?w(T):A>3?w(v,y,T):w(v,y))||T);return A>3&&T&&Object.defineProperty(v,y,T),T},f=this&&this.__param||function(_,v){return function(y,C){v(y,C,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const d=c(8460),g=c(844),p=c(5295),x=c(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let b=s.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(_){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(_.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(_,this))}resize(_,v){this.cols=_,this.rows=v,this.buffers.resize(_,v),this._onResize.fire({cols:_,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,v=!1){const y=this.buffer;let C;C=this._cachedBlankLine,C&&C.length===this.cols&&C.getFg(0)===_.fg&&C.getBg(0)===_.bg||(C=y.getBlankLine(_,v),this._cachedBlankLine=C),C.isWrapped=v;const w=y.ybase+y.scrollTop,A=y.ybase+y.scrollBottom;if(y.scrollTop===0){const T=y.lines.isFull;A===y.lines.length-1?T?y.lines.recycle().copyFrom(C):y.lines.push(C.clone()):y.lines.splice(A+1,0,C.clone()),T?this.isUserScrolling&&(y.ydisp=Math.max(y.ydisp-1,0)):(y.ybase++,this.isUserScrolling||y.ydisp++)}else{const T=A-w+1;y.lines.shiftElements(w+1,T-1,-1),y.lines.set(A,C.clone())}this.isUserScrolling||(y.ydisp=y.ybase),this._onScroll.fire(y.ydisp)}scrollLines(_,v,y){const C=this.buffer;if(_<0){if(C.ydisp===0)return;this.isUserScrolling=!0}else _+C.ydisp>=C.ybase&&(this.isUserScrolling=!1);const w=C.ydisp;C.ydisp=Math.max(Math.min(C.ydisp+_,C.ybase),0),w!==C.ydisp&&(v||this._onScroll.fire(C.ydisp))}};s.BufferService=b=u([f(0,x.IOptionsService)],b)},7994:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(l,s,c){var u=this&&this.__decorate||function(C,w,A,T){var E,L=arguments.length,R=L<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,A):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,w,A,T);else for(var D=C.length-1;D>=0;D--)(E=C[D])&&(R=(L<3?E(R):L>3?E(w,A,R):E(w,A))||R);return L>3&&R&&Object.defineProperty(w,A,R),R},f=this&&this.__param||function(C,w){return function(A,T){w(A,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const d=c(2585),g=c(8460),p=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:C=>C.button!==4&&C.action===1&&(C.ctrl=!1,C.alt=!1,C.shift=!1,!0)},VT200:{events:19,restrict:C=>C.action!==32},DRAG:{events:23,restrict:C=>C.action!==32||C.button!==3},ANY:{events:31,restrict:C=>!0}};function b(C,w){let A=(C.ctrl?16:0)|(C.shift?4:0)|(C.alt?8:0);return C.button===4?(A|=64,A|=C.action):(A|=3&C.button,4&C.button&&(A|=64),8&C.button&&(A|=128),C.action===32?A|=32:C.action!==0||w||(A|=3)),A}const _=String.fromCharCode,v={DEFAULT:C=>{const w=[b(C,!1)+32,C.col+32,C.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${_(w[0])}${_(w[1])}${_(w[2])}`},SGR:C=>{const w=C.action===0&&C.button!==4?"m":"M";return`\x1B[<${b(C,!0)};${C.col};${C.row}${w}`},SGR_PIXELS:C=>{const w=C.action===0&&C.button!==4?"m":"M";return`\x1B[<${b(C,!0)};${C.x};${C.y}${w}`}};let y=s.CoreMouseService=class extends p.Disposable{constructor(C,w){super(),this._bufferService=C,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(x))this.addProtocol(A,x[A]);for(const A of Object.keys(v))this.addEncoding(A,v[A]);this.reset()}addProtocol(C,w){this._protocols[C]=w}addEncoding(C,w){this._encodings[C]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(C){if(!this._protocols[C])throw new Error(`unknown protocol "${C}"`);this._activeProtocol=C,this._onProtocolChange.fire(this._protocols[C].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(C){if(!this._encodings[C])throw new Error(`unknown encoding "${C}"`);this._activeEncoding=C}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(C){if(C.col<0||C.col>=this._bufferService.cols||C.row<0||C.row>=this._bufferService.rows||C.button===4&&C.action===32||C.button===3&&C.action!==32||C.button!==4&&(C.action===2||C.action===3)||(C.col++,C.row++,C.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,C,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(C))return!1;const w=this._encodings[this._activeEncoding](C);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=C,!0}explainEvents(C){return{down:!!(1&C),up:!!(2&C),drag:!!(4&C),move:!!(8&C),wheel:!!(16&C)}}_equalEvents(C,w,A){if(A){if(C.x!==w.x||C.y!==w.y)return!1}else if(C.col!==w.col||C.row!==w.row)return!1;return C.button===w.button&&C.action===w.action&&C.ctrl===w.ctrl&&C.alt===w.alt&&C.shift===w.shift}};s.CoreMouseService=y=u([f(0,d.IBufferService),f(1,d.ICoreService)],y)},6975:function(l,s,c){var u=this&&this.__decorate||function(y,C,w,A){var T,E=arguments.length,L=E<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,w):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,C,w,A);else for(var R=y.length-1;R>=0;R--)(T=y[R])&&(L=(E<3?T(L):E>3?T(C,w,L):T(C,w))||L);return E>3&&L&&Object.defineProperty(C,w,L),L},f=this&&this.__param||function(y,C){return function(w,A){C(w,A,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const d=c(1439),g=c(8460),p=c(844),x=c(2585),b=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=s.CoreService=class extends p.Disposable{constructor(y,C,w){super(),this._bufferService=y,this._logService=C,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(_)}reset(){this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(_)}triggerDataEvent(y,C=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;C&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),C&&this._onUserInput.fire(),this._logService.debug(`sending data "${y}"`,(()=>y.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(y)}triggerBinaryEvent(y){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${y}"`,(()=>y.split("").map((C=>C.charCodeAt(0))))),this._onBinary.fire(y))}};s.CoreService=v=u([f(0,x.IBufferService),f(1,x.ILogService),f(2,x.IOptionsService)],v)},9074:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const u=c(8055),f=c(8460),d=c(844),g=c(6106);let p=0,x=0;class b extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((y=>y==null?void 0:y.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(y){if(y.marker.isDisposed)return;const C=new _(y);if(C){const w=C.marker.onDispose((()=>C.dispose()));C.onDispose((()=>{C&&(this._decorations.delete(C)&&this._onDecorationRemoved.fire(C),w.dispose())})),this._decorations.insert(C),this._onDecorationRegistered.fire(C)}return C}reset(){for(const y of this._decorations.values())y.dispose();this._decorations.clear()}*getDecorationsAtCell(y,C,w){let A=0,T=0;for(const E of this._decorations.getKeyIterator(C))A=E.options.x??0,T=A+(E.options.width??1),y>=A&&y<T&&(!w||(E.options.layer??"bottom")===w)&&(yield E)}forEachDecorationAtCell(y,C,w,A){this._decorations.forEachByKey(C,(T=>{p=T.options.x??0,x=p+(T.options.width??1),y>=p&&y<x&&(!w||(T.options.layer??"bottom")===w)&&A(T)}))}}s.DecorationService=b;class _ extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(y){super(),this.options=y,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=y.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const u=c(2585),f=c(8343);class d{constructor(...p){this._entries=new Map;for(const[x,b]of p)this.set(x,b)}set(p,x){const b=this._entries.get(p);return this._entries.set(p,x),b}forEach(p){for(const[x,b]of this._entries.entries())p(x,b)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}s.ServiceCollection=d,s.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(g,p){this._services.set(g,p)}getService(g){return this._services.get(g)}createInstance(g,...p){const x=(0,f.getServiceDependencies)(g).sort(((v,y)=>v.index-y.index)),b=[];for(const v of x){const y=this._services.get(v.id);if(!y)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${v.id}.`);b.push(y)}const _=x.length>0?x[0].index:p.length;if(p.length!==_)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${_+1} conflicts with ${p.length} static arguments`);return new g(...p,...b)}}},7866:function(l,s,c){var u=this&&this.__decorate||function(_,v,y,C){var w,A=arguments.length,T=A<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,v,y,C);else for(var E=_.length-1;E>=0;E--)(w=_[E])&&(T=(A<3?w(T):A>3?w(v,y,T):w(v,y))||T);return A>3&&T&&Object.defineProperty(v,y,T),T},f=this&&this.__param||function(_,v){return function(y,C){v(y,C,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const d=c(844),g=c(2585),p={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,b=s.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let v=0;v<_.length;v++)typeof _[v]=="function"&&(_[v]=_[v]())}_log(_,v,y){this._evalLazyOptionalParams(y),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...y)}trace(_,...v){var y;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.trace.bind(this._optionsService.options.logger))??console.log,_,v)}debug(_,...v){var y;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.debug.bind(this._optionsService.options.logger))??console.log,_,v)}info(_,...v){var y;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.info.bind(this._optionsService.options.logger))??console.info,_,v)}warn(_,...v){var y;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.warn.bind(this._optionsService.options.logger))??console.warn,_,v)}error(_,...v){var y;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.error.bind(this._optionsService.options.logger))??console.error,_,v)}};s.LogService=b=u([f(0,g.IOptionsService)],b),s.setTraceLogger=function(_){x=_},s.traceCall=function(_,v,y){if(typeof y.value!="function")throw new Error("not supported");const C=y.value;y.value=function(...w){if(x.logLevel!==g.LogLevelEnum.TRACE)return C.apply(this,w);x.trace(`GlyphRenderer#${C.name}(${w.map((T=>JSON.stringify(T))).join(", ")})`);const A=C.apply(this,w);return x.trace(`GlyphRenderer#${C.name} return`,A),A}}},7302:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const u=c(8460),f=c(844),d=c(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends f.Disposable{constructor(b){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...s.DEFAULT_OPTIONS};for(const v in b)if(v in _)try{const y=b[v];_[v]=this._sanitizeAndValidateOption(v,y)}catch(y){console.error(y)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,_){return this.onOptionChange((v=>{v===b&&_(this.rawOptions[b])}))}onMultipleOptionChange(b,_){return this.onOptionChange((v=>{b.indexOf(v)!==-1&&_()}))}_setupOptions(){const b=v=>{if(!(v in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},_=(v,y)=>{if(!(v in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);y=this._sanitizeAndValidateOption(v,y),this.rawOptions[v]!==y&&(this.rawOptions[v]=y,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const y={get:b.bind(this,v),set:_.bind(this,v)};Object.defineProperty(this.options,v,y)}}_sanitizeAndValidateOption(b,_){switch(b){case"cursorStyle":if(_||(_=s.DEFAULT_OPTIONS[b]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${b}`);break;case"wordSeparator":_||(_=s.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=g.includes(_)?_:s.DEFAULT_OPTIONS[b];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${b} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${b} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}s.OptionsService=p},2660:function(l,s,c){var u=this&&this.__decorate||function(p,x,b,_){var v,y=arguments.length,C=y<3?x:_===null?_=Object.getOwnPropertyDescriptor(x,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,x,b,_);else for(var w=p.length-1;w>=0;w--)(v=p[w])&&(C=(y<3?v(C):y>3?v(x,b,C):v(x,b))||C);return y>3&&C&&Object.defineProperty(x,b,C),C},f=this&&this.__param||function(p,x){return function(b,_){x(b,_,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const d=c(2585);let g=s.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const x=this._bufferService.buffer;if(p.id===void 0){const w=x.addMarker(x.ybase+x.y),A={data:p,id:this._nextId++,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(A,w))),this._dataByLinkId.set(A.id,A),A.id}const b=p,_=this._getEntryIdKey(b),v=this._entriesWithId.get(_);if(v)return this.addLineToLink(v.id,x.ybase+x.y),v.id;const y=x.addMarker(x.ybase+x.y),C={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(C,y))),this._entriesWithId.set(C.key,C),this._dataByLinkId.set(C.id,C),C.id}addLineToLink(p,x){const b=this._dataByLinkId.get(p);if(b&&b.lines.every((_=>_.line!==x))){const _=this._bufferService.buffer.addMarker(x);b.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(b,_)))}}getLinkData(p){var x;return(x=this._dataByLinkId.get(p))==null?void 0:x.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,x){const b=p.lines.indexOf(x);b!==-1&&(p.lines.splice(b,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};s.OscLinkService=g=u([f(0,d.IBufferService)],g)},8343:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",u="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[u]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const d=function(g,p,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,_,v){_[c]===_?_[u].push({id:b,index:v}):(_[u]=[{id:b,index:v}],_[c]=_)})(d,g,x)};return d.toString=()=>f,s.serviceRegistry.set(f,d),d}},2585:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const u=c(8343);var f;s.IBufferService=(0,u.createDecorator)("BufferService"),s.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),s.ICoreService=(0,u.createDecorator)("CoreService"),s.ICharsetService=(0,u.createDecorator)("CharsetService"),s.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(f||(s.LogLevelEnum=f={})),s.ILogService=(0,u.createDecorator)("LogService"),s.IOptionsService=(0,u.createDecorator)("OptionsService"),s.IOscLinkService=(0,u.createDecorator)("OscLinkService"),s.IUnicodeService=(0,u.createDecorator)("UnicodeService"),s.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const u=c(8460),f=c(225);class d{static extractShouldJoin(p){return(1&p)!=0}static extractWidth(p){return p>>1&3}static extractCharKind(p){return p>>3}static createPropertyValue(p,x,b=!1){return(16777215&p)<<3|(3&x)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const p=new f.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let x=0,b=0;const _=p.length;for(let v=0;v<_;++v){let y=p.charCodeAt(v);if(55296<=y&&y<=56319){if(++v>=_)return x+this.wcwidth(y);const A=p.charCodeAt(v);56320<=A&&A<=57343?y=1024*(y-55296)+A-56320+65536:x+=this.wcwidth(A)}const C=this.charProperties(y,b);let w=d.extractWidth(C);d.extractShouldJoin(C)&&(w-=d.extractWidth(b)),x+=w,b=C}return x}charProperties(p,x){return this._activeProvider.charProperties(p,x)}}s.UnicodeService=d}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l].call(c.exports,c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const s=n(9042),c=n(3236),u=n(844),f=n(5741),d=n(8285),g=n(7975),p=n(7090),x=["cols","rows"];class b extends u.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const y=w=>this._core.options[w],C=(w,A)=>{this._checkReadonlyOptions(w),this._core.options[w]=A};for(const w in this._core.options){const A={get:y.bind(this,w),set:C.bind(this,w)};Object.defineProperty(this._publicOptions,w,A)}}_checkReadonlyOptions(v){if(x.includes(v))throw new Error(`Option "${v}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new p.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let y="none";switch(this._core.coreMouseService.activeProtocol){case"X10":y="x10";break;case"VT200":y="vt200";break;case"DRAG":y="drag";break;case"ANY":y="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:y,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const y in v)this._publicOptions[y]=v[y]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,y=!0){this._core.input(v,y)}resize(v,y){this._verifyIntegers(v,y),this._core.resize(v,y)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,y,C){this._verifyIntegers(v,y,C),this._core.select(v,y,C)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,y){this._verifyIntegers(v,y),this._core.selectLines(v,y)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,y){this._core.write(v,y)}writeln(v,y){this._core.write(v),this._core.write(`\r
102
- `,y)}paste(v){this._core.paste(v)}refresh(v,y){this._verifyIntegers(v,y),this._core.refresh(v,y)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return s}_verifyIntegers(...v){for(const y of v)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const y of v)if(y&&(y===1/0||isNaN(y)||y%1!=0||y<0))throw new Error("This API only accepts positive integers")}}l.Terminal=b})(),o})()))})(y_)),y_.exports}var Sz=xz(),v_={exports:{}},vE;function wz(){return vE||(vE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const o=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(o._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,o=n._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(s.getPropertyValue("height")),u=Math.max(0,parseInt(s.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),d=c-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),g=u-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(g/o.css.cell.width)),rows:Math.max(1,Math.floor(d/o.css.cell.height))}}}})(),r})()))})(v_)),v_.exports}var Tz=wz(),C_={exports:{}},CE;function Ez(){return CE||(CE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,u){return c((f=>u.fire(f)))},s.runAndSubscribe=function(c,u){return u(void 0),c((f=>u(f)))}},859:(l,s)=>{function c(u){for(const f of u)f.dispose();u.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const f=this._disposables.indexOf(u);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var f;this._isDisposed||u===this._value||((f=this._value)==null||f.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},s.toDisposable=function(u){return{dispose:u}},s.disposeArray=c,s.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l](c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.SearchAddon=void 0;const s=n(345),c=n(859),u=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class f extends c.Disposable{constructor(g){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new c.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new c.MutableDisposable,this._onDidChangeResults=this.register(new s.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(g==null?void 0:g.highlightLimit)??1e3}activate(g){this._terminal=g,this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,c.toDisposable)((()=>this.clearDecorations())))}_updateMatches(){var g;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((g=this._lastSearchOptions)!=null&&g.decorations)&&(this._highlightTimeout=setTimeout((()=>{const p=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(p,{...this._lastSearchOptions,incremental:!0,noScroll:!0})}),200))}clearDecorations(g){this._selectedDecoration.clear(),(0,c.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),g||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,p);this._lastSearchOptions=p,p!=null&&p.decorations&&(this._cachedSearchTerm===void 0||g!==this._cachedSearchTerm||x)&&this._highlightAllMatches(g,p);const b=this._findNextAndSelect(g,p);return this._fireResults(p),this._cachedSearchTerm=g,b}_highlightAllMatches(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!g||g.length===0)return void this.clearDecorations();p=p||{},this.clearDecorations(!0);const x=[];let b,_=this._find(g,0,0,p);for(;_&&((b==null?void 0:b.row)!==_.row||(b==null?void 0:b.col)!==_.col)&&!(x.length>=this._highlightLimit);)b=_,x.push(b),_=this._find(g,b.col+b.term.length>=this._terminal.cols?b.row+1:b.row,b.col+b.term.length>=this._terminal.cols?0:b.col+1,p);for(const v of x){const y=this._createResultDecoration(v,p.decorations);y&&(this._highlightedLines.add(y.marker.line),this._highlightDecorations.push({decoration:y,match:v,dispose(){y.dispose()}}))}}_find(g,p,x,b){var y;if(!this._terminal||!g||g.length===0)return(y=this._terminal)==null||y.clearSelection(),void this.clearDecorations();if(x>this._terminal.cols)throw new Error(`Invalid col: ${x} to search in terminal of ${this._terminal.cols} cols`);let _;this._initLinesCache();const v={startRow:p,startCol:x};if(_=this._findInLine(g,v,b),!_)for(let C=p+1;C<this._terminal.buffer.active.baseY+this._terminal.rows&&(v.startRow=C,v.startCol=0,_=this._findInLine(g,v,b),!_);C++);return _}_findNextAndSelect(g,p){var C;if(!this._terminal||!g||g.length===0)return(C=this._terminal)==null||C.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let b=0,_=0;x&&(this._cachedSearchTerm===g?(b=x.end.x,_=x.end.y):(b=x.start.x,_=x.start.y)),this._initLinesCache();const v={startRow:_,startCol:b};let y=this._findInLine(g,v,p);if(!y)for(let w=_+1;w<this._terminal.buffer.active.baseY+this._terminal.rows&&(v.startRow=w,v.startCol=0,y=this._findInLine(g,v,p),!y);w++);if(!y&&_!==0)for(let w=0;w<_&&(v.startRow=w,v.startCol=0,y=this._findInLine(g,v,p),!y);w++);return!y&&x&&(v.startRow=x.start.y,v.startCol=0,y=this._findInLine(g,v,p)),this._selectResult(y,p==null?void 0:p.decorations,p==null?void 0:p.noScroll)}findPrevious(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,p);this._lastSearchOptions=p,p!=null&&p.decorations&&(this._cachedSearchTerm===void 0||g!==this._cachedSearchTerm||x)&&this._highlightAllMatches(g,p);const b=this._findPreviousAndSelect(g,p);return this._fireResults(p),this._cachedSearchTerm=g,b}_didOptionsChange(g,p){return!!p&&(g.caseSensitive!==p.caseSensitive||g.regex!==p.regex||g.wholeWord!==p.wholeWord)}_fireResults(g){if(g!=null&&g.decorations){let p=-1;if(this._selectedDecoration.value){const x=this._selectedDecoration.value.match;for(let b=0;b<this._highlightDecorations.length;b++){const _=this._highlightDecorations[b].match;if(_.row===x.row&&_.col===x.col&&_.size===x.size){p=b;break}}}this._onDidChangeResults.fire({resultIndex:p,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(g,p){var w;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!g||g.length===0)return(w=this._terminal)==null||w.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let b=this._terminal.buffer.active.baseY+this._terminal.rows-1,_=this._terminal.cols;const v=!0;this._initLinesCache();const y={startRow:b,startCol:_};let C;if(x&&(y.startRow=b=x.start.y,y.startCol=_=x.start.x,this._cachedSearchTerm!==g&&(C=this._findInLine(g,y,p,!1),C||(y.startRow=b=x.end.y,y.startCol=_=x.end.x))),C||(C=this._findInLine(g,y,p,v)),!C){y.startCol=Math.max(y.startCol,this._terminal.cols);for(let A=b-1;A>=0&&(y.startRow=A,C=this._findInLine(g,y,p,v),!C);A--);}if(!C&&b!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let A=this._terminal.buffer.active.baseY+this._terminal.rows-1;A>=b&&(y.startRow=A,C=this._findInLine(g,y,p,v),!C);A--);return this._selectResult(C,p==null?void 0:p.decorations,p==null?void 0:p.noScroll)}_initLinesCache(){const g=this._terminal;this._linesCache||(this._linesCache=new Array(g.buffer.active.length),this._linesCacheDisposables.value=(0,c.getDisposeArrayDisposable)([g.onLineFeed((()=>this._destroyLinesCache())),g.onCursorMove((()=>this._destroyLinesCache())),g.onResize((()=>this._destroyLinesCache()))])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(g,p,x){return(g===0||u.includes(p[g-1]))&&(g+x.length===p.length||u.includes(p[g+x.length]))}_findInLine(g,p,x={},b=!1){var N;const _=this._terminal,v=p.startRow,y=p.startCol,C=_.buffer.active.getLine(v);if(C!=null&&C.isWrapped)return b?void(p.startCol+=_.cols):(p.startRow--,p.startCol+=_.cols,this._findInLine(g,p,x));let w=(N=this._linesCache)==null?void 0:N[v];w||(w=this._translateBufferLineToStringWithWrap(v,!0),this._linesCache&&(this._linesCache[v]=w));const[A,T]=w,E=this._bufferColsToStringOffset(v,y),L=x.caseSensitive?g:g.toLowerCase(),R=x.caseSensitive?A:A.toLowerCase();let D=-1;if(x.regex){const $=RegExp(L,"g");let H;if(b)for(;H=$.exec(R.slice(0,E));)D=$.lastIndex-H[0].length,g=H[0],$.lastIndex-=g.length-1;else H=$.exec(R.slice(E)),H&&H[0].length>0&&(D=E+($.lastIndex-H[0].length),g=H[0])}else b?E-L.length>=0&&(D=R.lastIndexOf(L,E-L.length)):D=R.indexOf(L,E);if(D>=0){if(x.wholeWord&&!this._isWholeWord(D,R,g))return;let $=0;for(;$<T.length-1&&D>=T[$+1];)$++;let H=$;for(;H<T.length-1&&D+g.length>=T[H+1];)H++;const W=D-T[$],Z=D+g.length-T[H],P=this._stringLengthToBufferSize(v+$,W);return{term:g,col:P,row:v+$,size:this._stringLengthToBufferSize(v+H,Z)-P+_.cols*(H-$)}}}_stringLengthToBufferSize(g,p){const x=this._terminal.buffer.active.getLine(g);if(!x)return 0;for(let b=0;b<p;b++){const _=x.getCell(b);if(!_)break;const v=_.getChars();v.length>1&&(p-=v.length-1);const y=x.getCell(b+1);y&&y.getWidth()===0&&p++}return p}_bufferColsToStringOffset(g,p){const x=this._terminal;let b=g,_=0,v=x.buffer.active.getLine(b);for(;p>0&&v;){for(let y=0;y<p&&y<x.cols;y++){const C=v.getCell(y);if(!C)break;C.getWidth()&&(_+=C.getCode()===0?1:C.getChars().length)}if(b++,v=x.buffer.active.getLine(b),v&&!v.isWrapped)break;p-=x.cols}return _}_translateBufferLineToStringWithWrap(g,p){var y;const x=this._terminal,b=[],_=[0];let v=x.buffer.active.getLine(g);for(;v;){const C=x.buffer.active.getLine(g+1),w=!!C&&C.isWrapped;let A=v.translateToString(!w&&p);if(w&&C){const T=v.getCell(v.length-1);T&&T.getCode()===0&&T.getWidth()===1&&((y=C.getCell(0))==null?void 0:y.getWidth())===2&&(A=A.slice(0,-1))}if(b.push(A),!w)break;_.push(_[_.length-1]+A.length),g++,v=C}return[b.join(""),_]}_selectResult(g,p,x){const b=this._terminal;if(this._selectedDecoration.clear(),!g)return b.clearSelection(),!1;if(b.select(g.col,g.row,g.size),p){const _=b.registerMarker(-b.buffer.active.baseY-b.buffer.active.cursorY+g.row);if(_){const v=b.registerDecoration({marker:_,x:g.col,width:g.size,backgroundColor:p.activeMatchBackground,layer:"top",overviewRulerOptions:{color:p.activeMatchColorOverviewRuler}});if(v){const y=[];y.push(_),y.push(v.onRender((C=>this._applyStyles(C,p.activeMatchBorder,!0)))),y.push(v.onDispose((()=>(0,c.disposeArray)(y)))),this._selectedDecoration.value={decoration:v,match:g,dispose(){v.dispose()}}}}}if(!x&&(g.row>=b.buffer.active.viewportY+b.rows||g.row<b.buffer.active.viewportY)){let _=g.row-b.buffer.active.viewportY;_-=Math.floor(b.rows/2),b.scrollLines(_)}return!0}_applyStyles(g,p,x){g.classList.contains("xterm-find-result-decoration")||(g.classList.add("xterm-find-result-decoration"),p&&(g.style.outline=`1px solid ${p}`)),x&&g.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(g,p){const x=this._terminal,b=x.registerMarker(-x.buffer.active.baseY-x.buffer.active.cursorY+g.row);if(!b)return;const _=x.registerDecoration({marker:b,x:g.col,width:g.size,backgroundColor:p.matchBackground,overviewRulerOptions:this._highlightedLines.has(b.line)?void 0:{color:p.matchOverviewRuler,position:"center"}});if(_){const v=[];v.push(b),v.push(_.onRender((y=>this._applyStyles(y,p.matchBorder,!1)))),v.push(_.onDispose((()=>(0,c.disposeArray)(v))))}return _}}l.SearchAddon=f})(),o})()))})(C_)),C_.exports}var kz=Ez(),x_={exports:{}},xE;function Az(){return xE||(xE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(l,s)=>{function c(f){try{const d=new URL(f),g=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return f.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(f,d,g,p={}){this._terminal=f,this._regex=d,this._handler=g,this._options=p}provideLinks(f,d){const g=u.computeLink(f,this._regex,this._terminal,this._handler);d(this._addCallbacks(g))}_addCallbacks(f){return f.map((d=>(d.leave=this._options.leave,d.hover=(g,p)=>{if(this._options.hover){const{range:x}=d;this._options.hover(g,p,x)}},d)))}};class u{static computeLink(d,g,p,x){const b=new RegExp(g.source,(g.flags||"")+"g"),[_,v]=u._getWindowedLineStrings(d-1,p),y=_.join("");let C;const w=[];for(;C=b.exec(y);){const A=C[0];if(!c(A))continue;const[T,E]=u._mapStrIdx(p,v,0,C.index),[L,R]=u._mapStrIdx(p,T,E,A.length);if(T===-1||E===-1||L===-1||R===-1)continue;const D={start:{x:E+1,y:T+1},end:{x:R,y:L+1}};w.push({range:D,text:A,activate:x})}return w}static _getWindowedLineStrings(d,g){let p,x=d,b=d,_=0,v="";const y=[];if(p=g.buffer.active.getLine(d)){const C=p.translateToString(!0);if(p.isWrapped&&C[0]!==" "){for(_=0;(p=g.buffer.active.getLine(--x))&&_<2048&&(v=p.translateToString(!0),_+=v.length,y.push(v),p.isWrapped&&v.indexOf(" ")===-1););y.reverse()}for(y.push(C),_=0;(p=g.buffer.active.getLine(++b))&&p.isWrapped&&_<2048&&(v=p.translateToString(!0),_+=v.length,y.push(v),v.indexOf(" ")===-1););}return[y,x]}static _mapStrIdx(d,g,p,x){const b=d.buffer.active,_=b.getNullCell();let v=p;for(;x;){const y=b.getLine(g);if(!y)return[-1,-1];for(let C=v;C<y.length;++C){y.getCell(C,_);const w=_.getChars();if(_.getWidth()&&(x-=w.length||1,C===y.length-1&&w==="")){const A=b.getLine(g+1);A&&A.isWrapped&&(A.getCell(0,_),_.getWidth()===2&&(x+=1))}if(x<0)return[g,C]}g++,v=0}return[g,v]}}s.LinkComputer=u}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l](c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const s=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(f,d){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(f=u,d={}){this._handler=f,this._options=d}activate(f){this._terminal=f;const d=this._options,g=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,g,this._handler,d))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),o})()))})(x_)),x_.exports}var Lz=Az(),S_={exports:{}},SE;function Bz(){return SE||(SE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={903:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const u=c(274),f=c(627),d=c(237),g=c(860),p=c(374),x=c(296),b=c(345),_=c(859),v=c(399),y=c(855);class C extends _.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var T;return(T=this._charAtlas)==null?void 0:T.pages[0].canvas}constructor(T,E,L,R,D,N,$,H,W,Z){super(),this._terminal=T,this._container=E,this._alpha=D,this._themeService=N,this._bufferService=$,this._optionsService=H,this._decorationService=W,this._coreBrowserService=Z,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,x.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new _.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new b.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new u.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${L}-layer`),this._canvas.style.zIndex=R.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((P=>{this._refreshCharAtlas(P),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,p.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(T,E){}handleSelectionChanged(T,E,L=!1){this._selectionModel.update(this._terminal._core,T,E,L)}_setTransparency(T){if(T===this._alpha)return;const E=this._canvas;this._alpha=T,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(T){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,f.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,T,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,b.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let E=0;E<this._charAtlas.pages.length;E++)this._bitmapGenerator[E]=new w(this._charAtlas.pages[E].canvas)}}resize(T){this._deviceCellWidth=T.device.cell.width,this._deviceCellHeight=T.device.cell.height,this._deviceCharWidth=T.device.char.width,this._deviceCharHeight=T.device.char.height,this._deviceCharLeft=T.device.char.left,this._deviceCharTop=T.device.char.top,this._canvas.width=T.device.canvas.width,this._canvas.height=T.device.canvas.height,this._canvas.style.width=`${T.css.canvas.width}px`,this._canvas.style.height=`${T.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var T;(T=this._charAtlas)==null||T.clearTexture()}_fillCells(T,E,L,R){this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight)}_fillMiddleLineAtCells(T,E,L=1){const R=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(T*this._deviceCellWidth,(E+1)*this._deviceCellHeight-R-this._coreBrowserService.dpr,L*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(T,E,L=1,R=0){this._ctx.fillRect(T*this._deviceCellWidth,(E+1)*this._deviceCellHeight+R-this._coreBrowserService.dpr-1,L*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R;for(let D=0;D<L;D++){const N=(T+D)*this._deviceCellWidth,$=(T+D+.5)*this._deviceCellWidth,H=(T+D+1)*this._deviceCellWidth,W=(E+1)*this._deviceCellHeight-R-1,Z=W-R,P=W+R;this._ctx.moveTo(N,W),this._ctx.bezierCurveTo(N,Z,$,Z,$,W),this._ctx.bezierCurveTo($,P,H,P,H,W)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.setLineDash([2*R,R]);const D=T*this._deviceCellWidth,N=(E+1)*this._deviceCellHeight-R-1;this._ctx.moveTo(D,N);for(let $=0;$<L;$++){const H=(T+L+$)*this._deviceCellWidth;this._ctx.lineTo(H,N)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.setLineDash([4*R,3*R]);const D=T*this._deviceCellWidth,N=(T+L)*this._deviceCellWidth,$=(E+1)*this._deviceCellHeight-R-1;this._ctx.moveTo(D,$),this._ctx.lineTo(N,$),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(T,E,L){this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,this._coreBrowserService.dpr*L,this._deviceCellHeight)}_strokeRectAtCell(T,E,L,R){const D=this._coreBrowserService.dpr;this._ctx.lineWidth=D,this._ctx.strokeRect(T*this._deviceCellWidth+D/2,E*this._deviceCellHeight+D/2,L*this._deviceCellWidth-D,R*this._deviceCellHeight-D)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(T,E,L,R){this._alpha?this._ctx.clearRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight))}_fillCharTrueColor(T,E,L){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipRow(L);let R=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(R=(0,g.tryDrawCustomChar)(this._ctx,T.getChars(),E*this._deviceCellWidth,L*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),R||this._ctx.fillText(T.getChars(),E*this._deviceCellWidth+this._deviceCharLeft,L*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(T,E,L){var W,Z,P,G;const R=T.getChars(),D=T.getCode(),N=T.getWidth();if(this._cellColorResolver.resolve(T,E,this._bufferService.buffer.ydisp+L,this._deviceCellWidth),!this._charAtlas)return;let $;if($=R&&R.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(R,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(T.getCode()||y.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!$.size.x||!$.size.y)return;this._ctx.save(),this._clipRow(L),this._bitmapGenerator[$.texturePage]&&this._charAtlas.pages[$.texturePage].canvas!==this._bitmapGenerator[$.texturePage].canvas&&((Z=(W=this._bitmapGenerator[$.texturePage])==null?void 0:W.bitmap)==null||Z.close(),delete this._bitmapGenerator[$.texturePage]),this._charAtlas.pages[$.texturePage].version!==((P=this._bitmapGenerator[$.texturePage])==null?void 0:P.version)&&(this._bitmapGenerator[$.texturePage]||(this._bitmapGenerator[$.texturePage]=new w(this._charAtlas.pages[$.texturePage].canvas)),this._bitmapGenerator[$.texturePage].refresh(),this._bitmapGenerator[$.texturePage].version=this._charAtlas.pages[$.texturePage].version);let H=$.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(D,N,$.size.x,this._deviceCellWidth)&&(H=this._deviceCellWidth-1),this._ctx.drawImage(((G=this._bitmapGenerator[$.texturePage])==null?void 0:G.bitmap)||this._charAtlas.pages[$.texturePage].canvas,$.texturePosition.x,$.texturePosition.y,$.size.x,$.size.y,E*this._deviceCellWidth+this._deviceCharLeft-$.offset.x,L*this._deviceCellHeight+this._deviceCharTop-$.offset.y,H,$.size.y),this._ctx.restore()}_clipRow(T){this._ctx.beginPath(),this._ctx.rect(0,T*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(T,E){return`${E?"italic":""} ${T?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}s.BaseRenderLayer=C;class w{get bitmap(){return this._bitmap}constructor(T){this.canvas=T,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var T;(T=this._bitmap)==null||T.close(),this._bitmap=void 0,v.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var T;this._state===0&&((T=this._bitmap)==null||T.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((E=>{this._state===2?this.refresh():this._bitmap=E,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CanvasRenderer=void 0;const u=c(627),f=c(56),d=c(374),g=c(345),p=c(859),x=c(873),b=c(43),_=c(630),v=c(744);class y extends p.Disposable{constructor(w,A,T,E,L,R,D,N,$,H,W){super(),this._terminal=w,this._screenElement=A,this._bufferService=E,this._charSizeService=L,this._optionsService=R,this._coreBrowserService=$,this._themeService=W,this._observerDisposable=this.register(new p.MutableDisposable),this._onRequestRedraw=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new g.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new g.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const Z=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new v.TextRenderLayer(this._terminal,this._screenElement,0,Z,this._bufferService,this._optionsService,D,H,this._coreBrowserService,W),new _.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,H,this._optionsService,W),new b.LinkRenderLayer(this._terminal,this._screenElement,2,T,this._bufferService,this._optionsService,H,this._coreBrowserService,W),new x.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,N,this._coreBrowserService,H,W)];for(const P of this._renderLayers)(0,g.forwardEvent)(P.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,d.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((P,G)=>this._setCanvasDevicePixelDimensions(P,G))),this.register(this._coreBrowserService.onWindowChange((P=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._renderLayers[0].canvas,P,((G,X)=>this._setCanvasDevicePixelDimensions(G,X)))}))),this.register((0,p.toDisposable)((()=>{for(const P of this._renderLayers)P.dispose();(0,u.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(w,A){this._updateDimensions();for(const T of this._renderLayers)T.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((w=>w.handleBlur()))}handleFocus(){this._runOperation((w=>w.handleFocus()))}handleSelectionChanged(w,A,T=!1){this._runOperation((E=>E.handleSelectionChanged(w,A,T))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((w=>w.handleCursorMove()))}clear(){this._runOperation((w=>w.reset()))}_runOperation(w){for(const A of this._renderLayers)w(A)}renderRows(w,A){for(const T of this._renderLayers)T.handleGridChanged(w,A)}clearTextureAtlas(){for(const w of this._renderLayers)w.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*w),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(w,A){this.dimensions.device.canvas.height=A,this.dimensions.device.canvas.width=w;for(const T of this._renderLayers)T.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}s.CanvasRenderer=y},873:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorRenderLayer=void 0;const u=c(457),f=c(859),d=c(399),g=c(782),p=c(903);class x extends p.BaseRenderLayer{constructor(_,v,y,C,w,A,T,E,L,R){super(_,v,"cursor",y,!0,R,w,A,L,E),this._onRequestRedraw=C,this._coreService=T,this._cursorBlinkStateManager=this.register(new f.MutableDisposable),this._cell=new g.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(_){super.resize(_),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var _;this._clearCursor(),(_=this._cursorBlinkStateManager.value)==null||_.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var _;(_=this._cursorBlinkStateManager.value)==null||_.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var _;(_=this._cursorBlinkStateManager.value)==null||_.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new u.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var _;(_=this._cursorBlinkStateManager.value)==null||_.restartBlinkAnimation()}handleGridChanged(_,v){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(_){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const v=this._bufferService.buffer.ybase+this._bufferService.buffer.y,y=v-this._bufferService.buffer.ydisp;if(y<0||y>=this._bufferService.rows)return void this._clearCursor();const C=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(v).loadCell(C,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const w=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;return A&&A!=="none"&&this._cursorRenderers[A](C,y,this._cell),this._ctx.restore(),this._state.x=C,this._state.y=y,this._state.isFocused=!1,this._state.style=w,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===C&&this._state.y===y&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](C,y,this._cell),this._ctx.restore(),this._state.x=C,this._state.y=y,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(d.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(_,v,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(_,v,y.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(y,_,v),this._ctx.restore()}_renderUnderlineCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(_,v),this._ctx.restore()}_renderOutlineCursor(_,v,y){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(_,v,y.getWidth(),1),this._ctx.restore()}}s.CursorRenderLayer=x},574:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GridCache=void 0,s.GridCache=class{constructor(){this.cache=[]}resize(c,u){for(let f=0;f<c;f++){this.cache.length<=f&&this.cache.push([]);for(let d=this.cache[f].length;d<u;d++)this.cache[f].push(void 0);this.cache[f].length=u}this.cache.length=c}clear(){for(let c=0;c<this.cache.length;c++)for(let u=0;u<this.cache[c].length;u++)this.cache[c][u]=void 0}}},43:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const u=c(197),f=c(237),d=c(903);class g extends d.BaseRenderLayer{constructor(x,b,_,v,y,C,w,A,T){super(x,b,"link",_,!0,T,y,C,w,A),this.register(v.onShowLinkUnderline((E=>this._handleShowLinkUnderline(E)))),this.register(v.onHideLinkUnderline((E=>this._handleHideLinkUnderline(E))))}resize(x){super.resize(x),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const x=this._state.y2-this._state.y1-1;x>0&&this._clearCells(0,this._state.y1+1,this._state.cols,x),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(x){if(x.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:x.fg&&(0,u.is256Color)(x.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[x.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,x.y1===x.y2)this._fillBottomLineAtCells(x.x1,x.y1,x.x2-x.x1);else{this._fillBottomLineAtCells(x.x1,x.y1,x.cols-x.x1);for(let b=x.y1+1;b<x.y2;b++)this._fillBottomLineAtCells(0,b,x.cols);this._fillBottomLineAtCells(0,x.y2,x.x2)}this._state=x}_handleHideLinkUnderline(x){this._clearCurrentLink()}}s.LinkRenderLayer=g},630:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionRenderLayer=void 0;const u=c(903);class f extends u.BaseRenderLayer{constructor(g,p,x,b,_,v,y,C){super(g,p,"selection",x,!0,C,b,y,v,_),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(g){super.resize(g),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(g,p,x){super.handleSelectionChanged(g,p,x),this._redrawSelection(g,p,x)}_redrawSelection(g,p,x){if(!this._didStateChange(g,p,x,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!g||!p)return void this._clearState();const b=g[1]-this._bufferService.buffer.ydisp,_=p[1]-this._bufferService.buffer.ydisp,v=Math.max(b,0),y=Math.min(_,this._bufferService.rows-1);if(v>=this._bufferService.rows||y<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,x){const C=g[0],w=p[0]-C,A=y-v+1;this._fillCells(C,v,w,A)}else{const C=b===v?g[0]:0,w=v===_?p[0]:this._bufferService.cols;this._fillCells(C,v,w-C,1);const A=Math.max(y-v-1,0);if(this._fillCells(0,v+1,this._bufferService.cols,A),v!==y){const T=_===y?p[0]:this._bufferService.cols;this._fillCells(0,y,T,1)}}this._state.start=[g[0],g[1]],this._state.end=[p[0],p[1]],this._state.columnSelectMode=x,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(g,p,x,b){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(p,this._state.end)||x!==this._state.columnSelectMode||b!==this._state.ydisp}_areCoordinatesEqual(g,p){return!(!g||!p)&&g[0]===p[0]&&g[1]===p[1]}}s.SelectionRenderLayer=f},744:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextRenderLayer=void 0;const u=c(577),f=c(147),d=c(782),g=c(855),p=c(903),x=c(574);class b extends p.BaseRenderLayer{constructor(v,y,C,w,A,T,E,L,R,D){super(v,y,"text",C,w,D,A,T,L,R),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new d.CellData,this._state=new x.GridCache,this.register(T.onSpecificOptionChange("allowTransparency",(N=>this._setTransparency(N))))}resize(v){super.resize(v);const y=this._getFont(!1,!1);this._characterWidth===v.device.char.width&&this._characterFont===y||(this._characterWidth=v.device.char.width,this._characterFont=y,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(v,y,C){for(let w=v;w<=y;w++){const A=w+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.lines.get(A),E=this._characterJoinerService.getJoinedCharacters(A);for(let L=0;L<this._bufferService.cols;L++){T.loadCell(L,this._workCell);let R=this._workCell,D=!1,N=L;if(R.getWidth()!==0){if(E.length>0&&L===E[0][0]){D=!0;const $=E.shift();R=new u.JoinedCellData(this._workCell,T.translateToString(!0,$[0],$[1]),$[1]-$[0]),N=$[1]-1}!D&&this._isOverlapping(R)&&N<T.length-1&&T.getCodePoint(N+1)===g.NULL_CELL_CODE&&(R.content&=-12582913,R.content|=8388608),C(R,L,w),L=N}}}}_drawBackground(v,y){const C=this._ctx,w=this._bufferService.cols;let A=0,T=0,E=null;C.save(),this._forEachCell(v,y,((L,R,D)=>{let N=null;L.isInverse()?N=L.isFgDefault()?this._themeService.colors.foreground.css:L.isFgRGB()?`rgb(${f.AttributeData.toColorRGB(L.getFgColor()).join(",")})`:this._themeService.colors.ansi[L.getFgColor()].css:L.isBgRGB()?N=`rgb(${f.AttributeData.toColorRGB(L.getBgColor()).join(",")})`:L.isBgPalette()&&(N=this._themeService.colors.ansi[L.getBgColor()].css);let $=!1;this._decorationService.forEachDecorationAtCell(R,this._bufferService.buffer.ydisp+D,void 0,(H=>{H.options.layer!=="top"&&$||(H.backgroundColorRGB&&(N=H.backgroundColorRGB.css),$=H.options.layer==="top")})),E===null&&(A=R,T=D),D!==T?(C.fillStyle=E||"",this._fillCells(A,T,w-A,1),A=R,T=D):E!==N&&(C.fillStyle=E||"",this._fillCells(A,T,R-A,1),A=R,T=D),E=N})),E!==null&&(C.fillStyle=E,this._fillCells(A,T,w-A,1)),C.restore()}_drawForeground(v,y){this._forEachCell(v,y,((C,w,A)=>this._drawChars(C,w,A)))}handleGridChanged(v,y){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,v,this._bufferService.cols,y-v+1),this._drawBackground(v,y),this._drawForeground(v,y))}_isOverlapping(v){if(v.getWidth()!==1||v.getCode()<256)return!1;const y=v.getChars();if(this._characterOverlapCache.hasOwnProperty(y))return this._characterOverlapCache[y];this._ctx.save(),this._ctx.font=this._characterFont;const C=Math.floor(this._ctx.measureText(y).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[y]=C,C}}s.TextRenderLayer=b},274:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const u=c(855),f=c(160),d=c(374);let g,p=0,x=0,b=!1,_=!1,v=!1,y=0;s.CellColorResolver=class{constructor(C,w,A,T,E,L){this._terminal=C,this._optionService=w,this._selectionRenderModel=A,this._decorationService=T,this._coreBrowserService=E,this._themeService=L,this.result={fg:0,bg:0,ext:0}}resolve(C,w,A,T){if(this.result.bg=C.bg,this.result.fg=C.fg,this.result.ext=268435456&C.bg?C.extended.ext:0,x=0,p=0,_=!1,b=!1,v=!1,g=this._themeService.colors,y=0,C.getCode()!==u.NULL_CELL_CODE&&C.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));y=w*T%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(w,A,"bottom",(E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,_=!0),E.foregroundColorRGB&&(p=E.foregroundColorRGB.rgba>>8&16777215,b=!0)})),v=this._selectionRenderModel.isCellSelected(this._terminal,w,A),v){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}x=f.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else x=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(_=!0,g.selectionForeground&&(p=g.selectionForeground.rgba>>8&16777215,b=!0),(0,d.treatGlyphAsBackgroundColor)(C.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)p=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}p=f.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}b=!0}}this._decorationService.forEachDecorationAtCell(w,A,"top",(E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,_=!0),E.foregroundColorRGB&&(p=E.foregroundColorRGB.rgba>>8&16777215,b=!0)})),_&&(x=v?-16777216&C.bg&-134217729|x|50331648:-16777216&C.bg|x|50331648),b&&(p=-16777216&C.fg&-67108865|p|50331648),67108864&this.result.fg&&(_&&!b&&(p=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,b=!0),!_&&b&&(x=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,_=!0)),g=void 0,this.result.bg=_?x:this.result.bg,this.result.fg=b?p:this.result.fg,this.result.ext&=536870911,this.result.ext|=y<<29&3758096384}}},627:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const u=c(509),f=c(197),d=[];s.acquireTextureAtlas=function(g,p,x,b,_,v,y,C){const w=(0,f.generateConfig)(b,_,v,y,p,x,C);for(let E=0;E<d.length;E++){const L=d[E],R=L.ownedBy.indexOf(g);if(R>=0){if((0,f.configEquals)(L.config,w))return L.atlas;L.ownedBy.length===1?(L.atlas.dispose(),d.splice(E,1)):L.ownedBy.splice(R,1);break}}for(let E=0;E<d.length;E++){const L=d[E];if((0,f.configEquals)(L.config,w))return L.ownedBy.push(g),L.atlas}const A=g._core,T={atlas:new u.TextureAtlas(document,w,A.unicodeService),config:w,ownedBy:[g]};return d.push(T),T.atlas},s.removeTerminalFromCache=function(g){for(let p=0;p<d.length;p++){const x=d[p].ownedBy.indexOf(g);if(x!==-1){d[p].ownedBy.length===1?(d[p].atlas.dispose(),d.splice(p,1)):d[p].ownedBy.splice(x,1);break}}}},197:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const u=c(160);s.generateConfig=function(f,d,g,p,x,b,_){const v={foreground:b.foreground,background:b.background,cursor:u.NULL_COLOR,cursorAccent:u.NULL_COLOR,selectionForeground:u.NULL_COLOR,selectionBackgroundTransparent:u.NULL_COLOR,selectionBackgroundOpaque:u.NULL_COLOR,selectionInactiveBackgroundTransparent:u.NULL_COLOR,selectionInactiveBackgroundOpaque:u.NULL_COLOR,ansi:b.ansi.slice(),contrastCache:b.contrastCache,halfContrastCache:b.halfContrastCache};return{customGlyphs:x.customGlyphs,devicePixelRatio:_,letterSpacing:x.letterSpacing,lineHeight:x.lineHeight,deviceCellWidth:f,deviceCellHeight:d,deviceCharWidth:g,deviceCharHeight:p,fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight,fontWeightBold:x.fontWeightBold,allowTransparency:x.allowTransparency,drawBoldTextInBrightColors:x.drawBoldTextInBrightColors,minimumContrastRatio:x.minimumContrastRatio,colors:v}},s.configEquals=function(f,d){for(let g=0;g<f.colors.ansi.length;g++)if(f.colors.ansi[g].rgba!==d.colors.ansi[g].rgba)return!1;return f.devicePixelRatio===d.devicePixelRatio&&f.customGlyphs===d.customGlyphs&&f.lineHeight===d.lineHeight&&f.letterSpacing===d.letterSpacing&&f.fontFamily===d.fontFamily&&f.fontSize===d.fontSize&&f.fontWeight===d.fontWeight&&f.fontWeightBold===d.fontWeightBold&&f.allowTransparency===d.allowTransparency&&f.deviceCharWidth===d.deviceCharWidth&&f.deviceCharHeight===d.deviceCharHeight&&f.drawBoldTextInBrightColors===d.drawBoldTextInBrightColors&&f.minimumContrastRatio===d.minimumContrastRatio&&f.colors.foreground.rgba===d.colors.foreground.rgba&&f.colors.background.rgba===d.colors.background.rgba},s.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432}},237:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const u=c(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},457:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(c=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,u>0)return void this._restartInterval(u)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(u)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),c)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const u=c(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"║":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╒":{1:(b,_)=>`M.5,1 L.5,${.5-_} L1,${.5-_} M.5,${.5+_} L1,${.5+_}`},"╓":{1:(b,_)=>`M${.5-b},1 L${.5-b},.5 L1,.5 M${.5+b},.5 L${.5+b},1`},"╔":{1:(b,_)=>`M1,${.5-_} L${.5-b},${.5-_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1`},"╕":{1:(b,_)=>`M0,${.5-_} L.5,${.5-_} L.5,1 M0,${.5+_} L.5,${.5+_}`},"╖":{1:(b,_)=>`M${.5+b},1 L${.5+b},.5 L0,.5 M${.5-b},.5 L${.5-b},1`},"╗":{1:(b,_)=>`M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M0,${.5-_} L${.5+b},${.5-_} L${.5+b},1`},"╘":{1:(b,_)=>`M.5,0 L.5,${.5+_} L1,${.5+_} M.5,${.5-_} L1,${.5-_}`},"╙":{1:(b,_)=>`M1,.5 L${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╚":{1:(b,_)=>`M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0 M1,${.5+_} L${.5-b},${.5+_} L${.5-b},0`},"╛":{1:(b,_)=>`M0,${.5+_} L.5,${.5+_} L.5,0 M0,${.5-_} L.5,${.5-_}`},"╜":{1:(b,_)=>`M0,.5 L${.5+b},.5 L${.5+b},0 M${.5-b},.5 L${.5-b},0`},"╝":{1:(b,_)=>`M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M0,${.5+_} L${.5+b},${.5+_} L${.5+b},0`},"╞":{1:(b,_)=>`M.5,0 L.5,1 M.5,${.5-_} L1,${.5-_} M.5,${.5+_} L1,${.5+_}`},"╟":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1 M${.5+b},.5 L1,.5`},"╠":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╡":{1:(b,_)=>`M.5,0 L.5,1 M0,${.5-_} L.5,${.5-_} M0,${.5+_} L.5,${.5+_}`},"╢":{1:(b,_)=>`M0,.5 L${.5-b},.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╣":{1:(b,_)=>`M${.5+b},0 L${.5+b},1 M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0`},"╤":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_} M.5,${.5+_} L.5,1`},"╥":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},1 M${.5+b},.5 L${.5+b},1`},"╦":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1`},"╧":{1:(b,_)=>`M.5,0 L.5,${.5-_} M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"╨":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╩":{1:(b,_)=>`M0,${.5+_} L1,${.5+_} M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╪":{1:(b,_)=>`M.5,0 L.5,1 M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"╫":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╬":{1:(b,_)=>`M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1 M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(b,_)=>`M.5,1 L.5,${.5+_/.15*.5} C.5,${.5+_/.15*.5},.5,.5,1,.5`},"╮":{1:(b,_)=>`M.5,1 L.5,${.5+_/.15*.5} C.5,${.5+_/.15*.5},.5,.5,0,.5`},"╯":{1:(b,_)=>`M.5,0 L.5,${.5-_/.15*.5} C.5,${.5-_/.15*.5},.5,.5,0,.5`},"╰":{1:(b,_)=>`M.5,0 L.5,${.5-_/.15*.5} C.5,${.5-_/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(b,_,v,y,C,w,A,T){const E=s.blockElementDefinitions[_];if(E)return(function(N,$,H,W,Z,P){for(let G=0;G<$.length;G++){const X=$[G],j=Z/8,I=P/8;N.fillRect(H+X.x*j,W+X.y*I,X.w*j,X.h*I)}})(b,E,v,y,C,w),!0;const L=f[_];if(L)return(function(N,$,H,W,Z,P){let G=d.get($);G||(G=new Map,d.set($,G));const X=N.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let j=G.get(X);if(!j){const I=$[0].length,z=$.length,Y=N.canvas.ownerDocument.createElement("canvas");Y.width=I,Y.height=z;const q=(0,u.throwIfFalsy)(Y.getContext("2d")),Q=new ImageData(I,z);let ee,te,re,K;if(X.startsWith("#"))ee=parseInt(X.slice(1,3),16),te=parseInt(X.slice(3,5),16),re=parseInt(X.slice(5,7),16),K=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[ee,te,re,K]=X.substring(5,X.length-1).split(",").map((ce=>parseFloat(ce)))}for(let ce=0;ce<z;ce++)for(let ne=0;ne<I;ne++)Q.data[4*(ce*I+ne)]=ee,Q.data[4*(ce*I+ne)+1]=te,Q.data[4*(ce*I+ne)+2]=re,Q.data[4*(ce*I+ne)+3]=$[ce][ne]*(255*K);q.putImageData(Q,0,0),j=(0,u.throwIfFalsy)(N.createPattern(Y,null)),G.set(X,j)}N.fillStyle=j,N.fillRect(H,W,Z,P)})(b,L,v,y,C,w),!0;const R=s.boxDrawingDefinitions[_];if(R)return(function(N,$,H,W,Z,P,G){N.strokeStyle=N.fillStyle;for(const[X,j]of Object.entries($)){let I;N.beginPath(),N.lineWidth=G*Number.parseInt(X),I=typeof j=="function"?j(.15,.15/P*Z):j;for(const z of I.split(" ")){const Y=z[0],q=p[Y];if(!q){console.error(`Could not find drawing instructions for "${Y}"`);continue}const Q=z.substring(1).split(",");Q[0]&&Q[1]&&q(N,x(Q,Z,P,H,W,!0,G))}N.stroke(),N.closePath()}})(b,R,v,y,C,w,T),!0;const D=s.powerlineDefinitions[_];return!!D&&((function(N,$,H,W,Z,P,G,X){const j=new Path2D;j.rect(H,W,Z,P),N.clip(j),N.beginPath();const I=G/12;N.lineWidth=X*I;for(const z of $.d.split(" ")){const Y=z[0],q=p[Y];if(!q){console.error(`Could not find drawing instructions for "${Y}"`);continue}const Q=z.substring(1).split(",");Q[0]&&Q[1]&&q(N,x(Q,Z,P,H,W,!1,X,($.leftPadding??0)*(I/2),($.rightPadding??0)*(I/2)))}$.type===1?(N.strokeStyle=N.fillStyle,N.stroke()):N.fill(),N.closePath()})(b,D,v,y,C,w,A,T),!0)};const d=new Map;function g(b,_,v=0){return Math.max(Math.min(b,_),v)}const p={C:(b,_)=>b.bezierCurveTo(_[0],_[1],_[2],_[3],_[4],_[5]),L:(b,_)=>b.lineTo(_[0],_[1]),M:(b,_)=>b.moveTo(_[0],_[1])};function x(b,_,v,y,C,w,A,T=0,E=0){const L=b.map((R=>parseFloat(R)||parseInt(R)));if(L.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<L.length;R+=2)L[R]*=_-T*A-E*A,w&&L[R]!==0&&(L[R]=g(Math.round(L[R]+.5)-.5,_,0)),L[R]+=y+T*A;for(let R=1;R<L.length;R+=2)L[R]*=v,w&&L[R]!==0&&(L[R]=g(Math.round(L[R]+.5)-.5,v,0)),L[R]+=C;return L}},56:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const u=c(859);s.observeDevicePixelDimensions=function(f,d,g){let p=new d.ResizeObserver((x=>{const b=x.find((y=>y.target===f));if(!b)return;if(!("devicePixelContentBoxSize"in b))return p==null||p.disconnect(),void(p=void 0);const _=b.devicePixelContentBoxSize[0].inlineSize,v=b.devicePixelContentBoxSize[0].blockSize;_>0&&v>0&&g(_,v)}));try{p.observe(f,{box:["device-pixel-content-box"]})}catch{p.disconnect(),p=void 0}return(0,u.toDisposable)((()=>p==null?void 0:p.disconnect()))}},374:(l,s)=>{function c(f){return 57508<=f&&f<=57558}function u(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=u,s.allowRescaling=function(f,d,g,p){return d===1&&g>Math.ceil(1.5*p)&&f!==void 0&&f>255&&!u(f)&&!c(f)&&!(function(x){return 57344<=x&&x<=63743})(f)},s.treatGlyphAsBackgroundColor=function(f){return c(f)||(function(d){return 9472<=d&&d<=9631})(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,d,g=0){return(f-(2*Math.round(d)-g))%(2*Math.round(d))}},296:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(f,d,g,p=!1){if(this.selectionStart=d,this.selectionEnd=g,!d||!g||d[0]===g[0]&&d[1]===g[1])return void this.clear();const x=f.buffers.active.ydisp,b=d[1]-x,_=g[1]-x,v=Math.max(b,0),y=Math.min(_,f.rows-1);v>=f.rows||y<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=b,this.viewportEndRow=_,this.viewportCappedStartRow=v,this.viewportCappedEndRow=y,this.startCol=d[0],this.endCol=g[0])}isCellSelected(f,d,g){return!!this.hasSelection&&(g-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&g>=this.viewportCappedStartRow&&d<this.endCol&&g<=this.viewportCappedEndRow:d<this.startCol&&g>=this.viewportCappedStartRow&&d>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&d>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},509:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const u=c(237),f=c(860),d=c(374),g=c(160),p=c(345),x=c(485),b=c(385),_=c(147),v=c(855),y={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let C;class w{get pages(){return this._pages}constructor(R,D,N){this._document=R,this._config=D,this._unicodeService=N,this._didWarmUp=!1,this._cacheMap=new x.FourKeyMap,this._cacheMapCombined=new x.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new _.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new b.IdleTaskQueue;for(let D=33;D<126;D++)R.enqueue((()=>{if(!this._cacheMap.get(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT)){const N=this._drawToCache(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT);this._cacheMap.set(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT,N)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const D=this._pages.filter((G=>2*G.canvas.width<=(w.maxTextureSize||4096))).sort(((G,X)=>X.canvas.width!==G.canvas.width?X.canvas.width-G.canvas.width:X.percentageUsed-G.percentageUsed));let N=-1,$=0;for(let G=0;G<D.length;G++)if(D[G].canvas.width!==$)N=G,$=D[G].canvas.width;else if(G-N==3)break;const H=D.slice(N,N+4),W=H.map((G=>G.glyphs[0].texturePage)).sort(((G,X)=>G>X?1:-1)),Z=this.pages.length-H.length,P=this._mergePages(H,Z);P.version++;for(let G=W.length-1;G>=0;G--)this._deletePage(W[G]);this.pages.push(P),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(P.canvas)}const R=new A(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,D){const N=2*R[0].canvas.width,$=new A(this._document,N,R);for(const[H,W]of R.entries()){const Z=H*W.canvas.width%N,P=Math.floor(H/2)*W.canvas.height;$.ctx.drawImage(W.canvas,Z,P);for(const X of W.glyphs)X.texturePage=D,X.sizeClipSpace.x=X.size.x/N,X.sizeClipSpace.y=X.size.y/N,X.texturePosition.x+=Z,X.texturePosition.y+=P,X.texturePositionClipSpace.x=X.texturePosition.x/N,X.texturePositionClipSpace.y=X.texturePosition.y/N;this._onRemoveTextureAtlasCanvas.fire(W.canvas);const G=this._activePages.indexOf(W);G!==-1&&this._activePages.splice(G,1)}return $}_deletePage(R){this._pages.splice(R,1);for(let D=R;D<this._pages.length;D++){const N=this._pages[D];for(const $ of N.glyphs)$.texturePage--;N.version++}}getRasterizedGlyphCombinedChar(R,D,N,$,H){return this._getFromCacheMap(this._cacheMapCombined,R,D,N,$,H)}getRasterizedGlyph(R,D,N,$,H){return this._getFromCacheMap(this._cacheMap,R,D,N,$,H)}_getFromCacheMap(R,D,N,$,H,W=!1){return C=R.get(D,N,$,H),C||(C=this._drawToCache(D,N,$,H,W),R.set(D,N,$,H,C)),C}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,D,N,$){if(this._config.allowTransparency)return g.NULL_COLOR;let H;switch(R){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(D);break;case 50331648:const W=_.AttributeData.toColorRGB(D);H=g.channels.toColor(W[0],W[1],W[2]);break;default:H=N?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(R,D,N,$,H,W,Z,P,G,X){const j=this._getMinimumContrastColor(R,D,N,$,H,W,Z,G,P,X);if(j)return j;let I;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&G&&W<8&&(W+=8),I=this._getColorFromAnsiIndex(W);break;case 50331648:const z=_.AttributeData.toColorRGB(W);I=g.channels.toColor(z[0],z[1],z[2]);break;default:I=Z?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(I=g.color.opaque(I)),P&&(I=g.color.multiplyOpacity(I,u.DIM_OPACITY)),I}_resolveBackgroundRgba(R,D,N){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(D).rgba;case 50331648:return D<<8;default:return N?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,D,N,$){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&$&&D<8&&(D+=8),this._getColorFromAnsiIndex(D).rgba;case 50331648:return D<<8;default:return N?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,D,N,$,H,W,Z,P,G,X){if(this._config.minimumContrastRatio===1||X)return;const j=this._getContrastCache(G),I=j.getColor(R,$);if(I!==void 0)return I||void 0;const z=this._resolveBackgroundRgba(D,N,Z),Y=this._resolveForegroundRgba(H,W,Z,P),q=g.rgba.ensureContrastRatio(z,Y,this._config.minimumContrastRatio/(G?2:1));if(!q)return void j.setColor(R,$,null);const Q=g.channels.toColor(q>>24&255,q>>16&255,q>>8&255);return j.setColor(R,$,Q),Q}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,D,N,$,H=!1){const W=typeof R=="number"?String.fromCharCode(R):R,Z=Math.min(this._config.deviceCellWidth*Math.max(W.length,2)+4,this._textureSize);this._tmpCanvas.width<Z&&(this._tmpCanvas.width=Z);const P=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<P&&(this._tmpCanvas.height=P),this._tmpCtx.save(),this._workAttributeData.fg=N,this._workAttributeData.bg=D,this._workAttributeData.extended.ext=$,this._workAttributeData.isInvisible())return y;const G=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),I=!!this._workAttributeData.isItalic(),z=!!this._workAttributeData.isUnderline(),Y=!!this._workAttributeData.isStrikethrough(),q=!!this._workAttributeData.isOverline();let Q=this._workAttributeData.getFgColor(),ee=this._workAttributeData.getFgColorMode(),te=this._workAttributeData.getBgColor(),re=this._workAttributeData.getBgColorMode();if(X){const Fe=Q;Q=te,te=Fe;const Ue=ee;ee=re,re=Ue}const K=this._getBackgroundColor(re,te,X,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=K.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ce=G?this._config.fontWeightBold:this._config.fontWeight,ne=I?"italic":"";this._tmpCtx.font=`${ne} ${ce} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=u.TEXT_BASELINE;const de=W.length===1&&(0,d.isPowerlineGlyph)(W.charCodeAt(0)),_e=W.length===1&&(0,d.isRestrictedPowerlineGlyph)(W.charCodeAt(0)),Be=this._getForegroundColor(D,re,te,N,ee,Q,X,j,G,(0,d.treatGlyphAsBackgroundColor)(W.charCodeAt(0)));this._tmpCtx.fillStyle=Be.css;const De=_e?0:4;let Ze=!1;this._config.customGlyphs!==!1&&(Ze=(0,f.tryDrawCustomChar)(this._tmpCtx,W,De,De,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let kt,Je=!de;if(kt=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),z){this._tmpCtx.save();const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ue=Fe%2==1?.5:0;if(this._tmpCtx.lineWidth=Fe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Je=!1,this._tmpCtx.strokeStyle=`rgb(${_.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Je=!1;let Ve=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ve<8&&(Ve+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ve).css}this._tmpCtx.beginPath();const dt=De,pe=Math.ceil(De+this._config.deviceCharHeight)-Ue-(H?2*Fe:0),Te=pe+Fe,ze=pe+2*Fe;let Ge=this._workAttributeData.getUnderlineVariantOffset();for(let Ve=0;Ve<kt;Ve++){this._tmpCtx.save();const ot=dt+Ve*this._config.deviceCellWidth,it=dt+(Ve+1)*this._config.deviceCellWidth,Yt=ot+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe),this._tmpCtx.moveTo(ot,ze),this._tmpCtx.lineTo(it,ze);break;case 3:const $t=Fe<=1?ze:Math.ceil(De+this._config.deviceCharHeight-Fe/2)-Ue,Pt=Fe<=1?pe:Math.ceil(De+this._config.deviceCharHeight+Fe/2)-Ue,Mt=new Path2D;Mt.rect(ot,pe,this._config.deviceCellWidth,ze-pe),this._tmpCtx.clip(Mt),this._tmpCtx.moveTo(ot-this._config.deviceCellWidth/2,Te),this._tmpCtx.bezierCurveTo(ot-this._config.deviceCellWidth/2,Pt,ot,Pt,ot,Te),this._tmpCtx.bezierCurveTo(ot,$t,Yt,$t,Yt,Te),this._tmpCtx.bezierCurveTo(Yt,Pt,it,Pt,it,Te),this._tmpCtx.bezierCurveTo(it,$t,it+this._config.deviceCellWidth/2,$t,it+this._config.deviceCellWidth/2,Te);break;case 4:const zr=Ge===0?0:Ge>=Fe?2*Fe-Ge:Fe-Ge;Ge>=Fe||zr===0?(this._tmpCtx.setLineDash([Math.round(Fe),Math.round(Fe)]),this._tmpCtx.moveTo(ot+zr,pe),this._tmpCtx.lineTo(it,pe)):(this._tmpCtx.setLineDash([Math.round(Fe),Math.round(Fe)]),this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(ot+zr,pe),this._tmpCtx.moveTo(ot+zr+Fe,pe),this._tmpCtx.lineTo(it,pe)),Ge=(0,d.computeNextVariantOffset)(it-ot,Fe,Ge);break;case 5:const vr=.6,Zr=.3,Er=it-ot,ri=Math.floor(vr*Er),ur=Math.floor(Zr*Er),Gt=Er-ri-ur;this._tmpCtx.setLineDash([ri,ur,Gt]),this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe);break;default:this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ze&&this._config.fontSize>=12&&!this._config.allowTransparency&&W!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ve=this._tmpCtx.measureText(W);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ve&&Ve.actualBoundingBoxDescent>0){this._tmpCtx.save();const ot=new Path2D;ot.rect(dt,pe-Math.ceil(Fe/2),this._config.deviceCellWidth*kt,ze-pe+Math.ceil(Fe/2)),this._tmpCtx.clip(ot),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=K.css,this._tmpCtx.strokeText(W,De,De+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(q){const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ue=Fe%2==1?.5:0;this._tmpCtx.lineWidth=Fe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Ue),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*kt,De+Ue),this._tmpCtx.stroke()}if(Ze||this._tmpCtx.fillText(W,De,De+this._config.deviceCharHeight),W==="_"&&!this._config.allowTransparency){let Fe=T(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),K,Be,Je);if(Fe)for(let Ue=1;Ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=K.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(W,De,De+this._config.deviceCharHeight-Ue),Fe=T(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),K,Be,Je),Fe);Ue++);}if(Y){const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Fe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Math.floor(this._config.deviceCharHeight/2)-Ue),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*kt,De+Math.floor(this._config.deviceCharHeight/2)-Ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const st=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let At;if(At=this._config.allowTransparency?(function(Fe){for(let Ue=0;Ue<Fe.data.length;Ue+=4)if(Fe.data[Ue+3]>0)return!1;return!0})(st):T(st,K,Be,Je),At)return y;const ut=this._findGlyphBoundingBox(st,this._workBoundingBox,Z,_e,Ze,De);let Me,Ie;for(;;){if(this._activePages.length===0){const Fe=this._createNewPage();Me=Fe,Ie=Fe.currentRow,Ie.height=ut.size.y;break}Me=this._activePages[this._activePages.length-1],Ie=Me.currentRow;for(const Fe of this._activePages)ut.size.y<=Fe.currentRow.height&&(Me=Fe,Ie=Fe.currentRow);for(let Fe=this._activePages.length-1;Fe>=0;Fe--)for(const Ue of this._activePages[Fe].fixedRows)Ue.height<=Ie.height&&ut.size.y<=Ue.height&&(Me=this._activePages[Fe],Ie=Ue);if(Ie.y+ut.size.y>=Me.canvas.height||Ie.height>ut.size.y+2){let Fe=!1;if(Me.currentRow.y+Me.currentRow.height+ut.size.y>=Me.canvas.height){let Ue;for(const dt of this._activePages)if(dt.currentRow.y+dt.currentRow.height+ut.size.y<dt.canvas.height){Ue=dt;break}if(Ue)Me=Ue;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&Ie.y+ut.size.y<=Me.canvas.height&&Ie.height>=ut.size.y&&Ie.x+ut.size.x<=Me.canvas.width)Fe=!0;else{const dt=this._createNewPage();Me=dt,Ie=dt.currentRow,Ie.height=ut.size.y,Fe=!0}}Fe||(Me.currentRow.height>0&&Me.fixedRows.push(Me.currentRow),Ie={x:0,y:Me.currentRow.y+Me.currentRow.height,height:ut.size.y},Me.fixedRows.push(Ie),Me.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+ut.size.x<=Me.canvas.width)break;Ie===Me.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Me.fixedRows.splice(Me.fixedRows.indexOf(Ie),1)}return ut.texturePage=this._pages.indexOf(Me),ut.texturePosition.x=Ie.x,ut.texturePosition.y=Ie.y,ut.texturePositionClipSpace.x=Ie.x/Me.canvas.width,ut.texturePositionClipSpace.y=Ie.y/Me.canvas.height,ut.sizeClipSpace.x/=Me.canvas.width,ut.sizeClipSpace.y/=Me.canvas.height,Ie.height=Math.max(Ie.height,ut.size.y),Ie.x+=ut.size.x,Me.ctx.putImageData(st,ut.texturePosition.x-this._workBoundingBox.left,ut.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ut.size.x,ut.size.y),Me.addGlyph(ut),Me.version++,ut}_findGlyphBoundingBox(R,D,N,$,H,W){D.top=0;const Z=$?this._config.deviceCellHeight:this._tmpCanvas.height,P=$?this._config.deviceCellWidth:N;let G=!1;for(let X=0;X<Z;X++){for(let j=0;j<P;j++){const I=X*this._tmpCanvas.width*4+4*j+3;if(R.data[I]!==0){D.top=X,G=!0;break}}if(G)break}D.left=0,G=!1;for(let X=0;X<W+P;X++){for(let j=0;j<Z;j++){const I=j*this._tmpCanvas.width*4+4*X+3;if(R.data[I]!==0){D.left=X,G=!0;break}}if(G)break}D.right=P,G=!1;for(let X=W+P-1;X>=W;X--){for(let j=0;j<Z;j++){const I=j*this._tmpCanvas.width*4+4*X+3;if(R.data[I]!==0){D.right=X,G=!0;break}}if(G)break}D.bottom=Z,G=!1;for(let X=Z-1;X>=0;X--){for(let j=0;j<P;j++){const I=X*this._tmpCanvas.width*4+4*j+3;if(R.data[I]!==0){D.bottom=X,G=!0;break}}if(G)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:D.right-D.left+1,y:D.bottom-D.top+1},sizeClipSpace:{x:D.right-D.left+1,y:D.bottom-D.top+1},offset:{x:-D.left+W+($||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-D.top+W+($||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=w;class A{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,D,N){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],N)for(const $ of N)this._glyphs.push(...$.glyphs),this._usedPixels+=$._usedPixels;this.canvas=E(R,D,D),this.ctx=(0,d.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function T(L,R,D,N){const $=R.rgba>>>24,H=R.rgba>>>16&255,W=R.rgba>>>8&255,Z=D.rgba>>>24,P=D.rgba>>>16&255,G=D.rgba>>>8&255,X=Math.floor((Math.abs($-Z)+Math.abs(H-P)+Math.abs(W-G))/12);let j=!0;for(let I=0;I<L.data.length;I+=4)L.data[I]===$&&L.data[I+1]===H&&L.data[I+2]===W||N&&Math.abs(L.data[I]-$)+Math.abs(L.data[I+1]-H)+Math.abs(L.data[I+2]-W)<X?L.data[I+3]=0:j=!1;return j}function E(L,R,D){const N=L.createElement("canvas");return N.width=R,N.height=D,N}},577:function(l,s,c){var u=this&&this.__decorate||function(v,y,C,w){var A,T=arguments.length,E=T<3?y:w===null?w=Object.getOwnPropertyDescriptor(y,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,y,C,w);else for(var L=v.length-1;L>=0;L--)(A=v[L])&&(E=(T<3?A(E):T>3?A(y,C,E):A(y,C))||E);return T>3&&E&&Object.defineProperty(y,C,E),E},f=this&&this.__param||function(v,y){return function(C,w){y(C,w,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const d=c(147),g=c(855),p=c(782),x=c(97);class b extends d.AttributeData{constructor(y,C,w){super(),this.content=0,this.combinedData="",this.fg=y.fg,this.bg=y.bg,this.combinedData=C,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(y){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=b;let _=s.CharacterJoinerService=class B6{constructor(y){this._bufferService=y,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(y){const C={id:this._nextCharacterJoinerId++,handler:y};return this._characterJoiners.push(C),C.id}deregister(y){for(let C=0;C<this._characterJoiners.length;C++)if(this._characterJoiners[C].id===y)return this._characterJoiners.splice(C,1),!0;return!1}getJoinedCharacters(y){if(this._characterJoiners.length===0)return[];const C=this._bufferService.buffer.lines.get(y);if(!C||C.length===0)return[];const w=[],A=C.translateToString(!0);let T=0,E=0,L=0,R=C.getFg(0),D=C.getBg(0);for(let N=0;N<C.getTrimmedLength();N++)if(C.loadCell(N,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==D){if(N-T>1){const $=this._getJoinedRanges(A,L,E,C,T);for(let H=0;H<$.length;H++)w.push($[H])}T=N,L=E,R=this._workCell.fg,D=this._workCell.bg}E+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-T>1){const N=this._getJoinedRanges(A,L,E,C,T);for(let $=0;$<N.length;$++)w.push(N[$])}return w}_getJoinedRanges(y,C,w,A,T){const E=y.substring(C,w);let L=[];try{L=this._characterJoiners[0].handler(E)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const D=this._characterJoiners[R].handler(E);for(let N=0;N<D.length;N++)B6._mergeRanges(L,D[N])}catch(D){console.error(D)}return this._stringRangesToCellRanges(L,A,T),L}_stringRangesToCellRanges(y,C,w){let A=0,T=!1,E=0,L=y[A];if(L){for(let R=w;R<this._bufferService.cols;R++){const D=C.getWidth(R),N=C.getString(R).length||g.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!T&&L[0]<=E&&(L[0]=R,T=!0),L[1]<=E){if(L[1]=R,L=y[++A],!L)break;L[0]<=E?(L[0]=R,T=!0):T=!1}E+=N}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(y,C){let w=!1;for(let A=0;A<y.length;A++){const T=y[A];if(w){if(C[1]<=T[0])return y[A-1][1]=C[1],y;if(C[1]<=T[1])return y[A-1][1]=Math.max(C[1],T[1]),y.splice(A,1),y;y.splice(A,1),A--}else{if(C[1]<=T[0])return y.splice(A,0,C),y;if(C[1]<=T[1])return T[0]=Math.min(C[0],T[0]),y;C[0]<T[1]&&(T[0]=Math.min(C[0],T[0]),w=!0)}}return w?y[y.length-1][1]=C[1]:y.push(C),y}};s.CharacterJoinerService=_=u([f(0,x.IBufferService)],_)},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,u=0,f=0,d=0;var g,p,x,b,_;function v(C){const w=C.toString(16);return w.length<2?"0"+w:w}function y(C,w){return C<w?(w+.05)/(C+.05):(C+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(C){C.toCss=function(w,A,T,E){return E!==void 0?`#${v(w)}${v(A)}${v(T)}${v(E)}`:`#${v(w)}${v(A)}${v(T)}`},C.toRgba=function(w,A,T,E=255){return(w<<24|A<<16|T<<8|E)>>>0},C.toColor=function(w,A,T,E){return{css:C.toCss(w,A,T,E),rgba:C.toRgba(w,A,T,E)}}})(g||(s.channels=g={})),(function(C){function w(A,T){return d=Math.round(255*T),[c,u,f]=_.toChannels(A.rgba),{css:g.toCss(c,u,f,d),rgba:g.toRgba(c,u,f,d)}}C.blend=function(A,T){if(d=(255&T.rgba)/255,d===1)return{css:T.css,rgba:T.rgba};const E=T.rgba>>24&255,L=T.rgba>>16&255,R=T.rgba>>8&255,D=A.rgba>>24&255,N=A.rgba>>16&255,$=A.rgba>>8&255;return c=D+Math.round((E-D)*d),u=N+Math.round((L-N)*d),f=$+Math.round((R-$)*d),{css:g.toCss(c,u,f),rgba:g.toRgba(c,u,f)}},C.isOpaque=function(A){return(255&A.rgba)==255},C.ensureContrastRatio=function(A,T,E){const L=_.ensureContrastRatio(A.rgba,T.rgba,E);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},C.opaque=function(A){const T=(255|A.rgba)>>>0;return[c,u,f]=_.toChannels(T),{css:g.toCss(c,u,f),rgba:T}},C.opacity=w,C.multiplyOpacity=function(A,T){return d=255&A.rgba,w(A,d*T/255)},C.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(p||(s.color=p={})),(function(C){let w,A;try{const T=document.createElement("canvas");T.width=1,T.height=1;const E=T.getContext("2d",{willReadFrequently:!0});E&&(w=E,w.globalCompositeOperation="copy",A=w.createLinearGradient(0,0,1,1))}catch{}C.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),g.toColor(c,u,f);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),d=parseInt(T.slice(4,5).repeat(2),16),g.toColor(c,u,f,d);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const E=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),u=parseInt(E[2]),f=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),g.toColor(c,u,f,d);if(!w||!A)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=A,w.fillStyle=T,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[c,u,f,d]=w.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,u,f,d),css:T}}})(x||(s.css=x={})),(function(C){function w(A,T,E){const L=A/255,R=T/255,D=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}C.relativeLuminance=function(A){return w(A>>16&255,A>>8&255,255&A)},C.relativeLuminance2=w})(b||(s.rgb=b={})),(function(C){function w(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($>0||H>0||W>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),W-=Math.max(0,Math.ceil(.1*W)),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}function A(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($<255||H<255||W<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),H=Math.min(255,H+Math.ceil(.1*(255-H))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}C.blend=function(T,E){if(d=(255&E)/255,d===1)return E;const L=E>>24&255,R=E>>16&255,D=E>>8&255,N=T>>24&255,$=T>>16&255,H=T>>8&255;return c=N+Math.round((L-N)*d),u=$+Math.round((R-$)*d),f=H+Math.round((D-H)*d),g.toRgba(c,u,f)},C.ensureContrastRatio=function(T,E,L){const R=b.relativeLuminance(T>>8),D=b.relativeLuminance(E>>8);if(y(R,D)<L){if(D<R){const H=w(T,E,L),W=y(R,b.relativeLuminance(H>>8));if(W<L){const Z=A(T,E,L);return W>y(R,b.relativeLuminance(Z>>8))?H:Z}return H}const N=A(T,E,L),$=y(R,b.relativeLuminance(N>>8));if($<L){const H=w(T,E,L);return $>y(R,b.relativeLuminance(H>>8))?N:H}return N}},C.reduceLuminance=w,C.increaseLuminance=A,C.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(_||(s.rgba=_={})),s.toPaddedHex=v,s.contrastRatio=y},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,u){return c((f=>u.fire(f)))},s.runAndSubscribe=function(c,u){return u(void 0),c((f=>u(f)))}},859:(l,s)=>{function c(u){for(const f of u)f.dispose();u.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const f=this._disposables.indexOf(u);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var f;this._isDisposed||u===this._value||((f=this._value)==null||f.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},s.toDisposable=function(u){return{dispose:u}},s.disposeArray=c,s.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,d,g){this._data[f]||(this._data[f]={}),this._data[f][d]=g}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(u,f,d,g,p){this._data.get(u,f)||this._data.set(u,f,new c),this._data.get(u,f).set(d,g,p)}get(u,f,d,g){var p;return(p=this._data.get(u,f))==null?void 0:p.get(d,g)}clear(){this._data.clear()}}},399:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,u=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=c.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),s.isIpad=u==="iPad",s.isIphone=u==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),s.isLinux=u.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},385:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const u=c(399);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let x=0,b=0,_=p.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),b=Math.max(x,b),v=p.timeRemaining(),1.5*b>v)return _-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-x))}ms`),void this._start();_=v}this.clear()}}class d extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const x=Date.now()+p;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,g=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=g}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=u},782:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const u=c(133),f=c(855),d=c(147);class g extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const b=new g;return b.setFromCharData(x),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(x[f.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(x[f.CHAR_DATA_CHAR_INDEX].length===2){const _=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const v=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(_-55296)+v-56320+65536|x[f.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=x[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=g},855:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,u=0,f=c.length){let d="";for(let g=u;g<f;++g){let p=c[g];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const f=c.length;if(!f)return 0;let d=0,g=0;if(this._interim){const p=c.charCodeAt(g++);56320<=p&&p<=57343?u[d++]=1024*(this._interim-55296)+p-56320+65536:(u[d++]=this._interim,u[d++]=p),this._interim=0}for(let p=g;p<f;++p){const x=c.charCodeAt(p);if(55296<=x&&x<=56319){if(++p>=f)return this._interim=x,d;const b=c.charCodeAt(p);56320<=b&&b<=57343?u[d++]=1024*(x-55296)+b-56320+65536:(u[d++]=x,u[d++]=b)}else x!==65279&&(u[d++]=x)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const f=c.length;if(!f)return 0;let d,g,p,x,b=0,_=0,v=0;if(this.interim[0]){let w=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let T,E=0;for(;(T=63&this.interim[++E])&&E<4;)A<<=6,A|=T;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=L-E;for(;v<R;){if(v>=f)return 0;if(T=c[v++],(192&T)!=128){v--,w=!0;break}this.interim[E++]=T,A<<=6,A|=63&T}w||(L===2?A<128?v--:u[b++]=A:L===3?A<2048||A>=55296&&A<=57343||A===65279||(u[b++]=A):A<65536||A>1114111||(u[b++]=A)),this.interim.fill(0)}const y=f-4;let C=v;for(;C<f;){for(;!(!(C<y)||128&(d=c[C])||128&(g=c[C+1])||128&(p=c[C+2])||128&(x=c[C+3]));)u[b++]=d,u[b++]=g,u[b++]=p,u[b++]=x,C+=4;if(d=c[C++],d<128)u[b++]=d;else if((224&d)==192){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(_=(31&d)<<6|63&g,_<128){C--;continue}u[b++]=_}else if((240&d)==224){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(_=(15&d)<<12|(63&g)<<6|63&p,_<2048||_>=55296&&_<=57343||_===65279)continue;u[b++]=_}else if((248&d)==240){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,this.interim[2]=p,b;if(x=c[C++],(192&x)!=128){C--;continue}if(_=(7&d)<<18|(63&g)<<12|(63&p)<<6|63&x,_<65536||_>1114111)continue;u[b++]=_}}return b}}},776:function(l,s,c){var u=this&&this.__decorate||function(_,v,y,C){var w,A=arguments.length,T=A<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,v,y,C);else for(var E=_.length-1;E>=0;E--)(w=_[E])&&(T=(A<3?w(T):A>3?w(v,y,T):w(v,y))||T);return A>3&&T&&Object.defineProperty(v,y,T),T},f=this&&this.__param||function(_,v){return function(y,C){v(y,C,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const d=c(859),g=c(97),p={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,b=s.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let v=0;v<_.length;v++)typeof _[v]=="function"&&(_[v]=_[v]())}_log(_,v,y){this._evalLazyOptionalParams(y),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...y)}trace(_,...v){var y;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.trace.bind(this._optionsService.options.logger))??console.log,_,v)}debug(_,...v){var y;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.debug.bind(this._optionsService.options.logger))??console.log,_,v)}info(_,...v){var y;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.info.bind(this._optionsService.options.logger))??console.info,_,v)}warn(_,...v){var y;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.warn.bind(this._optionsService.options.logger))??console.warn,_,v)}error(_,...v){var y;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.error.bind(this._optionsService.options.logger))??console.error,_,v)}};s.LogService=b=u([f(0,g.IOptionsService)],b),s.setTraceLogger=function(_){x=_},s.traceCall=function(_,v,y){if(typeof y.value!="function")throw new Error("not supported");const C=y.value;y.value=function(...w){if(x.logLevel!==g.LogLevelEnum.TRACE)return C.apply(this,w);x.trace(`GlyphRenderer#${C.name}(${w.map((T=>JSON.stringify(T))).join(", ")})`);const A=C.apply(this,w);return x.trace(`GlyphRenderer#${C.name} return`,A),A}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",u="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[u]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const d=function(g,p,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,_,v){_[c]===_?_[u].push({id:b,index:v}):(_[u]=[{id:b,index:v}],_[c]=_)})(d,g,x)};return d.toString=()=>f,s.serviceRegistry.set(f,d),d}},97:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const u=c(726);var f;s.IBufferService=(0,u.createDecorator)("BufferService"),s.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),s.ICoreService=(0,u.createDecorator)("CoreService"),s.ICharsetService=(0,u.createDecorator)("CharsetService"),s.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(f||(s.LogLevelEnum=f={})),s.ILogService=(0,u.createDecorator)("LogService"),s.IOptionsService=(0,u.createDecorator)("OptionsService"),s.IOscLinkService=(0,u.createDecorator)("OscLinkService"),s.IUnicodeService=(0,u.createDecorator)("UnicodeService"),s.IDecorationService=(0,u.createDecorator)("DecorationService")}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l].call(c.exports,c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.CanvasAddon=void 0;const s=n(345),c=n(859),u=n(776),f=n(949);class d extends c.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var p;return(p=this._renderer)==null?void 0:p.textureAtlas}activate(p){const x=p._core;if(!p.element)return void this.register(x.onWillOpen((()=>this.activate(p))));this._terminal=p;const b=x.coreService,_=x.optionsService,v=x.screenElement,y=x.linkifier,C=x,w=C._bufferService,A=C._renderService,T=C._characterJoinerService,E=C._charSizeService,L=C._coreBrowserService,R=C._decorationService,D=C._logService,N=C._themeService;(0,u.setTraceLogger)(D),this._renderer=new f.CanvasRenderer(p,v,y,w,E,_,T,b,L,R,N),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),A.setRenderer(this._renderer),A.handleResize(w.cols,w.rows),this.register((0,c.toDisposable)((()=>{var $;A.setRenderer(this._terminal._core._createRenderer()),A.handleResize(p.cols,p.rows),($=this._renderer)==null||$.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var p;(p=this._renderer)==null||p.clearTextureAtlas()}}l.CanvasAddon=d})(),o})()))})(S_)),S_.exports}var Mz=Bz();function Rz(e={}){const{fontSize:t=14,onData:r,onResize:i,onSelectionChange:n}=e,o=F.useRef(null),l=F.useRef(null),s=F.useRef(null),c=F.useRef(()=>{}),u=F.useRef(null),[f,d]=F.useState(null),[g,p]=F.useState(null),[x,b]=F.useState(null),_=Md(A=>A.themeId),v=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<768,y=F.useCallback(()=>{var A,T;try{if(!v){(A=s.current)==null||A.fit();return}const E=l.current,L=s.current;if(!E||!L)return;const R=E._core;if(!R){L.fit();return}const D=(T=R._renderService)==null?void 0:T.dimensions;if(!D||D.css.cell.width===0||D.css.cell.height===0){L.fit();return}const N=E.element;if(!(N!=null&&N.parentElement)){L.fit();return}const $=window.getComputedStyle(N.parentElement),H=parseInt($.height),W=Math.max(0,parseInt($.width)),Z=window.getComputedStyle(N),P=H-parseInt(Z.paddingTop)-parseInt(Z.paddingBottom),G=W-parseInt(Z.paddingLeft)-parseInt(Z.paddingRight),X=Math.max(2,Math.floor(G/D.css.cell.width)),j=Math.max(1,Math.floor(P/D.css.cell.height));(E.rows!==j||E.cols!==X)&&(R._renderService.clear(),E.resize(X,j))}catch{}},[v]);c.current=y;const C=F.useCallback(A=>{var T;(T=l.current)==null||T.write(A)},[]),w=F.useCallback(()=>{var A;return((A=l.current)==null?void 0:A.getSelection())??""},[]);return F.useEffect(()=>{const A=o.current;if(!A)return;const T="'NerdFont', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Menlo', 'Consolas', monospace",E=QT(_),L=new Sz.Terminal({cursorBlink:!0,fontFamily:T,fontSize:t,scrollback:1e4,fontWeight:"normal",fontWeightBold:"bold",letterSpacing:0,lineHeight:1,allowProposedApi:!0,theme:E}),R=new Tz.FitAddon,D=new kz.SearchAddon,N=new Lz.WebLinksAddon;L.loadAddon(R),L.loadAddon(D),L.loadAddon(N),L.attachCustomKeyEventHandler(z=>{if((z.ctrlKey||z.metaKey)&&(z.key==="k"||z.key==="f"))return!1;if(z.key==="Escape"){const Y=rt.getState();if(Y.commandPaletteOpen||Y.searchBarOpen||Y.copyOverlayOpen)return!1}return!0});let $=!1;const H=z=>{var Y;(Y=z.message)!=null&&Y.includes("dimensions")&&z.preventDefault()},W=()=>{if($)return;window.addEventListener("error",H);try{L.open(A)}catch{window.removeEventListener("error",H);return}setTimeout(()=>window.removeEventListener("error",H),50);const z=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<768;if(!navigator.webdriver&&!z)try{const Q=new Mz.CanvasAddon;L.loadAddon(Q)}catch{}try{y()}catch{}const Y=A.querySelector(".xterm-screen");Y&&(Y.style.width="100%");const q=A.querySelector(".xterm-rows");if(q){q.style.width="100%",new MutationObserver(()=>{for(const ee of q.children)ee.style.width="100%"}).observe(q,{childList:!0});for(const ee of q.children)ee.style.width="100%"}};l.current=L,s.current=R,u.current=D;let Z=null;A.offsetWidth>0&&A.offsetHeight>0?W():(Z=new ResizeObserver(()=>{A.offsetWidth>0&&A.offsetHeight>0&&(Z.disconnect(),Z=null,W())}),Z.observe(A)),d(L),p(R),b(D),new FontFace("NerdFont","url(https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts@latest/patched-fonts/JetBrainsMono/Ligatures/Regular/JetBrainsMonoNerdFont-Regular.ttf)").load().then(z=>{if(!$&&(document.fonts.add(z),l.current)){l.current.options.fontFamily=T;try{c.current()}catch{}}}).catch(()=>{});let G,X=0,j=0;const I=new ResizeObserver(z=>{const Y=z[0];if(!Y||Y.contentRect.width===0||Y.contentRect.height===0)return;const q=Math.round(Y.contentRect.width),Q=Math.round(Y.contentRect.height);Math.abs(q-X)<=1&&Math.abs(Q-j)<=1||(X=q,j=Q,clearTimeout(G),G=setTimeout(()=>{try{c.current()}catch{}},150))});return I.observe(A),()=>{$=!0,clearTimeout(G),Z==null||Z.disconnect(),I.disconnect(),L.dispose(),l.current=null,s.current=null,u.current=null,d(null),p(null),b(null)}},[]),F.useEffect(()=>{let A;const T=()=>{clearTimeout(A),A=setTimeout(()=>{try{c.current()}catch{}},100)};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T),clearTimeout(A)}},[]),F.useEffect(()=>{const A=screen.orientation;if(!A)return;let T;const E=()=>{T=setTimeout(()=>{try{c.current()}catch{}},150)};return A.addEventListener("change",E),()=>{A.removeEventListener("change",E),clearTimeout(T)}},[]),F.useEffect(()=>{l.current&&(l.current.options.theme=QT(_))},[_]),F.useEffect(()=>{l.current&&(l.current.options.fontSize=t,y())},[t,y]),F.useEffect(()=>{if(!l.current||!r)return;const A=l.current.onData(r);return()=>A.dispose()},[f,r]),F.useEffect(()=>{if(!l.current||!i)return;const A=l.current.onResize(({cols:T,rows:E})=>i(T,E));return()=>A.dispose()},[f,i]),F.useEffect(()=>{if(!l.current||!n)return;const A=l.current.onSelectionChange(()=>{var E;const T=((E=l.current)==null?void 0:E.getSelection())??"";T&&n(T)});return()=>A.dispose()},[f,n]),{terminalRef:o,terminal:f,fitAddon:g,searchAddon:x,fit:y,write:C,getSelection:w}}const M6="termbeam-push-subscribed";function Dz(e){const t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/-/g,"+").replace(/_/g,"/"),i=window.atob(r);return Uint8Array.from([...i].map(n=>n.charCodeAt(0)))}async function xv(){var e;try{if(!("PushManager"in window)||!("serviceWorker"in navigator))return!1;const t=await navigator.serviceWorker.ready;if(!t.pushManager)return!1;const{publicKey:r}=await oF(),i=Dz(r),n=await t.pushManager.getSubscription();if(n){const s=(e=n.options)==null?void 0:e.applicationServerKey;let c=!0;if(s){const u=new Uint8Array(s);c=u.length===i.length&&u.every((f,d)=>f===i[d])}if(c){try{await VT(n.toJSON())}catch{}return vl(!0),!0}await n.unsubscribe()}const l=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:i})).toJSON();return await VT(l),vl(!0),!0}catch{return vl(!1),!1}}async function Oz(){var e;try{if(!("serviceWorker"in navigator))return;const r=await((e=(await navigator.serviceWorker.ready).pushManager)==null?void 0:e.getSubscription());if(!r){vl(!1);return}const i=r.endpoint;await r.unsubscribe();try{await lF(i)}catch{}}catch{}vl(!1)}function lm(){try{return localStorage.getItem(M6)==="true"}catch{return!1}}async function Nz(){var e;try{return!("serviceWorker"in navigator)||!("PushManager"in window)?!1:await((e=(await navigator.serviceWorker.ready).pushManager)==null?void 0:e.getSubscription())?(vl(!0),!0):lm()&&Notification.permission==="granted"?xv():(vl(!1),!1)}catch{return!1}}async function Iz(){try{if(Notification.permission!=="granted")return;await xv()}catch{}}function vl(e){try{localStorage.setItem(M6,String(e))}catch{}}const Dp=Object.freeze(Object.defineProperty({__proto__:null,ensurePushSubscription:Iz,initPushSubscription:xv,isPushSubscribed:Nz,isPushSubscribedSync:lm,removePushSubscription:Oz},Symbol.toStringTag,{value:"Module"}));let Bh=null;function Sv(){return Bh||(Bh=new(window.AudioContext||window.webkitAudioContext)),Bh.state==="suspended"&&Bh.resume(),Bh}document.addEventListener("click",()=>Sv(),{once:!0});document.addEventListener("touchstart",()=>Sv(),{once:!0});function Op(){try{const e=Sv(),t=e.createOscillator(),r=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,e.currentTime),r.gain.setValueAtTime(.15,e.currentTime),r.gain.exponentialRampToValueAtTime(.001,e.currentTime+.15),t.connect(r),r.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.15)}catch{}}function Np(){try{return localStorage.getItem("termbeam-notifications")!=="false"}catch{return!0}}function Fz(e){try{localStorage.setItem("termbeam-notifications",String(e))}catch{}}function wE(e){if(Np()&&Notification.permission==="granted"&&!lm())try{new Notification("Command finished in "+e,{icon:"/icons/icon-192.png",tag:"termbeam-cmd"})}catch{}}const W0=500,Pz=3e4,Hz=15e3,R6=document.title,$z=2e3,Mh=new Map;function jz(e){return e.replace(/\x1b\](?:4|10|11|12);[^\x07\x1b]*(?:\x07|\x1b\\)/g,"")}function zz(){var e;if(!document.hidden){document.title=R6;try{(e=navigator.clearAppBadge)==null||e.call(navigator)}catch{}}}document.addEventListener("visibilitychange",zz);function Uz(e){const{sessionId:t,terminal:r,onExit:i,onConnected:n}=e,o=F.useRef(null),l=F.useRef(W0),s=F.useRef(null),c=F.useRef(null),u=F.useRef(null),f=F.useRef(null),d=F.useRef(!0),g=F.useRef(null),[p,x]=F.useState(!1),[b,_]=F.useState(!1),v=F.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),c.current&&(clearInterval(c.current),c.current=null),u.current&&(clearTimeout(u.current),u.current=null)},[]),y=F.useCallback(R=>{const D=o.current;(D==null?void 0:D.readyState)===WebSocket.OPEN&&D.send(JSON.stringify({type:"input",data:R}))},[]),C=F.useRef(null),w=F.useRef(0),A=F.useRef(null),T=300,E=F.useCallback((R,D)=>{const N=()=>{const H=o.current;if((H==null?void 0:H.readyState)!==WebSocket.OPEN)return;const W=C.current;W&&W.cols===R&&W.rows===D||(C.current={cols:R,rows:D},w.current=Date.now(),H.send(JSON.stringify({type:"resize",cols:R,rows:D})))};A.current&&clearTimeout(A.current);const $=Date.now()-w.current;$>=T?N():A.current=setTimeout(()=>{A.current=null,N()},T-$)},[]);F.useEffect(()=>{if(!r||!t)return;d.current=!0;let R="",D=!1;function N(){R&&r&&(r.write(R),R=""),D=!1}function $(P){R+=P,D||(D=!0,requestAnimationFrame(N))}const H=r.onBell(()=>{if(!Np())return;const P=_t.getState();if(P.activeId!==t||document.hidden){Mh.has(t)||Op();const G=P.sessions.get(t);document.hidden&&wE((G==null?void 0:G.name)??t)}});function W(){if(!d.current)return;const P=I4(),G=new WebSocket(P);o.current=G,G.onopen=()=>{if(!d.current){G.close();return}G.send(JSON.stringify({type:"attach",sessionId:t})),l.current=W0,c.current=setInterval(()=>{G.readyState===WebSocket.OPEN&&G.send(JSON.stringify({type:"ping"}))},Hz)},G.onmessage=X=>{var I;if(!d.current||!r)return;let j;try{j=JSON.parse(X.data)}catch{const z=X.data;typeof z=="string"&&z.length>0&&$(z);return}switch(j.type){case"attached":{u.current&&(clearTimeout(u.current),u.current=null),x(!0),_(!1),n==null||n(),j.scrollback&&r.write(jz(j.scrollback)),r.cols&&r.rows&&G.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows}));const z=Mh.get(t);z&&clearTimeout(z),Mh.set(t,setTimeout(()=>Mh.delete(t),$z));break}case"output":{if($(j.data),Mh.has(t))break;const z=_t.getState(),Y=z.sessions.get(t);if(document.hidden&&z.activeId!==t){const q=(Y==null?void 0:Y.hasUnread)??!1;z.markUnread(t),!q&&Np()&&Op()}break}case"exit":{i==null||i(j.sessionId);break}case"notification":{if(!Np())break;const z=j.sessionName??t,Y=_t.getState();if(!document.hidden&&Y.activeId===t)break;document.hidden?(Op(),wE(z),document.title.startsWith("(●) ")||(document.title="(●) "+R6)):Et.info(`Command finished in ${z}`);break}case"error":{(I=j.message)!=null&&I.toLowerCase().includes("not found")?(d.current=!1,_t.getState().isDeleted(t)||(Et.error(j.message),i==null||i(t)),G.close()):Et.error(j.message);break}case"update-progress":{window.dispatchEvent(new MessageEvent("termbeam:ws-message",{data:X.data}));break}}},G.onclose=()=>{if(o.current!==G||(o.current=null,c.current&&(clearInterval(c.current),c.current=null),!d.current))return;u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,x(!1),_(!0)},2e3);const X=l.current;l.current=Math.min(X*2,Pz),s.current=setTimeout(W,X)},G.onerror=()=>{}}g.current=W,W();function Z(){if(document.hidden){f.current=Date.now();return}if(!d.current)return;const P=f.current?Date.now()-f.current:0;f.current=null,s.current&&(clearTimeout(s.current),s.current=null),l.current=W0;const G=o.current;if(!G||G.readyState===WebSocket.CLOSED||G.readyState===WebSocket.CLOSING){W();return}if(P>3e4){G.onclose=null,G.close(),o.current=null,x(!1),W();return}if(G.readyState===WebSocket.OPEN)try{G.send(JSON.stringify({type:"ping"}))}catch{G.onclose=null,G.close(),o.current=null,x(!1),W()}}return document.addEventListener("visibilitychange",Z),()=>{d.current=!1,v(),document.removeEventListener("visibilitychange",Z),H.dispose();const P=o.current;P&&(P.onclose=null,P.onerror=null,P.onmessage=null,P.close(),o.current=null),x(!1)}},[r,t,i,n,v]);const L=F.useCallback(()=>{var D;s.current&&(clearTimeout(s.current),s.current=null),c.current&&(clearInterval(c.current),c.current=null);const R=o.current;R&&(R.onclose=null,R.onerror=null,R.onmessage=null,R.close(),o.current=null),l.current=W0,x(!1),_(!1),(D=g.current)==null||D.call(g)},[]);return{send:y,connected:p,reconnecting:b,sendResize:E,reconnect:L,ws:o.current}}const qz="_pane_1kw18_1",Wz="_terminalContainer_1kw18_8",Yz="_scrollToBottom_1kw18_42",Gz="_exitOverlay_1kw18_66",Vz="_exitMessage_1kw18_76",Xz="_reconnectingBar_1kw18_86",Kz="_reconnectingDot_1kw18_113",Zz="_reconnectOverlay_1kw18_132",Qz="_reconnectContent_1kw18_152",Jz="_reconnectMessage_1kw18_163",eU="_reconnectActions_1kw18_168",tU="_reconnectBtn_1kw18_173",Qn={pane:qz,terminalContainer:Wz,scrollToBottom:Yz,exitOverlay:Gz,exitMessage:Vz,reconnectingBar:Xz,reconnectingDot:Kz,reconnectOverlay:Zz,reconnectContent:Qz,reconnectMessage:Jz,reconnectActions:eU,reconnectBtn:tU};function TE(e){if(!e)return!1;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function D6({sessionId:e,active:t,visible:r,fontSize:i=14}){const[n,o]=F.useState(!1),[l,s]=F.useState(!1),c=_t(Me=>Me.updateSession),u=F.useRef(null),f=F.useRef(!1),[d,g]=F.useState(!1),p=F.useRef(0),x=700,b=F.useRef(typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)),_=F.useCallback(()=>b.current&&Date.now()-p.current<x,[]),v=F.useRef(()=>{}),y=F.useRef(()=>{}),C=F.useCallback(Me=>{o(!0),c(Me,{exited:!0})},[c]),w=F.useCallback(Me=>{const{touchCtrlActive:Ie,setTouchCtrl:Fe}=rt.getState();if(Ie&&Me.length===1){const Ue=Me.toLowerCase().charCodeAt(0);if(Ue>=97&&Ue<=122){v.current(String.fromCharCode(Ue-96)),Fe(!1);return}}v.current(Me)},[]),A=F.useCallback((Me,Ie)=>{y.current(Me,Ie)},[]),T=F.useCallback(Me=>{Me&&navigator.clipboard.writeText(Me).then(()=>Et.success("Copied to clipboard"),()=>{})},[]),{terminalRef:E,terminal:L,fitAddon:R,searchAddon:D,fit:N}=Rz({fontSize:i,onData:w,onResize:A,onSelectionChange:T}),{send:$,sendResize:H,connected:W,reconnecting:Z,reconnect:P}=Uz({sessionId:e,terminal:L,onExit:C});F.useEffect(()=>{if(W&&(f.current=!0,L)){const Me=setTimeout(()=>{N(),L.refresh(0,L.rows-1),L.scrollToBottom()},200),Ie=setTimeout(()=>{_()||L.focus()},50);return()=>{clearTimeout(Me),clearTimeout(Ie)}}},[W,L,N]);const G=_t(Me=>Me.setActiveId),X=r??t;F.useEffect(()=>{if(!L||!X||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=u.current;if(!Ie)return;let Fe=0,Ue=0,dt=null;const pe=10,Te=Ge=>{Ge.touches.length===1&&(Fe=Ge.touches[0].clientX,Ue=Ge.touches[0].clientY,dt=Ge.target)},ze=Ge=>{var Yt,$t;if(!dt)return;const Ve=Ge.changedTouches[0],ot=Ve.clientX-Fe,it=Ve.clientY-Ue;if(Math.abs(ot)<pe&&Math.abs(it)<pe&&dt&&(Yt=E.current)!=null&&Yt.contains(dt)){t||G(e),p.current=Date.now(),L.focus(),($t=L.textarea)==null||$t.focus({preventScroll:!0});const Pt=L.element;if(Pt){const Mt={clientX:Fe,clientY:Ue,button:0,buttons:1,bubbles:!0,cancelable:!0};setTimeout(()=>{_()||document.activeElement===L.textarea&&(Pt.dispatchEvent(new MouseEvent("mousedown",Mt)),Pt.dispatchEvent(new MouseEvent("mouseup",{...Mt,buttons:0})))},x+150)}Ge.preventDefault()}};return Ie.addEventListener("touchstart",Te,{passive:!0,capture:!0}),Ie.addEventListener("touchend",ze,{capture:!0}),()=>{Ie.removeEventListener("touchstart",Te,{capture:!0}),Ie.removeEventListener("touchend",ze,{capture:!0})}},[L,X,t,e,G]),F.useEffect(()=>{v.current=$,y.current=H});const j=_t(Me=>Me.clearUnread),I=8e3;F.useEffect(()=>{if(W){g(!1);return}if(!f.current)return;const Me=setTimeout(()=>g(!0),I);return()=>clearTimeout(Me)},[W]),F.useEffect(()=>{t&&j(e)},[t,e,j]),F.useEffect(()=>{if(t&&L){const Me=requestAnimationFrame(()=>{N(),L.refresh(0,L.rows-1),L.scrollToBottom(),_()||L.focus()});return()=>cancelAnimationFrame(Me)}},[t,L,N,_]);const z=rt(Me=>Me.commandPaletteOpen),Y=rt(Me=>Me.searchBarOpen),q=rt(Me=>Me.sidePanelOpen),Q=rt(Me=>Me.copyOverlayOpen),ee=z||Y||q||Q,te=F.useRef(ee);F.useEffect(()=>{te.current&&!ee&&t&&L&&(_()||requestAnimationFrame(()=>L.focus())),te.current=ee},[ee,t,L,_]);const re=F.useRef(!1);F.useEffect(()=>{if(!L||!t)return;const Me=L.buffer.onBufferChange(Ie=>{const Fe=Ie.type==="alternate";re.current&&!Fe&&(_()||requestAnimationFrame(()=>{var Ue;L.focus(),(Ue=L.textarea)==null||Ue.focus({preventScroll:!0})})),re.current=Fe});return()=>Me.dispose()},[L,t,_]);const{keyboardOpen:K}=om(),ce=F.useRef(0),ne=F.useRef(K);F.useEffect(()=>{ne.current!==K&&(ce.current=Date.now(),ne.current=K)},[K]),F.useEffect(()=>{if(!L||!t||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=L.textarea;if(!Ie)return;let Fe=null;const Ue=dt=>{const{commandPaletteOpen:pe,searchBarOpen:Te,sidePanelOpen:ze,copyOverlayOpen:Ge}=rt.getState();if(pe||Te||ze||Ge)return;const Ve=dt.relatedTarget??null;TE(Ve)||Date.now()-ce.current<x||Date.now()-p.current<x||(Fe&&clearTimeout(Fe),Fe=setTimeout(()=>{Fe=null,!(Date.now()-ce.current<x)&&(Date.now()-p.current<x||TE(document.activeElement)||document.activeElement!==Ie&&Ie.focus({preventScroll:!0}))},50))};return Ie.addEventListener("blur",Ue),()=>{Ie.removeEventListener("blur",Ue),Fe&&clearTimeout(Fe)}},[L,t]);const de=F.useRef(!0),_e=F.useRef(null),Be=F.useRef(null),De=F.useRef(!1);F.useEffect(()=>{if(!L)return;const Me=L.element,Ie=()=>{De.current||_e.current||(_e.current=setTimeout(()=>{_e.current=null;const pe=L.buffer.active,Te=pe.viewportY>=pe.baseY;de.current=Te,s(!Te)},100))},Fe=L.onScroll(Ie);Me==null||Me.addEventListener("wheel",Ie,{passive:!0});const Ue=(Me==null?void 0:Me.querySelector(".xterm-viewport"))??null;Ue==null||Ue.addEventListener("scroll",Ie,{passive:!0});const dt=L.onWriteParsed(()=>{de.current&&Be.current===null&&(Be.current=requestAnimationFrame(()=>{Be.current=null;const pe=L.buffer.active;pe.viewportY<pe.baseY&&(De.current=!0,L.scrollToBottom(),De.current=!1)}))});return()=>{Fe.dispose(),dt.dispose(),_e.current&&clearTimeout(_e.current),Be.current!==null&&cancelAnimationFrame(Be.current),Me==null||Me.removeEventListener("wheel",Ie),Ue==null||Ue.removeEventListener("scroll",Ie)}},[L]),F.useEffect(()=>{L&&c(e,{term:L,fitAddon:R,searchAddon:D,connected:W,send:$})},[L,R,D,W,$,e,c]),F.useEffect(()=>{const Me=u.current;if(!Me)return;let Ie=0,Fe=0,Ue=!1,dt=null;function pe(Ve){const ot=Ve[0],it=Ve[1],Yt=ot.clientX-it.clientX,$t=ot.clientY-it.clientY;return Math.sqrt(Yt*Yt+$t*$t)}function Te(Ve){Ve.touches.length===2&&(Ue=!0,Ie=pe(Ve.touches),Fe=rt.getState().fontSize)}function ze(Ve){if(!Ue||Ve.touches.length!==2)return;Ve.preventDefault(),Ve.stopPropagation();const it=pe(Ve.touches)/Ie,Yt=Math.round(Fe*it);dt&&clearTimeout(dt),dt=setTimeout(()=>{rt.getState().setFontSize(Yt)},50)}function Ge(){Ue=!1}return Me.addEventListener("touchstart",Te,{passive:!0,capture:!0}),Me.addEventListener("touchmove",ze,{passive:!1,capture:!0}),Me.addEventListener("touchend",Ge,{capture:!0}),Me.addEventListener("touchcancel",Ge,{capture:!0}),()=>{Me.removeEventListener("touchstart",Te,{capture:!0}),Me.removeEventListener("touchmove",ze,{capture:!0}),Me.removeEventListener("touchend",Ge,{capture:!0}),Me.removeEventListener("touchcancel",Ge,{capture:!0}),dt&&clearTimeout(dt)}},[]),F.useEffect(()=>{if(!L||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=E.current;if(!Ie)return;const Fe=L.element;if(!Fe)return;const Ue=Fe.querySelector(".xterm-viewport");if(!Ue)return;const dt=Ue;let pe=0,Te=0,ze=0,Ge=0,Ve=!1;function ot(){return L.buffer.active.type==="alternate"}function it(Er){const ri=new WheelEvent("wheel",{deltaY:Er,deltaMode:WheelEvent.DOM_DELTA_PIXEL,bubbles:!0,cancelable:!0});dt.dispatchEvent(ri)}const Yt=4;let $t=0,Pt=!1;function Mt(Er){Er.touches.length===1&&(cancelAnimationFrame(Ge),Ve=!0,Pt=!1,$t=Er.touches[0].clientY,pe=$t,Te=performance.now(),ze=0,Er.stopPropagation())}function zr(Er){if(!Ve||Er.touches.length!==1){Ve=!1;return}const ri=Er.touches[0].clientY;if(!Pt){if(Math.abs(ri-$t)<Yt)return;Pt=!0}Er.stopPropagation(),Er.preventDefault();const ur=performance.now(),Gt=ur-Te,ae=pe-ri;Math.abs(ae)>=1&&(ot()?it(ae):(Gt>0&&(ze=ae/Gt),dt.scrollTop+=ae,de.current=!1),pe=ri,Te=ur)}function vr(){ze*=.96,!(Math.abs(ze)<.05)&&(dt.scrollTop+=ze*16,Ge=requestAnimationFrame(vr))}function Zr(){Ve&&(Ve=!1,Pt&&!ot()&&Math.abs(ze)>.15&&(Ge=requestAnimationFrame(vr)))}return Ie.addEventListener("touchstart",Mt,{capture:!0,passive:!1}),Ie.addEventListener("touchmove",zr,{capture:!0,passive:!1}),Ie.addEventListener("touchend",Zr,{capture:!0}),Ie.addEventListener("touchcancel",Zr,{capture:!0}),()=>{cancelAnimationFrame(Ge),Ie.removeEventListener("touchstart",Mt,{capture:!0}),Ie.removeEventListener("touchmove",zr,{capture:!0}),Ie.removeEventListener("touchend",Zr,{capture:!0}),Ie.removeEventListener("touchcancel",Zr,{capture:!0})}},[L]),F.useEffect(()=>{if(L&&(r??t)){const Ie=setTimeout(()=>{N(),L.refresh(0,L.rows-1),K&&L.scrollToBottom()},K?320:16);return()=>clearTimeout(Ie)}},[K,L,N,r,t]),F.useEffect(()=>{if(!t)return;function Me(Ie){var Ue;const Fe=(Ue=Ie.clipboardData)==null?void 0:Ue.items;if(Fe){for(const dt of Array.from(Fe))if(dt.type.startsWith("image/")){Ie.preventDefault(),Ie.stopPropagation();const pe=dt.getAsFile();if(!pe)return;const Te=Et.loading("Uploading image... 0%");mv(pe,dt.type,ze=>{Et.loading(`Uploading image... ${ze}%`,{id:Te})}).then(ze=>{const Ge=ze.path;Ge&&v.current(Ge+" "),Et.success("Image uploaded",{id:Te})}).catch(()=>{Et.error("Image upload failed",{id:Te})});return}}}return document.addEventListener("paste",Me,!0),()=>document.removeEventListener("paste",Me,!0)},[t]);const Ze=F.useCallback(Me=>{Me.preventDefault(),Me.stopPropagation(),L&&(De.current=!0,L.scrollToBottom(),De.current=!1,de.current=!0,s(!1))},[L]),kt=F.useCallback(()=>{L==null||L.clear(),L==null||L.focus(),P()},[L,P]),Je=F.useCallback(()=>{var Me;t||G(e),!_()&&(b.current&&(p.current=Date.now()),L==null||L.focus(),(Me=L==null?void 0:L.textarea)==null||Me.focus({preventScroll:!0}))},[L,t,e,G,_]),st=!W&&!n&&f.current,At=st&&Z&&!d,ut=st&&(!Z||d);return k.jsxs("div",{ref:u,className:Qn.pane,"data-testid":"terminal-pane",onClick:Je,...r??t?{"data-visible":"true"}:{},children:[k.jsx("div",{ref:E,className:Qn.terminalContainer}),l&&k.jsx("button",{className:Qn.scrollToBottom,onClick:Ze,tabIndex:-1,"aria-label":"Scroll to bottom",children:"↓"}),At&&k.jsxs("div",{className:Qn.reconnectingBar,"data-testid":"reconnecting-indicator",children:[k.jsx("span",{className:Qn.reconnectingDot}),k.jsx("span",{children:"Reconnecting…"})]}),ut&&k.jsx("div",{className:Qn.reconnectOverlay,"data-testid":"reconnect-overlay",children:k.jsxs("div",{className:Qn.reconnectContent,children:[k.jsx("span",{className:Qn.reconnectMessage,children:"Session disconnected"}),k.jsxs("div",{className:Qn.reconnectActions,children:[k.jsx("a",{href:"/",className:Qn.reconnectBtn,children:"Sessions"}),k.jsx("button",{className:Qn.reconnectBtn,onClick:kt,children:"Reconnect"})]})]})}),n&&k.jsx("div",{className:Qn.exitOverlay,children:k.jsx("span",{className:Qn.exitMessage,children:"Session ended"})})]})}function EE(e){const t=[],r=String(e||"");let i=r.indexOf(","),n=0,o=!1;for(;!o;){i===-1&&(i=r.length,o=!0);const l=r.slice(n,i).trim();(l||!o)&&t.push(l),n=i+1,i=r.indexOf(",",n)}return t}function O6(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const rU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nU={};function kE(e,t){return(nU.jsx?iU:rU).test(e)}const sU=/[ \t\n\f\r]/g;function aU(e){return typeof e=="object"?e.type==="text"?AE(e.value):!1:AE(e)}function AE(e){return e.replace(sU,"")===""}class nf{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}nf.prototype.normal={};nf.prototype.property={};nf.prototype.space=void 0;function N6(e,t){const r={},i={};for(const n of e)Object.assign(r,n.property),Object.assign(i,n.normal);return new nf(r,i,t)}function Od(e){return e.toLowerCase()}class jn{constructor(t,r){this.attribute=r,this.property=t}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let oU=0;const Qt=Il(),Li=Il(),qb=Il(),Ye=Il(),Wr=Il(),Uc=Il(),rs=Il();function Il(){return 2**++oU}const Wb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qt,booleanish:Li,commaOrSpaceSeparated:rs,commaSeparated:Uc,number:Ye,overloadedBoolean:qb,spaceSeparated:Wr},Symbol.toStringTag,{value:"Module"})),w_=Object.keys(Wb);class wv extends jn{constructor(t,r,i,n){let o=-1;if(super(t,r),LE(this,"space",n),typeof i=="number")for(;++o<w_.length;){const l=w_[o];LE(this,w_[o],(i&Wb[l])===Wb[l])}}}wv.prototype.defined=!0;function LE(e,t,r){r&&(e[t]=r)}function Su(e){const t={},r={};for(const[i,n]of Object.entries(e.properties)){const o=new wv(i,e.transform(e.attributes||{},i),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,r[Od(i)]=i,r[Od(o.attribute)]=i}return new nf(t,r,e.space)}const I6=Su({properties:{ariaActiveDescendant:null,ariaAtomic:Li,ariaAutoComplete:null,ariaBusy:Li,ariaChecked:Li,ariaColCount:Ye,ariaColIndex:Ye,ariaColSpan:Ye,ariaControls:Wr,ariaCurrent:null,ariaDescribedBy:Wr,ariaDetails:null,ariaDisabled:Li,ariaDropEffect:Wr,ariaErrorMessage:null,ariaExpanded:Li,ariaFlowTo:Wr,ariaGrabbed:Li,ariaHasPopup:null,ariaHidden:Li,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wr,ariaLevel:Ye,ariaLive:null,ariaModal:Li,ariaMultiLine:Li,ariaMultiSelectable:Li,ariaOrientation:null,ariaOwns:Wr,ariaPlaceholder:null,ariaPosInSet:Ye,ariaPressed:Li,ariaReadOnly:Li,ariaRelevant:null,ariaRequired:Li,ariaRoleDescription:Wr,ariaRowCount:Ye,ariaRowIndex:Ye,ariaRowSpan:Ye,ariaSelected:Li,ariaSetSize:Ye,ariaSort:null,ariaValueMax:Ye,ariaValueMin:Ye,ariaValueNow:Ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function F6(e,t){return t in e?e[t]:t}function P6(e,t){return F6(e,t.toLowerCase())}const lU=Su({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Uc,acceptCharset:Wr,accessKey:Wr,action:null,allow:null,allowFullScreen:Qt,allowPaymentRequest:Qt,allowUserMedia:Qt,alt:null,as:null,async:Qt,autoCapitalize:null,autoComplete:Wr,autoFocus:Qt,autoPlay:Qt,blocking:Wr,capture:null,charSet:null,checked:Qt,cite:null,className:Wr,cols:Ye,colSpan:null,content:null,contentEditable:Li,controls:Qt,controlsList:Wr,coords:Ye|Uc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qt,defer:Qt,dir:null,dirName:null,disabled:Qt,download:qb,draggable:Li,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qt,formTarget:null,headers:Wr,height:Ye,hidden:qb,high:Ye,href:null,hrefLang:null,htmlFor:Wr,httpEquiv:Wr,id:null,imageSizes:null,imageSrcSet:null,inert:Qt,inputMode:null,integrity:null,is:null,isMap:Qt,itemId:null,itemProp:Wr,itemRef:Wr,itemScope:Qt,itemType:Wr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qt,low:Ye,manifest:null,max:null,maxLength:Ye,media:null,method:null,min:null,minLength:Ye,multiple:Qt,muted:Qt,name:null,nonce:null,noModule:Qt,noValidate:Qt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Qt,optimum:Ye,pattern:null,ping:Wr,placeholder:null,playsInline:Qt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qt,referrerPolicy:null,rel:Wr,required:Qt,reversed:Qt,rows:Ye,rowSpan:Ye,sandbox:Wr,scope:null,scoped:Qt,seamless:Qt,selected:Qt,shadowRootClonable:Qt,shadowRootDelegatesFocus:Qt,shadowRootMode:null,shape:null,size:Ye,sizes:null,slot:null,span:Ye,spellCheck:Li,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ye,step:null,style:null,tabIndex:Ye,target:null,title:null,translate:null,type:null,typeMustMatch:Qt,useMap:null,value:Li,width:Ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wr,axis:null,background:null,bgColor:null,border:Ye,borderColor:null,bottomMargin:Ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qt,declare:Qt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ye,leftMargin:Ye,link:null,longDesc:null,lowSrc:null,marginHeight:Ye,marginWidth:Ye,noResize:Qt,noHref:Qt,noShade:Qt,noWrap:Qt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ye,rules:null,scheme:null,scrolling:Li,standby:null,summary:null,text:null,topMargin:Ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qt,disableRemotePlayback:Qt,prefix:null,property:null,results:Ye,security:null,unselectable:null},space:"html",transform:P6}),cU=Su({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rs,accentHeight:Ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ye,amplitude:Ye,arabicForm:null,ascent:Ye,attributeName:null,attributeType:null,azimuth:Ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ye,by:null,calcMode:null,capHeight:Ye,className:Wr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ye,diffuseConstant:Ye,direction:null,display:null,dur:null,divisor:Ye,dominantBaseline:null,download:Qt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ye,enableBackground:null,end:null,event:null,exponent:Ye,externalResourcesRequired:null,fill:null,fillOpacity:Ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Uc,g2:Uc,glyphName:Uc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ye,horizOriginX:Ye,horizOriginY:Ye,id:null,ideographic:Ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ye,k:Ye,k1:Ye,k2:Ye,k3:Ye,k4:Ye,kernelMatrix:rs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ye,overlineThickness:Ye,paintOrder:null,panose1:null,path:null,pathLength:Ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ye,pointsAtY:Ye,pointsAtZ:Ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rs,rev:rs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rs,requiredFeatures:rs,requiredFonts:rs,requiredFormats:rs,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ye,specularExponent:Ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ye,strikethroughThickness:Ye,string:null,stroke:null,strokeDashArray:rs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ye,strokeOpacity:Ye,strokeWidth:null,style:null,surfaceScale:Ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rs,tabIndex:Ye,tableValues:null,target:null,targetX:Ye,targetY:Ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ye,underlineThickness:Ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ye,values:null,vAlphabetic:Ye,vMathematical:Ye,vectorEffect:null,vHanging:Ye,vIdeographic:Ye,version:null,vertAdvY:Ye,vertOriginX:Ye,vertOriginY:Ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F6}),H6=Su({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$6=Su({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:P6}),j6=Su({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hU=/[A-Z]/g,BE=/-[a-z]/g,dU=/^data[-\w.:]+$/i;function cm(e,t){const r=Od(t);let i=t,n=jn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&dU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(BE,pU);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!BE.test(o)){let l=o.replace(hU,fU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}n=wv}return new n(i,t)}function fU(e){return"-"+e.toLowerCase()}function pU(e){return e.charAt(1).toUpperCase()}const sf=N6([I6,lU,H6,$6,j6],"html"),Ho=N6([I6,cU,H6,$6,j6],"svg");function ME(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function z6(e){return e.join(" ").trim()}var Tc={},T_,RE;function gU(){if(RE)return T_;RE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,n=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
102
+ `,y)}paste(v){this._core.paste(v)}refresh(v,y){this._verifyIntegers(v,y),this._core.refresh(v,y)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return s}_verifyIntegers(...v){for(const y of v)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const y of v)if(y&&(y===1/0||isNaN(y)||y%1!=0||y<0))throw new Error("This API only accepts positive integers")}}l.Terminal=b})(),o})()))})(y_)),y_.exports}var Sz=xz(),v_={exports:{}},vE;function wz(){return vE||(vE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const o=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(o._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,o=n._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(s.getPropertyValue("height")),u=Math.max(0,parseInt(s.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),d=c-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),g=u-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(g/o.css.cell.width)),rows:Math.max(1,Math.floor(d/o.css.cell.height))}}}})(),r})()))})(v_)),v_.exports}var Tz=wz(),C_={exports:{}},CE;function Ez(){return CE||(CE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,u){return c((f=>u.fire(f)))},s.runAndSubscribe=function(c,u){return u(void 0),c((f=>u(f)))}},859:(l,s)=>{function c(u){for(const f of u)f.dispose();u.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const f=this._disposables.indexOf(u);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var f;this._isDisposed||u===this._value||((f=this._value)==null||f.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},s.toDisposable=function(u){return{dispose:u}},s.disposeArray=c,s.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l](c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.SearchAddon=void 0;const s=n(345),c=n(859),u=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class f extends c.Disposable{constructor(g){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new c.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new c.MutableDisposable,this._onDidChangeResults=this.register(new s.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(g==null?void 0:g.highlightLimit)??1e3}activate(g){this._terminal=g,this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,c.toDisposable)((()=>this.clearDecorations())))}_updateMatches(){var g;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((g=this._lastSearchOptions)!=null&&g.decorations)&&(this._highlightTimeout=setTimeout((()=>{const p=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(p,{...this._lastSearchOptions,incremental:!0,noScroll:!0})}),200))}clearDecorations(g){this._selectedDecoration.clear(),(0,c.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),g||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,p);this._lastSearchOptions=p,p!=null&&p.decorations&&(this._cachedSearchTerm===void 0||g!==this._cachedSearchTerm||x)&&this._highlightAllMatches(g,p);const b=this._findNextAndSelect(g,p);return this._fireResults(p),this._cachedSearchTerm=g,b}_highlightAllMatches(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!g||g.length===0)return void this.clearDecorations();p=p||{},this.clearDecorations(!0);const x=[];let b,_=this._find(g,0,0,p);for(;_&&((b==null?void 0:b.row)!==_.row||(b==null?void 0:b.col)!==_.col)&&!(x.length>=this._highlightLimit);)b=_,x.push(b),_=this._find(g,b.col+b.term.length>=this._terminal.cols?b.row+1:b.row,b.col+b.term.length>=this._terminal.cols?0:b.col+1,p);for(const v of x){const y=this._createResultDecoration(v,p.decorations);y&&(this._highlightedLines.add(y.marker.line),this._highlightDecorations.push({decoration:y,match:v,dispose(){y.dispose()}}))}}_find(g,p,x,b){var y;if(!this._terminal||!g||g.length===0)return(y=this._terminal)==null||y.clearSelection(),void this.clearDecorations();if(x>this._terminal.cols)throw new Error(`Invalid col: ${x} to search in terminal of ${this._terminal.cols} cols`);let _;this._initLinesCache();const v={startRow:p,startCol:x};if(_=this._findInLine(g,v,b),!_)for(let C=p+1;C<this._terminal.buffer.active.baseY+this._terminal.rows&&(v.startRow=C,v.startCol=0,_=this._findInLine(g,v,b),!_);C++);return _}_findNextAndSelect(g,p){var C;if(!this._terminal||!g||g.length===0)return(C=this._terminal)==null||C.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let b=0,_=0;x&&(this._cachedSearchTerm===g?(b=x.end.x,_=x.end.y):(b=x.start.x,_=x.start.y)),this._initLinesCache();const v={startRow:_,startCol:b};let y=this._findInLine(g,v,p);if(!y)for(let w=_+1;w<this._terminal.buffer.active.baseY+this._terminal.rows&&(v.startRow=w,v.startCol=0,y=this._findInLine(g,v,p),!y);w++);if(!y&&_!==0)for(let w=0;w<_&&(v.startRow=w,v.startCol=0,y=this._findInLine(g,v,p),!y);w++);return!y&&x&&(v.startRow=x.start.y,v.startCol=0,y=this._findInLine(g,v,p)),this._selectResult(y,p==null?void 0:p.decorations,p==null?void 0:p.noScroll)}findPrevious(g,p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,p);this._lastSearchOptions=p,p!=null&&p.decorations&&(this._cachedSearchTerm===void 0||g!==this._cachedSearchTerm||x)&&this._highlightAllMatches(g,p);const b=this._findPreviousAndSelect(g,p);return this._fireResults(p),this._cachedSearchTerm=g,b}_didOptionsChange(g,p){return!!p&&(g.caseSensitive!==p.caseSensitive||g.regex!==p.regex||g.wholeWord!==p.wholeWord)}_fireResults(g){if(g!=null&&g.decorations){let p=-1;if(this._selectedDecoration.value){const x=this._selectedDecoration.value.match;for(let b=0;b<this._highlightDecorations.length;b++){const _=this._highlightDecorations[b].match;if(_.row===x.row&&_.col===x.col&&_.size===x.size){p=b;break}}}this._onDidChangeResults.fire({resultIndex:p,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(g,p){var w;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!g||g.length===0)return(w=this._terminal)==null||w.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let b=this._terminal.buffer.active.baseY+this._terminal.rows-1,_=this._terminal.cols;const v=!0;this._initLinesCache();const y={startRow:b,startCol:_};let C;if(x&&(y.startRow=b=x.start.y,y.startCol=_=x.start.x,this._cachedSearchTerm!==g&&(C=this._findInLine(g,y,p,!1),C||(y.startRow=b=x.end.y,y.startCol=_=x.end.x))),C||(C=this._findInLine(g,y,p,v)),!C){y.startCol=Math.max(y.startCol,this._terminal.cols);for(let A=b-1;A>=0&&(y.startRow=A,C=this._findInLine(g,y,p,v),!C);A--);}if(!C&&b!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let A=this._terminal.buffer.active.baseY+this._terminal.rows-1;A>=b&&(y.startRow=A,C=this._findInLine(g,y,p,v),!C);A--);return this._selectResult(C,p==null?void 0:p.decorations,p==null?void 0:p.noScroll)}_initLinesCache(){const g=this._terminal;this._linesCache||(this._linesCache=new Array(g.buffer.active.length),this._linesCacheDisposables.value=(0,c.getDisposeArrayDisposable)([g.onLineFeed((()=>this._destroyLinesCache())),g.onCursorMove((()=>this._destroyLinesCache())),g.onResize((()=>this._destroyLinesCache()))])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(g,p,x){return(g===0||u.includes(p[g-1]))&&(g+x.length===p.length||u.includes(p[g+x.length]))}_findInLine(g,p,x={},b=!1){var N;const _=this._terminal,v=p.startRow,y=p.startCol,C=_.buffer.active.getLine(v);if(C!=null&&C.isWrapped)return b?void(p.startCol+=_.cols):(p.startRow--,p.startCol+=_.cols,this._findInLine(g,p,x));let w=(N=this._linesCache)==null?void 0:N[v];w||(w=this._translateBufferLineToStringWithWrap(v,!0),this._linesCache&&(this._linesCache[v]=w));const[A,T]=w,E=this._bufferColsToStringOffset(v,y),L=x.caseSensitive?g:g.toLowerCase(),R=x.caseSensitive?A:A.toLowerCase();let D=-1;if(x.regex){const $=RegExp(L,"g");let H;if(b)for(;H=$.exec(R.slice(0,E));)D=$.lastIndex-H[0].length,g=H[0],$.lastIndex-=g.length-1;else H=$.exec(R.slice(E)),H&&H[0].length>0&&(D=E+($.lastIndex-H[0].length),g=H[0])}else b?E-L.length>=0&&(D=R.lastIndexOf(L,E-L.length)):D=R.indexOf(L,E);if(D>=0){if(x.wholeWord&&!this._isWholeWord(D,R,g))return;let $=0;for(;$<T.length-1&&D>=T[$+1];)$++;let H=$;for(;H<T.length-1&&D+g.length>=T[H+1];)H++;const W=D-T[$],Z=D+g.length-T[H],P=this._stringLengthToBufferSize(v+$,W);return{term:g,col:P,row:v+$,size:this._stringLengthToBufferSize(v+H,Z)-P+_.cols*(H-$)}}}_stringLengthToBufferSize(g,p){const x=this._terminal.buffer.active.getLine(g);if(!x)return 0;for(let b=0;b<p;b++){const _=x.getCell(b);if(!_)break;const v=_.getChars();v.length>1&&(p-=v.length-1);const y=x.getCell(b+1);y&&y.getWidth()===0&&p++}return p}_bufferColsToStringOffset(g,p){const x=this._terminal;let b=g,_=0,v=x.buffer.active.getLine(b);for(;p>0&&v;){for(let y=0;y<p&&y<x.cols;y++){const C=v.getCell(y);if(!C)break;C.getWidth()&&(_+=C.getCode()===0?1:C.getChars().length)}if(b++,v=x.buffer.active.getLine(b),v&&!v.isWrapped)break;p-=x.cols}return _}_translateBufferLineToStringWithWrap(g,p){var y;const x=this._terminal,b=[],_=[0];let v=x.buffer.active.getLine(g);for(;v;){const C=x.buffer.active.getLine(g+1),w=!!C&&C.isWrapped;let A=v.translateToString(!w&&p);if(w&&C){const T=v.getCell(v.length-1);T&&T.getCode()===0&&T.getWidth()===1&&((y=C.getCell(0))==null?void 0:y.getWidth())===2&&(A=A.slice(0,-1))}if(b.push(A),!w)break;_.push(_[_.length-1]+A.length),g++,v=C}return[b.join(""),_]}_selectResult(g,p,x){const b=this._terminal;if(this._selectedDecoration.clear(),!g)return b.clearSelection(),!1;if(b.select(g.col,g.row,g.size),p){const _=b.registerMarker(-b.buffer.active.baseY-b.buffer.active.cursorY+g.row);if(_){const v=b.registerDecoration({marker:_,x:g.col,width:g.size,backgroundColor:p.activeMatchBackground,layer:"top",overviewRulerOptions:{color:p.activeMatchColorOverviewRuler}});if(v){const y=[];y.push(_),y.push(v.onRender((C=>this._applyStyles(C,p.activeMatchBorder,!0)))),y.push(v.onDispose((()=>(0,c.disposeArray)(y)))),this._selectedDecoration.value={decoration:v,match:g,dispose(){v.dispose()}}}}}if(!x&&(g.row>=b.buffer.active.viewportY+b.rows||g.row<b.buffer.active.viewportY)){let _=g.row-b.buffer.active.viewportY;_-=Math.floor(b.rows/2),b.scrollLines(_)}return!0}_applyStyles(g,p,x){g.classList.contains("xterm-find-result-decoration")||(g.classList.add("xterm-find-result-decoration"),p&&(g.style.outline=`1px solid ${p}`)),x&&g.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(g,p){const x=this._terminal,b=x.registerMarker(-x.buffer.active.baseY-x.buffer.active.cursorY+g.row);if(!b)return;const _=x.registerDecoration({marker:b,x:g.col,width:g.size,backgroundColor:p.matchBackground,overviewRulerOptions:this._highlightedLines.has(b.line)?void 0:{color:p.matchOverviewRuler,position:"center"}});if(_){const v=[];v.push(b),v.push(_.onRender((y=>this._applyStyles(y,p.matchBorder,!1)))),v.push(_.onDispose((()=>(0,c.disposeArray)(v))))}return _}}l.SearchAddon=f})(),o})()))})(C_)),C_.exports}var kz=Ez(),x_={exports:{}},xE;function Az(){return xE||(xE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(l,s)=>{function c(f){try{const d=new URL(f),g=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return f.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(f,d,g,p={}){this._terminal=f,this._regex=d,this._handler=g,this._options=p}provideLinks(f,d){const g=u.computeLink(f,this._regex,this._terminal,this._handler);d(this._addCallbacks(g))}_addCallbacks(f){return f.map((d=>(d.leave=this._options.leave,d.hover=(g,p)=>{if(this._options.hover){const{range:x}=d;this._options.hover(g,p,x)}},d)))}};class u{static computeLink(d,g,p,x){const b=new RegExp(g.source,(g.flags||"")+"g"),[_,v]=u._getWindowedLineStrings(d-1,p),y=_.join("");let C;const w=[];for(;C=b.exec(y);){const A=C[0];if(!c(A))continue;const[T,E]=u._mapStrIdx(p,v,0,C.index),[L,R]=u._mapStrIdx(p,T,E,A.length);if(T===-1||E===-1||L===-1||R===-1)continue;const D={start:{x:E+1,y:T+1},end:{x:R,y:L+1}};w.push({range:D,text:A,activate:x})}return w}static _getWindowedLineStrings(d,g){let p,x=d,b=d,_=0,v="";const y=[];if(p=g.buffer.active.getLine(d)){const C=p.translateToString(!0);if(p.isWrapped&&C[0]!==" "){for(_=0;(p=g.buffer.active.getLine(--x))&&_<2048&&(v=p.translateToString(!0),_+=v.length,y.push(v),p.isWrapped&&v.indexOf(" ")===-1););y.reverse()}for(y.push(C),_=0;(p=g.buffer.active.getLine(++b))&&p.isWrapped&&_<2048&&(v=p.translateToString(!0),_+=v.length,y.push(v),v.indexOf(" ")===-1););}return[y,x]}static _mapStrIdx(d,g,p,x){const b=d.buffer.active,_=b.getNullCell();let v=p;for(;x;){const y=b.getLine(g);if(!y)return[-1,-1];for(let C=v;C<y.length;++C){y.getCell(C,_);const w=_.getChars();if(_.getWidth()&&(x-=w.length||1,C===y.length-1&&w==="")){const A=b.getLine(g+1);A&&A.isWrapped&&(A.getCell(0,_),_.getWidth()===2&&(x+=1))}if(x<0)return[g,C]}g++,v=0}return[g,v]}}s.LinkComputer=u}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l](c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const s=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(f,d){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(f=u,d={}){this._handler=f,this._options=d}activate(f){this._terminal=f;const d=this._options,g=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,g,this._handler,d))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),o})()))})(x_)),x_.exports}var Lz=Az(),S_={exports:{}},SE;function Bz(){return SE||(SE=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={903:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const u=c(274),f=c(627),d=c(237),g=c(860),p=c(374),x=c(296),b=c(345),_=c(859),v=c(399),y=c(855);class C extends _.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var T;return(T=this._charAtlas)==null?void 0:T.pages[0].canvas}constructor(T,E,L,R,D,N,$,H,W,Z){super(),this._terminal=T,this._container=E,this._alpha=D,this._themeService=N,this._bufferService=$,this._optionsService=H,this._decorationService=W,this._coreBrowserService=Z,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,x.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new _.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new b.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new u.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${L}-layer`),this._canvas.style.zIndex=R.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((P=>{this._refreshCharAtlas(P),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,p.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(T,E){}handleSelectionChanged(T,E,L=!1){this._selectionModel.update(this._terminal._core,T,E,L)}_setTransparency(T){if(T===this._alpha)return;const E=this._canvas;this._alpha=T,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(T){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,f.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,T,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,b.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let E=0;E<this._charAtlas.pages.length;E++)this._bitmapGenerator[E]=new w(this._charAtlas.pages[E].canvas)}}resize(T){this._deviceCellWidth=T.device.cell.width,this._deviceCellHeight=T.device.cell.height,this._deviceCharWidth=T.device.char.width,this._deviceCharHeight=T.device.char.height,this._deviceCharLeft=T.device.char.left,this._deviceCharTop=T.device.char.top,this._canvas.width=T.device.canvas.width,this._canvas.height=T.device.canvas.height,this._canvas.style.width=`${T.css.canvas.width}px`,this._canvas.style.height=`${T.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var T;(T=this._charAtlas)==null||T.clearTexture()}_fillCells(T,E,L,R){this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight)}_fillMiddleLineAtCells(T,E,L=1){const R=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(T*this._deviceCellWidth,(E+1)*this._deviceCellHeight-R-this._coreBrowserService.dpr,L*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(T,E,L=1,R=0){this._ctx.fillRect(T*this._deviceCellWidth,(E+1)*this._deviceCellHeight+R-this._coreBrowserService.dpr-1,L*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R;for(let D=0;D<L;D++){const N=(T+D)*this._deviceCellWidth,$=(T+D+.5)*this._deviceCellWidth,H=(T+D+1)*this._deviceCellWidth,W=(E+1)*this._deviceCellHeight-R-1,Z=W-R,P=W+R;this._ctx.moveTo(N,W),this._ctx.bezierCurveTo(N,Z,$,Z,$,W),this._ctx.bezierCurveTo($,P,H,P,H,W)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.setLineDash([2*R,R]);const D=T*this._deviceCellWidth,N=(E+1)*this._deviceCellHeight-R-1;this._ctx.moveTo(D,N);for(let $=0;$<L;$++){const H=(T+L+$)*this._deviceCellWidth;this._ctx.lineTo(H,N)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(T,E,L=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.setLineDash([4*R,3*R]);const D=T*this._deviceCellWidth,N=(T+L)*this._deviceCellWidth,$=(E+1)*this._deviceCellHeight-R-1;this._ctx.moveTo(D,$),this._ctx.lineTo(N,$),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(T,E,L){this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,this._coreBrowserService.dpr*L,this._deviceCellHeight)}_strokeRectAtCell(T,E,L,R){const D=this._coreBrowserService.dpr;this._ctx.lineWidth=D,this._ctx.strokeRect(T*this._deviceCellWidth+D/2,E*this._deviceCellHeight+D/2,L*this._deviceCellWidth-D,R*this._deviceCellHeight-D)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(T,E,L,R){this._alpha?this._ctx.clearRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(T*this._deviceCellWidth,E*this._deviceCellHeight,L*this._deviceCellWidth,R*this._deviceCellHeight))}_fillCharTrueColor(T,E,L){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipRow(L);let R=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(R=(0,g.tryDrawCustomChar)(this._ctx,T.getChars(),E*this._deviceCellWidth,L*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),R||this._ctx.fillText(T.getChars(),E*this._deviceCellWidth+this._deviceCharLeft,L*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(T,E,L){var W,Z,P,G;const R=T.getChars(),D=T.getCode(),N=T.getWidth();if(this._cellColorResolver.resolve(T,E,this._bufferService.buffer.ydisp+L,this._deviceCellWidth),!this._charAtlas)return;let $;if($=R&&R.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(R,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(T.getCode()||y.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!$.size.x||!$.size.y)return;this._ctx.save(),this._clipRow(L),this._bitmapGenerator[$.texturePage]&&this._charAtlas.pages[$.texturePage].canvas!==this._bitmapGenerator[$.texturePage].canvas&&((Z=(W=this._bitmapGenerator[$.texturePage])==null?void 0:W.bitmap)==null||Z.close(),delete this._bitmapGenerator[$.texturePage]),this._charAtlas.pages[$.texturePage].version!==((P=this._bitmapGenerator[$.texturePage])==null?void 0:P.version)&&(this._bitmapGenerator[$.texturePage]||(this._bitmapGenerator[$.texturePage]=new w(this._charAtlas.pages[$.texturePage].canvas)),this._bitmapGenerator[$.texturePage].refresh(),this._bitmapGenerator[$.texturePage].version=this._charAtlas.pages[$.texturePage].version);let H=$.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(D,N,$.size.x,this._deviceCellWidth)&&(H=this._deviceCellWidth-1),this._ctx.drawImage(((G=this._bitmapGenerator[$.texturePage])==null?void 0:G.bitmap)||this._charAtlas.pages[$.texturePage].canvas,$.texturePosition.x,$.texturePosition.y,$.size.x,$.size.y,E*this._deviceCellWidth+this._deviceCharLeft-$.offset.x,L*this._deviceCellHeight+this._deviceCharTop-$.offset.y,H,$.size.y),this._ctx.restore()}_clipRow(T){this._ctx.beginPath(),this._ctx.rect(0,T*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(T,E){return`${E?"italic":""} ${T?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}s.BaseRenderLayer=C;class w{get bitmap(){return this._bitmap}constructor(T){this.canvas=T,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var T;(T=this._bitmap)==null||T.close(),this._bitmap=void 0,v.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var T;this._state===0&&((T=this._bitmap)==null||T.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((E=>{this._state===2?this.refresh():this._bitmap=E,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CanvasRenderer=void 0;const u=c(627),f=c(56),d=c(374),g=c(345),p=c(859),x=c(873),b=c(43),_=c(630),v=c(744);class y extends p.Disposable{constructor(w,A,T,E,L,R,D,N,$,H,W){super(),this._terminal=w,this._screenElement=A,this._bufferService=E,this._charSizeService=L,this._optionsService=R,this._coreBrowserService=$,this._themeService=W,this._observerDisposable=this.register(new p.MutableDisposable),this._onRequestRedraw=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new g.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new g.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const Z=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new v.TextRenderLayer(this._terminal,this._screenElement,0,Z,this._bufferService,this._optionsService,D,H,this._coreBrowserService,W),new _.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,H,this._optionsService,W),new b.LinkRenderLayer(this._terminal,this._screenElement,2,T,this._bufferService,this._optionsService,H,this._coreBrowserService,W),new x.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,N,this._coreBrowserService,H,W)];for(const P of this._renderLayers)(0,g.forwardEvent)(P.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,d.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((P,G)=>this._setCanvasDevicePixelDimensions(P,G))),this.register(this._coreBrowserService.onWindowChange((P=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._renderLayers[0].canvas,P,((G,X)=>this._setCanvasDevicePixelDimensions(G,X)))}))),this.register((0,p.toDisposable)((()=>{for(const P of this._renderLayers)P.dispose();(0,u.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(w,A){this._updateDimensions();for(const T of this._renderLayers)T.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((w=>w.handleBlur()))}handleFocus(){this._runOperation((w=>w.handleFocus()))}handleSelectionChanged(w,A,T=!1){this._runOperation((E=>E.handleSelectionChanged(w,A,T))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((w=>w.handleCursorMove()))}clear(){this._runOperation((w=>w.reset()))}_runOperation(w){for(const A of this._renderLayers)w(A)}renderRows(w,A){for(const T of this._renderLayers)T.handleGridChanged(w,A)}clearTextureAtlas(){for(const w of this._renderLayers)w.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*w),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(w,A){this.dimensions.device.canvas.height=A,this.dimensions.device.canvas.width=w;for(const T of this._renderLayers)T.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}s.CanvasRenderer=y},873:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorRenderLayer=void 0;const u=c(457),f=c(859),d=c(399),g=c(782),p=c(903);class x extends p.BaseRenderLayer{constructor(_,v,y,C,w,A,T,E,L,R){super(_,v,"cursor",y,!0,R,w,A,L,E),this._onRequestRedraw=C,this._coreService=T,this._cursorBlinkStateManager=this.register(new f.MutableDisposable),this._cell=new g.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(_){super.resize(_),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var _;this._clearCursor(),(_=this._cursorBlinkStateManager.value)==null||_.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var _;(_=this._cursorBlinkStateManager.value)==null||_.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var _;(_=this._cursorBlinkStateManager.value)==null||_.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new u.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var _;(_=this._cursorBlinkStateManager.value)==null||_.restartBlinkAnimation()}handleGridChanged(_,v){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(_){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const v=this._bufferService.buffer.ybase+this._bufferService.buffer.y,y=v-this._bufferService.buffer.ydisp;if(y<0||y>=this._bufferService.rows)return void this._clearCursor();const C=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(v).loadCell(C,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const w=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;return A&&A!=="none"&&this._cursorRenderers[A](C,y,this._cell),this._ctx.restore(),this._state.x=C,this._state.y=y,this._state.isFocused=!1,this._state.style=w,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===C&&this._state.y===y&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](C,y,this._cell),this._ctx.restore(),this._state.x=C,this._state.y=y,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(d.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(_,v,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(_,v,y.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(y,_,v),this._ctx.restore()}_renderUnderlineCursor(_,v,y){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(_,v),this._ctx.restore()}_renderOutlineCursor(_,v,y){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(_,v,y.getWidth(),1),this._ctx.restore()}}s.CursorRenderLayer=x},574:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GridCache=void 0,s.GridCache=class{constructor(){this.cache=[]}resize(c,u){for(let f=0;f<c;f++){this.cache.length<=f&&this.cache.push([]);for(let d=this.cache[f].length;d<u;d++)this.cache[f].push(void 0);this.cache[f].length=u}this.cache.length=c}clear(){for(let c=0;c<this.cache.length;c++)for(let u=0;u<this.cache[c].length;u++)this.cache[c][u]=void 0}}},43:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const u=c(197),f=c(237),d=c(903);class g extends d.BaseRenderLayer{constructor(x,b,_,v,y,C,w,A,T){super(x,b,"link",_,!0,T,y,C,w,A),this.register(v.onShowLinkUnderline((E=>this._handleShowLinkUnderline(E)))),this.register(v.onHideLinkUnderline((E=>this._handleHideLinkUnderline(E))))}resize(x){super.resize(x),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const x=this._state.y2-this._state.y1-1;x>0&&this._clearCells(0,this._state.y1+1,this._state.cols,x),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(x){if(x.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:x.fg&&(0,u.is256Color)(x.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[x.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,x.y1===x.y2)this._fillBottomLineAtCells(x.x1,x.y1,x.x2-x.x1);else{this._fillBottomLineAtCells(x.x1,x.y1,x.cols-x.x1);for(let b=x.y1+1;b<x.y2;b++)this._fillBottomLineAtCells(0,b,x.cols);this._fillBottomLineAtCells(0,x.y2,x.x2)}this._state=x}_handleHideLinkUnderline(x){this._clearCurrentLink()}}s.LinkRenderLayer=g},630:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionRenderLayer=void 0;const u=c(903);class f extends u.BaseRenderLayer{constructor(g,p,x,b,_,v,y,C){super(g,p,"selection",x,!0,C,b,y,v,_),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(g){super.resize(g),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(g,p,x){super.handleSelectionChanged(g,p,x),this._redrawSelection(g,p,x)}_redrawSelection(g,p,x){if(!this._didStateChange(g,p,x,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!g||!p)return void this._clearState();const b=g[1]-this._bufferService.buffer.ydisp,_=p[1]-this._bufferService.buffer.ydisp,v=Math.max(b,0),y=Math.min(_,this._bufferService.rows-1);if(v>=this._bufferService.rows||y<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,x){const C=g[0],w=p[0]-C,A=y-v+1;this._fillCells(C,v,w,A)}else{const C=b===v?g[0]:0,w=v===_?p[0]:this._bufferService.cols;this._fillCells(C,v,w-C,1);const A=Math.max(y-v-1,0);if(this._fillCells(0,v+1,this._bufferService.cols,A),v!==y){const T=_===y?p[0]:this._bufferService.cols;this._fillCells(0,y,T,1)}}this._state.start=[g[0],g[1]],this._state.end=[p[0],p[1]],this._state.columnSelectMode=x,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(g,p,x,b){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(p,this._state.end)||x!==this._state.columnSelectMode||b!==this._state.ydisp}_areCoordinatesEqual(g,p){return!(!g||!p)&&g[0]===p[0]&&g[1]===p[1]}}s.SelectionRenderLayer=f},744:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextRenderLayer=void 0;const u=c(577),f=c(147),d=c(782),g=c(855),p=c(903),x=c(574);class b extends p.BaseRenderLayer{constructor(v,y,C,w,A,T,E,L,R,D){super(v,y,"text",C,w,D,A,T,L,R),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new d.CellData,this._state=new x.GridCache,this.register(T.onSpecificOptionChange("allowTransparency",(N=>this._setTransparency(N))))}resize(v){super.resize(v);const y=this._getFont(!1,!1);this._characterWidth===v.device.char.width&&this._characterFont===y||(this._characterWidth=v.device.char.width,this._characterFont=y,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(v,y,C){for(let w=v;w<=y;w++){const A=w+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.lines.get(A),E=this._characterJoinerService.getJoinedCharacters(A);for(let L=0;L<this._bufferService.cols;L++){T.loadCell(L,this._workCell);let R=this._workCell,D=!1,N=L;if(R.getWidth()!==0){if(E.length>0&&L===E[0][0]){D=!0;const $=E.shift();R=new u.JoinedCellData(this._workCell,T.translateToString(!0,$[0],$[1]),$[1]-$[0]),N=$[1]-1}!D&&this._isOverlapping(R)&&N<T.length-1&&T.getCodePoint(N+1)===g.NULL_CELL_CODE&&(R.content&=-12582913,R.content|=8388608),C(R,L,w),L=N}}}}_drawBackground(v,y){const C=this._ctx,w=this._bufferService.cols;let A=0,T=0,E=null;C.save(),this._forEachCell(v,y,((L,R,D)=>{let N=null;L.isInverse()?N=L.isFgDefault()?this._themeService.colors.foreground.css:L.isFgRGB()?`rgb(${f.AttributeData.toColorRGB(L.getFgColor()).join(",")})`:this._themeService.colors.ansi[L.getFgColor()].css:L.isBgRGB()?N=`rgb(${f.AttributeData.toColorRGB(L.getBgColor()).join(",")})`:L.isBgPalette()&&(N=this._themeService.colors.ansi[L.getBgColor()].css);let $=!1;this._decorationService.forEachDecorationAtCell(R,this._bufferService.buffer.ydisp+D,void 0,(H=>{H.options.layer!=="top"&&$||(H.backgroundColorRGB&&(N=H.backgroundColorRGB.css),$=H.options.layer==="top")})),E===null&&(A=R,T=D),D!==T?(C.fillStyle=E||"",this._fillCells(A,T,w-A,1),A=R,T=D):E!==N&&(C.fillStyle=E||"",this._fillCells(A,T,R-A,1),A=R,T=D),E=N})),E!==null&&(C.fillStyle=E,this._fillCells(A,T,w-A,1)),C.restore()}_drawForeground(v,y){this._forEachCell(v,y,((C,w,A)=>this._drawChars(C,w,A)))}handleGridChanged(v,y){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,v,this._bufferService.cols,y-v+1),this._drawBackground(v,y),this._drawForeground(v,y))}_isOverlapping(v){if(v.getWidth()!==1||v.getCode()<256)return!1;const y=v.getChars();if(this._characterOverlapCache.hasOwnProperty(y))return this._characterOverlapCache[y];this._ctx.save(),this._ctx.font=this._characterFont;const C=Math.floor(this._ctx.measureText(y).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[y]=C,C}}s.TextRenderLayer=b},274:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const u=c(855),f=c(160),d=c(374);let g,p=0,x=0,b=!1,_=!1,v=!1,y=0;s.CellColorResolver=class{constructor(C,w,A,T,E,L){this._terminal=C,this._optionService=w,this._selectionRenderModel=A,this._decorationService=T,this._coreBrowserService=E,this._themeService=L,this.result={fg:0,bg:0,ext:0}}resolve(C,w,A,T){if(this.result.bg=C.bg,this.result.fg=C.fg,this.result.ext=268435456&C.bg?C.extended.ext:0,x=0,p=0,_=!1,b=!1,v=!1,g=this._themeService.colors,y=0,C.getCode()!==u.NULL_CELL_CODE&&C.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));y=w*T%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(w,A,"bottom",(E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,_=!0),E.foregroundColorRGB&&(p=E.foregroundColorRGB.rgba>>8&16777215,b=!0)})),v=this._selectionRenderModel.isCellSelected(this._terminal,w,A),v){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}x=f.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else x=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(_=!0,g.selectionForeground&&(p=g.selectionForeground.rgba>>8&16777215,b=!0),(0,d.treatGlyphAsBackgroundColor)(C.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)p=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}p=f.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}b=!0}}this._decorationService.forEachDecorationAtCell(w,A,"top",(E=>{E.backgroundColorRGB&&(x=E.backgroundColorRGB.rgba>>8&16777215,_=!0),E.foregroundColorRGB&&(p=E.foregroundColorRGB.rgba>>8&16777215,b=!0)})),_&&(x=v?-16777216&C.bg&-134217729|x|50331648:-16777216&C.bg|x|50331648),b&&(p=-16777216&C.fg&-67108865|p|50331648),67108864&this.result.fg&&(_&&!b&&(p=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,b=!0),!_&&b&&(x=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,_=!0)),g=void 0,this.result.bg=_?x:this.result.bg,this.result.fg=b?p:this.result.fg,this.result.ext&=536870911,this.result.ext|=y<<29&3758096384}}},627:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const u=c(509),f=c(197),d=[];s.acquireTextureAtlas=function(g,p,x,b,_,v,y,C){const w=(0,f.generateConfig)(b,_,v,y,p,x,C);for(let E=0;E<d.length;E++){const L=d[E],R=L.ownedBy.indexOf(g);if(R>=0){if((0,f.configEquals)(L.config,w))return L.atlas;L.ownedBy.length===1?(L.atlas.dispose(),d.splice(E,1)):L.ownedBy.splice(R,1);break}}for(let E=0;E<d.length;E++){const L=d[E];if((0,f.configEquals)(L.config,w))return L.ownedBy.push(g),L.atlas}const A=g._core,T={atlas:new u.TextureAtlas(document,w,A.unicodeService),config:w,ownedBy:[g]};return d.push(T),T.atlas},s.removeTerminalFromCache=function(g){for(let p=0;p<d.length;p++){const x=d[p].ownedBy.indexOf(g);if(x!==-1){d[p].ownedBy.length===1?(d[p].atlas.dispose(),d.splice(p,1)):d[p].ownedBy.splice(x,1);break}}}},197:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const u=c(160);s.generateConfig=function(f,d,g,p,x,b,_){const v={foreground:b.foreground,background:b.background,cursor:u.NULL_COLOR,cursorAccent:u.NULL_COLOR,selectionForeground:u.NULL_COLOR,selectionBackgroundTransparent:u.NULL_COLOR,selectionBackgroundOpaque:u.NULL_COLOR,selectionInactiveBackgroundTransparent:u.NULL_COLOR,selectionInactiveBackgroundOpaque:u.NULL_COLOR,ansi:b.ansi.slice(),contrastCache:b.contrastCache,halfContrastCache:b.halfContrastCache};return{customGlyphs:x.customGlyphs,devicePixelRatio:_,letterSpacing:x.letterSpacing,lineHeight:x.lineHeight,deviceCellWidth:f,deviceCellHeight:d,deviceCharWidth:g,deviceCharHeight:p,fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight,fontWeightBold:x.fontWeightBold,allowTransparency:x.allowTransparency,drawBoldTextInBrightColors:x.drawBoldTextInBrightColors,minimumContrastRatio:x.minimumContrastRatio,colors:v}},s.configEquals=function(f,d){for(let g=0;g<f.colors.ansi.length;g++)if(f.colors.ansi[g].rgba!==d.colors.ansi[g].rgba)return!1;return f.devicePixelRatio===d.devicePixelRatio&&f.customGlyphs===d.customGlyphs&&f.lineHeight===d.lineHeight&&f.letterSpacing===d.letterSpacing&&f.fontFamily===d.fontFamily&&f.fontSize===d.fontSize&&f.fontWeight===d.fontWeight&&f.fontWeightBold===d.fontWeightBold&&f.allowTransparency===d.allowTransparency&&f.deviceCharWidth===d.deviceCharWidth&&f.deviceCharHeight===d.deviceCharHeight&&f.drawBoldTextInBrightColors===d.drawBoldTextInBrightColors&&f.minimumContrastRatio===d.minimumContrastRatio&&f.colors.foreground.rgba===d.colors.foreground.rgba&&f.colors.background.rgba===d.colors.background.rgba},s.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432}},237:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const u=c(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},457:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(c=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,u>0)return void this._restartInterval(u)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const u=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(u)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),c)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const u=c(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"║":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╒":{1:(b,_)=>`M.5,1 L.5,${.5-_} L1,${.5-_} M.5,${.5+_} L1,${.5+_}`},"╓":{1:(b,_)=>`M${.5-b},1 L${.5-b},.5 L1,.5 M${.5+b},.5 L${.5+b},1`},"╔":{1:(b,_)=>`M1,${.5-_} L${.5-b},${.5-_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1`},"╕":{1:(b,_)=>`M0,${.5-_} L.5,${.5-_} L.5,1 M0,${.5+_} L.5,${.5+_}`},"╖":{1:(b,_)=>`M${.5+b},1 L${.5+b},.5 L0,.5 M${.5-b},.5 L${.5-b},1`},"╗":{1:(b,_)=>`M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M0,${.5-_} L${.5+b},${.5-_} L${.5+b},1`},"╘":{1:(b,_)=>`M.5,0 L.5,${.5+_} L1,${.5+_} M.5,${.5-_} L1,${.5-_}`},"╙":{1:(b,_)=>`M1,.5 L${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╚":{1:(b,_)=>`M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0 M1,${.5+_} L${.5-b},${.5+_} L${.5-b},0`},"╛":{1:(b,_)=>`M0,${.5+_} L.5,${.5+_} L.5,0 M0,${.5-_} L.5,${.5-_}`},"╜":{1:(b,_)=>`M0,.5 L${.5+b},.5 L${.5+b},0 M${.5-b},.5 L${.5-b},0`},"╝":{1:(b,_)=>`M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M0,${.5+_} L${.5+b},${.5+_} L${.5+b},0`},"╞":{1:(b,_)=>`M.5,0 L.5,1 M.5,${.5-_} L1,${.5-_} M.5,${.5+_} L1,${.5+_}`},"╟":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1 M${.5+b},.5 L1,.5`},"╠":{1:(b,_)=>`M${.5-b},0 L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╡":{1:(b,_)=>`M.5,0 L.5,1 M0,${.5-_} L.5,${.5-_} M0,${.5+_} L.5,${.5+_}`},"╢":{1:(b,_)=>`M0,.5 L${.5-b},.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╣":{1:(b,_)=>`M${.5+b},0 L${.5+b},1 M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0`},"╤":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_} M.5,${.5+_} L.5,1`},"╥":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},1 M${.5+b},.5 L${.5+b},1`},"╦":{1:(b,_)=>`M0,${.5-_} L1,${.5-_} M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1`},"╧":{1:(b,_)=>`M.5,0 L.5,${.5-_} M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"╨":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╩":{1:(b,_)=>`M0,${.5+_} L1,${.5+_} M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╪":{1:(b,_)=>`M.5,0 L.5,1 M0,${.5-_} L1,${.5-_} M0,${.5+_} L1,${.5+_}`},"╫":{1:(b,_)=>`M0,.5 L1,.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╬":{1:(b,_)=>`M0,${.5+_} L${.5-b},${.5+_} L${.5-b},1 M1,${.5+_} L${.5+b},${.5+_} L${.5+b},1 M0,${.5-_} L${.5-b},${.5-_} L${.5-b},0 M1,${.5-_} L${.5+b},${.5-_} L${.5+b},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(b,_)=>`M.5,1 L.5,${.5+_/.15*.5} C.5,${.5+_/.15*.5},.5,.5,1,.5`},"╮":{1:(b,_)=>`M.5,1 L.5,${.5+_/.15*.5} C.5,${.5+_/.15*.5},.5,.5,0,.5`},"╯":{1:(b,_)=>`M.5,0 L.5,${.5-_/.15*.5} C.5,${.5-_/.15*.5},.5,.5,0,.5`},"╰":{1:(b,_)=>`M.5,0 L.5,${.5-_/.15*.5} C.5,${.5-_/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(b,_,v,y,C,w,A,T){const E=s.blockElementDefinitions[_];if(E)return(function(N,$,H,W,Z,P){for(let G=0;G<$.length;G++){const X=$[G],j=Z/8,I=P/8;N.fillRect(H+X.x*j,W+X.y*I,X.w*j,X.h*I)}})(b,E,v,y,C,w),!0;const L=f[_];if(L)return(function(N,$,H,W,Z,P){let G=d.get($);G||(G=new Map,d.set($,G));const X=N.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let j=G.get(X);if(!j){const I=$[0].length,z=$.length,Y=N.canvas.ownerDocument.createElement("canvas");Y.width=I,Y.height=z;const q=(0,u.throwIfFalsy)(Y.getContext("2d")),Q=new ImageData(I,z);let ee,te,re,K;if(X.startsWith("#"))ee=parseInt(X.slice(1,3),16),te=parseInt(X.slice(3,5),16),re=parseInt(X.slice(5,7),16),K=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[ee,te,re,K]=X.substring(5,X.length-1).split(",").map((ce=>parseFloat(ce)))}for(let ce=0;ce<z;ce++)for(let ne=0;ne<I;ne++)Q.data[4*(ce*I+ne)]=ee,Q.data[4*(ce*I+ne)+1]=te,Q.data[4*(ce*I+ne)+2]=re,Q.data[4*(ce*I+ne)+3]=$[ce][ne]*(255*K);q.putImageData(Q,0,0),j=(0,u.throwIfFalsy)(N.createPattern(Y,null)),G.set(X,j)}N.fillStyle=j,N.fillRect(H,W,Z,P)})(b,L,v,y,C,w),!0;const R=s.boxDrawingDefinitions[_];if(R)return(function(N,$,H,W,Z,P,G){N.strokeStyle=N.fillStyle;for(const[X,j]of Object.entries($)){let I;N.beginPath(),N.lineWidth=G*Number.parseInt(X),I=typeof j=="function"?j(.15,.15/P*Z):j;for(const z of I.split(" ")){const Y=z[0],q=p[Y];if(!q){console.error(`Could not find drawing instructions for "${Y}"`);continue}const Q=z.substring(1).split(",");Q[0]&&Q[1]&&q(N,x(Q,Z,P,H,W,!0,G))}N.stroke(),N.closePath()}})(b,R,v,y,C,w,T),!0;const D=s.powerlineDefinitions[_];return!!D&&((function(N,$,H,W,Z,P,G,X){const j=new Path2D;j.rect(H,W,Z,P),N.clip(j),N.beginPath();const I=G/12;N.lineWidth=X*I;for(const z of $.d.split(" ")){const Y=z[0],q=p[Y];if(!q){console.error(`Could not find drawing instructions for "${Y}"`);continue}const Q=z.substring(1).split(",");Q[0]&&Q[1]&&q(N,x(Q,Z,P,H,W,!1,X,($.leftPadding??0)*(I/2),($.rightPadding??0)*(I/2)))}$.type===1?(N.strokeStyle=N.fillStyle,N.stroke()):N.fill(),N.closePath()})(b,D,v,y,C,w,A,T),!0)};const d=new Map;function g(b,_,v=0){return Math.max(Math.min(b,_),v)}const p={C:(b,_)=>b.bezierCurveTo(_[0],_[1],_[2],_[3],_[4],_[5]),L:(b,_)=>b.lineTo(_[0],_[1]),M:(b,_)=>b.moveTo(_[0],_[1])};function x(b,_,v,y,C,w,A,T=0,E=0){const L=b.map((R=>parseFloat(R)||parseInt(R)));if(L.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<L.length;R+=2)L[R]*=_-T*A-E*A,w&&L[R]!==0&&(L[R]=g(Math.round(L[R]+.5)-.5,_,0)),L[R]+=y+T*A;for(let R=1;R<L.length;R+=2)L[R]*=v,w&&L[R]!==0&&(L[R]=g(Math.round(L[R]+.5)-.5,v,0)),L[R]+=C;return L}},56:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const u=c(859);s.observeDevicePixelDimensions=function(f,d,g){let p=new d.ResizeObserver((x=>{const b=x.find((y=>y.target===f));if(!b)return;if(!("devicePixelContentBoxSize"in b))return p==null||p.disconnect(),void(p=void 0);const _=b.devicePixelContentBoxSize[0].inlineSize,v=b.devicePixelContentBoxSize[0].blockSize;_>0&&v>0&&g(_,v)}));try{p.observe(f,{box:["device-pixel-content-box"]})}catch{p.disconnect(),p=void 0}return(0,u.toDisposable)((()=>p==null?void 0:p.disconnect()))}},374:(l,s)=>{function c(f){return 57508<=f&&f<=57558}function u(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=u,s.allowRescaling=function(f,d,g,p){return d===1&&g>Math.ceil(1.5*p)&&f!==void 0&&f>255&&!u(f)&&!c(f)&&!(function(x){return 57344<=x&&x<=63743})(f)},s.treatGlyphAsBackgroundColor=function(f){return c(f)||(function(d){return 9472<=d&&d<=9631})(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,d,g=0){return(f-(2*Math.round(d)-g))%(2*Math.round(d))}},296:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(f,d,g,p=!1){if(this.selectionStart=d,this.selectionEnd=g,!d||!g||d[0]===g[0]&&d[1]===g[1])return void this.clear();const x=f.buffers.active.ydisp,b=d[1]-x,_=g[1]-x,v=Math.max(b,0),y=Math.min(_,f.rows-1);v>=f.rows||y<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=b,this.viewportEndRow=_,this.viewportCappedStartRow=v,this.viewportCappedEndRow=y,this.startCol=d[0],this.endCol=g[0])}isCellSelected(f,d,g){return!!this.hasSelection&&(g-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&g>=this.viewportCappedStartRow&&d<this.endCol&&g<=this.viewportCappedEndRow:d<this.startCol&&g>=this.viewportCappedStartRow&&d>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&d>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},509:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const u=c(237),f=c(860),d=c(374),g=c(160),p=c(345),x=c(485),b=c(385),_=c(147),v=c(855),y={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let C;class w{get pages(){return this._pages}constructor(R,D,N){this._document=R,this._config=D,this._unicodeService=N,this._didWarmUp=!1,this._cacheMap=new x.FourKeyMap,this._cacheMapCombined=new x.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new _.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new b.IdleTaskQueue;for(let D=33;D<126;D++)R.enqueue((()=>{if(!this._cacheMap.get(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT)){const N=this._drawToCache(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT);this._cacheMap.set(D,v.DEFAULT_COLOR,v.DEFAULT_COLOR,v.DEFAULT_EXT,N)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const D=this._pages.filter((G=>2*G.canvas.width<=(w.maxTextureSize||4096))).sort(((G,X)=>X.canvas.width!==G.canvas.width?X.canvas.width-G.canvas.width:X.percentageUsed-G.percentageUsed));let N=-1,$=0;for(let G=0;G<D.length;G++)if(D[G].canvas.width!==$)N=G,$=D[G].canvas.width;else if(G-N==3)break;const H=D.slice(N,N+4),W=H.map((G=>G.glyphs[0].texturePage)).sort(((G,X)=>G>X?1:-1)),Z=this.pages.length-H.length,P=this._mergePages(H,Z);P.version++;for(let G=W.length-1;G>=0;G--)this._deletePage(W[G]);this.pages.push(P),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(P.canvas)}const R=new A(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,D){const N=2*R[0].canvas.width,$=new A(this._document,N,R);for(const[H,W]of R.entries()){const Z=H*W.canvas.width%N,P=Math.floor(H/2)*W.canvas.height;$.ctx.drawImage(W.canvas,Z,P);for(const X of W.glyphs)X.texturePage=D,X.sizeClipSpace.x=X.size.x/N,X.sizeClipSpace.y=X.size.y/N,X.texturePosition.x+=Z,X.texturePosition.y+=P,X.texturePositionClipSpace.x=X.texturePosition.x/N,X.texturePositionClipSpace.y=X.texturePosition.y/N;this._onRemoveTextureAtlasCanvas.fire(W.canvas);const G=this._activePages.indexOf(W);G!==-1&&this._activePages.splice(G,1)}return $}_deletePage(R){this._pages.splice(R,1);for(let D=R;D<this._pages.length;D++){const N=this._pages[D];for(const $ of N.glyphs)$.texturePage--;N.version++}}getRasterizedGlyphCombinedChar(R,D,N,$,H){return this._getFromCacheMap(this._cacheMapCombined,R,D,N,$,H)}getRasterizedGlyph(R,D,N,$,H){return this._getFromCacheMap(this._cacheMap,R,D,N,$,H)}_getFromCacheMap(R,D,N,$,H,W=!1){return C=R.get(D,N,$,H),C||(C=this._drawToCache(D,N,$,H,W),R.set(D,N,$,H,C)),C}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,D,N,$){if(this._config.allowTransparency)return g.NULL_COLOR;let H;switch(R){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(D);break;case 50331648:const W=_.AttributeData.toColorRGB(D);H=g.channels.toColor(W[0],W[1],W[2]);break;default:H=N?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(R,D,N,$,H,W,Z,P,G,X){const j=this._getMinimumContrastColor(R,D,N,$,H,W,Z,G,P,X);if(j)return j;let I;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&G&&W<8&&(W+=8),I=this._getColorFromAnsiIndex(W);break;case 50331648:const z=_.AttributeData.toColorRGB(W);I=g.channels.toColor(z[0],z[1],z[2]);break;default:I=Z?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(I=g.color.opaque(I)),P&&(I=g.color.multiplyOpacity(I,u.DIM_OPACITY)),I}_resolveBackgroundRgba(R,D,N){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(D).rgba;case 50331648:return D<<8;default:return N?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,D,N,$){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&$&&D<8&&(D+=8),this._getColorFromAnsiIndex(D).rgba;case 50331648:return D<<8;default:return N?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,D,N,$,H,W,Z,P,G,X){if(this._config.minimumContrastRatio===1||X)return;const j=this._getContrastCache(G),I=j.getColor(R,$);if(I!==void 0)return I||void 0;const z=this._resolveBackgroundRgba(D,N,Z),Y=this._resolveForegroundRgba(H,W,Z,P),q=g.rgba.ensureContrastRatio(z,Y,this._config.minimumContrastRatio/(G?2:1));if(!q)return void j.setColor(R,$,null);const Q=g.channels.toColor(q>>24&255,q>>16&255,q>>8&255);return j.setColor(R,$,Q),Q}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,D,N,$,H=!1){const W=typeof R=="number"?String.fromCharCode(R):R,Z=Math.min(this._config.deviceCellWidth*Math.max(W.length,2)+4,this._textureSize);this._tmpCanvas.width<Z&&(this._tmpCanvas.width=Z);const P=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<P&&(this._tmpCanvas.height=P),this._tmpCtx.save(),this._workAttributeData.fg=N,this._workAttributeData.bg=D,this._workAttributeData.extended.ext=$,this._workAttributeData.isInvisible())return y;const G=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),I=!!this._workAttributeData.isItalic(),z=!!this._workAttributeData.isUnderline(),Y=!!this._workAttributeData.isStrikethrough(),q=!!this._workAttributeData.isOverline();let Q=this._workAttributeData.getFgColor(),ee=this._workAttributeData.getFgColorMode(),te=this._workAttributeData.getBgColor(),re=this._workAttributeData.getBgColorMode();if(X){const Fe=Q;Q=te,te=Fe;const Ue=ee;ee=re,re=Ue}const K=this._getBackgroundColor(re,te,X,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=K.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ce=G?this._config.fontWeightBold:this._config.fontWeight,ne=I?"italic":"";this._tmpCtx.font=`${ne} ${ce} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=u.TEXT_BASELINE;const de=W.length===1&&(0,d.isPowerlineGlyph)(W.charCodeAt(0)),_e=W.length===1&&(0,d.isRestrictedPowerlineGlyph)(W.charCodeAt(0)),Be=this._getForegroundColor(D,re,te,N,ee,Q,X,j,G,(0,d.treatGlyphAsBackgroundColor)(W.charCodeAt(0)));this._tmpCtx.fillStyle=Be.css;const De=_e?0:4;let Ze=!1;this._config.customGlyphs!==!1&&(Ze=(0,f.tryDrawCustomChar)(this._tmpCtx,W,De,De,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let kt,Je=!de;if(kt=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),z){this._tmpCtx.save();const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ue=Fe%2==1?.5:0;if(this._tmpCtx.lineWidth=Fe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Je=!1,this._tmpCtx.strokeStyle=`rgb(${_.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Je=!1;let Ve=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ve<8&&(Ve+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ve).css}this._tmpCtx.beginPath();const dt=De,pe=Math.ceil(De+this._config.deviceCharHeight)-Ue-(H?2*Fe:0),Te=pe+Fe,ze=pe+2*Fe;let Ge=this._workAttributeData.getUnderlineVariantOffset();for(let Ve=0;Ve<kt;Ve++){this._tmpCtx.save();const ot=dt+Ve*this._config.deviceCellWidth,it=dt+(Ve+1)*this._config.deviceCellWidth,Yt=ot+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe),this._tmpCtx.moveTo(ot,ze),this._tmpCtx.lineTo(it,ze);break;case 3:const $t=Fe<=1?ze:Math.ceil(De+this._config.deviceCharHeight-Fe/2)-Ue,Pt=Fe<=1?pe:Math.ceil(De+this._config.deviceCharHeight+Fe/2)-Ue,Mt=new Path2D;Mt.rect(ot,pe,this._config.deviceCellWidth,ze-pe),this._tmpCtx.clip(Mt),this._tmpCtx.moveTo(ot-this._config.deviceCellWidth/2,Te),this._tmpCtx.bezierCurveTo(ot-this._config.deviceCellWidth/2,Pt,ot,Pt,ot,Te),this._tmpCtx.bezierCurveTo(ot,$t,Yt,$t,Yt,Te),this._tmpCtx.bezierCurveTo(Yt,Pt,it,Pt,it,Te),this._tmpCtx.bezierCurveTo(it,$t,it+this._config.deviceCellWidth/2,$t,it+this._config.deviceCellWidth/2,Te);break;case 4:const zr=Ge===0?0:Ge>=Fe?2*Fe-Ge:Fe-Ge;Ge>=Fe||zr===0?(this._tmpCtx.setLineDash([Math.round(Fe),Math.round(Fe)]),this._tmpCtx.moveTo(ot+zr,pe),this._tmpCtx.lineTo(it,pe)):(this._tmpCtx.setLineDash([Math.round(Fe),Math.round(Fe)]),this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(ot+zr,pe),this._tmpCtx.moveTo(ot+zr+Fe,pe),this._tmpCtx.lineTo(it,pe)),Ge=(0,d.computeNextVariantOffset)(it-ot,Fe,Ge);break;case 5:const vr=.6,Zr=.3,Er=it-ot,ri=Math.floor(vr*Er),ur=Math.floor(Zr*Er),Gt=Er-ri-ur;this._tmpCtx.setLineDash([ri,ur,Gt]),this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe);break;default:this._tmpCtx.moveTo(ot,pe),this._tmpCtx.lineTo(it,pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ze&&this._config.fontSize>=12&&!this._config.allowTransparency&&W!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ve=this._tmpCtx.measureText(W);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ve&&Ve.actualBoundingBoxDescent>0){this._tmpCtx.save();const ot=new Path2D;ot.rect(dt,pe-Math.ceil(Fe/2),this._config.deviceCellWidth*kt,ze-pe+Math.ceil(Fe/2)),this._tmpCtx.clip(ot),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=K.css,this._tmpCtx.strokeText(W,De,De+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(q){const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ue=Fe%2==1?.5:0;this._tmpCtx.lineWidth=Fe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Ue),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*kt,De+Ue),this._tmpCtx.stroke()}if(Ze||this._tmpCtx.fillText(W,De,De+this._config.deviceCharHeight),W==="_"&&!this._config.allowTransparency){let Fe=T(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),K,Be,Je);if(Fe)for(let Ue=1;Ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=K.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(W,De,De+this._config.deviceCharHeight-Ue),Fe=T(this._tmpCtx.getImageData(De,De,this._config.deviceCellWidth,this._config.deviceCellHeight),K,Be,Je),Fe);Ue++);}if(Y){const Fe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Fe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(De,De+Math.floor(this._config.deviceCharHeight/2)-Ue),this._tmpCtx.lineTo(De+this._config.deviceCharWidth*kt,De+Math.floor(this._config.deviceCharHeight/2)-Ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const st=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let At;if(At=this._config.allowTransparency?(function(Fe){for(let Ue=0;Ue<Fe.data.length;Ue+=4)if(Fe.data[Ue+3]>0)return!1;return!0})(st):T(st,K,Be,Je),At)return y;const ut=this._findGlyphBoundingBox(st,this._workBoundingBox,Z,_e,Ze,De);let Me,Ie;for(;;){if(this._activePages.length===0){const Fe=this._createNewPage();Me=Fe,Ie=Fe.currentRow,Ie.height=ut.size.y;break}Me=this._activePages[this._activePages.length-1],Ie=Me.currentRow;for(const Fe of this._activePages)ut.size.y<=Fe.currentRow.height&&(Me=Fe,Ie=Fe.currentRow);for(let Fe=this._activePages.length-1;Fe>=0;Fe--)for(const Ue of this._activePages[Fe].fixedRows)Ue.height<=Ie.height&&ut.size.y<=Ue.height&&(Me=this._activePages[Fe],Ie=Ue);if(Ie.y+ut.size.y>=Me.canvas.height||Ie.height>ut.size.y+2){let Fe=!1;if(Me.currentRow.y+Me.currentRow.height+ut.size.y>=Me.canvas.height){let Ue;for(const dt of this._activePages)if(dt.currentRow.y+dt.currentRow.height+ut.size.y<dt.canvas.height){Ue=dt;break}if(Ue)Me=Ue;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&Ie.y+ut.size.y<=Me.canvas.height&&Ie.height>=ut.size.y&&Ie.x+ut.size.x<=Me.canvas.width)Fe=!0;else{const dt=this._createNewPage();Me=dt,Ie=dt.currentRow,Ie.height=ut.size.y,Fe=!0}}Fe||(Me.currentRow.height>0&&Me.fixedRows.push(Me.currentRow),Ie={x:0,y:Me.currentRow.y+Me.currentRow.height,height:ut.size.y},Me.fixedRows.push(Ie),Me.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+ut.size.x<=Me.canvas.width)break;Ie===Me.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Me.fixedRows.splice(Me.fixedRows.indexOf(Ie),1)}return ut.texturePage=this._pages.indexOf(Me),ut.texturePosition.x=Ie.x,ut.texturePosition.y=Ie.y,ut.texturePositionClipSpace.x=Ie.x/Me.canvas.width,ut.texturePositionClipSpace.y=Ie.y/Me.canvas.height,ut.sizeClipSpace.x/=Me.canvas.width,ut.sizeClipSpace.y/=Me.canvas.height,Ie.height=Math.max(Ie.height,ut.size.y),Ie.x+=ut.size.x,Me.ctx.putImageData(st,ut.texturePosition.x-this._workBoundingBox.left,ut.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ut.size.x,ut.size.y),Me.addGlyph(ut),Me.version++,ut}_findGlyphBoundingBox(R,D,N,$,H,W){D.top=0;const Z=$?this._config.deviceCellHeight:this._tmpCanvas.height,P=$?this._config.deviceCellWidth:N;let G=!1;for(let X=0;X<Z;X++){for(let j=0;j<P;j++){const I=X*this._tmpCanvas.width*4+4*j+3;if(R.data[I]!==0){D.top=X,G=!0;break}}if(G)break}D.left=0,G=!1;for(let X=0;X<W+P;X++){for(let j=0;j<Z;j++){const I=j*this._tmpCanvas.width*4+4*X+3;if(R.data[I]!==0){D.left=X,G=!0;break}}if(G)break}D.right=P,G=!1;for(let X=W+P-1;X>=W;X--){for(let j=0;j<Z;j++){const I=j*this._tmpCanvas.width*4+4*X+3;if(R.data[I]!==0){D.right=X,G=!0;break}}if(G)break}D.bottom=Z,G=!1;for(let X=Z-1;X>=0;X--){for(let j=0;j<P;j++){const I=X*this._tmpCanvas.width*4+4*j+3;if(R.data[I]!==0){D.bottom=X,G=!0;break}}if(G)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:D.right-D.left+1,y:D.bottom-D.top+1},sizeClipSpace:{x:D.right-D.left+1,y:D.bottom-D.top+1},offset:{x:-D.left+W+($||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-D.top+W+($||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=w;class A{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,D,N){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],N)for(const $ of N)this._glyphs.push(...$.glyphs),this._usedPixels+=$._usedPixels;this.canvas=E(R,D,D),this.ctx=(0,d.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function T(L,R,D,N){const $=R.rgba>>>24,H=R.rgba>>>16&255,W=R.rgba>>>8&255,Z=D.rgba>>>24,P=D.rgba>>>16&255,G=D.rgba>>>8&255,X=Math.floor((Math.abs($-Z)+Math.abs(H-P)+Math.abs(W-G))/12);let j=!0;for(let I=0;I<L.data.length;I+=4)L.data[I]===$&&L.data[I+1]===H&&L.data[I+2]===W||N&&Math.abs(L.data[I]-$)+Math.abs(L.data[I+1]-H)+Math.abs(L.data[I+2]-W)<X?L.data[I+3]=0:j=!1;return j}function E(L,R,D){const N=L.createElement("canvas");return N.width=R,N.height=D,N}},577:function(l,s,c){var u=this&&this.__decorate||function(v,y,C,w){var A,T=arguments.length,E=T<3?y:w===null?w=Object.getOwnPropertyDescriptor(y,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,y,C,w);else for(var L=v.length-1;L>=0;L--)(A=v[L])&&(E=(T<3?A(E):T>3?A(y,C,E):A(y,C))||E);return T>3&&E&&Object.defineProperty(y,C,E),E},f=this&&this.__param||function(v,y){return function(C,w){y(C,w,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const d=c(147),g=c(855),p=c(782),x=c(97);class b extends d.AttributeData{constructor(y,C,w){super(),this.content=0,this.combinedData="",this.fg=y.fg,this.bg=y.bg,this.combinedData=C,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(y){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=b;let _=s.CharacterJoinerService=class B6{constructor(y){this._bufferService=y,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(y){const C={id:this._nextCharacterJoinerId++,handler:y};return this._characterJoiners.push(C),C.id}deregister(y){for(let C=0;C<this._characterJoiners.length;C++)if(this._characterJoiners[C].id===y)return this._characterJoiners.splice(C,1),!0;return!1}getJoinedCharacters(y){if(this._characterJoiners.length===0)return[];const C=this._bufferService.buffer.lines.get(y);if(!C||C.length===0)return[];const w=[],A=C.translateToString(!0);let T=0,E=0,L=0,R=C.getFg(0),D=C.getBg(0);for(let N=0;N<C.getTrimmedLength();N++)if(C.loadCell(N,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==D){if(N-T>1){const $=this._getJoinedRanges(A,L,E,C,T);for(let H=0;H<$.length;H++)w.push($[H])}T=N,L=E,R=this._workCell.fg,D=this._workCell.bg}E+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-T>1){const N=this._getJoinedRanges(A,L,E,C,T);for(let $=0;$<N.length;$++)w.push(N[$])}return w}_getJoinedRanges(y,C,w,A,T){const E=y.substring(C,w);let L=[];try{L=this._characterJoiners[0].handler(E)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const D=this._characterJoiners[R].handler(E);for(let N=0;N<D.length;N++)B6._mergeRanges(L,D[N])}catch(D){console.error(D)}return this._stringRangesToCellRanges(L,A,T),L}_stringRangesToCellRanges(y,C,w){let A=0,T=!1,E=0,L=y[A];if(L){for(let R=w;R<this._bufferService.cols;R++){const D=C.getWidth(R),N=C.getString(R).length||g.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!T&&L[0]<=E&&(L[0]=R,T=!0),L[1]<=E){if(L[1]=R,L=y[++A],!L)break;L[0]<=E?(L[0]=R,T=!0):T=!1}E+=N}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(y,C){let w=!1;for(let A=0;A<y.length;A++){const T=y[A];if(w){if(C[1]<=T[0])return y[A-1][1]=C[1],y;if(C[1]<=T[1])return y[A-1][1]=Math.max(C[1],T[1]),y.splice(A,1),y;y.splice(A,1),A--}else{if(C[1]<=T[0])return y.splice(A,0,C),y;if(C[1]<=T[1])return T[0]=Math.min(C[0],T[0]),y;C[0]<T[1]&&(T[0]=Math.min(C[0],T[0]),w=!0)}}return w?y[y.length-1][1]=C[1]:y.push(C),y}};s.CharacterJoinerService=_=u([f(0,x.IBufferService)],_)},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,u=0,f=0,d=0;var g,p,x,b,_;function v(C){const w=C.toString(16);return w.length<2?"0"+w:w}function y(C,w){return C<w?(w+.05)/(C+.05):(C+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(C){C.toCss=function(w,A,T,E){return E!==void 0?`#${v(w)}${v(A)}${v(T)}${v(E)}`:`#${v(w)}${v(A)}${v(T)}`},C.toRgba=function(w,A,T,E=255){return(w<<24|A<<16|T<<8|E)>>>0},C.toColor=function(w,A,T,E){return{css:C.toCss(w,A,T,E),rgba:C.toRgba(w,A,T,E)}}})(g||(s.channels=g={})),(function(C){function w(A,T){return d=Math.round(255*T),[c,u,f]=_.toChannels(A.rgba),{css:g.toCss(c,u,f,d),rgba:g.toRgba(c,u,f,d)}}C.blend=function(A,T){if(d=(255&T.rgba)/255,d===1)return{css:T.css,rgba:T.rgba};const E=T.rgba>>24&255,L=T.rgba>>16&255,R=T.rgba>>8&255,D=A.rgba>>24&255,N=A.rgba>>16&255,$=A.rgba>>8&255;return c=D+Math.round((E-D)*d),u=N+Math.round((L-N)*d),f=$+Math.round((R-$)*d),{css:g.toCss(c,u,f),rgba:g.toRgba(c,u,f)}},C.isOpaque=function(A){return(255&A.rgba)==255},C.ensureContrastRatio=function(A,T,E){const L=_.ensureContrastRatio(A.rgba,T.rgba,E);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},C.opaque=function(A){const T=(255|A.rgba)>>>0;return[c,u,f]=_.toChannels(T),{css:g.toCss(c,u,f),rgba:T}},C.opacity=w,C.multiplyOpacity=function(A,T){return d=255&A.rgba,w(A,d*T/255)},C.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(p||(s.color=p={})),(function(C){let w,A;try{const T=document.createElement("canvas");T.width=1,T.height=1;const E=T.getContext("2d",{willReadFrequently:!0});E&&(w=E,w.globalCompositeOperation="copy",A=w.createLinearGradient(0,0,1,1))}catch{}C.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),g.toColor(c,u,f);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),u=parseInt(T.slice(2,3).repeat(2),16),f=parseInt(T.slice(3,4).repeat(2),16),d=parseInt(T.slice(4,5).repeat(2),16),g.toColor(c,u,f,d);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const E=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),u=parseInt(E[2]),f=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),g.toColor(c,u,f,d);if(!w||!A)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=A,w.fillStyle=T,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[c,u,f,d]=w.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,u,f,d),css:T}}})(x||(s.css=x={})),(function(C){function w(A,T,E){const L=A/255,R=T/255,D=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}C.relativeLuminance=function(A){return w(A>>16&255,A>>8&255,255&A)},C.relativeLuminance2=w})(b||(s.rgb=b={})),(function(C){function w(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($>0||H>0||W>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),W-=Math.max(0,Math.ceil(.1*W)),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}function A(T,E,L){const R=T>>24&255,D=T>>16&255,N=T>>8&255;let $=E>>24&255,H=E>>16&255,W=E>>8&255,Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));for(;Z<L&&($<255||H<255||W<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),H=Math.min(255,H+Math.ceil(.1*(255-H))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Z=y(b.relativeLuminance2($,H,W),b.relativeLuminance2(R,D,N));return($<<24|H<<16|W<<8|255)>>>0}C.blend=function(T,E){if(d=(255&E)/255,d===1)return E;const L=E>>24&255,R=E>>16&255,D=E>>8&255,N=T>>24&255,$=T>>16&255,H=T>>8&255;return c=N+Math.round((L-N)*d),u=$+Math.round((R-$)*d),f=H+Math.round((D-H)*d),g.toRgba(c,u,f)},C.ensureContrastRatio=function(T,E,L){const R=b.relativeLuminance(T>>8),D=b.relativeLuminance(E>>8);if(y(R,D)<L){if(D<R){const H=w(T,E,L),W=y(R,b.relativeLuminance(H>>8));if(W<L){const Z=A(T,E,L);return W>y(R,b.relativeLuminance(Z>>8))?H:Z}return H}const N=A(T,E,L),$=y(R,b.relativeLuminance(N>>8));if($<L){const H=w(T,E,L);return $>y(R,b.relativeLuminance(H>>8))?N:H}return N}},C.reduceLuminance=w,C.increaseLuminance=A,C.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(_||(s.rgba=_={})),s.toPaddedHex=v,s.contrastRatio=y},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,u){return c((f=>u.fire(f)))},s.runAndSubscribe=function(c,u){return u(void 0),c((f=>u(f)))}},859:(l,s)=>{function c(u){for(const f of u)f.dispose();u.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const f=this._disposables.indexOf(u);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var f;this._isDisposed||u===this._value||((f=this._value)==null||f.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},s.toDisposable=function(u){return{dispose:u}},s.disposeArray=c,s.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,d,g){this._data[f]||(this._data[f]={}),this._data[f][d]=g}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(u,f,d,g,p){this._data.get(u,f)||this._data.set(u,f,new c),this._data.get(u,f).set(d,g,p)}get(u,f,d,g){var p;return(p=this._data.get(u,f))==null?void 0:p.get(d,g)}clear(){this._data.clear()}}},399:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,u=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=c.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),s.isIpad=u==="iPad",s.isIphone=u==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),s.isLinux=u.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},385:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const u=c(399);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let x=0,b=0,_=p.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),b=Math.max(x,b),v=p.timeRemaining(),1.5*b>v)return _-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-x))}ms`),void this._start();_=v}this.clear()}}class d extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const x=Date.now()+p;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,g=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=g}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=u},782:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const u=c(133),f=c(855),d=c(147);class g extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const b=new g;return b.setFromCharData(x),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(x[f.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(x[f.CHAR_DATA_CHAR_INDEX].length===2){const _=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const v=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(_-55296)+v-56320+65536|x[f.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=x[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=g},855:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,u=0,f=c.length){let d="";for(let g=u;g<f;++g){let p=c[g];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const f=c.length;if(!f)return 0;let d=0,g=0;if(this._interim){const p=c.charCodeAt(g++);56320<=p&&p<=57343?u[d++]=1024*(this._interim-55296)+p-56320+65536:(u[d++]=this._interim,u[d++]=p),this._interim=0}for(let p=g;p<f;++p){const x=c.charCodeAt(p);if(55296<=x&&x<=56319){if(++p>=f)return this._interim=x,d;const b=c.charCodeAt(p);56320<=b&&b<=57343?u[d++]=1024*(x-55296)+b-56320+65536:(u[d++]=x,u[d++]=b)}else x!==65279&&(u[d++]=x)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const f=c.length;if(!f)return 0;let d,g,p,x,b=0,_=0,v=0;if(this.interim[0]){let w=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let T,E=0;for(;(T=63&this.interim[++E])&&E<4;)A<<=6,A|=T;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=L-E;for(;v<R;){if(v>=f)return 0;if(T=c[v++],(192&T)!=128){v--,w=!0;break}this.interim[E++]=T,A<<=6,A|=63&T}w||(L===2?A<128?v--:u[b++]=A:L===3?A<2048||A>=55296&&A<=57343||A===65279||(u[b++]=A):A<65536||A>1114111||(u[b++]=A)),this.interim.fill(0)}const y=f-4;let C=v;for(;C<f;){for(;!(!(C<y)||128&(d=c[C])||128&(g=c[C+1])||128&(p=c[C+2])||128&(x=c[C+3]));)u[b++]=d,u[b++]=g,u[b++]=p,u[b++]=x,C+=4;if(d=c[C++],d<128)u[b++]=d;else if((224&d)==192){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(_=(31&d)<<6|63&g,_<128){C--;continue}u[b++]=_}else if((240&d)==224){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(_=(15&d)<<12|(63&g)<<6|63&p,_<2048||_>=55296&&_<=57343||_===65279)continue;u[b++]=_}else if((248&d)==240){if(C>=f)return this.interim[0]=d,b;if(g=c[C++],(192&g)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,b;if(p=c[C++],(192&p)!=128){C--;continue}if(C>=f)return this.interim[0]=d,this.interim[1]=g,this.interim[2]=p,b;if(x=c[C++],(192&x)!=128){C--;continue}if(_=(7&d)<<18|(63&g)<<12|(63&p)<<6|63&x,_<65536||_>1114111)continue;u[b++]=_}}return b}}},776:function(l,s,c){var u=this&&this.__decorate||function(_,v,y,C){var w,A=arguments.length,T=A<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,v,y,C);else for(var E=_.length-1;E>=0;E--)(w=_[E])&&(T=(A<3?w(T):A>3?w(v,y,T):w(v,y))||T);return A>3&&T&&Object.defineProperty(v,y,T),T},f=this&&this.__param||function(_,v){return function(y,C){v(y,C,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const d=c(859),g=c(97),p={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,b=s.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let v=0;v<_.length;v++)typeof _[v]=="function"&&(_[v]=_[v]())}_log(_,v,y){this._evalLazyOptionalParams(y),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...y)}trace(_,...v){var y;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.trace.bind(this._optionsService.options.logger))??console.log,_,v)}debug(_,...v){var y;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.debug.bind(this._optionsService.options.logger))??console.log,_,v)}info(_,...v){var y;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.info.bind(this._optionsService.options.logger))??console.info,_,v)}warn(_,...v){var y;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.warn.bind(this._optionsService.options.logger))??console.warn,_,v)}error(_,...v){var y;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((y=this._optionsService.options.logger)==null?void 0:y.error.bind(this._optionsService.options.logger))??console.error,_,v)}};s.LogService=b=u([f(0,g.IOptionsService)],b),s.setTraceLogger=function(_){x=_},s.traceCall=function(_,v,y){if(typeof y.value!="function")throw new Error("not supported");const C=y.value;y.value=function(...w){if(x.logLevel!==g.LogLevelEnum.TRACE)return C.apply(this,w);x.trace(`GlyphRenderer#${C.name}(${w.map((T=>JSON.stringify(T))).join(", ")})`);const A=C.apply(this,w);return x.trace(`GlyphRenderer#${C.name} return`,A),A}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",u="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[u]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const d=function(g,p,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,_,v){_[c]===_?_[u].push({id:b,index:v}):(_[u]=[{id:b,index:v}],_[c]=_)})(d,g,x)};return d.toString=()=>f,s.serviceRegistry.set(f,d),d}},97:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const u=c(726);var f;s.IBufferService=(0,u.createDecorator)("BufferService"),s.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),s.ICoreService=(0,u.createDecorator)("CoreService"),s.ICharsetService=(0,u.createDecorator)("CharsetService"),s.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(f||(s.LogLevelEnum=f={})),s.ILogService=(0,u.createDecorator)("LogService"),s.IOptionsService=(0,u.createDecorator)("OptionsService"),s.IOscLinkService=(0,u.createDecorator)("OscLinkService"),s.IUnicodeService=(0,u.createDecorator)("UnicodeService"),s.IDecorationService=(0,u.createDecorator)("DecorationService")}},i={};function n(l){var s=i[l];if(s!==void 0)return s.exports;var c=i[l]={exports:{}};return r[l].call(c.exports,c,c.exports,n),c.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.CanvasAddon=void 0;const s=n(345),c=n(859),u=n(776),f=n(949);class d extends c.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var p;return(p=this._renderer)==null?void 0:p.textureAtlas}activate(p){const x=p._core;if(!p.element)return void this.register(x.onWillOpen((()=>this.activate(p))));this._terminal=p;const b=x.coreService,_=x.optionsService,v=x.screenElement,y=x.linkifier,C=x,w=C._bufferService,A=C._renderService,T=C._characterJoinerService,E=C._charSizeService,L=C._coreBrowserService,R=C._decorationService,D=C._logService,N=C._themeService;(0,u.setTraceLogger)(D),this._renderer=new f.CanvasRenderer(p,v,y,w,E,_,T,b,L,R,N),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),A.setRenderer(this._renderer),A.handleResize(w.cols,w.rows),this.register((0,c.toDisposable)((()=>{var $;A.setRenderer(this._terminal._core._createRenderer()),A.handleResize(p.cols,p.rows),($=this._renderer)==null||$.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var p;(p=this._renderer)==null||p.clearTextureAtlas()}}l.CanvasAddon=d})(),o})()))})(S_)),S_.exports}var Mz=Bz();function Rz(e={}){const{fontSize:t=14,onData:r,onResize:i,onSelectionChange:n}=e,o=F.useRef(null),l=F.useRef(null),s=F.useRef(null),c=F.useRef(()=>{}),u=F.useRef(null),[f,d]=F.useState(null),[g,p]=F.useState(null),[x,b]=F.useState(null),_=Md(A=>A.themeId),v=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<768,y=F.useCallback(()=>{var A,T;try{if(!v){(A=s.current)==null||A.fit();return}const E=l.current,L=s.current;if(!E||!L)return;const R=E._core;if(!R){L.fit();return}const D=(T=R._renderService)==null?void 0:T.dimensions;if(!D||D.css.cell.width===0||D.css.cell.height===0){L.fit();return}const N=E.element;if(!(N!=null&&N.parentElement)){L.fit();return}const $=window.getComputedStyle(N.parentElement),H=parseInt($.height),W=Math.max(0,parseInt($.width)),Z=window.getComputedStyle(N),P=H-parseInt(Z.paddingTop)-parseInt(Z.paddingBottom),G=W-parseInt(Z.paddingLeft)-parseInt(Z.paddingRight),X=Math.max(2,Math.floor(G/D.css.cell.width)),j=Math.max(1,Math.floor(P/D.css.cell.height));(E.rows!==j||E.cols!==X)&&(R._renderService.clear(),E.resize(X,j))}catch{}},[v]);c.current=y;const C=F.useCallback(A=>{var T;(T=l.current)==null||T.write(A)},[]),w=F.useCallback(()=>{var A;return((A=l.current)==null?void 0:A.getSelection())??""},[]);return F.useEffect(()=>{const A=o.current;if(!A)return;const T="'NerdFont', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Menlo', 'Consolas', monospace",E=QT(_),L=new Sz.Terminal({cursorBlink:!0,fontFamily:T,fontSize:t,scrollback:1e4,fontWeight:"normal",fontWeightBold:"bold",letterSpacing:0,lineHeight:1,allowProposedApi:!0,theme:E}),R=new Tz.FitAddon,D=new kz.SearchAddon,N=new Lz.WebLinksAddon;L.loadAddon(R),L.loadAddon(D),L.loadAddon(N),L.attachCustomKeyEventHandler(z=>{if((z.ctrlKey||z.metaKey)&&(z.key==="k"||z.key==="f"))return!1;if(z.key==="Escape"){const Y=rt.getState();if(Y.commandPaletteOpen||Y.searchBarOpen||Y.copyOverlayOpen)return!1}return!0});let $=!1;const H=z=>{var Y;(Y=z.message)!=null&&Y.includes("dimensions")&&z.preventDefault()},W=()=>{if($)return;window.addEventListener("error",H);try{L.open(A)}catch{window.removeEventListener("error",H);return}setTimeout(()=>window.removeEventListener("error",H),50);const z=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<768;if(!navigator.webdriver&&!z)try{const Q=new Mz.CanvasAddon;L.loadAddon(Q)}catch{}try{y()}catch{}const Y=A.querySelector(".xterm-screen");Y&&(Y.style.width="100%");const q=A.querySelector(".xterm-rows");if(q){q.style.width="100%",new MutationObserver(()=>{for(const ee of q.children)ee.style.width="100%"}).observe(q,{childList:!0});for(const ee of q.children)ee.style.width="100%"}};l.current=L,s.current=R,u.current=D;let Z=null;A.offsetWidth>0&&A.offsetHeight>0?W():(Z=new ResizeObserver(()=>{A.offsetWidth>0&&A.offsetHeight>0&&(Z.disconnect(),Z=null,W())}),Z.observe(A)),d(L),p(R),b(D),new FontFace("NerdFont","url(https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts@latest/patched-fonts/JetBrainsMono/Ligatures/Regular/JetBrainsMonoNerdFont-Regular.ttf)").load().then(z=>{if(!$&&(document.fonts.add(z),l.current)){l.current.options.fontFamily=T;try{c.current()}catch{}}}).catch(()=>{});let G,X=0,j=0;const I=new ResizeObserver(z=>{const Y=z[0];if(!Y||Y.contentRect.width===0||Y.contentRect.height===0)return;const q=Math.round(Y.contentRect.width),Q=Math.round(Y.contentRect.height);Math.abs(q-X)<=1&&Math.abs(Q-j)<=1||(X=q,j=Q,clearTimeout(G),G=setTimeout(()=>{try{c.current()}catch{}},150))});return I.observe(A),()=>{$=!0,clearTimeout(G),Z==null||Z.disconnect(),I.disconnect(),L.dispose(),l.current=null,s.current=null,u.current=null,d(null),p(null),b(null)}},[]),F.useEffect(()=>{let A;const T=()=>{clearTimeout(A),A=setTimeout(()=>{try{c.current()}catch{}},100)};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T),clearTimeout(A)}},[]),F.useEffect(()=>{const A=screen.orientation;if(!A)return;let T;const E=()=>{T=setTimeout(()=>{try{c.current()}catch{}},150)};return A.addEventListener("change",E),()=>{A.removeEventListener("change",E),clearTimeout(T)}},[]),F.useEffect(()=>{l.current&&(l.current.options.theme=QT(_))},[_]),F.useEffect(()=>{l.current&&(l.current.options.fontSize=t,y())},[t,y]),F.useEffect(()=>{if(!l.current||!r)return;const A=l.current.onData(r);return()=>A.dispose()},[f,r]),F.useEffect(()=>{if(!l.current||!i)return;const A=l.current.onResize(({cols:T,rows:E})=>i(T,E));return()=>A.dispose()},[f,i]),F.useEffect(()=>{if(!l.current||!n)return;const A=l.current.onSelectionChange(()=>{var E;const T=((E=l.current)==null?void 0:E.getSelection())??"";T&&n(T)});return()=>A.dispose()},[f,n]),{terminalRef:o,terminal:f,fitAddon:g,searchAddon:x,fit:y,write:C,getSelection:w}}const M6="termbeam-push-subscribed";function Dz(e){const t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/-/g,"+").replace(/_/g,"/"),i=window.atob(r);return Uint8Array.from([...i].map(n=>n.charCodeAt(0)))}async function xv(){var e;try{if(!("PushManager"in window)||!("serviceWorker"in navigator))return!1;const t=await navigator.serviceWorker.ready;if(!t.pushManager)return!1;const{publicKey:r}=await oF(),i=Dz(r),n=await t.pushManager.getSubscription();if(n){const s=(e=n.options)==null?void 0:e.applicationServerKey;let c=!0;if(s){const u=new Uint8Array(s);c=u.length===i.length&&u.every((f,d)=>f===i[d])}if(c){try{await VT(n.toJSON())}catch{}return vl(!0),!0}await n.unsubscribe()}const l=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:i})).toJSON();return await VT(l),vl(!0),!0}catch{return vl(!1),!1}}async function Oz(){var e;try{if(!("serviceWorker"in navigator))return;const r=await((e=(await navigator.serviceWorker.ready).pushManager)==null?void 0:e.getSubscription());if(!r){vl(!1);return}const i=r.endpoint;await r.unsubscribe();try{await lF(i)}catch{}}catch{}vl(!1)}function lm(){try{return localStorage.getItem(M6)==="true"}catch{return!1}}async function Nz(){var e;try{return!("serviceWorker"in navigator)||!("PushManager"in window)?!1:await((e=(await navigator.serviceWorker.ready).pushManager)==null?void 0:e.getSubscription())?(vl(!0),!0):lm()&&Notification.permission==="granted"?xv():(vl(!1),!1)}catch{return!1}}async function Iz(){try{if(Notification.permission!=="granted")return;await xv()}catch{}}function vl(e){try{localStorage.setItem(M6,String(e))}catch{}}const Dp=Object.freeze(Object.defineProperty({__proto__:null,ensurePushSubscription:Iz,initPushSubscription:xv,isPushSubscribed:Nz,isPushSubscribedSync:lm,removePushSubscription:Oz},Symbol.toStringTag,{value:"Module"}));let Bh=null;function Sv(){return Bh||(Bh=new(window.AudioContext||window.webkitAudioContext)),Bh.state==="suspended"&&Bh.resume(),Bh}document.addEventListener("click",()=>Sv(),{once:!0});document.addEventListener("touchstart",()=>Sv(),{once:!0});function Op(){try{const e=Sv(),t=e.createOscillator(),r=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,e.currentTime),r.gain.setValueAtTime(.15,e.currentTime),r.gain.exponentialRampToValueAtTime(.001,e.currentTime+.15),t.connect(r),r.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.15)}catch{}}function Np(){try{return localStorage.getItem("termbeam-notifications")!=="false"}catch{return!0}}function Fz(e){try{localStorage.setItem("termbeam-notifications",String(e))}catch{}}function wE(e){if(Np()&&Notification.permission==="granted"&&!lm())try{new Notification("Command finished in "+e,{icon:"/icons/icon-192.png",tag:"termbeam-cmd"})}catch{}}const W0=500,Pz=3e4,Hz=15e3,R6=document.title,$z=2e3,Mh=new Map;function jz(e){return e.replace(/\x1b\](?:4|10|11|12);[^\x07\x1b]*(?:\x07|\x1b\\)/g,"")}function zz(){var e;if(!document.hidden){document.title=R6;try{(e=navigator.clearAppBadge)==null||e.call(navigator)}catch{}}}document.addEventListener("visibilitychange",zz);function Uz(e){const{sessionId:t,terminal:r,onExit:i,onConnected:n}=e,o=F.useRef(null),l=F.useRef(W0),s=F.useRef(null),c=F.useRef(null),u=F.useRef(null),f=F.useRef(null),d=F.useRef(!0),g=F.useRef(null),[p,x]=F.useState(!1),[b,_]=F.useState(!1),v=F.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),c.current&&(clearInterval(c.current),c.current=null),u.current&&(clearTimeout(u.current),u.current=null)},[]),y=F.useCallback(R=>{const D=o.current;(D==null?void 0:D.readyState)===WebSocket.OPEN&&D.send(JSON.stringify({type:"input",data:R}))},[]),C=F.useRef(null),w=F.useRef(0),A=F.useRef(null),T=300,E=F.useCallback((R,D)=>{const N=()=>{const H=o.current;if((H==null?void 0:H.readyState)!==WebSocket.OPEN)return;const W=C.current;W&&W.cols===R&&W.rows===D||(C.current={cols:R,rows:D},w.current=Date.now(),H.send(JSON.stringify({type:"resize",cols:R,rows:D})))};A.current&&clearTimeout(A.current);const $=Date.now()-w.current;$>=T?N():A.current=setTimeout(()=>{A.current=null,N()},T-$)},[]);F.useEffect(()=>{if(!r||!t)return;d.current=!0;let R="",D=!1;function N(){R&&r&&(r.write(R),R=""),D=!1}function $(P){R+=P,D||(D=!0,requestAnimationFrame(N))}const H=r.onBell(()=>{if(!Np())return;const P=_t.getState();if(P.activeId!==t||document.hidden){Mh.has(t)||Op();const G=P.sessions.get(t);document.hidden&&wE((G==null?void 0:G.name)??t)}});function W(){if(!d.current)return;const P=I4(),G=new WebSocket(P);o.current=G,G.onopen=()=>{if(!d.current){G.close();return}G.send(JSON.stringify({type:"attach",sessionId:t})),l.current=W0,c.current=setInterval(()=>{G.readyState===WebSocket.OPEN&&G.send(JSON.stringify({type:"ping"}))},Hz)},G.onmessage=X=>{var I;if(o.current!==G||!d.current||!r)return;let j;try{j=JSON.parse(X.data)}catch{const z=X.data;typeof z=="string"&&z.length>0&&$(z);return}switch(j.type){case"attached":{u.current&&(clearTimeout(u.current),u.current=null),x(!0),_(!1),n==null||n(),r.cols&&r.rows&&G.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows}));const z=Mh.get(t);z&&clearTimeout(z),Mh.set(t,setTimeout(()=>Mh.delete(t),$z));break}case"replay":{R="",D=!1,r.reset(),j.data&&r.write(jz(j.data));break}case"output":{if($(j.data),Mh.has(t))break;const z=_t.getState(),Y=z.sessions.get(t);if(document.hidden&&z.activeId!==t){const q=(Y==null?void 0:Y.hasUnread)??!1;z.markUnread(t),!q&&Np()&&Op()}break}case"exit":{i==null||i(j.sessionId);break}case"notification":{if(!Np())break;const z=j.sessionName??t,Y=_t.getState();if(!document.hidden&&Y.activeId===t)break;document.hidden?(Op(),wE(z),document.title.startsWith("(●) ")||(document.title="(●) "+R6)):Et.info(`Command finished in ${z}`);break}case"error":{(I=j.message)!=null&&I.toLowerCase().includes("not found")?(d.current=!1,_t.getState().isDeleted(t)||(Et.error(j.message),i==null||i(t)),G.close()):Et.error(j.message);break}case"update-progress":{window.dispatchEvent(new MessageEvent("termbeam:ws-message",{data:X.data}));break}}},G.onclose=()=>{if(o.current!==G||(o.current=null,c.current&&(clearInterval(c.current),c.current=null),!d.current))return;u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,x(!1),_(!0)},2e3);const X=l.current;l.current=Math.min(X*2,Pz),s.current=setTimeout(W,X)},G.onerror=()=>{}}g.current=W,W();function Z(){if(document.hidden){f.current=Date.now();return}if(!d.current)return;const P=f.current?Date.now()-f.current:0;f.current=null,s.current&&(clearTimeout(s.current),s.current=null),l.current=W0;const G=o.current;if(!G||G.readyState===WebSocket.CLOSED||G.readyState===WebSocket.CLOSING){W();return}if(P>3e4){G.onclose=null,G.close(),o.current=null,x(!1),W();return}if(G.readyState===WebSocket.OPEN)try{G.send(JSON.stringify({type:"ping"}))}catch{G.onclose=null,G.close(),o.current=null,x(!1),W()}}return document.addEventListener("visibilitychange",Z),()=>{d.current=!1,v(),document.removeEventListener("visibilitychange",Z),H.dispose();const P=o.current;P&&(P.onclose=null,P.onerror=null,P.onmessage=null,P.close(),o.current=null),x(!1)}},[r,t,i,n,v]);const L=F.useCallback(()=>{var D;s.current&&(clearTimeout(s.current),s.current=null),c.current&&(clearInterval(c.current),c.current=null);const R=o.current;R&&(R.onclose=null,R.onerror=null,R.onmessage=null,R.close(),o.current=null),l.current=W0,x(!1),_(!1),(D=g.current)==null||D.call(g)},[]);return{send:y,connected:p,reconnecting:b,sendResize:E,reconnect:L,ws:o.current}}const qz="_pane_1kw18_1",Wz="_terminalContainer_1kw18_8",Yz="_scrollToBottom_1kw18_42",Gz="_exitOverlay_1kw18_66",Vz="_exitMessage_1kw18_76",Xz="_reconnectingBar_1kw18_86",Kz="_reconnectingDot_1kw18_113",Zz="_reconnectOverlay_1kw18_132",Qz="_reconnectContent_1kw18_152",Jz="_reconnectMessage_1kw18_163",eU="_reconnectActions_1kw18_168",tU="_reconnectBtn_1kw18_173",Qn={pane:qz,terminalContainer:Wz,scrollToBottom:Yz,exitOverlay:Gz,exitMessage:Vz,reconnectingBar:Xz,reconnectingDot:Kz,reconnectOverlay:Zz,reconnectContent:Qz,reconnectMessage:Jz,reconnectActions:eU,reconnectBtn:tU};function TE(e){if(!e)return!1;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function D6({sessionId:e,active:t,visible:r,fontSize:i=14}){const[n,o]=F.useState(!1),[l,s]=F.useState(!1),c=_t(Me=>Me.updateSession),u=F.useRef(null),f=F.useRef(!1),[d,g]=F.useState(!1),p=F.useRef(0),x=700,b=F.useRef(typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)),_=F.useCallback(()=>b.current&&Date.now()-p.current<x,[]),v=F.useRef(()=>{}),y=F.useRef(()=>{}),C=F.useCallback(Me=>{o(!0),c(Me,{exited:!0})},[c]),w=F.useCallback(Me=>{const{touchCtrlActive:Ie,setTouchCtrl:Fe}=rt.getState();if(Ie&&Me.length===1){const Ue=Me.toLowerCase().charCodeAt(0);if(Ue>=97&&Ue<=122){v.current(String.fromCharCode(Ue-96)),Fe(!1);return}}v.current(Me)},[]),A=F.useCallback((Me,Ie)=>{y.current(Me,Ie)},[]),T=F.useCallback(Me=>{Me&&navigator.clipboard.writeText(Me).then(()=>Et.success("Copied to clipboard"),()=>{})},[]),{terminalRef:E,terminal:L,fitAddon:R,searchAddon:D,fit:N}=Rz({fontSize:i,onData:w,onResize:A,onSelectionChange:T}),{send:$,sendResize:H,connected:W,reconnecting:Z,reconnect:P}=Uz({sessionId:e,terminal:L,onExit:C});F.useEffect(()=>{if(W&&(f.current=!0,L)){const Me=setTimeout(()=>{N(),L.refresh(0,L.rows-1),L.scrollToBottom()},200),Ie=setTimeout(()=>{_()||L.focus()},50);return()=>{clearTimeout(Me),clearTimeout(Ie)}}},[W,L,N]);const G=_t(Me=>Me.setActiveId),X=r??t;F.useEffect(()=>{if(!L||!X||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=u.current;if(!Ie)return;let Fe=0,Ue=0,dt=null;const pe=10,Te=Ge=>{Ge.touches.length===1&&(Fe=Ge.touches[0].clientX,Ue=Ge.touches[0].clientY,dt=Ge.target)},ze=Ge=>{var Yt,$t;if(!dt)return;const Ve=Ge.changedTouches[0],ot=Ve.clientX-Fe,it=Ve.clientY-Ue;if(Math.abs(ot)<pe&&Math.abs(it)<pe&&dt&&(Yt=E.current)!=null&&Yt.contains(dt)){t||G(e),p.current=Date.now(),L.focus(),($t=L.textarea)==null||$t.focus({preventScroll:!0});const Pt=L.element;if(Pt){const Mt={clientX:Fe,clientY:Ue,button:0,buttons:1,bubbles:!0,cancelable:!0};setTimeout(()=>{_()||document.activeElement===L.textarea&&(Pt.dispatchEvent(new MouseEvent("mousedown",Mt)),Pt.dispatchEvent(new MouseEvent("mouseup",{...Mt,buttons:0})))},x+150)}Ge.preventDefault()}};return Ie.addEventListener("touchstart",Te,{passive:!0,capture:!0}),Ie.addEventListener("touchend",ze,{capture:!0}),()=>{Ie.removeEventListener("touchstart",Te,{capture:!0}),Ie.removeEventListener("touchend",ze,{capture:!0})}},[L,X,t,e,G]),F.useEffect(()=>{v.current=$,y.current=H});const j=_t(Me=>Me.clearUnread),I=8e3;F.useEffect(()=>{if(W){g(!1);return}if(!f.current)return;const Me=setTimeout(()=>g(!0),I);return()=>clearTimeout(Me)},[W]),F.useEffect(()=>{t&&j(e)},[t,e,j]),F.useEffect(()=>{if(t&&L){const Me=requestAnimationFrame(()=>{N(),L.refresh(0,L.rows-1),L.scrollToBottom(),_()||L.focus()});return()=>cancelAnimationFrame(Me)}},[t,L,N,_]);const z=rt(Me=>Me.commandPaletteOpen),Y=rt(Me=>Me.searchBarOpen),q=rt(Me=>Me.sidePanelOpen),Q=rt(Me=>Me.copyOverlayOpen),ee=z||Y||q||Q,te=F.useRef(ee);F.useEffect(()=>{te.current&&!ee&&t&&L&&(_()||requestAnimationFrame(()=>L.focus())),te.current=ee},[ee,t,L,_]);const re=F.useRef(!1);F.useEffect(()=>{if(!L||!t)return;const Me=L.buffer.onBufferChange(Ie=>{const Fe=Ie.type==="alternate";re.current&&!Fe&&(_()||requestAnimationFrame(()=>{var Ue;L.focus(),(Ue=L.textarea)==null||Ue.focus({preventScroll:!0})})),re.current=Fe});return()=>Me.dispose()},[L,t,_]);const{keyboardOpen:K}=om(),ce=F.useRef(0),ne=F.useRef(K);F.useEffect(()=>{ne.current!==K&&(ce.current=Date.now(),ne.current=K)},[K]),F.useEffect(()=>{if(!L||!t||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=L.textarea;if(!Ie)return;let Fe=null;const Ue=dt=>{const{commandPaletteOpen:pe,searchBarOpen:Te,sidePanelOpen:ze,copyOverlayOpen:Ge}=rt.getState();if(pe||Te||ze||Ge)return;const Ve=dt.relatedTarget??null;TE(Ve)||Date.now()-ce.current<x||Date.now()-p.current<x||(Fe&&clearTimeout(Fe),Fe=setTimeout(()=>{Fe=null,!(Date.now()-ce.current<x)&&(Date.now()-p.current<x||TE(document.activeElement)||document.activeElement!==Ie&&Ie.focus({preventScroll:!0}))},50))};return Ie.addEventListener("blur",Ue),()=>{Ie.removeEventListener("blur",Ue),Fe&&clearTimeout(Fe)}},[L,t]);const de=F.useRef(!0),_e=F.useRef(null),Be=F.useRef(null),De=F.useRef(!1);F.useEffect(()=>{if(!L)return;const Me=L.element,Ie=()=>{De.current||_e.current||(_e.current=setTimeout(()=>{_e.current=null;const pe=L.buffer.active,Te=pe.viewportY>=pe.baseY;de.current=Te,s(!Te)},100))},Fe=L.onScroll(Ie);Me==null||Me.addEventListener("wheel",Ie,{passive:!0});const Ue=(Me==null?void 0:Me.querySelector(".xterm-viewport"))??null;Ue==null||Ue.addEventListener("scroll",Ie,{passive:!0});const dt=L.onWriteParsed(()=>{de.current&&Be.current===null&&(Be.current=requestAnimationFrame(()=>{Be.current=null;const pe=L.buffer.active;pe.viewportY<pe.baseY&&(De.current=!0,L.scrollToBottom(),De.current=!1)}))});return()=>{Fe.dispose(),dt.dispose(),_e.current&&clearTimeout(_e.current),Be.current!==null&&cancelAnimationFrame(Be.current),Me==null||Me.removeEventListener("wheel",Ie),Ue==null||Ue.removeEventListener("scroll",Ie)}},[L]),F.useEffect(()=>{L&&c(e,{term:L,fitAddon:R,searchAddon:D,connected:W,send:$})},[L,R,D,W,$,e,c]),F.useEffect(()=>{const Me=u.current;if(!Me)return;let Ie=0,Fe=0,Ue=!1,dt=null;function pe(Ve){const ot=Ve[0],it=Ve[1],Yt=ot.clientX-it.clientX,$t=ot.clientY-it.clientY;return Math.sqrt(Yt*Yt+$t*$t)}function Te(Ve){Ve.touches.length===2&&(Ue=!0,Ie=pe(Ve.touches),Fe=rt.getState().fontSize)}function ze(Ve){if(!Ue||Ve.touches.length!==2)return;Ve.preventDefault(),Ve.stopPropagation();const it=pe(Ve.touches)/Ie,Yt=Math.round(Fe*it);dt&&clearTimeout(dt),dt=setTimeout(()=>{rt.getState().setFontSize(Yt)},50)}function Ge(){Ue=!1}return Me.addEventListener("touchstart",Te,{passive:!0,capture:!0}),Me.addEventListener("touchmove",ze,{passive:!1,capture:!0}),Me.addEventListener("touchend",Ge,{capture:!0}),Me.addEventListener("touchcancel",Ge,{capture:!0}),()=>{Me.removeEventListener("touchstart",Te,{capture:!0}),Me.removeEventListener("touchmove",ze,{capture:!0}),Me.removeEventListener("touchend",Ge,{capture:!0}),Me.removeEventListener("touchcancel",Ge,{capture:!0}),dt&&clearTimeout(dt)}},[]),F.useEffect(()=>{if(!L||!("ontouchstart"in window||navigator.maxTouchPoints>0))return;const Ie=E.current;if(!Ie)return;const Fe=L.element;if(!Fe)return;const Ue=Fe.querySelector(".xterm-viewport");if(!Ue)return;const dt=Ue;let pe=0,Te=0,ze=0,Ge=0,Ve=!1;function ot(){return L.buffer.active.type==="alternate"}function it(Er){const ri=new WheelEvent("wheel",{deltaY:Er,deltaMode:WheelEvent.DOM_DELTA_PIXEL,bubbles:!0,cancelable:!0});dt.dispatchEvent(ri)}const Yt=4;let $t=0,Pt=!1;function Mt(Er){Er.touches.length===1&&(cancelAnimationFrame(Ge),Ve=!0,Pt=!1,$t=Er.touches[0].clientY,pe=$t,Te=performance.now(),ze=0,Er.stopPropagation())}function zr(Er){if(!Ve||Er.touches.length!==1){Ve=!1;return}const ri=Er.touches[0].clientY;if(!Pt){if(Math.abs(ri-$t)<Yt)return;Pt=!0}Er.stopPropagation(),Er.preventDefault();const ur=performance.now(),Gt=ur-Te,ae=pe-ri;Math.abs(ae)>=1&&(ot()?it(ae):(Gt>0&&(ze=ae/Gt),dt.scrollTop+=ae,de.current=!1),pe=ri,Te=ur)}function vr(){ze*=.96,!(Math.abs(ze)<.05)&&(dt.scrollTop+=ze*16,Ge=requestAnimationFrame(vr))}function Zr(){Ve&&(Ve=!1,Pt&&!ot()&&Math.abs(ze)>.15&&(Ge=requestAnimationFrame(vr)))}return Ie.addEventListener("touchstart",Mt,{capture:!0,passive:!1}),Ie.addEventListener("touchmove",zr,{capture:!0,passive:!1}),Ie.addEventListener("touchend",Zr,{capture:!0}),Ie.addEventListener("touchcancel",Zr,{capture:!0}),()=>{cancelAnimationFrame(Ge),Ie.removeEventListener("touchstart",Mt,{capture:!0}),Ie.removeEventListener("touchmove",zr,{capture:!0}),Ie.removeEventListener("touchend",Zr,{capture:!0}),Ie.removeEventListener("touchcancel",Zr,{capture:!0})}},[L]),F.useEffect(()=>{if(L&&(r??t)){const Ie=setTimeout(()=>{N(),L.refresh(0,L.rows-1),K&&L.scrollToBottom()},K?320:16);return()=>clearTimeout(Ie)}},[K,L,N,r,t]),F.useEffect(()=>{if(!t)return;function Me(Ie){var Ue;const Fe=(Ue=Ie.clipboardData)==null?void 0:Ue.items;if(Fe){for(const dt of Array.from(Fe))if(dt.type.startsWith("image/")){Ie.preventDefault(),Ie.stopPropagation();const pe=dt.getAsFile();if(!pe)return;const Te=Et.loading("Uploading image... 0%");mv(pe,dt.type,ze=>{Et.loading(`Uploading image... ${ze}%`,{id:Te})}).then(ze=>{const Ge=ze.path;Ge&&v.current(Ge+" "),Et.success("Image uploaded",{id:Te})}).catch(()=>{Et.error("Image upload failed",{id:Te})});return}}}return document.addEventListener("paste",Me,!0),()=>document.removeEventListener("paste",Me,!0)},[t]);const Ze=F.useCallback(Me=>{Me.preventDefault(),Me.stopPropagation(),L&&(De.current=!0,L.scrollToBottom(),De.current=!1,de.current=!0,s(!1))},[L]),kt=F.useCallback(()=>{L==null||L.clear(),L==null||L.focus(),P()},[L,P]),Je=F.useCallback(()=>{var Me;t||G(e),!_()&&(b.current&&(p.current=Date.now()),L==null||L.focus(),(Me=L==null?void 0:L.textarea)==null||Me.focus({preventScroll:!0}))},[L,t,e,G,_]),st=!W&&!n&&f.current,At=st&&Z&&!d,ut=st&&(!Z||d);return k.jsxs("div",{ref:u,className:Qn.pane,"data-testid":"terminal-pane",onClick:Je,...r??t?{"data-visible":"true"}:{},children:[k.jsx("div",{ref:E,className:Qn.terminalContainer}),l&&k.jsx("button",{className:Qn.scrollToBottom,onClick:Ze,tabIndex:-1,"aria-label":"Scroll to bottom",children:"↓"}),At&&k.jsxs("div",{className:Qn.reconnectingBar,"data-testid":"reconnecting-indicator",children:[k.jsx("span",{className:Qn.reconnectingDot}),k.jsx("span",{children:"Reconnecting…"})]}),ut&&k.jsx("div",{className:Qn.reconnectOverlay,"data-testid":"reconnect-overlay",children:k.jsxs("div",{className:Qn.reconnectContent,children:[k.jsx("span",{className:Qn.reconnectMessage,children:"Session disconnected"}),k.jsxs("div",{className:Qn.reconnectActions,children:[k.jsx("a",{href:"/",className:Qn.reconnectBtn,children:"Sessions"}),k.jsx("button",{className:Qn.reconnectBtn,onClick:kt,children:"Reconnect"})]})]})}),n&&k.jsx("div",{className:Qn.exitOverlay,children:k.jsx("span",{className:Qn.exitMessage,children:"Session ended"})})]})}function EE(e){const t=[],r=String(e||"");let i=r.indexOf(","),n=0,o=!1;for(;!o;){i===-1&&(i=r.length,o=!0);const l=r.slice(n,i).trim();(l||!o)&&t.push(l),n=i+1,i=r.indexOf(",",n)}return t}function O6(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const rU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nU={};function kE(e,t){return(nU.jsx?iU:rU).test(e)}const sU=/[ \t\n\f\r]/g;function aU(e){return typeof e=="object"?e.type==="text"?AE(e.value):!1:AE(e)}function AE(e){return e.replace(sU,"")===""}class nf{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}nf.prototype.normal={};nf.prototype.property={};nf.prototype.space=void 0;function N6(e,t){const r={},i={};for(const n of e)Object.assign(r,n.property),Object.assign(i,n.normal);return new nf(r,i,t)}function Od(e){return e.toLowerCase()}class jn{constructor(t,r){this.attribute=r,this.property=t}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let oU=0;const Qt=Il(),Li=Il(),qb=Il(),Ye=Il(),Wr=Il(),Uc=Il(),rs=Il();function Il(){return 2**++oU}const Wb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qt,booleanish:Li,commaOrSpaceSeparated:rs,commaSeparated:Uc,number:Ye,overloadedBoolean:qb,spaceSeparated:Wr},Symbol.toStringTag,{value:"Module"})),w_=Object.keys(Wb);class wv extends jn{constructor(t,r,i,n){let o=-1;if(super(t,r),LE(this,"space",n),typeof i=="number")for(;++o<w_.length;){const l=w_[o];LE(this,w_[o],(i&Wb[l])===Wb[l])}}}wv.prototype.defined=!0;function LE(e,t,r){r&&(e[t]=r)}function Su(e){const t={},r={};for(const[i,n]of Object.entries(e.properties)){const o=new wv(i,e.transform(e.attributes||{},i),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,r[Od(i)]=i,r[Od(o.attribute)]=i}return new nf(t,r,e.space)}const I6=Su({properties:{ariaActiveDescendant:null,ariaAtomic:Li,ariaAutoComplete:null,ariaBusy:Li,ariaChecked:Li,ariaColCount:Ye,ariaColIndex:Ye,ariaColSpan:Ye,ariaControls:Wr,ariaCurrent:null,ariaDescribedBy:Wr,ariaDetails:null,ariaDisabled:Li,ariaDropEffect:Wr,ariaErrorMessage:null,ariaExpanded:Li,ariaFlowTo:Wr,ariaGrabbed:Li,ariaHasPopup:null,ariaHidden:Li,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wr,ariaLevel:Ye,ariaLive:null,ariaModal:Li,ariaMultiLine:Li,ariaMultiSelectable:Li,ariaOrientation:null,ariaOwns:Wr,ariaPlaceholder:null,ariaPosInSet:Ye,ariaPressed:Li,ariaReadOnly:Li,ariaRelevant:null,ariaRequired:Li,ariaRoleDescription:Wr,ariaRowCount:Ye,ariaRowIndex:Ye,ariaRowSpan:Ye,ariaSelected:Li,ariaSetSize:Ye,ariaSort:null,ariaValueMax:Ye,ariaValueMin:Ye,ariaValueNow:Ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function F6(e,t){return t in e?e[t]:t}function P6(e,t){return F6(e,t.toLowerCase())}const lU=Su({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Uc,acceptCharset:Wr,accessKey:Wr,action:null,allow:null,allowFullScreen:Qt,allowPaymentRequest:Qt,allowUserMedia:Qt,alt:null,as:null,async:Qt,autoCapitalize:null,autoComplete:Wr,autoFocus:Qt,autoPlay:Qt,blocking:Wr,capture:null,charSet:null,checked:Qt,cite:null,className:Wr,cols:Ye,colSpan:null,content:null,contentEditable:Li,controls:Qt,controlsList:Wr,coords:Ye|Uc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qt,defer:Qt,dir:null,dirName:null,disabled:Qt,download:qb,draggable:Li,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qt,formTarget:null,headers:Wr,height:Ye,hidden:qb,high:Ye,href:null,hrefLang:null,htmlFor:Wr,httpEquiv:Wr,id:null,imageSizes:null,imageSrcSet:null,inert:Qt,inputMode:null,integrity:null,is:null,isMap:Qt,itemId:null,itemProp:Wr,itemRef:Wr,itemScope:Qt,itemType:Wr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qt,low:Ye,manifest:null,max:null,maxLength:Ye,media:null,method:null,min:null,minLength:Ye,multiple:Qt,muted:Qt,name:null,nonce:null,noModule:Qt,noValidate:Qt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Qt,optimum:Ye,pattern:null,ping:Wr,placeholder:null,playsInline:Qt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qt,referrerPolicy:null,rel:Wr,required:Qt,reversed:Qt,rows:Ye,rowSpan:Ye,sandbox:Wr,scope:null,scoped:Qt,seamless:Qt,selected:Qt,shadowRootClonable:Qt,shadowRootDelegatesFocus:Qt,shadowRootMode:null,shape:null,size:Ye,sizes:null,slot:null,span:Ye,spellCheck:Li,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ye,step:null,style:null,tabIndex:Ye,target:null,title:null,translate:null,type:null,typeMustMatch:Qt,useMap:null,value:Li,width:Ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wr,axis:null,background:null,bgColor:null,border:Ye,borderColor:null,bottomMargin:Ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qt,declare:Qt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ye,leftMargin:Ye,link:null,longDesc:null,lowSrc:null,marginHeight:Ye,marginWidth:Ye,noResize:Qt,noHref:Qt,noShade:Qt,noWrap:Qt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ye,rules:null,scheme:null,scrolling:Li,standby:null,summary:null,text:null,topMargin:Ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qt,disableRemotePlayback:Qt,prefix:null,property:null,results:Ye,security:null,unselectable:null},space:"html",transform:P6}),cU=Su({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rs,accentHeight:Ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ye,amplitude:Ye,arabicForm:null,ascent:Ye,attributeName:null,attributeType:null,azimuth:Ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ye,by:null,calcMode:null,capHeight:Ye,className:Wr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ye,diffuseConstant:Ye,direction:null,display:null,dur:null,divisor:Ye,dominantBaseline:null,download:Qt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ye,enableBackground:null,end:null,event:null,exponent:Ye,externalResourcesRequired:null,fill:null,fillOpacity:Ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Uc,g2:Uc,glyphName:Uc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ye,horizOriginX:Ye,horizOriginY:Ye,id:null,ideographic:Ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ye,k:Ye,k1:Ye,k2:Ye,k3:Ye,k4:Ye,kernelMatrix:rs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ye,overlineThickness:Ye,paintOrder:null,panose1:null,path:null,pathLength:Ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ye,pointsAtY:Ye,pointsAtZ:Ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rs,rev:rs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rs,requiredFeatures:rs,requiredFonts:rs,requiredFormats:rs,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ye,specularExponent:Ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ye,strikethroughThickness:Ye,string:null,stroke:null,strokeDashArray:rs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ye,strokeOpacity:Ye,strokeWidth:null,style:null,surfaceScale:Ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rs,tabIndex:Ye,tableValues:null,target:null,targetX:Ye,targetY:Ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ye,underlineThickness:Ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ye,values:null,vAlphabetic:Ye,vMathematical:Ye,vectorEffect:null,vHanging:Ye,vIdeographic:Ye,version:null,vertAdvY:Ye,vertOriginX:Ye,vertOriginY:Ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F6}),H6=Su({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$6=Su({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:P6}),j6=Su({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},hU=/[A-Z]/g,BE=/-[a-z]/g,dU=/^data[-\w.:]+$/i;function cm(e,t){const r=Od(t);let i=t,n=jn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&dU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(BE,pU);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!BE.test(o)){let l=o.replace(hU,fU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}n=wv}return new n(i,t)}function fU(e){return"-"+e.toLowerCase()}function pU(e){return e.charAt(1).toUpperCase()}const sf=N6([I6,lU,H6,$6,j6],"html"),Ho=N6([I6,cU,H6,$6,j6],"svg");function ME(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function z6(e){return e.join(" ").trim()}var Tc={},T_,RE;function gU(){if(RE)return T_;RE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,n=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
103
103
  `,u="/",f="*",d="",g="comment",p="declaration";function x(_,v){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];v=v||{};var y=1,C=1;function w(W){var Z=W.match(t);Z&&(y+=Z.length);var P=W.lastIndexOf(c);C=~P?W.length-P:C+W.length}function A(){var W={line:y,column:C};return function(Z){return Z.position=new T(W),R(),Z}}function T(W){this.start=W,this.end={line:y,column:C},this.source=v.source}T.prototype.content=_;function E(W){var Z=new Error(v.source+":"+y+":"+C+": "+W);if(Z.reason=W,Z.filename=v.source,Z.line=y,Z.column=C,Z.source=_,!v.silent)throw Z}function L(W){var Z=W.exec(_);if(Z){var P=Z[0];return w(P),_=_.slice(P.length),Z}}function R(){L(r)}function D(W){var Z;for(W=W||[];Z=N();)Z!==!1&&W.push(Z);return W}function N(){var W=A();if(!(u!=_.charAt(0)||f!=_.charAt(1))){for(var Z=2;d!=_.charAt(Z)&&(f!=_.charAt(Z)||u!=_.charAt(Z+1));)++Z;if(Z+=2,d===_.charAt(Z-1))return E("End of comment missing");var P=_.slice(2,Z-2);return C+=2,w(P),_=_.slice(Z),C+=2,W({type:g,comment:P})}}function $(){var W=A(),Z=L(i);if(Z){if(N(),!L(n))return E("property missing ':'");var P=L(o),G=W({type:p,property:b(Z[0].replace(e,d)),value:P?b(P[0].replace(e,d)):d});return L(l),G}}function H(){var W=[];D(W);for(var Z;Z=$();)Z!==!1&&(W.push(Z),D(W));return W}return R(),H()}function b(_){return _?_.replace(s,d):d}return T_=x,T_}var DE;function mU(){if(DE)return Tc;DE=1;var e=Tc&&Tc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=r;const t=e(gU());function r(i,n){let o=null;if(!i||typeof i!="string")return o;const l=(0,t.default)(i),s=typeof n=="function";return l.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:f}=c;s?n(u,f,c):f&&(o=o||{},o[u]=f)}),o}return Tc}var Rh={},OE;function _U(){if(OE)return Rh;OE=1,Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,n=/^-(ms)-/,o=function(u){return!u||r.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},s=function(u,f){return"".concat(f,"-")},c=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(n,s):u=u.replace(i,s),u.replace(t,l))};return Rh.camelCase=c,Rh}var Dh,NE;function bU(){if(NE)return Dh;NE=1;var e=Dh&&Dh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},t=e(mU()),r=_U();function i(n,o){var l={};return!n||typeof n!="string"||(0,t.default)(n,function(s,c){s&&c&&(l[(0,r.camelCase)(s,o)]=c)}),l}return i.default=i,Dh=i,Dh}var yU=bU();const vU=Ol(yU),um=U6("end"),sa=U6("start");function U6(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function CU(e){const t=sa(e),r=um(e);if(t&&r)return{start:t,end:r}}function dd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?IE(e.position):"start"in e||"end"in e?IE(e):"line"in e||"column"in e?Yb(e):""}function Yb(e){return FE(e&&e.line)+":"+FE(e&&e.column)}function IE(e){return Yb(e&&e.start)+"-"+Yb(e&&e.end)}function FE(e){return e&&typeof e=="number"?e:1}class un extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let n="",o={},l=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof t=="string"?n=t:!o.cause&&t&&(l=!0,n=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?o.ruleId=i:(o.source=i.slice(0,c),o.ruleId=i.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=s?s.line:void 0,this.name=dd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}un.prototype.file="";un.prototype.name="";un.prototype.reason="";un.prototype.message="";un.prototype.stack="";un.prototype.column=void 0;un.prototype.line=void 0;un.prototype.ancestors=void 0;un.prototype.cause=void 0;un.prototype.fatal=void 0;un.prototype.place=void 0;un.prototype.ruleId=void 0;un.prototype.source=void 0;const Tv={}.hasOwnProperty,xU=new Map,SU=/[A-Z]/g,wU=new Set(["table","tbody","thead","tfoot","tr"]),TU=new Set(["td","th"]),q6="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function EU(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=OU(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=DU(r,t.jsx,t.jsxs)}const n={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ho:sf,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=W6(n,e,void 0);return o&&typeof o!="string"?o:n.create(e,n.Fragment,{children:o||void 0},void 0)}function W6(e,t,r){if(t.type==="element")return kU(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BU(e,t,r);if(t.type==="mdxjsEsm")return LU(e,t);if(t.type==="root")return MU(e,t,r);if(t.type==="text")return RU(e,t)}function kU(e,t,r){const i=e.schema;let n=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(n=Ho,e.schema=n),e.ancestors.push(t);const o=G6(e,t.tagName,!1),l=NU(e,t);let s=kv(e,t);return wU.has(t.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!aU(c):!0})),Y6(e,l,o,t),Ev(l,s),e.ancestors.pop(),e.schema=i,e.create(t,o,l,r)}function AU(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Nd(e,t.position)}function LU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nd(e,t.position)}function BU(e,t,r){const i=e.schema;let n=i;t.name==="svg"&&i.space==="html"&&(n=Ho,e.schema=n),e.ancestors.push(t);const o=t.name===null?e.Fragment:G6(e,t.name,!0),l=IU(e,t),s=kv(e,t);return Y6(e,l,o,t),Ev(l,s),e.ancestors.pop(),e.schema=i,e.create(t,o,l,r)}function MU(e,t,r){const i={};return Ev(i,kv(e,t)),e.create(t,e.Fragment,i,r)}function RU(e,t){return t.value}function Y6(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function Ev(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function DU(e,t,r){return i;function i(n,o,l,s){const u=Array.isArray(l.children)?r:t;return s?u(o,l,s):u(o,l)}}function OU(e,t){return r;function r(i,n,o,l){const s=Array.isArray(o.children),c=sa(i);return t(n,o,l,s,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function NU(e,t){const r={};let i,n;for(n in t.properties)if(n!=="children"&&Tv.call(t.properties,n)){const o=FU(e,n,t.properties[n]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&TU.has(t.tagName)?i=s:r[l]=s}}if(i){const o=r.style||(r.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function IU(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else Nd(e,t.position);else{const n=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const s=i.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Nd(e,t.position);else o=i.value===null?!0:i.value;r[n]=o}return r}function kv(e,t){const r=[];let i=-1;const n=e.passKeys?new Map:xU;for(;++i<t.children.length;){const o=t.children[i];let l;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const u=n.get(c)||0;l=c+"-"+u,n.set(c,u+1)}}const s=W6(e,o,l);s!==void 0&&r.push(s)}return r}function FU(e,t,r){const i=cm(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?O6(r):z6(r)),i.property==="style"){let n=typeof r=="object"?r:PU(e,String(r));return e.stylePropertyNameCase==="css"&&(n=HU(n)),["style",n]}return[e.elementAttributeNameCase==="react"&&i.space?uU[i.property]||i.property:i.attribute,r]}}function PU(e,t){try{return vU(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,n=new un("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=q6+"#cannot-parse-style-attribute",n}}function G6(e,t,r){let i;if(!r)i={type:"Literal",value:t};else if(t.includes(".")){const n=t.split(".");let o=-1,l;for(;++o<n.length;){const s=kE(n[o])?{type:"Identifier",name:n[o]}:{type:"Literal",value:n[o]};l=l?{type:"MemberExpression",object:l,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}i=l}else i=kE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const n=i.value;return Tv.call(e.components,n)?e.components[n]:n}if(e.evaluater)return e.evaluater.evaluateExpression(i);Nd(e)}function Nd(e,t){const r=new un("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=q6+"#cannot-handle-mdx-estrees-without-createevaluater",r}function HU(e){const t={};let r;for(r in e)Tv.call(e,r)&&(t[$U(r)]=e[r]);return t}function $U(e){let t=e.replace(SU,jU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jU(e){return"-"+e.toLowerCase()}const E_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},zU={};function Av(e,t){const r=zU,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return V6(e,i,n)}function V6(e,t,r){if(UU(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return PE(e.children,t,r)}return Array.isArray(e)?PE(e,t,r):""}function PE(e,t,r){const i=[];let n=-1;for(;++n<e.length;)i[n]=V6(e[n],t,r);return i.join("")}function UU(e){return!!(e&&typeof e=="object")}const HE=document.createElement("i");function Lv(e){const t="&"+e+";";HE.innerHTML=t;const r=HE.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function is(e,t,r,i){const n=e.length;let o=0,l;if(t<0?t=-t>n?0:n+t:t=t>n?n:t,r=r>0?r:0,i.length<1e4)l=Array.from(i),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);o<i.length;)l=i.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function ys(e,t){return e.length>0?(is(e,e.length,0,t),e):t}const $E={}.hasOwnProperty;function X6(e){const t={};let r=-1;for(;++r<e.length;)qU(t,e[r]);return t}function qU(e,t){let r;for(r in t){const n=($E.call(e,r)?e[r]:void 0)||(e[r]={}),o=t[r];let l;if(o)for(l in o){$E.call(n,l)||(n[l]=[]);const s=o[l];WU(n[l],Array.isArray(s)?s:s?[s]:[])}}}function WU(e,t){let r=-1;const i=[];for(;++r<t.length;)(t[r].add==="after"?e:i).push(t[r]);is(e,0,0,i)}function K6(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ds(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=$o(/[A-Za-z]/),ln=$o(/[\dA-Za-z]/),YU=$o(/[#-'*+\--9=?A-Z^-~]/);function ig(e){return e!==null&&(e<32||e===127)}const Gb=$o(/\d/),GU=$o(/[\dA-Fa-f]/),VU=$o(/[!-/:-@[-`{-~]/);function Lt(e){return e!==null&&e<-2}function $r(e){return e!==null&&(e<0||e===32)}function ar(e){return e===-2||e===-1||e===32}const hm=$o(new RegExp("\\p{P}|\\p{S}","u")),Tl=$o(/\s/);function $o(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function wu(e){const t=[];let r=-1,i=0,n=0;for(;++r<e.length;){const o=e.charCodeAt(r);let l="";if(o===37&&ln(e.charCodeAt(r+1))&&ln(e.charCodeAt(r+2)))n=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(r+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),n=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(i,r),encodeURIComponent(l)),i=r+n+1,l=""),n&&(r+=n,n=0)}return t.join("")+e.slice(i)}function fr(e,t,r,i){const n=i?i-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(c){return ar(c)?(e.enter(r),s(c)):t(c)}function s(c){return ar(c)&&o++<n?(e.consume(c),s):(e.exit(r),t(c))}}const XU={tokenize:KU};function KU(e){const t=e.attempt(this.parser.constructs.contentInitial,i,n);let r;return t;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),fr(e,t,"linePrefix")}function n(s){return e.enter("paragraph"),o(s)}function o(s){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Lt(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),l)}}const ZU={tokenize:QU},jE={tokenize:JU};function QU(e){const t=this,r=[];let i=0,n,o,l;return s;function s(C){if(i<r.length){const w=r[i];return t.containerState=w[1],e.attempt(w[0].continuation,c,u)(C)}return u(C)}function c(C){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,n&&y();const w=t.events.length;let A=w,T;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){T=t.events[A][1].end;break}v(i);let E=w;for(;E<t.events.length;)t.events[E][1].end={...T},E++;return is(t.events,A+1,0,t.events.slice(w)),t.events.length=E,u(C)}return s(C)}function u(C){if(i===r.length){if(!n)return g(C);if(n.currentConstruct&&n.currentConstruct.concrete)return x(C);t.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(jE,f,d)(C)}function f(C){return n&&y(),v(i),g(C)}function d(C){return t.parser.lazy[t.now().line]=i!==r.length,l=t.now().offset,x(C)}function g(C){return t.containerState={},e.attempt(jE,p,x)(C)}function p(C){return i++,r.push([t.currentConstruct,t.containerState]),g(C)}function x(C){if(C===null){n&&y(),v(0),e.consume(C);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:n,contentType:"flow",previous:o}),b(C)}function b(C){if(C===null){_(e.exit("chunkFlow"),!0),v(0),e.consume(C);return}return Lt(C)?(e.consume(C),_(e.exit("chunkFlow")),i=0,t.interrupt=void 0,s):(e.consume(C),b)}function _(C,w){const A=t.sliceStream(C);if(w&&A.push(null),C.previous=o,o&&(o.next=C),o=C,n.defineSkip(C.start),n.write(A),t.parser.lazy[C.start.line]){let T=n.events.length;for(;T--;)if(n.events[T][1].start.offset<l&&(!n.events[T][1].end||n.events[T][1].end.offset>l))return;const E=t.events.length;let L=E,R,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(R){D=t.events[L][1].end;break}R=!0}for(v(i),T=E;T<t.events.length;)t.events[T][1].end={...D},T++;is(t.events,L+1,0,t.events.slice(E)),t.events.length=T}}function v(C){let w=r.length;for(;w-- >C;){const A=r[w];t.containerState=A[1],A[0].exit.call(t,e)}r.length=C}function y(){n.write([null]),o=void 0,n=void 0,t.containerState._closeFlow=void 0}}function JU(e,t,r){return fr(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cu(e){if(e===null||$r(e)||Tl(e))return 1;if(hm(e))return 2}function dm(e,t,r){const i=[];let n=-1;for(;++n<e.length;){const o=e[n].resolveAll;o&&!i.includes(o)&&(t=o(t,r),i.push(o))}return t}const Vb={name:"attention",resolveAll:eq,tokenize:tq};function eq(e,t){let r=-1,i,n,o,l,s,c,u,f;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;c=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const d={...e[i][1].end},g={...e[r][1].start};zE(d,-c),zE(g,c),l={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:g},o={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},n={type:c>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[i][1].end={...l.start},e[r][1].start={...s.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=ys(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=ys(u,[["enter",n,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=ys(u,dm(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),u=ys(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",n,t]]),e[r][1].end.offset-e[r][1].start.offset?(f=2,u=ys(u,[["enter",e[r][1],t],["exit",e[r][1],t]])):f=0,is(e,i-1,r-i+3,u),r=i+u.length-f-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function tq(e,t){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,n=cu(i);let o;return l;function l(c){return o=c,e.enter("attentionSequence"),s(c)}function s(c){if(c===o)return e.consume(c),s;const u=e.exit("attentionSequence"),f=cu(c),d=!f||f===2&&n||r.includes(c),g=!n||n===2&&f||r.includes(i);return u._open=!!(o===42?d:d&&(n||!g)),u._close=!!(o===42?g:g&&(f||!d)),t(c)}}function zE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rq={name:"autolink",tokenize:iq};function iq(e,t,r){let i=0;return n;function n(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return _n(p)?(e.consume(p),l):p===64?r(p):u(p)}function l(p){return p===43||p===45||p===46||ln(p)?(i=1,s(p)):u(p)}function s(p){return p===58?(e.consume(p),i=0,c):(p===43||p===45||p===46||ln(p))&&i++<32?(e.consume(p),s):(i=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ig(p)?r(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),f):YU(p)?(e.consume(p),u):r(p)}function f(p){return ln(p)?d(p):r(p)}function d(p){return p===46?(e.consume(p),i=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||ln(p))&&i++<63){const x=p===45?g:d;return e.consume(p),x}return r(p)}}const af={partial:!0,tokenize:nq};function nq(e,t,r){return i;function i(o){return ar(o)?fr(e,n,"linePrefix")(o):n(o)}function n(o){return o===null||Lt(o)?t(o):r(o)}}const Z6={continuation:{tokenize:aq},exit:oq,name:"blockQuote",tokenize:sq};function sq(e,t,r){const i=this;return n;function n(l){if(l===62){const s=i.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return r(l)}function o(l){return ar(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function aq(e,t,r){const i=this;return n;function n(l){return ar(l)?fr(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Z6,t,r)(l)}}function oq(e){e.exit("blockQuote")}const Q6={name:"characterEscape",tokenize:lq};function lq(e,t,r){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),n}function n(o){return VU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(o)}}const J6={name:"characterReference",tokenize:cq};function cq(e,t,r){const i=this;let n=0,o,l;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=ln,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=GU,f):(e.enter("characterReferenceValue"),o=7,l=Gb,f(d))}function f(d){if(d===59&&n){const g=e.exit("characterReferenceValue");return l===ln&&!Lv(i.sliceSerialize(g))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(d)&&n++<o?(e.consume(d),f):r(d)}}const UE={partial:!0,tokenize:hq},qE={concrete:!0,name:"codeFenced",tokenize:uq};function uq(e,t,r){const i=this,n={partial:!0,tokenize:A};let o=0,l=0,s;return c;function c(T){return u(T)}function u(T){const E=i.events[i.events.length-1];return o=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,s=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(T)}function f(T){return T===s?(l++,e.consume(T),f):l<3?r(T):(e.exit("codeFencedFenceSequence"),ar(T)?fr(e,d,"whitespace")(T):d(T))}function d(T){return T===null||Lt(T)?(e.exit("codeFencedFence"),i.interrupt?t(T):e.check(UE,b,w)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(T))}function g(T){return T===null||Lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):ar(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),fr(e,p,"whitespace")(T)):T===96&&T===s?r(T):(e.consume(T),g)}function p(T){return T===null||Lt(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===s?r(T):(e.consume(T),x)}function b(T){return e.attempt(n,w,_)(T)}function _(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return o>0&&ar(T)?fr(e,y,"linePrefix",o+1)(T):y(T)}function y(T){return T===null||Lt(T)?e.check(UE,b,w)(T):(e.enter("codeFlowValue"),C(T))}function C(T){return T===null||Lt(T)?(e.exit("codeFlowValue"),y(T)):(e.consume(T),C)}function w(T){return e.exit("codeFenced"),t(T)}function A(T,E,L){let R=0;return D;function D(Z){return T.enter("lineEnding"),T.consume(Z),T.exit("lineEnding"),N}function N(Z){return T.enter("codeFencedFence"),ar(Z)?fr(T,$,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):$(Z)}function $(Z){return Z===s?(T.enter("codeFencedFenceSequence"),H(Z)):L(Z)}function H(Z){return Z===s?(R++,T.consume(Z),H):R>=l?(T.exit("codeFencedFenceSequence"),ar(Z)?fr(T,W,"whitespace")(Z):W(Z)):L(Z)}function W(Z){return Z===null||Lt(Z)?(T.exit("codeFencedFence"),E(Z)):L(Z)}}}function hq(e,t,r){const i=this;return n;function n(l){return l===null?r(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return i.parser.lazy[i.now().line]?r(l):t(l)}}const k_={name:"codeIndented",tokenize:fq},dq={partial:!0,tokenize:pq};function fq(e,t,r){const i=this;return n;function n(u){return e.enter("codeIndented"),fr(e,o,"linePrefix",5)(u)}function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):r(u)}function l(u){return u===null?c(u):Lt(u)?e.attempt(dq,l,c)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Lt(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function c(u){return e.exit("codeIndented"),t(u)}}function pq(e,t,r){const i=this;return n;function n(l){return i.parser.lazy[i.now().line]?r(l):Lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n):fr(e,o,"linePrefix",5)(l)}function o(l){const s=i.events[i.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):Lt(l)?n(l):r(l)}}const gq={name:"codeText",previous:_q,resolve:mq,tokenize:bq};function mq(e){let t=e.length-4,r=3,i,n;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i<t;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(i=r-1,t++;++i<=t;)n===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(n=i):(i===t||e[i][1].type==="lineEnding")&&(e[n][1].type="codeTextData",i!==n+2&&(e[n][1].end=e[i-1][1].end,e.splice(n+2,i-n-2),t-=i-n-2,i=n+2),n=void 0);return e}function _q(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bq(e,t,r){let i=0,n,o;return l;function l(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),i++,s):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?r(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(o=e.enter("codeTextSequence"),n=0,f(d)):Lt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Lt(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),n++,f):n===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",u(d))}}class yq{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const n=r||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return i&&Oh(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Oh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oh(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Oh(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oh(this.left,r.reverse())}}}function Oh(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function eA(e){const t={};let r=-1,i,n,o,l,s,c,u;const f=new yq(e);for(;++r<f.length;){for(;r in t;)r=t[r];if(i=f.get(r),r&&i[1].type==="chunkFlow"&&f.get(r-1)[1].type==="listItemPrefix"&&(c=i[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,vq(f,r)),r=t[r],u=!0);else if(i[1]._container){for(o=r,n=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(n&&(f.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;n&&(i[1].end={...f.get(n)[1].start},s=f.slice(n,r),s.unshift(i),f.splice(n,r-n+1,s))}}return is(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function vq(e,t){const r=e.get(t)[1],i=e.get(t)[2];let n=t-1;const o=[];let l=r._tokenizer;l||(l=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,c=[],u={};let f,d,g=-1,p=r,x=0,b=0;const _=[b];for(;p;){for(;e.get(++n)[1]!==p;);o.push(n),p._tokenizer||(f=i.sliceStream(p),p.next||f.push(null),d&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=r;++g<s.length;)s[g][0]==="exit"&&s[g-1][0]==="enter"&&s[g][1].type===s[g-1][1].type&&s[g][1].start.line!==s[g][1].end.line&&(b=g+1,_.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),g=_.length;g--;){const v=s.slice(_[g],_[g+1]),y=o.pop();c.push([y,y+v.length-1]),e.splice(y,2,v)}for(c.reverse(),g=-1;++g<c.length;)u[x+c[g][0]]=x+c[g][1],x+=c[g][1]-c[g][0]-1;return u}const Cq={resolve:Sq,tokenize:wq},xq={partial:!0,tokenize:Tq};function Sq(e){return eA(e),e}function wq(e,t){let r;return i;function i(s){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(s)}function n(s){return s===null?o(s):Lt(s)?e.check(xq,l,o)(s):(e.consume(s),n)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function l(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function Tq(e,t,r){const i=this;return n;function n(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),fr(e,o,"linePrefix")}function o(l){if(l===null||Lt(l))return r(l);const s=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,r,t)(l)}}function tA(e,t,r,i,n,o,l,s,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(i),e.enter(n),e.enter(o),e.consume(v),e.exit(o),g):v===null||v===32||v===41||ig(v)?r(v):(e.enter(i),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(v))}function g(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(n),e.exit(i),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(s),g(v)):v===null||v===60||Lt(v)?r(v):(e.consume(v),v===92?x:p)}function x(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function b(v){return!f&&(v===null||v===41||$r(v))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(i),t(v)):f<u&&v===40?(e.consume(v),f++,b):v===41?(e.consume(v),f--,b):v===null||v===32||v===40||ig(v)?r(v):(e.consume(v),v===92?_:b)}function _(v){return v===40||v===41||v===92?(e.consume(v),b):b(v)}}function rA(e,t,r,i,n,o){const l=this;let s=0,c;return u;function u(p){return e.enter(i),e.enter(n),e.consume(p),e.exit(n),e.enter(o),f}function f(p){return s>999||p===null||p===91||p===93&&!c||p===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?r(p):p===93?(e.exit(o),e.enter(n),e.consume(p),e.exit(n),e.exit(i),t):Lt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Lt(p)||s++>999?(e.exit("chunkString"),f(p)):(e.consume(p),c||(c=!ar(p)),p===92?g:d)}function g(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function iA(e,t,r,i,n,o){let l;return s;function s(g){return g===34||g===39||g===40?(e.enter(i),e.enter(n),e.consume(g),e.exit(n),l=g===40?41:g,c):r(g)}function c(g){return g===l?(e.enter(n),e.consume(g),e.exit(n),e.exit(i),t):(e.enter(o),u(g))}function u(g){return g===l?(e.exit(o),c(l)):g===null?r(g):Lt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),fr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===l||g===null||Lt(g)?(e.exit("chunkString"),u(g)):(e.consume(g),g===92?d:f)}function d(g){return g===l||g===92?(e.consume(g),f):f(g)}}function fd(e,t){let r;return i;function i(n){return Lt(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,i):ar(n)?fr(e,i,r?"linePrefix":"lineSuffix")(n):t(n)}}const Eq={name:"definition",tokenize:Aq},kq={partial:!0,tokenize:Lq};function Aq(e,t,r){const i=this;let n;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return rA.call(i,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return n=Ds(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):r(p)}function c(p){return $r(p)?fd(e,u)(p):u(p)}function u(p){return tA(e,f,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(kq,d,d)(p)}function d(p){return ar(p)?fr(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Lt(p)?(e.exit("definition"),i.parser.defined.push(n),t(p)):r(p)}}function Lq(e,t,r){return i;function i(s){return $r(s)?fd(e,n)(s):r(s)}function n(s){return iA(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ar(s)?fr(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Lt(s)?t(s):r(s)}}const Bq={name:"hardBreakEscape",tokenize:Mq};function Mq(e,t,r){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),n}function n(o){return Lt(o)?(e.exit("hardBreakEscape"),t(o)):r(o)}}const Rq={name:"headingAtx",resolve:Dq,tokenize:Oq};function Dq(e,t){let r=e.length-2,i=3,n,o;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},o={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},is(e,i,r-i+1,[["enter",n,t],["enter",o,t],["exit",o,t],["exit",n,t]])),e}function Oq(e,t,r){let i=0;return n;function n(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&i++<6?(e.consume(f),l):f===null||$r(f)?(e.exit("atxHeadingSequence"),s(f)):r(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||Lt(f)?(e.exit("atxHeading"),t(f)):ar(f)?fr(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||$r(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const Nq=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WE=["pre","script","style","textarea"],Iq={concrete:!0,name:"htmlFlow",resolveTo:Hq,tokenize:$q},Fq={partial:!0,tokenize:zq},Pq={partial:!0,tokenize:jq};function Hq(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $q(e,t,r){const i=this;let n,o,l,s,c;return u;function u(q){return f(q)}function f(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),d}function d(q){return q===33?(e.consume(q),g):q===47?(e.consume(q),o=!0,b):q===63?(e.consume(q),n=3,i.interrupt?t:I):_n(q)?(e.consume(q),l=String.fromCharCode(q),_):r(q)}function g(q){return q===45?(e.consume(q),n=2,p):q===91?(e.consume(q),n=5,s=0,x):_n(q)?(e.consume(q),n=4,i.interrupt?t:I):r(q)}function p(q){return q===45?(e.consume(q),i.interrupt?t:I):r(q)}function x(q){const Q="CDATA[";return q===Q.charCodeAt(s++)?(e.consume(q),s===Q.length?i.interrupt?t:$:x):r(q)}function b(q){return _n(q)?(e.consume(q),l=String.fromCharCode(q),_):r(q)}function _(q){if(q===null||q===47||q===62||$r(q)){const Q=q===47,ee=l.toLowerCase();return!Q&&!o&&WE.includes(ee)?(n=1,i.interrupt?t(q):$(q)):Nq.includes(l.toLowerCase())?(n=6,Q?(e.consume(q),v):i.interrupt?t(q):$(q)):(n=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(q):o?y(q):C(q))}return q===45||ln(q)?(e.consume(q),l+=String.fromCharCode(q),_):r(q)}function v(q){return q===62?(e.consume(q),i.interrupt?t:$):r(q)}function y(q){return ar(q)?(e.consume(q),y):D(q)}function C(q){return q===47?(e.consume(q),D):q===58||q===95||_n(q)?(e.consume(q),w):ar(q)?(e.consume(q),C):D(q)}function w(q){return q===45||q===46||q===58||q===95||ln(q)?(e.consume(q),w):A(q)}function A(q){return q===61?(e.consume(q),T):ar(q)?(e.consume(q),A):C(q)}function T(q){return q===null||q===60||q===61||q===62||q===96?r(q):q===34||q===39?(e.consume(q),c=q,E):ar(q)?(e.consume(q),T):L(q)}function E(q){return q===c?(e.consume(q),c=null,R):q===null||Lt(q)?r(q):(e.consume(q),E)}function L(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||$r(q)?A(q):(e.consume(q),L)}function R(q){return q===47||q===62||ar(q)?C(q):r(q)}function D(q){return q===62?(e.consume(q),N):r(q)}function N(q){return q===null||Lt(q)?$(q):ar(q)?(e.consume(q),N):r(q)}function $(q){return q===45&&n===2?(e.consume(q),P):q===60&&n===1?(e.consume(q),G):q===62&&n===4?(e.consume(q),z):q===63&&n===3?(e.consume(q),I):q===93&&n===5?(e.consume(q),j):Lt(q)&&(n===6||n===7)?(e.exit("htmlFlowData"),e.check(Fq,Y,H)(q)):q===null||Lt(q)?(e.exit("htmlFlowData"),H(q)):(e.consume(q),$)}function H(q){return e.check(Pq,W,Y)(q)}function W(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),Z}function Z(q){return q===null||Lt(q)?H(q):(e.enter("htmlFlowData"),$(q))}function P(q){return q===45?(e.consume(q),I):$(q)}function G(q){return q===47?(e.consume(q),l="",X):$(q)}function X(q){if(q===62){const Q=l.toLowerCase();return WE.includes(Q)?(e.consume(q),z):$(q)}return _n(q)&&l.length<8?(e.consume(q),l+=String.fromCharCode(q),X):$(q)}function j(q){return q===93?(e.consume(q),I):$(q)}function I(q){return q===62?(e.consume(q),z):q===45&&n===2?(e.consume(q),I):$(q)}function z(q){return q===null||Lt(q)?(e.exit("htmlFlowData"),Y(q)):(e.consume(q),z)}function Y(q){return e.exit("htmlFlow"),t(q)}}function jq(e,t,r){const i=this;return n;function n(l){return Lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):r(l)}function o(l){return i.parser.lazy[i.now().line]?r(l):t(l)}}function zq(e,t,r){return i;function i(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(af,t,r)}}const Uq={name:"htmlText",tokenize:qq};function qq(e,t,r){const i=this;let n,o,l;return s;function s(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),A):I===63?(e.consume(I),C):_n(I)?(e.consume(I),L):r(I)}function u(I){return I===45?(e.consume(I),f):I===91?(e.consume(I),o=0,x):_n(I)?(e.consume(I),y):r(I)}function f(I){return I===45?(e.consume(I),p):r(I)}function d(I){return I===null?r(I):I===45?(e.consume(I),g):Lt(I)?(l=d,G(I)):(e.consume(I),d)}function g(I){return I===45?(e.consume(I),p):d(I)}function p(I){return I===62?P(I):I===45?g(I):d(I)}function x(I){const z="CDATA[";return I===z.charCodeAt(o++)?(e.consume(I),o===z.length?b:x):r(I)}function b(I){return I===null?r(I):I===93?(e.consume(I),_):Lt(I)?(l=b,G(I)):(e.consume(I),b)}function _(I){return I===93?(e.consume(I),v):b(I)}function v(I){return I===62?P(I):I===93?(e.consume(I),v):b(I)}function y(I){return I===null||I===62?P(I):Lt(I)?(l=y,G(I)):(e.consume(I),y)}function C(I){return I===null?r(I):I===63?(e.consume(I),w):Lt(I)?(l=C,G(I)):(e.consume(I),C)}function w(I){return I===62?P(I):C(I)}function A(I){return _n(I)?(e.consume(I),T):r(I)}function T(I){return I===45||ln(I)?(e.consume(I),T):E(I)}function E(I){return Lt(I)?(l=E,G(I)):ar(I)?(e.consume(I),E):P(I)}function L(I){return I===45||ln(I)?(e.consume(I),L):I===47||I===62||$r(I)?R(I):r(I)}function R(I){return I===47?(e.consume(I),P):I===58||I===95||_n(I)?(e.consume(I),D):Lt(I)?(l=R,G(I)):ar(I)?(e.consume(I),R):P(I)}function D(I){return I===45||I===46||I===58||I===95||ln(I)?(e.consume(I),D):N(I)}function N(I){return I===61?(e.consume(I),$):Lt(I)?(l=N,G(I)):ar(I)?(e.consume(I),N):R(I)}function $(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(e.consume(I),n=I,H):Lt(I)?(l=$,G(I)):ar(I)?(e.consume(I),$):(e.consume(I),W)}function H(I){return I===n?(e.consume(I),n=void 0,Z):I===null?r(I):Lt(I)?(l=H,G(I)):(e.consume(I),H)}function W(I){return I===null||I===34||I===39||I===60||I===61||I===96?r(I):I===47||I===62||$r(I)?R(I):(e.consume(I),W)}function Z(I){return I===47||I===62||$r(I)?R(I):r(I)}function P(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):r(I)}function G(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),X}function X(I){return ar(I)?fr(e,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):j(I)}function j(I){return e.enter("htmlTextData"),l(I)}}const Bv={name:"labelEnd",resolveAll:Vq,resolveTo:Xq,tokenize:Kq},Wq={tokenize:Zq},Yq={tokenize:Qq},Gq={tokenize:Jq};function Vq(e){let t=-1;const r=[];for(;++t<e.length;){const i=e[t][1];if(r.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const n=i.type==="labelImage"?4:2;i.type="data",t+=n}}return e.length!==r.length&&is(e,0,e.length,r),e}function Xq(e,t){let r=e.length,i=0,n,o,l,s;for(;r--;)if(n=e[r][1],o){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;e[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(l){if(e[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(o=r,n.type!=="labelLink")){i=2;break}}else n.type==="labelEnd"&&(l=r);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[l-2][1].start}};return s=[["enter",c,t],["enter",u,t]],s=ys(s,e.slice(o+1,o+i+3)),s=ys(s,[["enter",f,t]]),s=ys(s,dm(t.parser.constructs.insideSpan.null,e.slice(o+i+4,l-3),t)),s=ys(s,[["exit",f,t],e[l-2],e[l-1],["exit",u,t]]),s=ys(s,e.slice(l+1)),s=ys(s,[["exit",c,t]]),is(e,o,e.length,s),e}function Kq(e,t,r){const i=this;let n=i.events.length,o,l;for(;n--;)if((i.events[n][1].type==="labelImage"||i.events[n][1].type==="labelLink")&&!i.events[n][1]._balanced){o=i.events[n][1];break}return s;function s(g){return o?o._inactive?d(g):(l=i.parser.defined.includes(Ds(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),c):r(g)}function c(g){return g===40?e.attempt(Wq,f,l?f:d)(g):g===91?e.attempt(Yq,f,l?u:d)(g):l?f(g):d(g)}function u(g){return e.attempt(Gq,f,d)(g)}function f(g){return t(g)}function d(g){return o._balanced=!0,r(g)}}function Zq(e,t,r){return i;function i(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),n}function n(d){return $r(d)?fd(e,o)(d):o(d)}function o(d){return d===41?f(d):tA(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function l(d){return $r(d)?fd(e,c)(d):f(d)}function s(d){return r(d)}function c(d){return d===34||d===39||d===40?iA(e,u,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return $r(d)?fd(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function Qq(e,t,r){const i=this;return n;function n(s){return rA.call(i,e,o,l,"reference","referenceMarker","referenceString")(s)}function o(s){return i.parser.defined.includes(Ds(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function l(s){return r(s)}}function Jq(e,t,r){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),n}function n(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):r(o)}}const eW={name:"labelStartImage",resolveAll:Bv.resolveAll,tokenize:tW};function tW(e,t,r){const i=this;return n;function n(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),l):r(s)}function l(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(s):t(s)}}const rW={name:"labelStartLink",resolveAll:Bv.resolveAll,tokenize:iW};function iW(e,t,r){const i=this;return n;function n(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(l):t(l)}}const A_={name:"lineEnding",tokenize:nW};function nW(e,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),fr(e,t,"linePrefix")}}const Ip={name:"thematicBreak",tokenize:sW};function sW(e,t,r){let i=0,n;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return n=u,s(u)}function s(u){return u===n?(e.enter("thematicBreakSequence"),c(u)):i>=3&&(u===null||Lt(u))?(e.exit("thematicBreak"),t(u)):r(u)}function c(u){return u===n?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),ar(u)?fr(e,s,"whitespace")(u):s(u))}}const Dn={continuation:{tokenize:cW},exit:hW,name:"list",tokenize:lW},aW={partial:!0,tokenize:dW},oW={partial:!0,tokenize:uW};function lW(e,t,r){const i=this,n=i.events[i.events.length-1];let o=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,l=0;return s;function s(p){const x=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:Gb(p)){if(i.containerState.type||(i.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Ip,r,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return r(p)}function c(p){return Gb(p)&&++l<10?(e.consume(p),c):(!i.interrupt||l<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):r(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(af,i.interrupt?r:f,e.attempt(aW,g,d))}function f(p){return i.containerState.initialBlankLine=!0,o++,g(p)}function d(p){return ar(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):r(p)}function g(p){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function cW(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(af,n,o);function n(s){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,fr(e,t,"listItemIndent",i.containerState.size+1)(s)}function o(s){return i.containerState.furtherBlankLines||!ar(s)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(s)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(oW,t,l)(s))}function l(s){return i.containerState._closeFlow=!0,i.interrupt=void 0,fr(e,e.attempt(Dn,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function uW(e,t,r){const i=this;return fr(e,n,"listItemIndent",i.containerState.size+1);function n(o){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(o):r(o)}}function hW(e){e.exit(this.containerState.type)}function dW(e,t,r){const i=this;return fr(e,n,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(o){const l=i.events[i.events.length-1];return!ar(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):r(o)}}const YE={name:"setextUnderline",resolveTo:fW,tokenize:pW};function fW(e,t){let r=e.length,i,n,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(n=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",o?(e.splice(n,0,["enter",l,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function pW(e,t,r){const i=this;let n;return o;function o(u){let f=i.events.length,d;for(;f--;)if(i.events[f][1].type!=="lineEnding"&&i.events[f][1].type!=="linePrefix"&&i.events[f][1].type!=="content"){d=i.events[f][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),n=u,l(u)):r(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===n?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ar(u)?fr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Lt(u)?(e.exit("setextHeadingLine"),t(u)):r(u)}}const gW={tokenize:mW};function mW(e){const t=this,r=e.attempt(af,i,e.attempt(this.parser.constructs.flowInitial,n,fr(e,e.attempt(this.parser.constructs.flow,n,e.attempt(Cq,n)),"linePrefix")));return r;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const _W={resolveAll:sA()},bW=nA("string"),yW=nA("text");function nA(e){return{resolveAll:sA(e==="text"?vW:void 0),tokenize:t};function t(r){const i=this,n=this.parser.constructs[e],o=r.attempt(n,l,s);return l;function l(f){return u(f)?o(f):s(f)}function s(f){if(f===null){r.consume(f);return}return r.enter("data"),r.consume(f),c}function c(f){return u(f)?(r.exit("data"),o(f)):(r.consume(f),c)}function u(f){if(f===null)return!0;const d=n[f];let g=-1;if(d)for(;++g<d.length;){const p=d[g];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function sA(e){return t;function t(r,i){let n=-1,o;for(;++n<=r.length;)o===void 0?r[n]&&r[n][1].type==="data"&&(o=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==o+2&&(r[o][1].end=r[n-1][1].end,r.splice(o+2,n-o-2),n=o+2),o=void 0);return e?e(r,i):r}}function vW(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],n=t.sliceStream(i);let o=n.length,l=-1,s=0,c;for(;o--;){const u=n[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)s++,l--;if(l)break;l=-1}else if(u===-2)c=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(s=0),s){const u={type:r===e.length||c||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:i.start._bufferIndex+l,_index:i.start._index+o,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...u.start},i.start.offset===i.end.offset?Object.assign(i,u):(e.splice(r,0,["enter",u,t],["exit",u,t]),r+=2)}r++}return e}const CW={42:Dn,43:Dn,45:Dn,48:Dn,49:Dn,50:Dn,51:Dn,52:Dn,53:Dn,54:Dn,55:Dn,56:Dn,57:Dn,62:Z6},xW={91:Eq},SW={[-2]:k_,[-1]:k_,32:k_},wW={35:Rq,42:Ip,45:[YE,Ip],60:Iq,61:YE,95:Ip,96:qE,126:qE},TW={38:J6,92:Q6},EW={[-5]:A_,[-4]:A_,[-3]:A_,33:eW,38:J6,42:Vb,60:[rq,Uq],91:rW,92:[Bq,Q6],93:Bv,95:Vb,96:gq},kW={null:[Vb,_W]},AW={null:[42,95]},LW={null:[]},BW=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:AW,contentInitial:xW,disable:LW,document:CW,flow:wW,flowInitial:SW,insideSpan:kW,string:TW,text:EW},Symbol.toStringTag,{value:"Module"}));function MW(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const n={},o=[];let l=[],s=[];const c={attempt:E(A),check:E(T),consume:y,enter:C,exit:w,interrupt:E(T,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:g,sliceStream:p,write:d};let f=t.tokenize.call(u,c);return t.resolveAll&&o.push(t),u;function d(N){return l=ys(l,N),_(),l[l.length-1]!==null?[]:(L(t,0),u.events=dm(o,u.events,u),u.events)}function g(N,$){return DW(p(N),$)}function p(N){return RW(l,N)}function x(){const{_bufferIndex:N,_index:$,line:H,column:W,offset:Z}=i;return{_bufferIndex:N,_index:$,line:H,column:W,offset:Z}}function b(N){n[N.line]=N.column,D()}function _(){let N;for(;i._index<l.length;){const $=l[i._index];if(typeof $=="string")for(N=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===N&&i._bufferIndex<$.length;)v($.charCodeAt(i._bufferIndex));else v($)}}function v(N){f=f(N)}function y(N){Lt(N)?(i.line++,i.column=1,i.offset+=N===-3?2:1,D()):N!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=N}function C(N,$){const H=$||{};return H.type=N,H.start=x(),u.events.push(["enter",H,u]),s.push(H),H}function w(N){const $=s.pop();return $.end=x(),u.events.push(["exit",$,u]),$}function A(N,$){L(N,$.from)}function T(N,$){$.restore()}function E(N,$){return H;function H(W,Z,P){let G,X,j,I;return Array.isArray(W)?Y(W):"tokenize"in W?Y([W]):z(W);function z(te){return re;function re(K){const ce=K!==null&&te[K],ne=K!==null&&te.null,de=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return Y(de)(K)}}function Y(te){return G=te,X=0,te.length===0?P:q(te[X])}function q(te){return re;function re(K){return I=R(),j=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?ee():te.tokenize.call($?Object.assign(Object.create(u),$):u,c,Q,ee)(K)}}function Q(te){return N(j,I),Z}function ee(te){return I.restore(),++X<G.length?q(G[X]):P}}}function L(N,$){N.resolveAll&&!o.includes(N)&&o.push(N),N.resolve&&is(u.events,$,u.events.length-$,N.resolve(u.events.slice($),u)),N.resolveTo&&(u.events=N.resolveTo(u.events,u))}function R(){const N=x(),$=u.previous,H=u.currentConstruct,W=u.events.length,Z=Array.from(s);return{from:W,restore:P};function P(){i=N,u.previous=$,u.currentConstruct=H,u.events.length=W,s=Z,D()}}function D(){i.line in n&&i.column<2&&(i.column=n[i.line],i.offset+=n[i.line]-1)}}function RW(e,t){const r=t.start._index,i=t.start._bufferIndex,n=t.end._index,o=t.end._bufferIndex;let l;if(r===n)l=[e[r].slice(i,o)];else{if(l=e.slice(r,n),i>-1){const s=l[0];typeof s=="string"?l[0]=s.slice(i):l.shift()}o>0&&l.push(e[n].slice(0,o))}return l}function DW(e,t){let r=-1;const i=[];let n;for(;++r<e.length;){const o=e[r];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
104
104
  `;break}case-3:{l=`\r
105
105
  `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&n)continue;l=" ";break}default:l=String.fromCharCode(o)}n=o===-2,i.push(l)}return i.join("")}function OW(e){const i={constructs:X6([BW,...(e||{}).extensions||[]]),content:n(XU),defined:[],document:n(ZU),flow:n(gW),lazy:{},string:n(bW),text:n(yW)};return i;function n(o){return l;function l(s){return MW(i,o,s)}}}function NW(e){for(;!eA(e););return e}const GE=/[\0\t\n\r]/g;function IW(){let e=1,t="",r=!0,i;return n;function n(o,l,s){const c=[];let u,f,d,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),d=0,t="",r&&(o.charCodeAt(0)===65279&&d++,r=void 0);d<o.length;){if(GE.lastIndex=d,u=GE.exec(o),g=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(g),!u){t=o.slice(d);break}if(p===10&&d===g&&i)c.push(-3),i=void 0;else switch(i&&(c.push(-5),i=void 0),d<g&&(c.push(o.slice(d,g)),e+=g-d),p){case 0:{c.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,c.push(-2);e++<f;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:i=!0,e=1}d=g+1}return s&&(i&&c.push(-5),t&&c.push(t),c.push(null)),c}}const FW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PW(e){return e.replace(FW,HW)}function HW(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const n=r.charCodeAt(1),o=n===120||n===88;return K6(r.slice(o?2:1),o?16:10)}return Lv(r)||e}const aA={}.hasOwnProperty;function $W(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),jW(r)(NW(OW(r).document().write(IW()(e,t,!0))))}function jW(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(At),autolinkProtocol:R,autolinkEmail:R,atxHeading:o(Ze),blockQuote:o(ne),characterEscape:R,characterReference:R,codeFenced:o(de),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(de,l),codeText:o(_e,l),codeTextData:R,data:R,codeFlowValue:R,definition:o(Be),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(De),hardBreakEscape:o(kt),hardBreakTrailing:o(kt),htmlFlow:o(Je,l),htmlFlowData:R,htmlText:o(Je,l),htmlTextData:R,image:o(st),label:l,link:o(At),listItem:o(Me),listItemValue:g,listOrdered:o(ut,d),listUnordered:o(ut),paragraph:o(Ie),reference:q,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Ze),strong:o(Fe),thematicBreak:o(dt)},exit:{atxHeading:c(),atxHeadingSequence:A,autolink:c(),autolinkEmail:ce,autolinkProtocol:K,blockQuote:c(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:te,characterReference:re,codeFenced:c(_),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:D,codeIndented:c(v),codeText:c(Z),codeTextData:D,data:D,definition:c(),definitionDestinationString:w,definitionLabelString:y,definitionTitleString:C,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(H),htmlFlowData:D,htmlText:c(W),htmlTextData:D,image:c(G),label:j,labelText:X,lineEnding:N,link:c(P),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:I,resourceTitleString:z,resource:Y,setextHeading:c(L),setextHeadingLineSequence:E,setextHeadingText:T,strong:c(),thematicBreak:c()}};oA(t,(e||{}).mdastExtensions||[]);const r={};return i;function i(pe){let Te={type:"root",children:[]};const ze={stack:[Te],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:f,data:r},Ge=[];let Ve=-1;for(;++Ve<pe.length;)if(pe[Ve][1].type==="listOrdered"||pe[Ve][1].type==="listUnordered")if(pe[Ve][0]==="enter")Ge.push(Ve);else{const ot=Ge.pop();Ve=n(pe,ot,Ve)}for(Ve=-1;++Ve<pe.length;){const ot=t[pe[Ve][0]];aA.call(ot,pe[Ve][1].type)&&ot[pe[Ve][1].type].call(Object.assign({sliceSerialize:pe[Ve][2].sliceSerialize},ze),pe[Ve][1])}if(ze.tokenStack.length>0){const ot=ze.tokenStack[ze.tokenStack.length-1];(ot[1]||VE).call(ze,void 0,ot[0])}for(Te.position={start:vo(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:vo(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)Te=t.transforms[Ve](Te)||Te;return Te}function n(pe,Te,ze){let Ge=Te-1,Ve=-1,ot=!1,it,Yt,$t,Pt;for(;++Ge<=ze;){const Mt=pe[Ge];switch(Mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mt[0]==="enter"?Ve++:Ve--,Pt=void 0;break}case"lineEndingBlank":{Mt[0]==="enter"&&(it&&!Pt&&!Ve&&!$t&&($t=Ge),Pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pt=void 0}if(!Ve&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||Ve===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(it){let zr=Ge;for(Yt=void 0;zr--;){const vr=pe[zr];if(vr[1].type==="lineEnding"||vr[1].type==="lineEndingBlank"){if(vr[0]==="exit")continue;Yt&&(pe[Yt][1].type="lineEndingBlank",ot=!0),vr[1].type="lineEnding",Yt=zr}else if(!(vr[1].type==="linePrefix"||vr[1].type==="blockQuotePrefix"||vr[1].type==="blockQuotePrefixWhitespace"||vr[1].type==="blockQuoteMarker"||vr[1].type==="listItemIndent"))break}$t&&(!Yt||$t<Yt)&&(it._spread=!0),it.end=Object.assign({},Yt?pe[Yt][1].start:Mt[1].end),pe.splice(Yt||Ge,0,["exit",it,Mt[2]]),Ge++,ze++}if(Mt[1].type==="listItemPrefix"){const zr={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0};it=zr,pe.splice(Ge,0,["enter",zr,Mt[2]]),Ge++,ze++,$t=void 0,Pt=!0}}}return pe[Te][1]._spread=ot,ze}function o(pe,Te){return ze;function ze(Ge){s.call(this,pe(Ge),Ge),Te&&Te.call(this,Ge)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(pe,Te,ze){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Te,ze||void 0]),pe.position={start:vo(Te.start),end:void 0}}function c(pe){return Te;function Te(ze){pe&&pe.call(this,ze),u.call(this,ze)}}function u(pe,Te){const ze=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(Te?Te.call(this,pe,Ge[0]):(Ge[1]||VE).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+dd({start:pe.start,end:pe.end})+"): it’s not open");ze.position.end=vo(pe.end)}function f(){return Av(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function g(pe){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=pe}function x(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=pe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe.replace(/(\r?\n|\r)$/g,"")}function y(pe){const Te=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Te,ze.identifier=Ds(this.sliceSerialize(pe)).toLowerCase()}function C(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.title=pe}function w(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.url=pe}function A(pe){const Te=this.stack[this.stack.length-1];if(!Te.depth){const ze=this.sliceSerialize(pe).length;Te.depth=ze}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function E(pe){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function R(pe){const ze=this.stack[this.stack.length-1].children;let Ge=ze[ze.length-1];(!Ge||Ge.type!=="text")&&(Ge=Ue(),Ge.position={start:vo(pe.start),end:void 0},ze.push(Ge)),this.stack.push(Ge)}function D(pe){const Te=this.stack.pop();Te.value+=this.sliceSerialize(pe),Te.position.end=vo(pe.end)}function N(pe){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=Te.children[Te.children.length-1];ze.position.end=vo(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(R.call(this,pe),D.call(this,pe))}function $(){this.data.atHardBreak=!0}function H(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function W(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function Z(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.value=pe}function P(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Te,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Te,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function X(pe){const Te=this.sliceSerialize(pe),ze=this.stack[this.stack.length-2];ze.label=PW(Te),ze.identifier=Ds(Te).toLowerCase()}function j(){const pe=this.stack[this.stack.length-1],Te=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const Ge=pe.children;ze.children=Ge}else ze.alt=Te}function I(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.url=pe}function z(){const pe=this.resume(),Te=this.stack[this.stack.length-1];Te.title=pe}function Y(){this.data.inReference=void 0}function q(){this.data.referenceType="collapsed"}function Q(pe){const Te=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Te,ze.identifier=Ds(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function ee(pe){this.data.characterReferenceType=pe.type}function te(pe){const Te=this.sliceSerialize(pe),ze=this.data.characterReferenceType;let Ge;ze?(Ge=K6(Te,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Lv(Te);const Ve=this.stack[this.stack.length-1];Ve.value+=Ge}function re(pe){const Te=this.stack.pop();Te.position.end=vo(pe.end)}function K(pe){D.call(this,pe);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(pe)}function ce(pe){D.call(this,pe);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(pe)}function ne(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function kt(){return{type:"break"}}function Je(){return{type:"html",value:""}}function st(){return{type:"image",title:null,url:"",alt:null}}function At(){return{type:"link",title:null,url:"",children:[]}}function ut(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Me(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Ie(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function vo(e){return{line:e.line,column:e.column,offset:e.offset}}function oA(e,t){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?oA(e,i):zW(e,i)}}function zW(e,t){let r;for(r in t)if(aA.call(t,r))switch(r){case"canContainEols":{const i=t[r];i&&e[r].push(...i);break}case"transforms":{const i=t[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=t[r];i&&Object.assign(e[r],i);break}}}function VE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dd({start:t.start,end:t.end})+") is still open")}function UW(e){const t=this;t.parser=r;function r(i){return $W(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function qW(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function WW(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
@@ -439,8 +439,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
439
439
  L0,20`)},"requirement_arrow"),Sme=U((e,t,r)=>{const i=ai(),{themeVariables:n}=i,{strokeWidth:o}=n;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
440
440
  L20,10
441
441
  M20,10
442
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),wme=U((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Tme=U((e,t,r)=>{const i=ai(),{themeVariables:n}=i,{strokeWidth:o}=n,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");l.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),l.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),l.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),l.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Eme={extension:nme,composition:sme,aggregation:ame,dependency:ome,lollipop:lme,point:cme,circle:ume,cross:hme,barb:dme,barbNeo:fme,only_one:pme,zero_or_one:gme,one_or_more:mme,zero_or_more:_me,only_one_neo:bme,zero_or_one_neo:yme,one_or_more_neo:vme,zero_or_more_neo:Cme,requirement_arrow:xme,requirement_contains:wme,requirement_arrow_neo:Sme,requirement_contains_neo:Tme},kme=ime,Ame={common:mf,getConfig:ai,insertCluster:Tge,insertEdge:rme,insertEdgeLabel:Kge,insertMarkers:kme,insertNode:jO,interpolateToCurve:MC,labelHelper:Ot,log:Pe,positionEdgeLabel:Zge},Jd={},WO=U(e=>{for(const t of e)Jd[t.name]=t},"registerLayoutLoaders"),Lme=U(()=>{WO([{name:"dagre",loader:U(async()=>await er(()=>import("./dagre-KV5264BT-CDXKs5yo.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:U(async()=>await er(()=>import("./cose-bilkent-S5V4N54A-BW1nNLLk.js"),__vite__mapDeps([6,7])),"loader")}])},"registerDefaultLayoutLoaders");Lme();var lTe=U(async(e,t)=>{if(!(e.layoutAlgorithm in Jd))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const f of e.nodes){const d=f.domId||f.id;f.domId=`${e.diagramId}-${d}`}const r=Jd[e.layoutAlgorithm],i=await r.loader(),{theme:n,themeVariables:o}=e.config,{useGradient:l,gradientStart:s,gradientStop:c}=o,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),l){const f=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");f.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),f.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return i.render(e,t,Ame,{algorithm:r.algorithm})},"render"),cTe=U((e="",{fallback:t="dagre"}={})=>{if(e in Jd)return e;if(t in Jd)return Pe.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),YO="comm",GO="rule",VO="decl",Bme="@import",Mme="@namespace",Rme="@keyframes",Dme="@layer",XO=Math.abs,QC=String.fromCharCode;function KO(e){return e.trim()}function Kp(e,t,r){return e.replace(t,r)}function Ome(e,t,r){return e.indexOf(t,r)}function Gc(e,t){return e.charCodeAt(t)|0}function vu(e,t,r){return e.slice(t,r)}function Qs(e){return e.length}function Nme(e){return e.length}function mp(e,t){return t.push(e),e}var Xm=1,Cu=1,ZO=0,Ss=0,Mi=0,Nu="";function JC(e,t,r,i,n,o,l,s){return{value:e,root:t,parent:r,type:i,props:n,children:o,line:Xm,column:Cu,length:l,return:"",siblings:s}}function Ime(){return Mi}function Fme(){return Mi=Ss>0?Gc(Nu,--Ss):0,Cu--,Mi===10&&(Cu=1,Xm--),Mi}function Ns(){return Mi=Ss<ZO?Gc(Nu,Ss++):0,Cu++,Mi===10&&(Cu=1,Xm++),Mi}function Mo(){return Gc(Nu,Ss)}function Zp(){return Ss}function Km(e,t){return vu(Nu,e,t)}function ef(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Pme(e){return Xm=Cu=1,ZO=Qs(Nu=e),Ss=0,[]}function Hme(e){return Nu="",e}function vb(e){return KO(Km(Ss-1,iv(e===91?e+2:e===40?e+1:e)))}function $me(e){for(;(Mi=Mo())&&Mi<33;)Ns();return ef(e)>2||ef(Mi)>3?"":" "}function jme(e,t){for(;--t&&Ns()&&!(Mi<48||Mi>102||Mi>57&&Mi<65||Mi>70&&Mi<97););return Km(e,Zp()+(t<6&&Mo()==32&&Ns()==32))}function iv(e){for(;Ns();)switch(Mi){case e:return Ss;case 34:case 39:e!==34&&e!==39&&iv(Mi);break;case 40:e===41&&iv(e);break;case 92:Ns();break}return Ss}function zme(e,t){for(;Ns()&&e+Mi!==57;)if(e+Mi===84&&Mo()===47)break;return"/*"+Km(t,Ss-1)+"*"+QC(e===47?e:Ns())}function Ume(e){for(;!ef(Mo());)Ns();return Km(e,Ss)}function qme(e){return Hme(Qp("",null,null,null,[""],e=Pme(e),0,[0],e))}function Qp(e,t,r,i,n,o,l,s,c){for(var u=0,f=0,d=l,g=0,p=0,x=0,b=1,_=1,v=1,y=0,C="",w=n,A=o,T=i,E=C;_;)switch(x=y,y=Ns()){case 40:if(x!=108&&Gc(E,d-1)==58){Ome(E+=Kp(vb(y),"&","&\f"),"&\f",XO(u?s[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:E+=vb(y);break;case 9:case 10:case 13:case 32:E+=$me(x);break;case 92:E+=jme(Zp()-1,7);continue;case 47:switch(Mo()){case 42:case 47:mp(Wme(zme(Ns(),Zp()),t,r,c),c),(ef(x||1)==5||ef(Mo()||1)==5)&&Qs(E)&&vu(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*b:s[u++]=Qs(E)*v;case 125*b:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+f:v==-1&&(E=Kp(E,/\f/g,"")),p>0&&(Qs(E)-d||b===0&&x===47)&&mp(p>32?z5(E+";",i,r,d-1,c):z5(Kp(E," ","")+";",i,r,d-2,c),c);break;case 59:E+=";";default:if(mp(T=j5(E,t,r,u,f,n,s,C,w=[],A=[],d,o),o),y===123)if(f===0)Qp(E,t,T,T,w,o,d,s,A);else{switch(g){case 99:if(Gc(E,3)===110)break;case 108:if(Gc(E,2)===97)break;default:f=0;case 100:case 109:case 115:}f?Qp(e,T,T,i&&mp(j5(e,T,T,0,0,n,s,C,n,w=[],d,A),A),n,A,d,s,i?w:A):Qp(E,T,T,T,[""],A,0,s,A)}}u=f=p=0,b=v=1,C=E="",d=l;break;case 58:d=1+Qs(E),p=x;default:if(b<1){if(y==123)--b;else if(y==125&&b++==0&&Fme()==125)continue}switch(E+=QC(y),y*b){case 38:v=f>0?1:(E+="\f",-1);break;case 44:s[u++]=(Qs(E)-1)*v,v=1;break;case 64:Mo()===45&&(E+=vb(Ns())),g=Mo(),f=d=Qs(C=E+=Ume(Zp())),y++;break;case 45:x===45&&Qs(E)==2&&(b=0)}}return o}function j5(e,t,r,i,n,o,l,s,c,u,f,d){for(var g=n-1,p=n===0?o:[""],x=Nme(p),b=0,_=0,v=0;b<i;++b)for(var y=0,C=vu(e,g+1,g=XO(_=l[b])),w=e;y<x;++y)(w=KO(_>0?p[y]+" "+C:Kp(C,/&\f/g,p[y])))&&(c[v++]=w);return JC(e,t,r,n===0?GO:s,c,u,f,d)}function Wme(e,t,r,i){return JC(e,t,r,YO,QC(Ime()),vu(e,2,-2),0,i)}function z5(e,t,r,i,n){return JC(e,t,r,VO,vu(e,0,i),vu(e,i+1,-1),i,n)}function nv(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function Yme(e,t,r,i){switch(e.type){case Dme:if(e.children.length)break;case Bme:case Mme:case VO:return e.return=e.return||e.value;case YO:return"";case Rme:return e.return=e.value+"{"+nv(e.children,i)+"}";case GO:if(!Qs(e.value=e.props.join(",")))return""}return Qs(r=nv(e.children,i))?e.return=e.value+"{"+r+"}":""}var Gme=vR(Object.keys,Object),Vme=Object.prototype,Xme=Vme.hasOwnProperty;function Kme(e){if(!$m(e))return Gme(e);var t=[];for(var r in Object(e))Xme.call(e,r)&&r!="constructor"&&t.push(r);return t}var sv=$l(ua,"DataView"),av=$l(ua,"Promise"),ov=$l(ua,"Set"),lv=$l(ua,"WeakMap"),U5="[object Map]",Zme="[object Object]",q5="[object Promise]",W5="[object Set]",Y5="[object WeakMap]",G5="[object DataView]",Qme=Hl(sv),Jme=Hl(Zd),e1e=Hl(av),t1e=Hl(ov),r1e=Hl(lv),pl=Mu;(sv&&pl(new sv(new ArrayBuffer(1)))!=G5||Zd&&pl(new Zd)!=U5||av&&pl(av.resolve())!=q5||ov&&pl(new ov)!=W5||lv&&pl(new lv)!=Y5)&&(pl=function(e){var t=Mu(e),r=t==Zme?e.constructor:void 0,i=r?Hl(r):"";if(i)switch(i){case Qme:return G5;case Jme:return U5;case e1e:return q5;case t1e:return W5;case r1e:return Y5}return t});var i1e="[object Map]",n1e="[object Set]",s1e=Object.prototype,a1e=s1e.hasOwnProperty;function V5(e){if(e==null)return!0;if(jm(e)&&(Pg(e)||typeof e=="string"||typeof e.splice=="function"||LC(e)||BC(e)||Fg(e)))return!e.length;var t=pl(e);if(t==i1e||t==n1e)return!e.size;if($m(e))return!Kme(e).length;for(var r in e)if(a1e.call(e,r))return!1;return!0}var QO="c4",o1e=U(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),l1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./c4Diagram-AHTNJAMY-BATf25U2.js");return{diagram:t}},__vite__mapDeps([8,9]));return{id:QO,diagram:e}},"loader"),c1e={id:QO,detector:o1e,loader:l1e},u1e=c1e,JO="flowchart",h1e=U((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),d1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DpRY38iu.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:JO,diagram:e}},"loader"),f1e={id:JO,detector:h1e,loader:d1e},p1e=f1e,eN="flowchart-v2",g1e=U((e,t)=>{var r,i,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),m1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DpRY38iu.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:eN,diagram:e}},"loader"),_1e={id:eN,detector:g1e,loader:m1e},b1e=_1e,tN="er",y1e=U(e=>/^\s*erDiagram/.test(e),"detector"),v1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./erDiagram-SMLLAGMA-BCpXZJei.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]));return{id:tN,diagram:e}},"loader"),C1e={id:tN,detector:y1e,loader:v1e},x1e=C1e,rN="gitGraph",S1e=U(e=>/^\s*gitGraph/.test(e),"detector"),w1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./gitGraphDiagram-UUTBAWPF-CpEmQcDN.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,2,4,5]));return{id:rN,diagram:e}},"loader"),T1e={id:rN,detector:S1e,loader:w1e},E1e=T1e,iN="gantt",k1e=U(e=>/^\s*gantt/.test(e),"detector"),A1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./ganttDiagram-T4ZO3ILL-DJrwFHlO.js");return{diagram:t}},__vite__mapDeps([20,21,22,23]));return{id:iN,diagram:e}},"loader"),L1e={id:iN,detector:k1e,loader:A1e},B1e=L1e,nN="info",M1e=U(e=>/^\s*info/.test(e),"detector"),R1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./infoDiagram-42DDH7IO-sXN9f7L8.js");return{diagram:t}},__vite__mapDeps([24,19,2,4,5]));return{id:nN,diagram:e}},"loader"),D1e={id:nN,detector:M1e,loader:R1e},sN="pie",O1e=U(e=>/^\s*pie/.test(e),"detector"),N1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./pieDiagram-DEJITSTG-Ck2h10zd.js");return{diagram:t}},__vite__mapDeps([25,17,19,2,4,5,26,27,22]));return{id:sN,diagram:e}},"loader"),I1e={id:sN,detector:O1e,loader:N1e},aN="quadrantChart",F1e=U(e=>/^\s*quadrantChart/.test(e),"detector"),P1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./quadrantDiagram-34T5L4WZ-B1ZrruGm.js");return{diagram:t}},__vite__mapDeps([28,21,22,23]));return{id:aN,diagram:e}},"loader"),H1e={id:aN,detector:F1e,loader:P1e},$1e=H1e,oN="xychart",j1e=U(e=>/^\s*xychart(-beta)?/.test(e),"detector"),z1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./xychartDiagram-5P7HB3ND-CSZSmQ9N.js");return{diagram:t}},__vite__mapDeps([29,22,27,21,23]));return{id:oN,diagram:e}},"loader"),U1e={id:oN,detector:j1e,loader:z1e},q1e=U1e,lN="requirement",W1e=U(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Y1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./requirementDiagram-MS252O5E-B8JKwgDX.js");return{diagram:t}},__vite__mapDeps([30,12,13]));return{id:lN,diagram:e}},"loader"),G1e={id:lN,detector:W1e,loader:Y1e},V1e=G1e,cN="sequence",X1e=U(e=>/^\s*sequenceDiagram/.test(e),"detector"),K1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./sequenceDiagram-FGHM5R23-DY9IFA-F.js");return{diagram:t}},__vite__mapDeps([31,9,18]));return{id:cN,diagram:e}},"loader"),Z1e={id:cN,detector:X1e,loader:K1e},Q1e=Z1e,uN="class",J1e=U((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),e2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./classDiagram-6PBFFD2Q-BaJ5lA7J.js");return{diagram:t}},__vite__mapDeps([32,33,11,9,12,13]));return{id:uN,diagram:e}},"loader"),t2e={id:uN,detector:J1e,loader:e2e},r2e=t2e,hN="classDiagram",i2e=U((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),n2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./classDiagram-v2-HSJHXN6E-BaJ5lA7J.js");return{diagram:t}},__vite__mapDeps([34,33,11,9,12,13]));return{id:hN,diagram:e}},"loader"),s2e={id:hN,detector:i2e,loader:n2e},a2e=s2e,dN="state",o2e=U((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),l2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./stateDiagram-FHFEXIEX-IGjwW9Pw.js");return{diagram:t}},__vite__mapDeps([35,36,12,13,1,2,3,4]));return{id:dN,diagram:e}},"loader"),c2e={id:dN,detector:o2e,loader:l2e},u2e=c2e,fN="stateDiagram",h2e=U((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),d2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./stateDiagram-v2-QKLJ7IA2-2xQCbec6.js");return{diagram:t}},__vite__mapDeps([37,36,12,13]));return{id:fN,diagram:e}},"loader"),f2e={id:fN,detector:h2e,loader:d2e},p2e=f2e,pN="journey",g2e=U(e=>/^\s*journey/.test(e),"detector"),m2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./journeyDiagram-VCZTEJTY-CUv-hh0I.js");return{diagram:t}},__vite__mapDeps([38,11,9,26]));return{id:pN,diagram:e}},"loader"),_2e={id:pN,detector:g2e,loader:m2e},b2e=_2e,y2e=U((e,t,r)=>{Pe.debug(`rendering svg for syntax error
443
- `);const i=zue(t),n=i.append("g");i.attr("viewBox","0 0 2412 512"),H8(i,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),gN={draw:y2e},v2e=gN,C2e={db:{},renderer:gN,parser:{parse:U(()=>{},"parse")}},x2e=C2e,mN="flowchart-elk",S2e=U((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),w2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DpRY38iu.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:mN,diagram:e}},"loader"),T2e={id:mN,detector:S2e,loader:w2e},E2e=T2e,_N="timeline",k2e=U(e=>/^\s*timeline/.test(e),"detector"),A2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./timeline-definition-GMOUNBTQ-B0JwGAT7.js");return{diagram:t}},__vite__mapDeps([39,26]));return{id:_N,diagram:e}},"loader"),L2e={id:_N,detector:k2e,loader:A2e},B2e=L2e,bN="mindmap",M2e=U(e=>/^\s*mindmap/.test(e),"detector"),R2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./mindmap-definition-QFDTVHPH-Swj4jh3Z.js");return{diagram:t}},__vite__mapDeps([40,12,13]));return{id:bN,diagram:e}},"loader"),D2e={id:bN,detector:M2e,loader:R2e},O2e=D2e,yN="kanban",N2e=U(e=>/^\s*kanban/.test(e),"detector"),I2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./kanban-definition-6JOO6SKY-Cx3Plwl2.js");return{diagram:t}},__vite__mapDeps([41,11]));return{id:yN,diagram:e}},"loader"),F2e={id:yN,detector:N2e,loader:I2e},P2e=F2e,vN="sankey",H2e=U(e=>/^\s*sankey(-beta)?/.test(e),"detector"),$2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./sankeyDiagram-XADWPNL6-b442XRH8.js");return{diagram:t}},__vite__mapDeps([42,27,22]));return{id:vN,diagram:e}},"loader"),j2e={id:vN,detector:H2e,loader:$2e},z2e=j2e,CN="packet",U2e=U(e=>/^\s*packet(-beta)?/.test(e),"detector"),q2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-TYMM5635-CAMd8OZP.js");return{diagram:t}},__vite__mapDeps([43,17,19,2,4,5]));return{id:CN,diagram:e}},"loader"),W2e={id:CN,detector:U2e,loader:q2e},xN="radar",Y2e=U(e=>/^\s*radar-beta/.test(e),"detector"),G2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-MMDJMWI5-CWwOGFbE.js");return{diagram:t}},__vite__mapDeps([44,17,19,2,4,5]));return{id:xN,diagram:e}},"loader"),V2e={id:xN,detector:Y2e,loader:G2e},SN="block",X2e=U(e=>/^\s*block(-beta)?/.test(e),"detector"),K2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./blockDiagram-DXYQGD6D-DrElm25z.js");return{diagram:t}},__vite__mapDeps([45,11,5,2,1,14]));return{id:SN,diagram:e}},"loader"),Z2e={id:SN,detector:X2e,loader:K2e},Q2e=Z2e,wN="treeView",J2e=U(e=>/^\s*treeView-beta/.test(e),"detector"),e_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-5BDNPKRD-DfSZsVAD.js");return{diagram:t}},__vite__mapDeps([46,17,18,19,2,4,5]));return{id:wN,diagram:e}},"loader"),t_e={id:wN,detector:J2e,loader:e_e},r_e=t_e,TN="architecture",i_e=U(e=>/^\s*architecture/.test(e),"detector"),n_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./architectureDiagram-Q4EWVU46-ByQ5j_Jw.js");return{diagram:t}},__vite__mapDeps([47,17,19,2,4,5,7]));return{id:TN,diagram:e}},"loader"),s_e={id:TN,detector:i_e,loader:n_e},a_e=s_e,EN="ishikawa",o_e=U(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),l_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./ishikawaDiagram-UXIWVN3A-D_2gGEMI.js");return{diagram:t}},[]);return{id:EN,diagram:e}},"loader"),c_e={id:EN,detector:o_e,loader:l_e},kN="venn",u_e=U(e=>/^\s*venn-beta/.test(e),"detector"),h_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./vennDiagram-DHZGUBPP-DKLiidvh.js");return{diagram:t}},[]);return{id:kN,diagram:e}},"loader"),d_e={id:kN,detector:u_e,loader:h_e},f_e=d_e,AN="treemap",p_e=U(e=>/^\s*treemap/.test(e),"detector"),g_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-G4DWMVQ6-CIKqapDb.js");return{diagram:t}},__vite__mapDeps([48,13,17,19,2,4,5,23,27,22]));return{id:AN,diagram:e}},"loader"),m_e={id:AN,detector:p_e,loader:g_e},LN="wardley-beta",__e=U(e=>/^\s*wardley-beta/i.test(e),"detector"),b_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./wardleyDiagram-NUSXRM2D-BhbO6L2Q.js");return{diagram:t}},__vite__mapDeps([49,17,19,2,4,5]));return{id:LN,diagram:e}},"loader"),y_e={id:LN,detector:__e,loader:b_e},v_e=y_e,X5=!1,Zm=U(()=>{X5||(X5=!0,yg("error",x2e,e=>e.toLowerCase().trim()==="error"),yg("---",{db:{clear:U(()=>{},"clear")},styles:{},renderer:{draw:U(()=>{},"draw")},parser:{parse:U(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:U(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),dy(E2e,O2e,a_e),dy(u1e,P2e,a2e,r2e,x1e,B1e,D1e,I1e,V1e,Q1e,b1e,p1e,B2e,E1e,p2e,u2e,b2e,$1e,z2e,W2e,q1e,Q2e,r_e,V2e,c_e,m_e,f_e,v_e))},"addDiagrams"),C_e=U(async()=>{Pe.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(El).map(async([r,{detector:i,loader:n}])=>{if(n)try{my(r)}catch{try{const{diagram:o,id:l}=await n();yg(l,o,i)}catch(o){throw Pe.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete El[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){Pe.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Pe.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),x_e="graphics-document document";function BN(e,t){e.attr("role",x_e),t!==""&&e.attr("aria-roledescription",t)}U(BN,"setA11yDiagramInfo");function MN(e,t,r,i){if(e.insert!==void 0){if(r){const n=`chart-desc-${i}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(r)}if(t){const n=`chart-title-${i}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}U(MN,"addSVGa11yTitleDescription");var Sl,cv=(Sl=class{constructor(t,r,i,n,o){this.type=t,this.text=r,this.db=i,this.parser=n,this.renderer=o}static async fromText(t,r={}){var u,f;const i=ai(),n=tC(t,i);t=W0e(t)+`
442
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),wme=U((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Tme=U((e,t,r)=>{const i=ai(),{themeVariables:n}=i,{strokeWidth:o}=n,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");l.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),l.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),l.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),l.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Eme={extension:nme,composition:sme,aggregation:ame,dependency:ome,lollipop:lme,point:cme,circle:ume,cross:hme,barb:dme,barbNeo:fme,only_one:pme,zero_or_one:gme,one_or_more:mme,zero_or_more:_me,only_one_neo:bme,zero_or_one_neo:yme,one_or_more_neo:vme,zero_or_more_neo:Cme,requirement_arrow:xme,requirement_contains:wme,requirement_arrow_neo:Sme,requirement_contains_neo:Tme},kme=ime,Ame={common:mf,getConfig:ai,insertCluster:Tge,insertEdge:rme,insertEdgeLabel:Kge,insertMarkers:kme,insertNode:jO,interpolateToCurve:MC,labelHelper:Ot,log:Pe,positionEdgeLabel:Zge},Jd={},WO=U(e=>{for(const t of e)Jd[t.name]=t},"registerLayoutLoaders"),Lme=U(()=>{WO([{name:"dagre",loader:U(async()=>await er(()=>import("./dagre-KV5264BT-BSL5FMc3.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:U(async()=>await er(()=>import("./cose-bilkent-S5V4N54A-C1mk64VU.js"),__vite__mapDeps([6,7])),"loader")}])},"registerDefaultLayoutLoaders");Lme();var lTe=U(async(e,t)=>{if(!(e.layoutAlgorithm in Jd))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const f of e.nodes){const d=f.domId||f.id;f.domId=`${e.diagramId}-${d}`}const r=Jd[e.layoutAlgorithm],i=await r.loader(),{theme:n,themeVariables:o}=e.config,{useGradient:l,gradientStart:s,gradientStop:c}=o,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),l){const f=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");f.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),f.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return i.render(e,t,Ame,{algorithm:r.algorithm})},"render"),cTe=U((e="",{fallback:t="dagre"}={})=>{if(e in Jd)return e;if(t in Jd)return Pe.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),YO="comm",GO="rule",VO="decl",Bme="@import",Mme="@namespace",Rme="@keyframes",Dme="@layer",XO=Math.abs,QC=String.fromCharCode;function KO(e){return e.trim()}function Kp(e,t,r){return e.replace(t,r)}function Ome(e,t,r){return e.indexOf(t,r)}function Gc(e,t){return e.charCodeAt(t)|0}function vu(e,t,r){return e.slice(t,r)}function Qs(e){return e.length}function Nme(e){return e.length}function mp(e,t){return t.push(e),e}var Xm=1,Cu=1,ZO=0,Ss=0,Mi=0,Nu="";function JC(e,t,r,i,n,o,l,s){return{value:e,root:t,parent:r,type:i,props:n,children:o,line:Xm,column:Cu,length:l,return:"",siblings:s}}function Ime(){return Mi}function Fme(){return Mi=Ss>0?Gc(Nu,--Ss):0,Cu--,Mi===10&&(Cu=1,Xm--),Mi}function Ns(){return Mi=Ss<ZO?Gc(Nu,Ss++):0,Cu++,Mi===10&&(Cu=1,Xm++),Mi}function Mo(){return Gc(Nu,Ss)}function Zp(){return Ss}function Km(e,t){return vu(Nu,e,t)}function ef(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Pme(e){return Xm=Cu=1,ZO=Qs(Nu=e),Ss=0,[]}function Hme(e){return Nu="",e}function vb(e){return KO(Km(Ss-1,iv(e===91?e+2:e===40?e+1:e)))}function $me(e){for(;(Mi=Mo())&&Mi<33;)Ns();return ef(e)>2||ef(Mi)>3?"":" "}function jme(e,t){for(;--t&&Ns()&&!(Mi<48||Mi>102||Mi>57&&Mi<65||Mi>70&&Mi<97););return Km(e,Zp()+(t<6&&Mo()==32&&Ns()==32))}function iv(e){for(;Ns();)switch(Mi){case e:return Ss;case 34:case 39:e!==34&&e!==39&&iv(Mi);break;case 40:e===41&&iv(e);break;case 92:Ns();break}return Ss}function zme(e,t){for(;Ns()&&e+Mi!==57;)if(e+Mi===84&&Mo()===47)break;return"/*"+Km(t,Ss-1)+"*"+QC(e===47?e:Ns())}function Ume(e){for(;!ef(Mo());)Ns();return Km(e,Ss)}function qme(e){return Hme(Qp("",null,null,null,[""],e=Pme(e),0,[0],e))}function Qp(e,t,r,i,n,o,l,s,c){for(var u=0,f=0,d=l,g=0,p=0,x=0,b=1,_=1,v=1,y=0,C="",w=n,A=o,T=i,E=C;_;)switch(x=y,y=Ns()){case 40:if(x!=108&&Gc(E,d-1)==58){Ome(E+=Kp(vb(y),"&","&\f"),"&\f",XO(u?s[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:E+=vb(y);break;case 9:case 10:case 13:case 32:E+=$me(x);break;case 92:E+=jme(Zp()-1,7);continue;case 47:switch(Mo()){case 42:case 47:mp(Wme(zme(Ns(),Zp()),t,r,c),c),(ef(x||1)==5||ef(Mo()||1)==5)&&Qs(E)&&vu(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*b:s[u++]=Qs(E)*v;case 125*b:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+f:v==-1&&(E=Kp(E,/\f/g,"")),p>0&&(Qs(E)-d||b===0&&x===47)&&mp(p>32?z5(E+";",i,r,d-1,c):z5(Kp(E," ","")+";",i,r,d-2,c),c);break;case 59:E+=";";default:if(mp(T=j5(E,t,r,u,f,n,s,C,w=[],A=[],d,o),o),y===123)if(f===0)Qp(E,t,T,T,w,o,d,s,A);else{switch(g){case 99:if(Gc(E,3)===110)break;case 108:if(Gc(E,2)===97)break;default:f=0;case 100:case 109:case 115:}f?Qp(e,T,T,i&&mp(j5(e,T,T,0,0,n,s,C,n,w=[],d,A),A),n,A,d,s,i?w:A):Qp(E,T,T,T,[""],A,0,s,A)}}u=f=p=0,b=v=1,C=E="",d=l;break;case 58:d=1+Qs(E),p=x;default:if(b<1){if(y==123)--b;else if(y==125&&b++==0&&Fme()==125)continue}switch(E+=QC(y),y*b){case 38:v=f>0?1:(E+="\f",-1);break;case 44:s[u++]=(Qs(E)-1)*v,v=1;break;case 64:Mo()===45&&(E+=vb(Ns())),g=Mo(),f=d=Qs(C=E+=Ume(Zp())),y++;break;case 45:x===45&&Qs(E)==2&&(b=0)}}return o}function j5(e,t,r,i,n,o,l,s,c,u,f,d){for(var g=n-1,p=n===0?o:[""],x=Nme(p),b=0,_=0,v=0;b<i;++b)for(var y=0,C=vu(e,g+1,g=XO(_=l[b])),w=e;y<x;++y)(w=KO(_>0?p[y]+" "+C:Kp(C,/&\f/g,p[y])))&&(c[v++]=w);return JC(e,t,r,n===0?GO:s,c,u,f,d)}function Wme(e,t,r,i){return JC(e,t,r,YO,QC(Ime()),vu(e,2,-2),0,i)}function z5(e,t,r,i,n){return JC(e,t,r,VO,vu(e,0,i),vu(e,i+1,-1),i,n)}function nv(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function Yme(e,t,r,i){switch(e.type){case Dme:if(e.children.length)break;case Bme:case Mme:case VO:return e.return=e.return||e.value;case YO:return"";case Rme:return e.return=e.value+"{"+nv(e.children,i)+"}";case GO:if(!Qs(e.value=e.props.join(",")))return""}return Qs(r=nv(e.children,i))?e.return=e.value+"{"+r+"}":""}var Gme=vR(Object.keys,Object),Vme=Object.prototype,Xme=Vme.hasOwnProperty;function Kme(e){if(!$m(e))return Gme(e);var t=[];for(var r in Object(e))Xme.call(e,r)&&r!="constructor"&&t.push(r);return t}var sv=$l(ua,"DataView"),av=$l(ua,"Promise"),ov=$l(ua,"Set"),lv=$l(ua,"WeakMap"),U5="[object Map]",Zme="[object Object]",q5="[object Promise]",W5="[object Set]",Y5="[object WeakMap]",G5="[object DataView]",Qme=Hl(sv),Jme=Hl(Zd),e1e=Hl(av),t1e=Hl(ov),r1e=Hl(lv),pl=Mu;(sv&&pl(new sv(new ArrayBuffer(1)))!=G5||Zd&&pl(new Zd)!=U5||av&&pl(av.resolve())!=q5||ov&&pl(new ov)!=W5||lv&&pl(new lv)!=Y5)&&(pl=function(e){var t=Mu(e),r=t==Zme?e.constructor:void 0,i=r?Hl(r):"";if(i)switch(i){case Qme:return G5;case Jme:return U5;case e1e:return q5;case t1e:return W5;case r1e:return Y5}return t});var i1e="[object Map]",n1e="[object Set]",s1e=Object.prototype,a1e=s1e.hasOwnProperty;function V5(e){if(e==null)return!0;if(jm(e)&&(Pg(e)||typeof e=="string"||typeof e.splice=="function"||LC(e)||BC(e)||Fg(e)))return!e.length;var t=pl(e);if(t==i1e||t==n1e)return!e.size;if($m(e))return!Kme(e).length;for(var r in e)if(a1e.call(e,r))return!1;return!0}var QO="c4",o1e=U(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),l1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./c4Diagram-AHTNJAMY-DzCXv9Rz.js");return{diagram:t}},__vite__mapDeps([8,9]));return{id:QO,diagram:e}},"loader"),c1e={id:QO,detector:o1e,loader:l1e},u1e=c1e,JO="flowchart",h1e=U((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),d1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DwB23P40.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:JO,diagram:e}},"loader"),f1e={id:JO,detector:h1e,loader:d1e},p1e=f1e,eN="flowchart-v2",g1e=U((e,t)=>{var r,i,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),m1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DwB23P40.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:eN,diagram:e}},"loader"),_1e={id:eN,detector:g1e,loader:m1e},b1e=_1e,tN="er",y1e=U(e=>/^\s*erDiagram/.test(e),"detector"),v1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./erDiagram-SMLLAGMA-CbMPq8iC.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]));return{id:tN,diagram:e}},"loader"),C1e={id:tN,detector:y1e,loader:v1e},x1e=C1e,rN="gitGraph",S1e=U(e=>/^\s*gitGraph/.test(e),"detector"),w1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./gitGraphDiagram-UUTBAWPF-BbYP2iH_.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,2,4,5]));return{id:rN,diagram:e}},"loader"),T1e={id:rN,detector:S1e,loader:w1e},E1e=T1e,iN="gantt",k1e=U(e=>/^\s*gantt/.test(e),"detector"),A1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./ganttDiagram-T4ZO3ILL-CvrFWOtX.js");return{diagram:t}},__vite__mapDeps([20,21,22,23]));return{id:iN,diagram:e}},"loader"),L1e={id:iN,detector:k1e,loader:A1e},B1e=L1e,nN="info",M1e=U(e=>/^\s*info/.test(e),"detector"),R1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./infoDiagram-42DDH7IO-ngTxsXzv.js");return{diagram:t}},__vite__mapDeps([24,19,2,4,5]));return{id:nN,diagram:e}},"loader"),D1e={id:nN,detector:M1e,loader:R1e},sN="pie",O1e=U(e=>/^\s*pie/.test(e),"detector"),N1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./pieDiagram-DEJITSTG-D3Z4P9gD.js");return{diagram:t}},__vite__mapDeps([25,17,19,2,4,5,26,27,22]));return{id:sN,diagram:e}},"loader"),I1e={id:sN,detector:O1e,loader:N1e},aN="quadrantChart",F1e=U(e=>/^\s*quadrantChart/.test(e),"detector"),P1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./quadrantDiagram-34T5L4WZ-CQDIQCh0.js");return{diagram:t}},__vite__mapDeps([28,21,22,23]));return{id:aN,diagram:e}},"loader"),H1e={id:aN,detector:F1e,loader:P1e},$1e=H1e,oN="xychart",j1e=U(e=>/^\s*xychart(-beta)?/.test(e),"detector"),z1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./xychartDiagram-5P7HB3ND-C3j-s6OI.js");return{diagram:t}},__vite__mapDeps([29,22,27,21,23]));return{id:oN,diagram:e}},"loader"),U1e={id:oN,detector:j1e,loader:z1e},q1e=U1e,lN="requirement",W1e=U(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Y1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./requirementDiagram-MS252O5E-Wmr4p5Qx.js");return{diagram:t}},__vite__mapDeps([30,12,13]));return{id:lN,diagram:e}},"loader"),G1e={id:lN,detector:W1e,loader:Y1e},V1e=G1e,cN="sequence",X1e=U(e=>/^\s*sequenceDiagram/.test(e),"detector"),K1e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./sequenceDiagram-FGHM5R23-BTfkp-Sc.js");return{diagram:t}},__vite__mapDeps([31,9,18]));return{id:cN,diagram:e}},"loader"),Z1e={id:cN,detector:X1e,loader:K1e},Q1e=Z1e,uN="class",J1e=U((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),e2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./classDiagram-6PBFFD2Q-ClceLk7l.js");return{diagram:t}},__vite__mapDeps([32,33,11,9,12,13]));return{id:uN,diagram:e}},"loader"),t2e={id:uN,detector:J1e,loader:e2e},r2e=t2e,hN="classDiagram",i2e=U((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),n2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./classDiagram-v2-HSJHXN6E-ClceLk7l.js");return{diagram:t}},__vite__mapDeps([34,33,11,9,12,13]));return{id:hN,diagram:e}},"loader"),s2e={id:hN,detector:i2e,loader:n2e},a2e=s2e,dN="state",o2e=U((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),l2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./stateDiagram-FHFEXIEX-Bawg9xGH.js");return{diagram:t}},__vite__mapDeps([35,36,12,13,1,2,3,4]));return{id:dN,diagram:e}},"loader"),c2e={id:dN,detector:o2e,loader:l2e},u2e=c2e,fN="stateDiagram",h2e=U((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),d2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./stateDiagram-v2-QKLJ7IA2-XEPIytdt.js");return{diagram:t}},__vite__mapDeps([37,36,12,13]));return{id:fN,diagram:e}},"loader"),f2e={id:fN,detector:h2e,loader:d2e},p2e=f2e,pN="journey",g2e=U(e=>/^\s*journey/.test(e),"detector"),m2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./journeyDiagram-VCZTEJTY-BoXoPVa_.js");return{diagram:t}},__vite__mapDeps([38,11,9,26]));return{id:pN,diagram:e}},"loader"),_2e={id:pN,detector:g2e,loader:m2e},b2e=_2e,y2e=U((e,t,r)=>{Pe.debug(`rendering svg for syntax error
443
+ `);const i=zue(t),n=i.append("g");i.attr("viewBox","0 0 2412 512"),H8(i,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),gN={draw:y2e},v2e=gN,C2e={db:{},renderer:gN,parser:{parse:U(()=>{},"parse")}},x2e=C2e,mN="flowchart-elk",S2e=U((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),w2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM-DwB23P40.js");return{diagram:t}},__vite__mapDeps([10,11,9,12,13,14]));return{id:mN,diagram:e}},"loader"),T2e={id:mN,detector:S2e,loader:w2e},E2e=T2e,_N="timeline",k2e=U(e=>/^\s*timeline/.test(e),"detector"),A2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./timeline-definition-GMOUNBTQ-DX9pgCZO.js");return{diagram:t}},__vite__mapDeps([39,26]));return{id:_N,diagram:e}},"loader"),L2e={id:_N,detector:k2e,loader:A2e},B2e=L2e,bN="mindmap",M2e=U(e=>/^\s*mindmap/.test(e),"detector"),R2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./mindmap-definition-QFDTVHPH-DdfcmeNI.js");return{diagram:t}},__vite__mapDeps([40,12,13]));return{id:bN,diagram:e}},"loader"),D2e={id:bN,detector:M2e,loader:R2e},O2e=D2e,yN="kanban",N2e=U(e=>/^\s*kanban/.test(e),"detector"),I2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./kanban-definition-6JOO6SKY-D0b2gEsK.js");return{diagram:t}},__vite__mapDeps([41,11]));return{id:yN,diagram:e}},"loader"),F2e={id:yN,detector:N2e,loader:I2e},P2e=F2e,vN="sankey",H2e=U(e=>/^\s*sankey(-beta)?/.test(e),"detector"),$2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./sankeyDiagram-XADWPNL6-BuyeAyf9.js");return{diagram:t}},__vite__mapDeps([42,27,22]));return{id:vN,diagram:e}},"loader"),j2e={id:vN,detector:H2e,loader:$2e},z2e=j2e,CN="packet",U2e=U(e=>/^\s*packet(-beta)?/.test(e),"detector"),q2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-TYMM5635-BlD2XrpC.js");return{diagram:t}},__vite__mapDeps([43,17,19,2,4,5]));return{id:CN,diagram:e}},"loader"),W2e={id:CN,detector:U2e,loader:q2e},xN="radar",Y2e=U(e=>/^\s*radar-beta/.test(e),"detector"),G2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-MMDJMWI5-oWVftPim.js");return{diagram:t}},__vite__mapDeps([44,17,19,2,4,5]));return{id:xN,diagram:e}},"loader"),V2e={id:xN,detector:Y2e,loader:G2e},SN="block",X2e=U(e=>/^\s*block(-beta)?/.test(e),"detector"),K2e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./blockDiagram-DXYQGD6D-CrM8tY-y.js");return{diagram:t}},__vite__mapDeps([45,11,5,2,1,14]));return{id:SN,diagram:e}},"loader"),Z2e={id:SN,detector:X2e,loader:K2e},Q2e=Z2e,wN="treeView",J2e=U(e=>/^\s*treeView-beta/.test(e),"detector"),e_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-5BDNPKRD-DG9c1zKo.js");return{diagram:t}},__vite__mapDeps([46,17,18,19,2,4,5]));return{id:wN,diagram:e}},"loader"),t_e={id:wN,detector:J2e,loader:e_e},r_e=t_e,TN="architecture",i_e=U(e=>/^\s*architecture/.test(e),"detector"),n_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./architectureDiagram-Q4EWVU46-l3JVHnV_.js");return{diagram:t}},__vite__mapDeps([47,17,19,2,4,5,7]));return{id:TN,diagram:e}},"loader"),s_e={id:TN,detector:i_e,loader:n_e},a_e=s_e,EN="ishikawa",o_e=U(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),l_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./ishikawaDiagram-UXIWVN3A-BBNbsPSu.js");return{diagram:t}},[]);return{id:EN,diagram:e}},"loader"),c_e={id:EN,detector:o_e,loader:l_e},kN="venn",u_e=U(e=>/^\s*venn-beta/.test(e),"detector"),h_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./vennDiagram-DHZGUBPP-cOITHLkN.js");return{diagram:t}},[]);return{id:kN,diagram:e}},"loader"),d_e={id:kN,detector:u_e,loader:h_e},f_e=d_e,AN="treemap",p_e=U(e=>/^\s*treemap/.test(e),"detector"),g_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./diagram-G4DWMVQ6-D7mtSUWN.js");return{diagram:t}},__vite__mapDeps([48,13,17,19,2,4,5,23,27,22]));return{id:AN,diagram:e}},"loader"),m_e={id:AN,detector:p_e,loader:g_e},LN="wardley-beta",__e=U(e=>/^\s*wardley-beta/i.test(e),"detector"),b_e=U(async()=>{const{diagram:e}=await er(async()=>{const{diagram:t}=await import("./wardleyDiagram-NUSXRM2D-BK2TsVYj.js");return{diagram:t}},__vite__mapDeps([49,17,19,2,4,5]));return{id:LN,diagram:e}},"loader"),y_e={id:LN,detector:__e,loader:b_e},v_e=y_e,X5=!1,Zm=U(()=>{X5||(X5=!0,yg("error",x2e,e=>e.toLowerCase().trim()==="error"),yg("---",{db:{clear:U(()=>{},"clear")},styles:{},renderer:{draw:U(()=>{},"draw")},parser:{parse:U(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:U(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),dy(E2e,O2e,a_e),dy(u1e,P2e,a2e,r2e,x1e,B1e,D1e,I1e,V1e,Q1e,b1e,p1e,B2e,E1e,p2e,u2e,b2e,$1e,z2e,W2e,q1e,Q2e,r_e,V2e,c_e,m_e,f_e,v_e))},"addDiagrams"),C_e=U(async()=>{Pe.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(El).map(async([r,{detector:i,loader:n}])=>{if(n)try{my(r)}catch{try{const{diagram:o,id:l}=await n();yg(l,o,i)}catch(o){throw Pe.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete El[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){Pe.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Pe.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),x_e="graphics-document document";function BN(e,t){e.attr("role",x_e),t!==""&&e.attr("aria-roledescription",t)}U(BN,"setA11yDiagramInfo");function MN(e,t,r,i){if(e.insert!==void 0){if(r){const n=`chart-desc-${i}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(r)}if(t){const n=`chart-title-${i}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}U(MN,"addSVGa11yTitleDescription");var Sl,cv=(Sl=class{constructor(t,r,i,n,o){this.type=t,this.text=r,this.db=i,this.parser=n,this.renderer=o}static async fromText(t,r={}){var u,f;const i=ai(),n=tC(t,i);t=W0e(t)+`
444
444
  `;try{my(n)}catch{const d=oae(n);if(!d)throw new T8(`Diagram ${n} not found.`);const{id:g,diagram:p}=await d();yg(g,p)}const{db:o,parser:l,renderer:s,init:c}=my(n);return l.parser&&(l.parser.yy=o),(u=o.clear)==null||u.call(o),c==null||c(i),r.title&&((f=o.setDiagramTitle)==null||f.call(o,r.title)),await l.parse(t),new Sl(n,t,o,l,s)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},U(Sl,"Diagram"),Sl),K5=[],S_e=U(()=>{K5.forEach(e=>{e()}),K5=[]},"attachFunctions"),w_e=U(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function RN(e){const t=e.match(w8);if(!t)return{text:e,metadata:{}};let r=Xhe(t[1],{schema:Vhe})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}U(RN,"extractFrontMatter");var T_e=U(e=>e.replace(/\r\n?/g,`
445
445
  `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),E_e=U(e=>{const{text:t,metadata:r}=RN(e),{displayMode:i,title:n,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:n,config:o,text:t}},"processFrontmatter"),k_e=U(e=>{const t=Rs.detectInit(e)??{},r=Rs.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:R0e(e),directive:t}},"processDirectives");function ex(e){const t=T_e(e),r=E_e(t),i=k_e(r.text),n=IC(r.config,i.directive);return e=w_e(i.text),{code:e,title:r.title,config:n}}U(ex,"preprocessDiagram");function DN(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}U(DN,"toBase64");var A_e=5e4,L_e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",B_e="sandbox",M_e="loose",R_e="http://www.w3.org/2000/svg",D_e="http://www.w3.org/1999/xlink",O_e="http://www.w3.org/1999/xhtml",N_e="100%",I_e="100%",F_e="border:0;margin:0;",P_e="margin:0",H_e="allow-top-navigation-by-user-activation allow-popups",$_e='The "iframe" tag is not supported by your browser.',j_e=["foreignobject"],z_e=["dominant-baseline"];function tx(e){const t=ex(e);return _g(),Nae(t.config??{}),t}U(tx,"processAndSetConfigs");async function ON(e,t){Zm();try{const{code:r,config:i}=tx(e);return{diagramType:(await IN(r)).type,config:i}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}U(ON,"parse");var Z5=U((e,t,r=[])=>`
446
446
  .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),U_e=U((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=`