cc-viewer 1.6.192 → 1.6.193

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 (131) hide show
  1. package/dist/assets/App-BCmqNn2_.js +1 -0
  2. package/dist/assets/AppHeader.module-wVvzNXcQ.js +2 -0
  3. package/dist/assets/Mobile-D8gW8cio.js +1 -0
  4. package/dist/assets/_baseUniq-ob5WCjfq.js +1 -0
  5. package/dist/assets/arc-tZK_aa2R.js +1 -0
  6. package/dist/assets/architectureDiagram-Q4EWVU46-CLUEAtql.js +1 -0
  7. package/dist/assets/blockDiagram-DXYQGD6D-xDM5WOZm.js +1 -0
  8. package/dist/assets/c4Diagram-AHTNJAMY-B6RZf0_O.js +1 -0
  9. package/dist/assets/{channel-G3S1FOvm.js → channel-yPGVmk7J.js} +1 -1
  10. package/dist/assets/chunk-4BX2VUAB-CEnrJ8lf.js +1 -0
  11. package/dist/assets/chunk-4TB4RGXK-rbexG5yC.js +1 -0
  12. package/dist/assets/chunk-55IACEB6-blt2QS_L.js +1 -0
  13. package/dist/assets/chunk-EDXVE4YY-CJab02SL.js +1 -0
  14. package/dist/assets/chunk-FMBD7UC4-b2SvZGni.js +1 -0
  15. package/dist/assets/chunk-OYMX7WX6-CTafJWoH.js +1 -0
  16. package/dist/assets/chunk-QZHKN3VN-DocThykI.js +1 -0
  17. package/dist/assets/{chunk-YZCP3GAM-BYW1PNda.js → chunk-YZCP3GAM-ntU--N7q.js} +1 -1
  18. package/dist/assets/classDiagram-6PBFFD2Q-RlKigyDm.js +1 -0
  19. package/dist/assets/classDiagram-v2-HSJHXN6E-RlKigyDm.js +1 -0
  20. package/dist/assets/clone-zoFVytWa.js +1 -0
  21. package/dist/assets/cose-bilkent-S5V4N54A-DOA8531R.js +1 -0
  22. package/dist/assets/cytoscape.esm-CT1mZavR.js +9 -0
  23. package/dist/assets/dagre-KV5264BT-B9TB-rx0.js +1 -0
  24. package/dist/assets/defaultLocale-DZ7E7S9R.js +1 -0
  25. package/dist/assets/diagram-5BDNPKRD-d4f64tiM.js +1 -0
  26. package/dist/assets/diagram-G4DWMVQ6-DAHZ4eKZ.js +1 -0
  27. package/dist/assets/diagram-MMDJMWI5-Dw-VpXtN.js +1 -0
  28. package/dist/assets/diagram-TYMM5635-BMF1VNan.js +1 -0
  29. package/dist/assets/erDiagram-SMLLAGMA-DARFHI5n.js +1 -0
  30. package/dist/assets/flowDiagram-DWJPFMVM-4zgN2SRF.js +1 -0
  31. package/dist/assets/ganttDiagram-T4ZO3ILL-DnxYMHQX.js +1 -0
  32. package/dist/assets/gitGraphDiagram-UUTBAWPF-Tkkak6GE.js +1 -0
  33. package/dist/assets/graph-C8koNCFy.js +1 -0
  34. package/dist/assets/html2canvas.esm-HFdlUwfn.js +20 -0
  35. package/dist/assets/index-Cg7laj9Y.js +2 -0
  36. package/dist/assets/infoDiagram-42DDH7IO-B3fxENEb.js +1 -0
  37. package/dist/assets/{init-C7FSzFHJ.js → init-DMZMl1PR.js} +1 -1
  38. package/dist/assets/ishikawaDiagram-UXIWVN3A-DSYRAz6c.js +1 -0
  39. package/dist/assets/journeyDiagram-VCZTEJTY-C1ULMq89.js +1 -0
  40. package/dist/assets/kanban-definition-6JOO6SKY-DiS9f1Ou.js +1 -0
  41. package/dist/assets/katex-DSO9-KAp.js +1 -0
  42. package/dist/assets/layout-Dw7PqMj_.js +1 -0
  43. package/dist/assets/linear-CzxAHmCK.js +1 -0
  44. package/dist/assets/mermaid.core-DaRhWNVu.js +7 -0
  45. package/dist/assets/min-CYyUMv00.js +1 -0
  46. package/dist/assets/mindmap-definition-QFDTVHPH-BSnxqws_.js +1 -0
  47. package/dist/assets/ordinal-DA-_8pMy.js +1 -0
  48. package/dist/assets/pieDiagram-DEJITSTG-DLqzHBqi.js +1 -0
  49. package/dist/assets/quadrantDiagram-34T5L4WZ-BxGLS3JO.js +1 -0
  50. package/dist/assets/requirementDiagram-MS252O5E-CFH2qTHK.js +1 -0
  51. package/dist/assets/sankeyDiagram-XADWPNL6-CbI11f-J.js +1 -0
  52. package/dist/assets/sequenceDiagram-FGHM5R23-WQeKqjGD.js +1 -0
  53. package/dist/assets/stateDiagram-FHFEXIEX--nhFK-dR.js +1 -0
  54. package/dist/assets/stateDiagram-v2-QKLJ7IA2-DpubT_1_.js +1 -0
  55. package/dist/assets/timeline-definition-GMOUNBTQ-Dvcn0Sjo.js +1 -0
  56. package/dist/assets/vendor-antd-n6I8Q8WX.js +17 -0
  57. package/dist/assets/vendor-codemirror-CXzpjiCu.js +1 -0
  58. package/dist/assets/vendor-highlight-IFTJ9nxW.js +1 -0
  59. package/dist/assets/vendor-markdown-Bpu4AByL.js +1 -0
  60. package/dist/assets/vendor-qrcode-CVdDMI3Y.js +6 -0
  61. package/dist/assets/vendor-virtuoso-bstsOWAx.js +1 -0
  62. package/dist/assets/vendor-xterm-DckPrCx1.js +37 -0
  63. package/dist/assets/vennDiagram-DHZGUBPP-Bjjoa-3c.js +1 -0
  64. package/dist/assets/wardley-RL74JXVD-D8p4v9Ts.js +1 -0
  65. package/dist/assets/wardleyDiagram-NUSXRM2D-DoGm-2Kz.js +1 -0
  66. package/dist/assets/xychartDiagram-5P7HB3ND-D2jULfQB.js +1 -0
  67. package/dist/index.html +3 -3
  68. package/package.json +2 -1
  69. package/dist/assets/App-DuGHwadX.js +0 -31
  70. package/dist/assets/AppHeader.module-CozRDKfP.js +0 -573
  71. package/dist/assets/Mobile-Bab634xx.js +0 -10
  72. package/dist/assets/_baseUniq-DJPPdHyT.js +0 -1
  73. package/dist/assets/arc-DZ3Bjq-l.js +0 -1
  74. package/dist/assets/architectureDiagram-Q4EWVU46-xy0J2lr0.js +0 -36
  75. package/dist/assets/blockDiagram-DXYQGD6D-CoUm8UC5.js +0 -132
  76. package/dist/assets/c4Diagram-AHTNJAMY-CFHX4Dfx.js +0 -10
  77. package/dist/assets/chunk-4BX2VUAB-CiktxOyY.js +0 -1
  78. package/dist/assets/chunk-4TB4RGXK-DHl7ZlQV.js +0 -206
  79. package/dist/assets/chunk-55IACEB6-DcgWxDD5.js +0 -1
  80. package/dist/assets/chunk-EDXVE4YY-DeUzWpQx.js +0 -1
  81. package/dist/assets/chunk-FMBD7UC4-BCaKpugk.js +0 -15
  82. package/dist/assets/chunk-OYMX7WX6-DKMEMbG9.js +0 -231
  83. package/dist/assets/chunk-QZHKN3VN-BREApeQ-.js +0 -1
  84. package/dist/assets/classDiagram-6PBFFD2Q-B0-7EUsz.js +0 -1
  85. package/dist/assets/classDiagram-v2-HSJHXN6E-B0-7EUsz.js +0 -1
  86. package/dist/assets/clone-CX_D5SrR.js +0 -1
  87. package/dist/assets/cose-bilkent-S5V4N54A-DpwiMCiq.js +0 -1
  88. package/dist/assets/cytoscape.esm-BMgRe88L.js +0 -331
  89. package/dist/assets/dagre-KV5264BT-Dc7qbya2.js +0 -4
  90. package/dist/assets/defaultLocale-CcTwRAjA.js +0 -1
  91. package/dist/assets/diagram-5BDNPKRD-v7FsHeLQ.js +0 -10
  92. package/dist/assets/diagram-G4DWMVQ6-BhKNBlcE.js +0 -24
  93. package/dist/assets/diagram-MMDJMWI5-C-3cRdzG.js +0 -43
  94. package/dist/assets/diagram-TYMM5635-HfNcJIfT.js +0 -24
  95. package/dist/assets/erDiagram-SMLLAGMA-Ckj0dkk7.js +0 -85
  96. package/dist/assets/flowDiagram-DWJPFMVM-yf315tJr.js +0 -162
  97. package/dist/assets/ganttDiagram-T4ZO3ILL-Ch2bINVC.js +0 -292
  98. package/dist/assets/gitGraphDiagram-UUTBAWPF-CesdgsJi.js +0 -106
  99. package/dist/assets/graph-CRpmapJV.js +0 -1
  100. package/dist/assets/html2canvas.esm-B8c0f9Wq.js +0 -22
  101. package/dist/assets/index-DJ0iGKLy.js +0 -2
  102. package/dist/assets/infoDiagram-42DDH7IO-CuD16P9Y.js +0 -2
  103. package/dist/assets/ishikawaDiagram-UXIWVN3A-4y8aG54G.js +0 -70
  104. package/dist/assets/journeyDiagram-VCZTEJTY-B6TtR2Zk.js +0 -139
  105. package/dist/assets/kanban-definition-6JOO6SKY-DTcNHYUS.js +0 -89
  106. package/dist/assets/katex-CJRKSY_b.js +0 -257
  107. package/dist/assets/layout-CX5hpkD2.js +0 -1
  108. package/dist/assets/linear-tWlC-NXc.js +0 -1
  109. package/dist/assets/mermaid.core-DNvsWVDx.js +0 -308
  110. package/dist/assets/min-CDExe3RN.js +0 -1
  111. package/dist/assets/mindmap-definition-QFDTVHPH-CW0yNQcb.js +0 -96
  112. package/dist/assets/ordinal-aRyHI6gl.js +0 -1
  113. package/dist/assets/pieDiagram-DEJITSTG-DNrnOqmz.js +0 -30
  114. package/dist/assets/quadrantDiagram-34T5L4WZ-Cl176vnh.js +0 -7
  115. package/dist/assets/requirementDiagram-MS252O5E-DKp3A5f_.js +0 -84
  116. package/dist/assets/sankeyDiagram-XADWPNL6-BMV0lAz8.js +0 -10
  117. package/dist/assets/sequenceDiagram-FGHM5R23-CQ4preep.js +0 -157
  118. package/dist/assets/stateDiagram-FHFEXIEX-BKqYYN8H.js +0 -1
  119. package/dist/assets/stateDiagram-v2-QKLJ7IA2-C1W1ECmZ.js +0 -1
  120. package/dist/assets/timeline-definition-GMOUNBTQ-4kgeuumv.js +0 -120
  121. package/dist/assets/vendor-antd-Dk5s46Ag.js +0 -406
  122. package/dist/assets/vendor-codemirror-DxvDOrio.js +0 -46
  123. package/dist/assets/vendor-highlight-DVwgAdJY.js +0 -3
  124. package/dist/assets/vendor-markdown-DO-Ppp4f.js +0 -60
  125. package/dist/assets/vendor-qrcode-hI5wlAgK.js +0 -9
  126. package/dist/assets/vendor-virtuoso-HW77kTCh.js +0 -1
  127. package/dist/assets/vendor-xterm-D2cUrYEx.js +0 -140
  128. package/dist/assets/vennDiagram-DHZGUBPP-CqBcUIdK.js +0 -34
  129. package/dist/assets/wardley-RL74JXVD-CbEnkKx8.js +0 -162
  130. package/dist/assets/wardleyDiagram-NUSXRM2D-BJrjkZMg.js +0 -20
  131. package/dist/assets/xychartDiagram-5P7HB3ND-D8aBEz8e.js +0 -7
@@ -1,140 +0,0 @@
1
- /**
2
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
- * @license MIT
4
- *
5
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
6
- * @license MIT
7
- *
8
- * Originally forked from (with the author's permission):
9
- * Fabrice Bellard's javascript vt100 for jslinux:
10
- * http://bellard.org/jslinux/
11
- * Copyright (c) 2011 Fabrice Bellard
12
- */var zs=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,Ll=(s15,t)=>{for(var e in t)zs(s15,e,{get:t[e],enumerable:!0})},M$1=(s15,t,e,i8)=>{for(var r5=i8>1?void 0:i8?Rl(t,e):t,n=s15.length-1,o2;n>=0;n--)(o2=s15[n])&&(r5=(i8?o2(t,e,r5):o2(r5))||r5);return i8&&r5&&zs(t,e,r5),r5},S=(s15,t)=>(e,i8)=>t(e,i8,s15),Gs="Terminal input",mi$1={get:()=>Gs,set:s15=>Gs=s15},$s="Too much output to announce, navigate to rows manually to read",_i$1={get:()=>$s,set:s15=>$s=s15};function Al(s15){return s15.replace(/\r?\n/g,"\r")}function kl(s15,t){return t?"\x1B[200~"+s15+"\x1B[201~":s15}function Vs(s15,t){s15.clipboardData&&s15.clipboardData.setData("text/plain",t.selectionText),s15.preventDefault()}function qs(s15,t,e,i8){if(s15.stopPropagation(),s15.clipboardData){let r5=s15.clipboardData.getData("text/plain");Cn(r5,t,e,i8)}}function Cn(s15,t,e,i8){s15=Al(s15),s15=kl(s15,e.decPrivateModes.bracketedPasteMode&&i8.rawOptions.ignoreBracketedPasteMode!==!0),e.triggerDataEvent(s15,!0),t.value=""}function Mn$1(s15,t,e){let i8=e.getBoundingClientRect(),r5=s15.clientX-i8.left-10,n=s15.clientY-i8.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r5}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Pn$1(s15,t,e,i8,r5){Mn$1(s15,t,e),r5&&i8.rightClickSelect(s15),t.value=i8.selectionText,t.select()}function Ce$1(s15){return s15>65535?(s15-=65536,String.fromCharCode((s15>>10)+55296)+String.fromCharCode(s15%1024+56320)):String.fromCharCode(s15)}function It$1(s15,t=0,e=s15.length){let i8="";for(let r5=t;r5<e;++r5){let n=s15[r5];n>65535?(n-=65536,i8+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):i8+=String.fromCharCode(n)}return i8}var er$1=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){let i8=t.length;if(!i8)return 0;let r5=0,n=0;if(this._interim){let o2=t.charCodeAt(n++);56320<=o2&&o2<=57343?e[r5++]=(this._interim-55296)*1024+o2-56320+65536:(e[r5++]=this._interim,e[r5++]=o2),this._interim=0}for(let o2=n;o2<i8;++o2){let l2=t.charCodeAt(o2);if(55296<=l2&&l2<=56319){if(++o2>=i8)return this._interim=l2,r5;let a=t.charCodeAt(o2);56320<=a&&a<=57343?e[r5++]=(l2-55296)*1024+a-56320+65536:(e[r5++]=l2,e[r5++]=a);continue}l2!==65279&&(e[r5++]=l2)}return r5}},tr$1=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){let i8=t.length;if(!i8)return 0;let r5=0,n,o2,l2,a,u=0,h2=0;if(this.interim[0]){let _2=!1,p=this.interim[0];p&=(p&224)===192?31:(p&240)===224?15:7;let m=0,f;for(;(f=this.interim[++m]&63)&&m<4;)p<<=6,p|=f;let A2=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,R=A2-m;for(;h2<R;){if(h2>=i8)return 0;if(f=t[h2++],(f&192)!==128){h2--,_2=!0;break}else this.interim[m++]=f,p<<=6,p|=f&63}_2||(A2===2?p<128?h2--:e[r5++]=p:A2===3?p<2048||p>=55296&&p<=57343||p===65279||(e[r5++]=p):p<65536||p>1114111||(e[r5++]=p)),this.interim.fill(0)}let c=i8-4,d=h2;for(;d<i8;){for(;d<c&&!((n=t[d])&128)&&!((o2=t[d+1])&128)&&!((l2=t[d+2])&128)&&!((a=t[d+3])&128);)e[r5++]=n,e[r5++]=o2,e[r5++]=l2,e[r5++]=a,d+=4;if(n=t[d++],n<128)e[r5++]=n;else if((n&224)===192){if(d>=i8)return this.interim[0]=n,r5;if(o2=t[d++],(o2&192)!==128){d--;continue}if(u=(n&31)<<6|o2&63,u<128){d--;continue}e[r5++]=u}else if((n&240)===224){if(d>=i8)return this.interim[0]=n,r5;if(o2=t[d++],(o2&192)!==128){d--;continue}if(d>=i8)return this.interim[0]=n,this.interim[1]=o2,r5;if(l2=t[d++],(l2&192)!==128){d--;continue}if(u=(n&15)<<12|(o2&63)<<6|l2&63,u<2048||u>=55296&&u<=57343||u===65279)continue;e[r5++]=u}else if((n&248)===240){if(d>=i8)return this.interim[0]=n,r5;if(o2=t[d++],(o2&192)!==128){d--;continue}if(d>=i8)return this.interim[0]=n,this.interim[1]=o2,r5;if(l2=t[d++],(l2&192)!==128){d--;continue}if(d>=i8)return this.interim[0]=n,this.interim[1]=o2,this.interim[2]=l2,r5;if(a=t[d++],(a&192)!==128){d--;continue}if(u=(n&7)<<18|(o2&63)<<12|(l2&63)<<6|a&63,u<65536||u>1114111)continue;e[r5++]=u}}return r5}},ir="",we=" ",De$2=class s{constructor(){this.fg=0,this.bg=0,this.extended=new rt$1}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new s;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},rt$1=class s2{constructor(t=0,e=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=e}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new s2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},q=class s3 extends De$2{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new rt$1,this.combinedData=""}static fromCharData(e){let i8=new s3;return i8.setFromCharData(e),i8}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ce$1(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i8=!1;if(e[1].length>2)i8=!0;else if(e[1].length===2){let r5=e[1].charCodeAt(0);if(55296<=r5&&r5<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r5-55296)*1024+n-56320+65536|e[2]<<22:i8=!0}else i8=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i8&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},js="di$target",Hn$1="di$dependencies",Fn$1=new Map;function Xs(s15){return s15[Hn$1]||[]}function ie$1(s15){if(Fn$1.has(s15))return Fn$1.get(s15);let t=function(e,i8,r5){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Pl(t,e,r5)};return t._id=s15,Fn$1.set(s15,t),t}function Pl(s15,t,e){t[js]===t?t[Hn$1].push({id:s15,index:e}):(t[Hn$1]=[{id:s15,index:e}],t[js]=t)}var F$1=ie$1("BufferService"),rr=ie$1("CoreMouseService"),ge$2=ie$1("CoreService"),Zs=ie$1("CharsetService"),xt$2=ie$1("InstantiationService"),nr$1=ie$1("LogService"),H$2=ie$1("OptionsService"),sr=ie$1("OscLinkService"),Js=ie$1("UnicodeService"),Be$1=ie$1("DecorationService"),wt$1=class{constructor(t,e,i8){this._bufferService=t,this._optionsService=e,this._oscLinkService=i8}provideLinks(t,e){var _a7;let i8=this._bufferService.buffer.lines.get(t-1);if(!i8){e(void 0);return}let r5=[],n=this._optionsService.rawOptions.linkHandler,o2=new q,l2=i8.getTrimmedLength(),a=-1,u=-1,h2=!1;for(let c=0;c<l2;c++)if(!(u===-1&&!i8.hasContent(c))){if(i8.loadCell(c,o2),o2.hasExtendedAttrs()&&o2.extended.urlId)if(u===-1){u=c,a=o2.extended.urlId;continue}else h2=o2.extended.urlId!==a;else u!==-1&&(h2=!0);if(h2||u!==-1&&c===l2-1){let d=(_a7=this._oscLinkService.getLinkData(a))==null?void 0:_a7.uri;if(d){let _2={start:{x:u+1,y:t},end:{x:c+(!h2&&c===l2-1?1:0),y:t}},p=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{let m=new URL(d);["http:","https:"].includes(m.protocol)||(p=!0)}catch{p=!0}p||r5.push({text:d,range:_2,activate:(m,f)=>n?n.activate(m,f,_2):Ol(m,f),hover:(m,f)=>{var _a8;return(_a8=n==null?void 0:n.hover)==null?void 0:_a8.call(n,m,f,_2)},leave:(m,f)=>{var _a8;return(_a8=n==null?void 0:n.leave)==null?void 0:_a8.call(n,m,f,_2)}})}h2=!1,o2.hasExtendedAttrs()&&o2.extended.urlId?(u=c,a=o2.extended.urlId):(u=-1,a=-1)}}e(r5)}};wt$1=M$1([S(0,F$1),S(1,H$2),S(2,sr)],wt$1);function Ol(s15,t){if(confirm(`Do you want to navigate to ${t}?
13
-
14
- WARNING: This link could potentially be dangerous`)){let i8=window.open();if(i8){try{i8.opener=null}catch{}i8.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var nt$1=ie$1("CharSizeService"),ae$1=ie$1("CoreBrowserService"),Dt$1=ie$1("MouseService"),ce$1=ie$1("RenderService"),Qs=ie$1("SelectionService"),or=ie$1("CharacterJoinerService"),Re=ie$1("ThemeService"),lr=ie$1("LinkProviderService"),Wn$1=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?ar.isErrorNoTelemetry(t)?new ar(t.message+`
15
-
16
- `+t.stack):new Error(t.message+`
17
-
18
- `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Bl=new Wn$1;function Lt$1(s15){Nl(s15)||Bl.onUnexpectedError(s15)}var Un$1="Canceled";function Nl(s15){return s15 instanceof bi$1?!0:s15 instanceof Error&&s15.name===Un$1&&s15.message===Un$1}var bi$1=class extends Error{constructor(){super(Un$1),this.name=this.message}};function eo(s15){return new Error(`Illegal argument: ${s15}`)}var ar=class s4 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof s4)return t;let e=new s4;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Rt$1=class s5 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,s5.prototype)}};function Se(s15,t=0){return s15[s15.length-(1+t)]}var ro;(l2=>{function s15(a){return a<0}l2.isLessThan=s15;function t(a){return a<=0}l2.isLessThanOrEqual=t;function e(a){return a>0}l2.isGreaterThan=e;function i8(a){return a===0}l2.isNeitherLessOrGreaterThan=i8,l2.greaterThan=1,l2.lessThan=-1,l2.neitherLessOrGreaterThan=0})(ro||(ro={}));function Kn$1(s15,t){let e=this,i8=!1,r5;return function(){return i8||(i8=!0,t||(r5=s15.apply(e,arguments))),r5}}var zn$1;(O2=>{function s15(I2){return I2&&typeof I2=="object"&&typeof I2[Symbol.iterator]=="function"}O2.is=s15;let t=Object.freeze([]);function e(){return t}O2.empty=e;function*i8(I2){yield I2}O2.single=i8;function r5(I2){return s15(I2)?I2:i8(I2)}O2.wrap=r5;function n(I2){return I2||t}O2.from=n;function*o2(I2){for(let k2=I2.length-1;k2>=0;k2--)yield I2[k2]}O2.reverse=o2;function l2(I2){return!I2||I2[Symbol.iterator]().next().done===!0}O2.isEmpty=l2;function a(I2){return I2[Symbol.iterator]().next().value}O2.first=a;function u(I2,k2){let P=0;for(let oe of I2)if(k2(oe,P++))return!0;return!1}O2.some=u;function h2(I2,k2){for(let P of I2)if(k2(P))return P}O2.find=h2;function*c(I2,k2){for(let P of I2)k2(P)&&(yield P)}O2.filter=c;function*d(I2,k2){let P=0;for(let oe of I2)yield k2(oe,P++)}O2.map=d;function*_2(I2,k2){let P=0;for(let oe of I2)yield*k2(oe,P++)}O2.flatMap=_2;function*p(...I2){for(let k2 of I2)yield*k2}O2.concat=p;function m(I2,k2,P){let oe=P;for(let Me2 of I2)oe=k2(oe,Me2);return oe}O2.reduce=m;function*f(I2,k2,P=I2.length){for(k2<0&&(k2+=I2.length),P<0?P+=I2.length:P>I2.length&&(P=I2.length);k2<P;k2++)yield I2[k2]}O2.slice=f;function A2(I2,k2=Number.POSITIVE_INFINITY){let P=[];if(k2===0)return[P,I2];let oe=I2[Symbol.iterator]();for(let Me2=0;Me2<k2;Me2++){let Pe2=oe.next();if(Pe2.done)return[P,O2.empty()];P.push(Pe2.value)}return[P,{[Symbol.iterator](){return oe}}]}O2.consume=A2;async function R(I2){let k2=[];for await(let P of I2)k2.push(P);return Promise.resolve(k2)}O2.asyncToArray=R})(zn$1||(zn$1={}));function Ne(s15){if(zn$1.is(s15)){let t=[];for(let e of s15)if(e)try{e.dispose()}catch(i8){t.push(i8)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(s15)?[]:s15}else if(s15)return s15.dispose(),s15}function ho(...s15){return C$2(()=>Ne(s15))}function C$2(s15){return{dispose:Kn$1(()=>{s15()})}}var dr=class dr2{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ne(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?dr2.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};dr.DISABLE_DISPOSED_WARNING=!1;var Ee$2=dr,D$1=class{constructor(){this._store=new Ee$2,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};D$1.None=Object.freeze({dispose(){}});var ye$2=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var _a7;this._isDisposed||t===this._value||((_a7=this._value)==null||_a7.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var _a7;this._isDisposed=!0,(_a7=this._value)==null||_a7.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},fe$2=typeof window=="object"?window:globalThis,kt$1=class kt{constructor(t){this.element=t,this.next=kt.Undefined,this.prev=kt.Undefined}};kt$1.Undefined=new kt$1(void 0);var G$1=kt$1,Ct$1=class{constructor(){this._first=G$1.Undefined,this._last=G$1.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===G$1.Undefined}clear(){let t=this._first;for(;t!==G$1.Undefined;){let e=t.next;t.prev=G$1.Undefined,t.next=G$1.Undefined,t=e}this._first=G$1.Undefined,this._last=G$1.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let i8=new G$1(t);if(this._first===G$1.Undefined)this._first=i8,this._last=i8;else if(e){let n=this._last;this._last=i8,i8.prev=n,n.next=i8}else{let n=this._first;this._first=i8,i8.next=n,n.prev=i8}this._size+=1;let r5=!1;return()=>{r5||(r5=!0,this._remove(i8))}}shift(){if(this._first!==G$1.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==G$1.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==G$1.Undefined&&t.next!==G$1.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===G$1.Undefined&&t.next===G$1.Undefined?(this._first=G$1.Undefined,this._last=G$1.Undefined):t.next===G$1.Undefined?(this._last=this._last.prev,this._last.next=G$1.Undefined):t.prev===G$1.Undefined&&(this._first=this._first.next,this._first.prev=G$1.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==G$1.Undefined;)yield t.element,t=t.next}},zl=globalThis.performance&&typeof globalThis.performance.now=="function",mr$1=class s6{static create(t){return new s6(t)}constructor(t){this._now=zl&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},$;(Qe=>{Qe.None=()=>D$1.None;function e(y,T){return d(y,()=>{},0,void 0,!0,void 0,T)}Qe.defer=e;function i8(y){return(T,g2=null,w2)=>{let E=!1,x;return x=y(N2=>{if(!E)return x?x.dispose():E=!0,T.call(g2,N2)},null,w2),E&&x.dispose(),x}}Qe.once=i8;function r5(y,T,g2){return h2((w2,E=null,x)=>y(N2=>w2.call(E,T(N2)),null,x),g2)}Qe.map=r5;function n(y,T,g2){return h2((w2,E=null,x)=>y(N2=>{T(N2),w2.call(E,N2)},null,x),g2)}Qe.forEach=n;function o2(y,T,g2){return h2((w2,E=null,x)=>y(N2=>T(N2)&&w2.call(E,N2),null,x),g2)}Qe.filter=o2;function l2(y){return y}Qe.signal=l2;function a(...y){return(T,g2=null,w2)=>{let E=ho(...y.map(x=>x(N2=>T.call(g2,N2))));return c(E,w2)}}Qe.any=a;function u(y,T,g2,w2){let E=g2;return r5(y,x=>(E=T(E,x),E),w2)}Qe.reduce=u;function h2(y,T){let g2,w2={onWillAddFirstListener(){g2=y(E.fire,E)},onDidRemoveLastListener(){g2==null||g2.dispose()}},E=new v$1(w2);return T==null||T.add(E),E.event}function c(y,T){return T instanceof Array?T.push(y):T&&T.add(y),y}function d(y,T,g2=100,w2=!1,E=!1,x,N2){let Z2,te3,Oe2,ze2=0,le2,et2={leakWarningThreshold:x,onWillAddFirstListener(){Z2=y(ht=>{ze2++,te3=T(te3,ht),w2&&!Oe2&&(me2.fire(te3),te3=void 0),le2=()=>{let fi2=te3;te3=void 0,Oe2=void 0,(!w2||ze2>1)&&me2.fire(fi2),ze2=0},typeof g2=="number"?(clearTimeout(Oe2),Oe2=setTimeout(le2,g2)):Oe2===void 0&&(Oe2=0,queueMicrotask(le2))})},onWillRemoveListener(){E&&ze2>0&&(le2==null||le2())},onDidRemoveLastListener(){le2=void 0,Z2.dispose()}},me2=new v$1(et2);return N2==null||N2.add(me2),me2.event}Qe.debounce=d;function _2(y,T=0,g2){return Qe.debounce(y,(w2,E)=>w2?(w2.push(E),w2):[E],T,void 0,!0,void 0,g2)}Qe.accumulate=_2;function p(y,T=(w2,E)=>w2===E,g2){let w2=!0,E;return o2(y,x=>{let N2=w2||!T(x,E);return w2=!1,E=x,N2},g2)}Qe.latch=p;function m(y,T,g2){return[Qe.filter(y,T,g2),Qe.filter(y,w2=>!T(w2),g2)]}Qe.split=m;function f(y,T=!1,g2=[],w2){let E=g2.slice(),x=y(te3=>{E?E.push(te3):Z2.fire(te3)});w2&&w2.add(x);let N2=()=>{E==null||E.forEach(te3=>Z2.fire(te3)),E=null},Z2=new v$1({onWillAddFirstListener(){x||(x=y(te3=>Z2.fire(te3)),w2&&w2.add(x))},onDidAddFirstListener(){E&&(T?setTimeout(N2):N2())},onDidRemoveLastListener(){x&&x.dispose(),x=null}});return w2&&w2.add(Z2),Z2.event}Qe.buffer=f;function A2(y,T){return(w2,E,x)=>{let N2=T(new O2);return y(function(Z2){let te3=N2.evaluate(Z2);te3!==R&&w2.call(E,te3)},void 0,x)}}Qe.chain=A2;let R=Symbol("HaltChainable");class O2{constructor(){this.steps=[]}map(T){return this.steps.push(T),this}forEach(T){return this.steps.push(g2=>(T(g2),g2)),this}filter(T){return this.steps.push(g2=>T(g2)?g2:R),this}reduce(T,g2){let w2=g2;return this.steps.push(E=>(w2=T(w2,E),w2)),this}latch(T=(g2,w2)=>g2===w2){let g2=!0,w2;return this.steps.push(E=>{let x=g2||!T(E,w2);return g2=!1,w2=E,x?E:R}),this}evaluate(T){for(let g2 of this.steps)if(T=g2(T),T===R)break;return T}}function I2(y,T,g2=w2=>w2){let w2=(...Z2)=>N2.fire(g2(...Z2)),E=()=>y.on(T,w2),x=()=>y.removeListener(T,w2),N2=new v$1({onWillAddFirstListener:E,onDidRemoveLastListener:x});return N2.event}Qe.fromNodeEventEmitter=I2;function k2(y,T,g2=w2=>w2){let w2=(...Z2)=>N2.fire(g2(...Z2)),E=()=>y.addEventListener(T,w2),x=()=>y.removeEventListener(T,w2),N2=new v$1({onWillAddFirstListener:E,onDidRemoveLastListener:x});return N2.event}Qe.fromDOMEventEmitter=k2;function P(y){return new Promise(T=>i8(y)(T))}Qe.toPromise=P;function oe(y){let T=new v$1;return y.then(g2=>{T.fire(g2)},()=>{T.fire(void 0)}).finally(()=>{T.dispose()}),T.event}Qe.fromPromise=oe;function Me2(y,T){return y(g2=>T.fire(g2))}Qe.forward=Me2;function Pe2(y,T,g2){return T(g2),y(w2=>T(w2))}Qe.runAndSubscribe=Pe2;class Ke2{constructor(T,g2){this._observable=T,this._counter=0,this._hasChanged=!1;let w2={onWillAddFirstListener:()=>{T.addObserver(this)},onDidRemoveLastListener:()=>{T.removeObserver(this)}};this.emitter=new v$1(w2),g2&&g2.add(this.emitter)}beginUpdate(T){this._counter++}handlePossibleChange(T){}handleChange(T,g2){this._hasChanged=!0}endUpdate(T){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function di(y,T){return new Ke2(y,T).emitter.event}Qe.fromObservable=di;function V2(y){return(T,g2,w2)=>{let E=0,x=!1,N2={beginUpdate(){E++},endUpdate(){E--,E===0&&(y.reportChanges(),x&&(x=!1,T.call(g2)))},handlePossibleChange(){},handleChange(){x=!0}};y.addObserver(N2),y.reportChanges();let Z2={dispose(){y.removeObserver(N2)}};return w2 instanceof Ee$2?w2.add(Z2):Array.isArray(w2)&&w2.push(Z2),Z2}}Qe.fromObservableLight=V2})($||($={}));var Mt$1=class Mt{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Mt._idPool++}`,Mt.all.add(this)}start(t){this._stopWatch=new mr$1,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Mt$1.all=new Set,Mt$1._idPool=0;var $n$1=Mt$1,po=-1,br$1=class br{constructor(t,e,i8=(br._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=e,this.name=i8,this._warnCountdown=0}dispose(){var _a7;(_a7=this._stacks)==null||_a7.clear()}check(t,e){let i8=this.threshold;if(i8<=0||e<i8)return;this._stacks||(this._stacks=new Map);let r5=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r5+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i8*.5;let[n,o2]=this.getMostFrequentStack(),l2=`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${o2}):`;console.warn(l2),console.warn(n);let a=new qn(l2,n);this._errorHandler(a)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,e=0;for(let[i8,r5]of this._stacks)(!t||e<r5)&&(t=[i8,r5],e=r5);return t}};br$1._idPool=1;var Vn$1=br$1,gi$1=class s7{constructor(t){this.value=t}static create(){let t=new Error;return new s7(t.stack??"")}print(){console.warn(this.value.split(`
19
- `).slice(2).join(`
20
- `))}},qn=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},Yn=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Vl=0,Pt$1=class{constructor(t){this.value=t,this.id=Vl++}},ql=2,_r$1,v$1=class{constructor(t){var _a7,_b,_c2,_d;this._size=0,this._options=t,this._leakageMon=(_a7=this._options)!=null&&_a7.leakWarningThreshold?new Vn$1((t==null?void 0:t.onListenerError)??Lt$1,((_b=this._options)==null?void 0:_b.leakWarningThreshold)??po):void 0,this._perfMon=(_c2=this._options)!=null&&_c2._profName?new $n$1(this._options._profName):void 0,this._deliveryQueue=(_d=this._options)==null?void 0:_d.deliveryQueue}dispose(){var _a7,_b,_c2,_d;this._disposed||(this._disposed=!0,((_a7=this._deliveryQueue)==null?void 0:_a7.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(_c2=(_b=this._options)==null?void 0:_b.onDidRemoveLastListener)==null||_c2.call(_b),(_d=this._leakageMon)==null||_d.dispose())}get event(){return this._event??(this._event=(t,e,i8)=>{var _a7,_b,_c2,_d,_e3;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h2=new Yn(`${a}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(((_a7=this._options)==null?void 0:_a7.onListenerError)||Lt$1)(h2),D$1.None}if(this._disposed)return D$1.None;e&&(t=t.bind(e));let r5=new Pt$1(t),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r5.stack=gi$1.create(),n=this._leakageMon.check(r5.stack,this._size+1)),this._listeners?this._listeners instanceof Pt$1?(this._deliveryQueue??(this._deliveryQueue=new jn$1),this._listeners=[this._listeners,r5]):this._listeners.push(r5):((_c2=(_b=this._options)==null?void 0:_b.onWillAddFirstListener)==null||_c2.call(_b,this),this._listeners=r5,(_e3=(_d=this._options)==null?void 0:_d.onDidAddFirstListener)==null||_e3.call(_d,this)),this._size++;let l2=C$2(()=>{n==null||n(),this._removeListener(r5)});return i8 instanceof Ee$2?i8.add(l2):Array.isArray(i8)&&i8.push(l2),l2}),this._event}_removeListener(t){var _a7,_b,_c2,_d;if((_b=(_a7=this._options)==null?void 0:_a7.onWillRemoveListener)==null||_b.call(_a7,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(_d=(_c2=this._options)==null?void 0:_c2.onDidRemoveLastListener)==null||_d.call(_c2,this),this._size=0;return}let e=this._listeners,i8=e.indexOf(t);if(i8===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i8]=void 0;let r5=this._deliveryQueue.current===this;if(this._size*ql<=e.length){let n=0;for(let o2=0;o2<e.length;o2++)e[o2]?e[n++]=e[o2]:r5&&(this._deliveryQueue.end--,n<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=n}}_deliver(t,e){var _a7;if(!t)return;let i8=((_a7=this._options)==null?void 0:_a7.onListenerError)||Lt$1;if(!i8){t.value(e);return}try{t.value(e)}catch(r5){i8(r5)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){var _a7,_b,_c2,_d;if((_a7=this._deliveryQueue)!=null&&_a7.current&&(this._deliverQueue(this._deliveryQueue),(_b=this._perfMon)==null||_b.stop()),(_c2=this._perfMon)==null||_c2.start(this._size),this._listeners)if(this._listeners instanceof Pt$1)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}(_d=this._perfMon)==null||_d.stop()}hasListeners(){return this._size>0}},jn$1=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i8){this.i=0,this.end=i8,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},gr=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new v$1,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new v$1,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,e){if(this.getZoomLevel(e)===t)return;let i8=this.getWindowId(e);this.mapWindowIdToZoomLevel.set(i8,t),this._onDidChangeZoomLevel.fire(i8)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,e){this.mapWindowIdToZoomFactor.set(this.getWindowId(e),t)}setFullscreen(t,e){if(this.isFullscreen(e)===t)return;let i8=this.getWindowId(e);this.mapWindowIdToFullScreen.set(i8,t),this._onDidChangeFullscreen.fire(i8)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};gr.INSTANCE=new gr;var Si$1=gr;function Xl(s15,t,e){typeof t=="string"&&(t=s15.matchMedia(t)),t.addEventListener("change",e)}Si$1.INSTANCE.onDidChangeZoomLevel;function mo(s15){return Si$1.INSTANCE.getZoomFactor(s15)}Si$1.INSTANCE.onDidChangeFullscreen;var Ot$1=typeof navigator=="object"?navigator.userAgent:"",Ei$1=Ot$1.indexOf("Firefox")>=0,Bt$1=Ot$1.indexOf("AppleWebKit")>=0,Ti$1=Ot$1.indexOf("Chrome")>=0,Sr=!Ti$1&&Ot$1.indexOf("Safari")>=0;Ot$1.indexOf("Electron/")>=0;Ot$1.indexOf("Android")>=0;var vr$1=!1;if(typeof fe$2.matchMedia=="function"){let s15=fe$2.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=fe$2.matchMedia("(display-mode: fullscreen)");vr$1=s15.matches,Xl(fe$2,s15,({matches:e})=>{vr$1&&t.matches||(vr$1=e)})}var Nt$1="en",yr=!1,xr$1=!1,Ii$1=!1,vo=!1,Tr,Ir=Nt$1,bo=Nt$1,ia,$e,Ve$1=globalThis,xe$1,_a;typeof Ve$1.vscode<"u"&&typeof Ve$1.vscode.process<"u"?xe$1=Ve$1.vscode.process:typeof process<"u"&&typeof((_a=process==null?void 0:process.versions)==null?void 0:_a.node)=="string"&&(xe$1=process);var _a2,So=typeof((_a2=xe$1==null?void 0:xe$1.versions)==null?void 0:_a2.electron)=="string",ra=So&&(xe$1==null?void 0:xe$1.type)==="renderer",_a3;if(typeof xe$1=="object"){yr=xe$1.platform==="win32",xr$1=xe$1.platform==="darwin",Ii$1=xe$1.platform==="linux",Ii$1&&xe$1.env.SNAP&&xe$1.env.SNAP_REVISION,xe$1.env.CI||xe$1.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Tr=Nt$1,Ir=Nt$1;let s15=xe$1.env.VSCODE_NLS_CONFIG;if(s15)try{let t=JSON.parse(s15);Tr=t.userLocale,bo=t.osLocale,Ir=t.resolvedLanguage||Nt$1,ia=(_a3=t.languagePack)==null?void 0:_a3.translationsConfigFile}catch{}vo=!0}else typeof navigator=="object"&&!ra?($e=navigator.userAgent,yr=$e.indexOf("Windows")>=0,xr$1=$e.indexOf("Macintosh")>=0,($e.indexOf("Macintosh")>=0||$e.indexOf("iPad")>=0||$e.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ii$1=$e.indexOf("Linux")>=0,($e==null?void 0:$e.indexOf("Mobi"))>=0,Ir=globalThis._VSCODE_NLS_LANGUAGE||Nt$1,Tr=navigator.language.toLowerCase(),bo=Tr):console.error("Unable to resolve platform.");var wr=yr,Te$2=xr$1,Zn=Ii$1,Dr$1=vo,Fe$1=$e,st$2=Ir,sa;(i8=>{function s15(){return st$2}i8.value=s15;function t(){return st$2.length===2?st$2==="en":st$2.length>=3?st$2[0]==="e"&&st$2[1]==="n"&&st$2[2]==="-":!1}i8.isDefaultVariant=t;function e(){return st$2==="en"}i8.isDefault=e})(sa||(sa={}));var oa=typeof Ve$1.postMessage=="function"&&!Ve$1.importScripts;(()=>{if(oa){let s15=[];Ve$1.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let i8=0,r5=s15.length;i8<r5;i8++){let n=s15[i8];if(n.id===e.data.vscodeScheduleAsyncWork){s15.splice(i8,1),n.callback();return}}});let t=0;return e=>{let i8=++t;s15.push({id:i8,callback:e}),Ve$1.postMessage({vscodeScheduleAsyncWork:i8},"*")}}return s15=>setTimeout(s15)})();var la=!!(Fe$1&&Fe$1.indexOf("Chrome")>=0);Fe$1&&Fe$1.indexOf("Firefox")>=0;!la&&Fe$1&&Fe$1.indexOf("Safari")>=0;Fe$1&&Fe$1.indexOf("Edg/")>=0;Fe$1&&Fe$1.indexOf("Android")>=0;var ot$2=typeof navigator=="object"?navigator:{};Dr$1||document.queryCommandSupported&&document.queryCommandSupported("copy")||ot$2&&ot$2.clipboard&&ot$2.clipboard.writeText,Dr$1||ot$2&&ot$2.clipboard&&ot$2.clipboard.readText;var yi$1=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},Jn$1=new yi$1,To=new yi$1,Io=new yi$1,yo=new Array(230),Qn$1;(o2=>{function s15(l2){return Jn$1.keyCodeToStr(l2)}o2.toString=s15;function t(l2){return Jn$1.strToKeyCode(l2)}o2.fromString=t;function e(l2){return To.keyCodeToStr(l2)}o2.toUserSettingsUS=e;function i8(l2){return Io.keyCodeToStr(l2)}o2.toUserSettingsGeneral=i8;function r5(l2){return To.strToKeyCode(l2)||Io.strToKeyCode(l2)}o2.fromUserSettings=r5;function n(l2){if(l2>=98&&l2<=113)return null;switch(l2){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Jn$1.keyCodeToStr(l2)}o2.toElectronAccelerator=n})(Qn$1||(Qn$1={}));var Rr$1=class s8{constructor(t,e,i8,r5,n){this.ctrlKey=t,this.shiftKey=e,this.altKey=i8,this.metaKey=r5,this.keyCode=n}equals(t){return t instanceof s8&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",e=this.shiftKey?"1":"0",i8=this.altKey?"1":"0",r5=this.metaKey?"1":"0";return`K${t}${e}${i8}${r5}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new es([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},es=class{constructor(t){if(t.length===0)throw eo("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i8=this.chords.length;e<i8;e++)e!==0&&(t+=";"),t+=this.chords[e].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(t.chords[e]))return!1;return!0}};function ca(s15){if(s15.charCode){let e=String.fromCharCode(s15.charCode).toUpperCase();return Qn$1.fromString(e)}let t=s15.keyCode;if(t===3)return 7;if(Ei$1)switch(t){case 59:return 85;case 60:if(Zn)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Te$2)return 57;break}else if(Bt$1&&(Te$2&&t===93||!Te$2&&t===92))return 57;return yo[t]||0}var ua=Te$2?256:2048,ha=512,da=1024,fa=Te$2?2048:256,ft=class{constructor(t){var _a7;this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=(_a7=e.getModifierState)==null?void 0:_a7.call(e,"AltGraph"),this.keyCode=ca(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=ua),this.altKey&&(e|=ha),this.shiftKey&&(e|=da),this.metaKey&&(e|=fa),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new Rr$1(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},wo=new WeakMap;function pa(s15){if(!s15.parent||s15.parent===s15)return null;try{let t=s15.location,e=s15.parent.location;if(t.origin!=="null"&&e.origin!=="null"&&t.origin!==e.origin)return null}catch{return null}return s15.parent}var Lr=class{static getSameOriginWindowChain(t){let e=wo.get(t);if(!e){e=[],wo.set(t,e);let i8=t,r5;do r5=pa(i8),r5?e.push({window:new WeakRef(i8),iframeElement:i8.frameElement||null}):e.push({window:new WeakRef(i8),iframeElement:null}),i8=r5;while(i8)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i8=0,r5=0,n=this.getSameOriginWindowChain(t);for(let o2 of n){let l2=o2.window.deref();if(i8+=(l2==null?void 0:l2.scrollY)??0,r5+=(l2==null?void 0:l2.scrollX)??0,l2===e||!o2.iframeElement)break;let a=o2.iframeElement.getBoundingClientRect();i8+=a.top,r5+=a.left}return{top:i8,left:r5}}},qe$2=class{constructor(t,e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i8=Lr.getPositionOfChildWindowRelativeToAncestorWindow(t,e.view);this.posx-=i8.left,this.posy-=i8.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},xi$1=class{constructor(t,e=0,i8=0){var _a7;this.browserEvent=t||null,this.target=t?t.target||t.targetNode||t.srcElement:null,this.deltaY=i8,this.deltaX=e;let r5=!1;if(Ti$1){let n=navigator.userAgent.match(/Chrome\/(\d+)/);r5=(n?parseInt(n[1]):123)<=122}if(t){let n=t,o2=t,l2=((_a7=t.view)==null?void 0:_a7.devicePixelRatio)||1;if(typeof n.wheelDeltaY<"u")r5?this.deltaY=n.wheelDeltaY/(120*l2):this.deltaY=n.wheelDeltaY/120;else if(typeof o2.VERTICAL_AXIS<"u"&&o2.axis===o2.VERTICAL_AXIS)this.deltaY=-o2.detail/3;else if(t.type==="wheel"){let a=t;a.deltaMode===a.DOM_DELTA_LINE?Ei$1&&!Te$2?this.deltaY=-t.deltaY/3:this.deltaY=-t.deltaY:this.deltaY=-t.deltaY/40}if(typeof n.wheelDeltaX<"u")Sr&&wr?this.deltaX=-(n.wheelDeltaX/120):r5?this.deltaX=n.wheelDeltaX/(120*l2):this.deltaX=n.wheelDeltaX/120;else if(typeof o2.HORIZONTAL_AXIS<"u"&&o2.axis===o2.HORIZONTAL_AXIS)this.deltaX=-t.detail/3;else if(t.type==="wheel"){let a=t;a.deltaMode===a.DOM_DELTA_LINE?Ei$1&&!Te$2?this.deltaX=-t.deltaX/3:this.deltaX=-t.deltaX:this.deltaX=-t.deltaX/40}this.deltaY===0&&this.deltaX===0&&t.wheelDelta&&(r5?this.deltaY=t.wheelDelta/(120*l2):this.deltaY=t.wheelDelta/120)}}preventDefault(){var _a7;(_a7=this.browserEvent)==null||_a7.preventDefault()}stopPropagation(){var _a7;(_a7=this.browserEvent)==null||_a7.stopPropagation()}},Do=Object.freeze(function(s15,t){let e=setTimeout(s15.bind(t),0);return{dispose(){clearTimeout(e)}}}),ma;(i8=>{function s15(r5){return r5===i8.None||r5===i8.Cancelled||r5 instanceof ts?!0:!r5||typeof r5!="object"?!1:typeof r5.isCancellationRequested=="boolean"&&typeof r5.onCancellationRequested=="function"}i8.isCancellationToken=s15,i8.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:$.None}),i8.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Do})})(ma||(ma={}));var ts=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Do:(this._emitter||(this._emitter=new v$1),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Ye$1=class{constructor(t,e){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof e=="number"&&this.setIfNotSet(t,e)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,e){if(this._isDisposed)throw new Rt$1("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},e)}setIfNotSet(t,e){if(this._isDisposed)throw new Rt$1("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},e))}},kr$1=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var _a7;(_a7=this.disposable)==null||_a7.dispose(),this.disposable=void 0}cancelAndSet(t,e,i8=globalThis){if(this.isDisposed)throw new Rt$1("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r5=i8.setInterval(()=>{t()},e);this.disposable=C$2(()=>{i8.clearInterval(r5),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},va;(e=>{async function s15(i8){let r5,n=await Promise.all(i8.map(o2=>o2.then(l2=>l2,l2=>{r5||(r5=l2)})));if(typeof r5<"u")throw r5;return n}e.settled=s15;function t(i8){return new Promise(async(r5,n)=>{try{await i8(r5,n)}catch(o2){n(o2)}})}e.withAsyncBody=t})(va||(va={}));var _e$1=class _e{static fromArray(t){return new _e(e=>{e.emitMany(t)})}static fromPromise(t){return new _e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new _e(async e=>{await Promise.all(t.map(async i8=>e.emitOne(await i8)))})}static merge(t){return new _e(async e=>{await Promise.all(t.map(async i8=>{for await(let r5 of i8)e.emitOne(r5)}))})}constructor(t,e){this._state=0,this._results=[],this._error=null,this._onReturn=e,this._onStateChanged=new v$1,queueMicrotask(async()=>{let i8={emitOne:r5=>this.emitOne(r5),emitMany:r5=>this.emitMany(r5),reject:r5=>this.reject(r5)};try{await Promise.resolve(t(i8)),this.resolve()}catch(r5){this.reject(r5)}finally{i8.emitOne=void 0,i8.emitMany=void 0,i8.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await $.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var _a7;return(_a7=this._onReturn)==null||_a7.call(this),{done:!0,value:void 0}}}}static map(t,e){return new _e(async i8=>{for await(let r5 of t)i8.emitOne(e(r5))})}map(t){return _e.map(this,t)}static filter(t,e){return new _e(async i8=>{for await(let r5 of t)e(r5)&&i8.emitOne(r5)})}filter(t){return _e.filter(this,t)}static coalesce(t){return _e.filter(t,e=>!!e)}coalesce(){return _e.coalesce(this)}static async toPromise(t){let e=[];for await(let i8 of t)e.push(i8);return e}toPromise(){return _e.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};_e$1.EMPTY=_e$1.fromArray([]);var{getWindow:be$2,getWindowId:Oo,onDidRegisterWindow:No}=(function(){let s15=new Map,t={window:fe$2,disposables:new Ee$2};s15.set(fe$2.vscodeWindowId,t);let e=new v$1,i8=new v$1,r5=new v$1;function n(o2,l2){return(typeof o2=="number"?s15.get(o2):void 0)??(l2?t:void 0)}return{onDidRegisterWindow:e.event,onWillUnregisterWindow:r5.event,onDidUnregisterWindow:i8.event,registerWindow(o2){if(s15.has(o2.vscodeWindowId))return D$1.None;let l2=new Ee$2,a={window:o2,disposables:l2.add(new Ee$2)};return s15.set(o2.vscodeWindowId,a),l2.add(C$2(()=>{s15.delete(o2.vscodeWindowId),i8.fire(o2)})),l2.add(L$1(o2,Y$2.BEFORE_UNLOAD,()=>{r5.fire(o2)})),e.fire(a),l2},getWindows(){return s15.values()},getWindowsCount(){return s15.size},getWindowId(o2){return o2.vscodeWindowId},hasWindow(o2){return s15.has(o2)},getWindowById:n,getWindow(o2){var _a7;let l2=o2;if((_a7=l2==null?void 0:l2.ownerDocument)!=null&&_a7.defaultView)return l2.ownerDocument.defaultView.window;let a=o2;return a!=null&&a.view?a.view.window:fe$2},getDocument(o2){return be$2(o2).document}}})(),ss$1=class{constructor(t,e,i8,r5){this._node=t,this._type=e,this._handler=i8,this._options=r5||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function L$1(s15,t,e,i8){return new ss$1(s15,t,e,i8)}var os$1=function(t,e,i8,r5){return L$1(t,e,i8,r5)},mt,Mr=class extends kr$1{constructor(t){super(),this.defaultTarget=t&&be$2(t)}cancelAndSet(t,e,i8){return super.cancelAndSet(t,e,i8??this.defaultTarget)}},Di$1=class{constructor(t,e=0){this._runner=t,this.priority=e,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){Lt$1(t)}}static sort(t,e){return e.priority-t.priority}};(function(){let s15=new Map,t=new Map,e=new Map,i8=new Map,r5=n=>{e.set(n,!1);let o2=s15.get(n)??[];for(t.set(n,o2),s15.set(n,[]),i8.set(n,!0);o2.length>0;)o2.sort(Di$1.sort),o2.shift().execute();i8.set(n,!1)};mt=(n,o2,l2=0)=>{let a=Oo(n),u=new Di$1(o2,l2),h2=s15.get(a);return h2||(h2=[],s15.set(a,h2)),h2.push(u),e.get(a)||(e.set(a,!0),n.requestAnimationFrame(()=>r5(a))),u}})();function Fo(s15){let t=s15.getBoundingClientRect(),e=be$2(s15);return{left:t.left+e.scrollX,top:t.top+e.scrollY,width:t.width,height:t.height}}var Y$2={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},ls=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=Ie$1(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Ie$1(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Ie$1(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Ie$1(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Ie$1(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Ie$1(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Ie$1(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Ie$1(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Ie$1(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Ie$1(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Ie$1(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Ie$1(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Ie$1(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Ie$1(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Ie$1(s15){return typeof s15=="number"?`${s15}px`:s15}function _t(s15){return new ls(s15)}var Wt$1=class{constructor(){this._hooks=new Ee$2,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,e){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i8=this._onStopCallback;this._onStopCallback=null,t&&i8&&i8(e)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,e,i8,r5,n){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r5,this._onStopCallback=n;let o2=t;try{t.setPointerCapture(e),this._hooks.add(C$2(()=>{try{t.releasePointerCapture(e)}catch{}}))}catch{o2=be$2(t)}this._hooks.add(L$1(o2,Y$2.POINTER_MOVE,l2=>{if(l2.buttons!==i8){this.stopMonitoring(!0);return}l2.preventDefault(),this._pointerMoveCallback(l2)})),this._hooks.add(L$1(o2,Y$2.POINTER_UP,l2=>this.stopMonitoring(!0)))}};function Wo(s15,t,e){let i8=null,r5=null;if(typeof e.value=="function"?(i8="value",r5=e.value,r5.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof e.get=="function"&&(i8="get",r5=e.get),!r5)throw new Error("not supported");let n=`$memoize$${t}`;e[i8]=function(...o2){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r5.apply(this,o2)}),this[n]}}var He$1;(n=>(n.Tap="-xterm-gesturetap",n.Change="-xterm-gesturechange",n.Start="-xterm-gesturestart",n.End="-xterm-gesturesend",n.Contextmenu="-xterm-gesturecontextmenu"))(He$1||(He$1={}));var Q$1=class Q extends D$1{constructor(){super(),this.dispatched=!1,this.targets=new Ct$1,this.ignoreTargets=new Ct$1,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register($.runAndSubscribe(No,({window:e,disposables:i8})=>{i8.add(L$1(e.document,"touchstart",r5=>this.onTouchStart(r5),{passive:!1})),i8.add(L$1(e.document,"touchend",r5=>this.onTouchEnd(e,r5))),i8.add(L$1(e.document,"touchmove",r5=>this.onTouchMove(r5),{passive:!1}))},{window:fe$2,disposables:this._store}))}static addTarget(e){if(!Q.isTouchDevice())return D$1.None;Q.INSTANCE||(Q.INSTANCE=new Q);let i8=Q.INSTANCE.targets.push(e);return C$2(i8)}static ignoreTarget(e){if(!Q.isTouchDevice())return D$1.None;Q.INSTANCE||(Q.INSTANCE=new Q);let i8=Q.INSTANCE.ignoreTargets.push(e);return C$2(i8)}static isTouchDevice(){return"ontouchstart"in fe$2||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i8=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r5=0,n=e.targetTouches.length;r5<n;r5++){let o2=e.targetTouches.item(r5);this.activeTouches[o2.identifier]={id:o2.identifier,initialTarget:o2.target,initialTimeStamp:i8,initialPageX:o2.pageX,initialPageY:o2.pageY,rollingTimestamps:[i8],rollingPageX:[o2.pageX],rollingPageY:[o2.pageY]};let l2=this.newGestureEvent(He$1.Start,o2.target);l2.pageX=o2.pageX,l2.pageY=o2.pageY,this.dispatchEvent(l2)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i8){let r5=Date.now(),n=Object.keys(this.activeTouches).length;for(let o2=0,l2=i8.changedTouches.length;o2<l2;o2++){let a=i8.changedTouches.item(o2);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let u=this.activeTouches[a.identifier],h2=Date.now()-u.initialTimeStamp;if(h2<Q.HOLD_DELAY&&Math.abs(u.initialPageX-Se(u.rollingPageX))<30&&Math.abs(u.initialPageY-Se(u.rollingPageY))<30){let c=this.newGestureEvent(He$1.Tap,u.initialTarget);c.pageX=Se(u.rollingPageX),c.pageY=Se(u.rollingPageY),this.dispatchEvent(c)}else if(h2>=Q.HOLD_DELAY&&Math.abs(u.initialPageX-Se(u.rollingPageX))<30&&Math.abs(u.initialPageY-Se(u.rollingPageY))<30){let c=this.newGestureEvent(He$1.Contextmenu,u.initialTarget);c.pageX=Se(u.rollingPageX),c.pageY=Se(u.rollingPageY),this.dispatchEvent(c)}else if(n===1){let c=Se(u.rollingPageX),d=Se(u.rollingPageY),_2=Se(u.rollingTimestamps)-u.rollingTimestamps[0],p=c-u.rollingPageX[0],m=d-u.rollingPageY[0],f=[...this.targets].filter(A2=>u.initialTarget instanceof Node&&A2.contains(u.initialTarget));this.inertia(e,f,r5,Math.abs(p)/_2,p>0?1:-1,c,Math.abs(m)/_2,m>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(He$1.End,u.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i8.preventDefault(),i8.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i8){let r5=document.createEvent("CustomEvent");return r5.initEvent(e,!1,!0),r5.initialTarget=i8,r5.tapCount=0,r5}dispatchEvent(e){if(e.type===He$1.Tap){let i8=new Date().getTime(),r5=0;i8-this._lastSetTapCountTime>Q.CLEAR_TAP_COUNT_TIME?r5=1:r5=2,this._lastSetTapCountTime=i8,e.tapCount=r5}else(e.type===He$1.Change||e.type===He$1.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let r5 of this.ignoreTargets)if(r5.contains(e.initialTarget))return;let i8=[];for(let r5 of this.targets)if(r5.contains(e.initialTarget)){let n=0,o2=e.initialTarget;for(;o2&&o2!==r5;)n++,o2=o2.parentElement;i8.push([n,r5])}i8.sort((r5,n)=>r5[0]-n[0]);for(let[r5,n]of i8)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,i8,r5,n,o2,l2,a,u,h2){this.handle=mt(e,()=>{let c=Date.now(),d=c-r5,_2=0,p=0,m=!0;n+=Q.SCROLL_FRICTION*d,a+=Q.SCROLL_FRICTION*d,n>0&&(m=!1,_2=o2*n*d),a>0&&(m=!1,p=u*a*d);let f=this.newGestureEvent(He$1.Change);f.translationX=_2,f.translationY=p,i8.forEach(A2=>A2.dispatchEvent(f)),m||this.inertia(e,i8,c,n,o2,l2+_2,a,u,h2+p)})}onTouchMove(e){let i8=Date.now();for(let r5=0,n=e.changedTouches.length;r5<n;r5++){let o2=e.changedTouches.item(r5);if(!this.activeTouches.hasOwnProperty(String(o2.identifier))){console.warn("end of an UNKNOWN touch",o2);continue}let l2=this.activeTouches[o2.identifier],a=this.newGestureEvent(He$1.Change,l2.initialTarget);a.translationX=o2.pageX-Se(l2.rollingPageX),a.translationY=o2.pageY-Se(l2.rollingPageY),a.pageX=o2.pageX,a.pageY=o2.pageY,this.dispatchEvent(a),l2.rollingPageX.length>3&&(l2.rollingPageX.shift(),l2.rollingPageY.shift(),l2.rollingTimestamps.shift()),l2.rollingPageX.push(o2.pageX),l2.rollingPageY.push(o2.pageY),l2.rollingTimestamps.push(i8)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Q$1.SCROLL_FRICTION=-.005,Q$1.HOLD_DELAY=700,Q$1.CLEAR_TAP_COUNT_TIME=400,M$1([Wo],Q$1,"isTouchDevice",1);var Pr$1=Q$1,lt$2=class extends D$1{onclick(t,e){this._register(L$1(t,Y$2.CLICK,i8=>e(new qe$2(be$2(t),i8))))}onmousedown(t,e){this._register(L$1(t,Y$2.MOUSE_DOWN,i8=>e(new qe$2(be$2(t),i8))))}onmouseover(t,e){this._register(L$1(t,Y$2.MOUSE_OVER,i8=>e(new qe$2(be$2(t),i8))))}onmouseleave(t,e){this._register(L$1(t,Y$2.MOUSE_LEAVE,i8=>e(new qe$2(be$2(t),i8))))}onkeydown(t,e){this._register(L$1(t,Y$2.KEY_DOWN,i8=>e(new ft(i8))))}onkeyup(t,e){this._register(L$1(t,Y$2.KEY_UP,i8=>e(new ft(i8))))}oninput(t,e){this._register(L$1(t,Y$2.INPUT,e))}onblur(t,e){this._register(L$1(t,Y$2.BLUR,e))}onfocus(t,e){this._register(L$1(t,Y$2.FOCUS,e))}onchange(t,e){this._register(L$1(t,Y$2.CHANGE,e))}ignoreGesture(t){return Pr$1.ignoreTarget(t)}},Uo=11,Or=class extends lt$2{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=Uo+"px",this.domNode.style.height=Uo+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new Wt$1),this._register(os$1(this.bgDomNode,Y$2.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(os$1(this.domNode,Y$2.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Mr),this._pointerdownScheduleRepeatTimer=this._register(new Ye$1)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,be$2(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i8=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},cs=class s9{constructor(t,e,i8,r5,n,o2,l2){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(e=e|0,i8=i8|0,r5=r5|0,n=n|0,o2=o2|0,l2=l2|0),this.rawScrollLeft=r5,this.rawScrollTop=l2,e<0&&(e=0),r5+e>i8&&(r5=i8-e),r5<0&&(r5=0),n<0&&(n=0),l2+n>o2&&(l2=o2-n),l2<0&&(l2=0),this.width=e,this.scrollWidth=i8,this.scrollLeft=r5,this.height=n,this.scrollHeight=o2,this.scrollTop=l2}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,e){return new s9(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,e?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,e?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new s9(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,e){let i8=this.width!==t.width,r5=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o2=this.height!==t.height,l2=this.scrollHeight!==t.scrollHeight,a=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:e,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i8,scrollWidthChanged:r5,scrollLeftChanged:n,heightChanged:o2,scrollHeightChanged:l2,scrollTopChanged:a}}},Ri=class extends D$1{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new v$1),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cs(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i8){var _a7;let r5=this._state.withScrollDimensions(e,i8);this._setState(r5,!!this._smoothScrolling),(_a7=this._smoothScrolling)==null||_a7.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i8=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i8,!1)}setScrollPositionSmooth(e,i8){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r5=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r5.scrollLeft&&this._smoothScrolling.to.scrollTop===r5.scrollTop)return;let n;i8?n=new Nr(this._smoothScrolling.from,r5,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r5,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r5=this._state.withScrollPosition(e);this._smoothScrolling=Nr.start(this._state,r5,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i8=this._state.withScrollPosition(e);if(this._setState(i8,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i8){let r5=this._state;r5.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r5,i8)))}},Br$1=class{constructor(t,e,i8){this.scrollLeft=t,this.scrollTop=e,this.isDone=i8}};function as$1(s15,t){let e=t-s15;return function(i8){return s15+e*ka(i8)}}function La(s15,t,e){return function(i8){return i8<e?s15(i8/e):t((i8-e)/(1-e))}}var Nr=class s10{constructor(t,e,i8,r5){this.from=t,this.to=e,this.duration=r5,this.startTime=i8,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,e,i8){if(Math.abs(t-e)>2.5*i8){let n,o2;return t<e?(n=t+.75*i8,o2=e-.75*i8):(n=t-.75*i8,o2=e+.75*i8),La(as$1(t,n),as$1(o2,e),.33)}return as$1(t,e)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let e=(t-this.startTime)/this.duration;if(e<1){let i8=this.scrollLeft(e),r5=this.scrollTop(e);return new Br$1(i8,r5,!1)}return new Br$1(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,e,i8){return s10.start(t,e,i8)}static start(t,e,i8){i8=i8+10;let r5=Date.now()-10;return new s10(t,e,r5,i8)}};function Aa(s15){return Math.pow(s15,3)}function ka(s15){return 1-Aa(1-s15)}var Fr$1=class extends D$1{constructor(t,e,i8){super(),this._visibility=t,this._visibleClassName=e,this._invisibleClassName=i8,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ye$1)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this._updateShouldBeVisible())}setShouldBeVisible(t){this._rawShouldBeVisible=t,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let t=this._applyVisibilitySetting();this._shouldBeVisible!==t&&(this._shouldBeVisible=t,this.ensureVisibility())}setIsNeeded(t){this._isNeeded!==t&&(this._isNeeded=t,this.ensureVisibility())}setDomNode(t){this._domNode=t,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var _a7;(_a7=this._domNode)==null||_a7.setClassName(this._visibleClassName)},0))}_hide(t){var _a7;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(_a7=this._domNode)==null||_a7.setClassName(this._invisibleClassName+(t?" fade":"")))}},Ca=140,Ut$1=class extends lt$2{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new Fr$1(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Wt$1),this._shouldRender=!0,this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(L$1(this.domNode.domNode,Y$2.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(t){let e=this._register(new Or(t));this.domNode.domNode.appendChild(e.bgDomNode),this.domNode.domNode.appendChild(e.domNode)}_createSlider(t,e,i8,r5){this.slider=_t(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(e),typeof i8=="number"&&this.slider.setWidth(i8),typeof r5=="number"&&this.slider.setHeight(r5),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(L$1(this.slider.domNode,Y$2.POINTER_DOWN,n=>{n.button===0&&(n.preventDefault(),this._sliderPointerDown(n))})),this.onclick(this.slider.domNode,n=>{n.leftButton&&n.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let e=this.domNode.domNode.getClientRects()[0].top,i8=e+this._scrollbarState.getSliderPosition(),r5=e+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),n=this._sliderPointerPosition(t);i8<=n&&n<=r5?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let e,i8;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")e=t.offsetX,i8=t.offsetY;else{let n=Fo(this.domNode.domNode);e=t.pageX-n.left,i8=t.pageY-n.top}let r5=this._pointerDownRelativePosition(e,i8);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r5):this._scrollbarState.getDesiredScrollPositionFromOffset(r5)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=this._sliderPointerPosition(t),i8=this._sliderOrthogonalPointerPosition(t),r5=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,n=>{let o2=this._sliderOrthogonalPointerPosition(n),l2=Math.abs(o2-i8);if(wr&&l2>Ca){this._setDesiredScrollPositionNow(r5.getScrollPosition());return}let u=this._sliderPointerPosition(n)-e;this._setDesiredScrollPositionNow(r5.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let e={};this.writeScrollPosition(e,t),this._scrollable.setScrollPositionNow(e)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Kt$1=class s11{constructor(t,e,i8,r5,n,o2){this._scrollbarSize=Math.round(e),this._oppositeScrollbarSize=Math.round(i8),this._arrowSize=Math.round(t),this._visibleSize=r5,this._scrollSize=n,this._scrollPosition=o2,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new s11(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let e=Math.round(t);return this._visibleSize!==e?(this._visibleSize=e,this._refreshComputedValues(),!0):!1}setScrollSize(t){let e=Math.round(t);return this._scrollSize!==e?(this._scrollSize=e,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let e=Math.round(t);return this._scrollPosition!==e?(this._scrollPosition=e,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,e,i8,r5,n){let o2=Math.max(0,i8-t),l2=Math.max(0,o2-2*e),a=r5>0&&r5>i8;if(!a)return{computedAvailableSize:Math.round(o2),computedIsNeeded:a,computedSliderSize:Math.round(l2),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(i8*l2/r5))),h2=(l2-u)/(r5-i8),c=n*h2;return{computedAvailableSize:Math.round(o2),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:h2,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){let t=s11._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let e=t-this._arrowSize-this._computedSliderSize/2;return Math.round(e/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let e=t-this._arrowSize,i8=this._scrollPosition;return e<this._computedSliderPosition?i8-=this._visibleSize:i8+=this._visibleSize,i8}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let e=this._computedSliderPosition+t;return Math.round(e/this._computedSliderRatio)}},Wr$1=class extends Ut$1{constructor(t,e,i8){let r5=t.getScrollDimensions(),n=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i8,scrollbarState:new Kt$1(e.horizontalHasArrows?e.arrowSize:0,e.horizontal===2?0:e.horizontalScrollbarSize,e.vertical===2?0:e.verticalScrollbarSize,r5.width,r5.scrollWidth,n.scrollLeft),visibility:e.horizontal,extraScrollbarClassName:"horizontal",scrollable:t,scrollByPage:e.scrollByPage}),e.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((e.horizontalScrollbarSize-e.horizontalSliderSize)/2),0,void 0,e.horizontalSliderSize)}_updateSlider(t,e){this.slider.setWidth(t),this.slider.setLeft(e)}_renderDomNode(t,e){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(t.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return t}_sliderPointerPosition(t){return t.pageX}_sliderOrthogonalPointerPosition(t){return t.pageY}_updateScrollbarSize(t){this.slider.setHeight(t)}writeScrollPosition(t,e){t.scrollLeft=e}updateOptions(t){this.updateScrollbarSize(t.horizontal===2?0:t.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._visibilityController.setVisibility(t.horizontal),this._scrollByPage=t.scrollByPage}},Ur=class extends Ut$1{constructor(t,e,i8){let r5=t.getScrollDimensions(),n=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i8,scrollbarState:new Kt$1(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,r5.height,r5.scrollHeight,n.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},Ma=500,Ko=50,us$1=class{constructor(t,e,i8){this.timestamp=t,this.deltaX=e,this.deltaY=i8,this.score=0}},zr$1=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,e=0,i8=1,r5=this._rear;do{let n=r5===this._front?t:Math.pow(2,-i8);if(t-=n,e+=this._memory[r5].score*n,r5===this._front)break;r5=(this._capacity+r5-1)%this._capacity,i8++}while(!0);return e<=.5}acceptStandardWheelEvent(t){if(Ti$1){let e=be$2(t.browserEvent),i8=mo(e);this.accept(Date.now(),t.deltaX*i8,t.deltaY*i8)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,e,i8){let r5=null,n=new us$1(t,e,i8);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r5=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r5)}_computeScore(t,e){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let i8=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i8+=.25),e){let r5=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o2=Math.abs(e.deltaX),l2=Math.abs(e.deltaY),a=Math.max(Math.min(r5,o2),1),u=Math.max(Math.min(n,l2),1),h2=Math.max(r5,o2),c=Math.max(n,l2);h2%a===0&&c%u===0&&(i8-=.5)}return Math.min(Math.max(i8,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};zr$1.INSTANCE=new zr$1;var hs=zr$1,ds=class extends lt$2{constructor(e,i8,r5){super(),this._onScroll=this._register(new v$1),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new v$1),this.onWillScroll=this._onWillScroll.event,this._options=Pa(i8),this._scrollable=r5,this._register(this._scrollable.onScroll(o2=>{this._onWillScroll.fire(o2),this._onDidScroll(o2),this._onScroll.fire(o2)}));let n={onMouseWheel:o2=>this._onMouseWheel(o2),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Ur(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Wr$1(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_t(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_t(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_t(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o2=>this._onMouseOver(o2)),this.onmouseleave(this._listenOnDomNode,o2=>this._onMouseLeave(o2)),this._hideTimeout=this._register(new Ye$1),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ne(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Te$2&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new xi$1(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ne(this._mouseWheelToDispose),e)){let r5=n=>{this._onMouseWheel(new xi$1(n))};this._mouseWheelToDispose.push(L$1(this._listenOnDomNode,Y$2.MOUSE_WHEEL,r5,{passive:!1}))}}_onMouseWheel(e){var _a7;if((_a7=e.browserEvent)!=null&&_a7.defaultPrevented)return;let i8=hs.INSTANCE;i8.acceptStandardWheelEvent(e);let r5=!1;if(e.deltaY||e.deltaX){let o2=e.deltaY*this._options.mouseWheelScrollSensitivity,l2=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l2+o2===0?l2=o2=0:Math.abs(o2)>=Math.abs(l2)?l2=0:o2=0),this._options.flipAxes&&([o2,l2]=[l2,o2]);let a=!Te$2&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!l2&&(l2=o2,o2=0),e.browserEvent&&e.browserEvent.altKey&&(l2=l2*this._options.fastScrollSensitivity,o2=o2*this._options.fastScrollSensitivity);let u=this._scrollable.getFutureScrollPosition(),h2={};if(o2){let c=Ko*o2,d=u.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(h2,d)}if(l2){let c=Ko*l2,d=u.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(h2,d)}h2=this._scrollable.validateScrollPosition(h2),(u.scrollLeft!==h2.scrollLeft||u.scrollTop!==h2.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i8.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h2):this._scrollable.setScrollPositionNow(h2),r5=!0)}let n=r5;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i8=e.scrollTop>0,r5=e.scrollLeft>0,n=r5?" left":"",o2=i8?" top":"",l2=r5||i8?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o2}`),this._topLeftShadowDomNode.setClassName(`shadow${l2}${o2}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Ma)}},Kr$1=class extends ds{constructor(t,e,i8){super(t,e,i8)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Pa(s15){let t={lazyRender:typeof s15.lazyRender<"u"?s15.lazyRender:!1,className:typeof s15.className<"u"?s15.className:"",useShadows:typeof s15.useShadows<"u"?s15.useShadows:!0,handleMouseWheel:typeof s15.handleMouseWheel<"u"?s15.handleMouseWheel:!0,flipAxes:typeof s15.flipAxes<"u"?s15.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s15.consumeMouseWheelIfScrollbarIsNeeded<"u"?s15.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s15.alwaysConsumeMouseWheel<"u"?s15.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s15.scrollYToX<"u"?s15.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s15.mouseWheelScrollSensitivity<"u"?s15.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s15.fastScrollSensitivity<"u"?s15.fastScrollSensitivity:5,scrollPredominantAxis:typeof s15.scrollPredominantAxis<"u"?s15.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s15.mouseWheelSmoothScroll<"u"?s15.mouseWheelSmoothScroll:!0,arrowSize:typeof s15.arrowSize<"u"?s15.arrowSize:11,listenOnDomNode:typeof s15.listenOnDomNode<"u"?s15.listenOnDomNode:null,horizontal:typeof s15.horizontal<"u"?s15.horizontal:1,horizontalScrollbarSize:typeof s15.horizontalScrollbarSize<"u"?s15.horizontalScrollbarSize:10,horizontalSliderSize:typeof s15.horizontalSliderSize<"u"?s15.horizontalSliderSize:0,horizontalHasArrows:typeof s15.horizontalHasArrows<"u"?s15.horizontalHasArrows:!1,vertical:typeof s15.vertical<"u"?s15.vertical:1,verticalScrollbarSize:typeof s15.verticalScrollbarSize<"u"?s15.verticalScrollbarSize:10,verticalHasArrows:typeof s15.verticalHasArrows<"u"?s15.verticalHasArrows:!1,verticalSliderSize:typeof s15.verticalSliderSize<"u"?s15.verticalSliderSize:0,scrollByPage:typeof s15.scrollByPage<"u"?s15.scrollByPage:!1};return t.horizontalSliderSize=typeof s15.horizontalSliderSize<"u"?s15.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof s15.verticalSliderSize<"u"?s15.verticalSliderSize:t.verticalScrollbarSize,Te$2&&(t.className+=" mac"),t}var zt$1=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u){super(),this._bufferService=r5,this._optionsService=a,this._renderService=u,this._onRequestScrollLines=this._register(new v$1),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h2=this._register(new Ri({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>mt(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h2.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Kr$1(i8,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h2)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o2.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register($.runAndSubscribe(l2.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l2.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(C$2(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),i8.appendChild(this._styleElement),this._register(C$2(()=>this._styleElement.remove())),this._register($.runAndSubscribe(l2.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l2.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l2.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l2.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
21
- `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let i8=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i8.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i8){i8&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i8,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var _a7;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((_a7=this._optionsService.rawOptions.overviewRuler)==null?void 0:_a7.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i8=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r5=i8-this._bufferService.buffer.ydisp;r5!==0&&(this._latestYDisp=i8,this._onRequestScrollLines.fire(r5)),this._isHandlingScroll=!1}};zt$1=M$1([S(2,F$1),S(3,ae$1),S(4,rr),S(5,Re),S(6,H$2),S(7,ce$1)],zt$1);var Gt$1=class extends D$1{constructor(e,i8,r5,n,o2){super(),this._screenElement=e,this._bufferService=i8,this._coreBrowserService=r5,this._decorationService=n,this._renderService=o2,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(l2=>this._removeDecoration(l2))),this._register(C$2(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var _a7;let i8=this._coreBrowserService.mainDocument.createElement("div");i8.classList.add("xterm-decoration"),i8.classList.toggle("xterm-decoration-top-layer",((_a7=e==null?void 0:e.options)==null?void 0:_a7.layer)==="top"),i8.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i8.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i8.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i8.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r5=e.options.x??0;return r5&&r5>this._bufferService.cols&&(i8.style.display="none"),this._refreshXPosition(e,i8),i8}_refreshStyle(e){let i8=e.marker.line-this._bufferService.buffers.active.ydisp;if(i8<0||i8>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r5=this._decorationElements.get(e);r5||(r5=this._createElement(e),e.element=r5,this._decorationElements.set(e,r5),this._container.appendChild(r5),e.onDispose(()=>{this._decorationElements.delete(e),r5.remove()})),r5.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r5.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r5.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r5.style.top=`${i8*this._renderService.dimensions.css.cell.height}px`,r5.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r5)}}_refreshXPosition(e,i8=e.element){if(!i8)return;let r5=e.options.x??0;(e.options.anchor||"left")==="right"?i8.style.right=r5?`${r5*this._renderService.dimensions.css.cell.width}px`:"":i8.style.left=r5?`${r5*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var _a7;(_a7=this._decorationElements.get(e))==null||_a7.remove(),this._decorationElements.delete(e),e.dispose()}};Gt$1=M$1([S(1,F$1),S(2,ae$1),S(3,Be$1),S(4,ce$1)],Gt$1);var Gr$1=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(t){if(t.options.overviewRulerOptions){for(let e of this._zones)if(e.color===t.options.overviewRulerOptions.color&&e.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(e,t.marker.line))return;if(this._lineAdjacentToZone(e,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(e,t.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=t.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=t.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=t.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=t.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:t.options.overviewRulerOptions.color,position:t.options.overviewRulerOptions.position,startBufferLine:t.marker.line,endBufferLine:t.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(t){this._linePadding=t}_lineIntersectsZone(t,e){return e>=t.startBufferLine&&e<=t.endBufferLine}_lineAdjacentToZone(t,e,i8){return e>=t.startBufferLine-this._linePadding[i8||"full"]&&e<=t.endBufferLine+this._linePadding[i8||"full"]}_addLineToZone(t,e){t.startBufferLine=Math.min(t.startBufferLine,e),t.endBufferLine=Math.max(t.endBufferLine,e)}},We$2={full:0,left:0,center:0,right:0},at$1={full:0,left:0,center:0,right:0},Li$1={full:0,left:0,center:0,right:0},bt$1=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u){var _a7;super(),this._viewportElement=e,this._screenElement=i8,this._bufferService=r5,this._decorationService=n,this._renderService=o2,this._optionsService=l2,this._themeService=a,this._coreBrowserService=u,this._colorZoneStore=new Gr$1,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(_a7=this._viewportElement.parentElement)==null||_a7.insertBefore(this._canvas,this._viewportElement),this._register(C$2(()=>{var _a8;return(_a8=this._canvas)==null?void 0:_a8.remove()}));let h2=this._canvas.getContext("2d");if(h2)this._ctx=h2;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var _a7;return((_a7=this._optionsService.options.overviewRuler)==null?void 0:_a7.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i8=Math.ceil((this._canvas.width-1)/3);at$1.full=this._canvas.width,at$1.left=e,at$1.center=i8,at$1.right=e,this._refreshDrawHeightConstants(),Li$1.full=1,Li$1.left=1,Li$1.center=1+at$1.left,Li$1.right=1+at$1.left+at$1.center}_refreshDrawHeightConstants(){We$2.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i8=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);We$2.left=i8,We$2.center=i8,We$2.right=i8}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We$2.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We$2.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We$2.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We$2.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i8 of this._decorationService.decorations)this._colorZoneStore.addDecoration(i8);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i8 of e)i8.position!=="full"&&this._renderColorZone(i8);for(let i8 of e)i8.position==="full"&&this._renderColorZone(i8);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Li$1[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-We$2[e.position||"full"]/2),at$1[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+We$2[e.position||"full"]))}_queueRefresh(e,i8){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i8||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};bt$1=M$1([S(2,F$1),S(3,Be$1),S(4,ce$1),S(5,H$2),S(6,Re),S(7,ae$1)],bt$1);var b;(E=>(E.NUL="\0",E.SOH="",E.STX="",E.ETX="",E.EOT="",E.ENQ="",E.ACK="",E.BEL="\x07",E.BS="\b",E.HT=" ",E.LF=`
22
- `,E.VT="\v",E.FF="\f",E.CR="\r",E.SO="",E.SI="",E.DLE="",E.DC1="",E.DC2="",E.DC3="",E.DC4="",E.NAK="",E.SYN="",E.ETB="",E.CAN="",E.EM="",E.SUB="",E.ESC="\x1B",E.FS="",E.GS="",E.RS="",E.US="",E.SP=" ",E.DEL=""))(b||(b={}));var Ai$1;(g2=>(g2.PAD="€",g2.HOP="",g2.BPH="‚",g2.NBH="ƒ",g2.IND="„",g2.NEL="…",g2.SSA="†",g2.ESA="‡",g2.HTS="ˆ",g2.HTJ="‰",g2.VTS="Š",g2.PLD="‹",g2.PLU="Œ",g2.RI="",g2.SS2="Ž",g2.SS3="",g2.DCS="",g2.PU1="‘",g2.PU2="’",g2.STS="“",g2.CCH="”",g2.MW="•",g2.SPA="–",g2.EPA="—",g2.SOS="˜",g2.SGCI="™",g2.SCI="š",g2.CSI="›",g2.ST="œ",g2.OSC="",g2.PM="ž",g2.APC="Ÿ"))(Ai$1||(Ai$1={}));var fs;(t=>t.ST=`${b.ESC}\\`)(fs||(fs={}));var $t$1=class{constructor(t,e,i8,r5,n,o2){this._textarea=t,this._compositionView=e,this._bufferService=i8,this._optionsService=r5,this._coreService=n,this._renderService=o2,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i8;e.start+=this._dataAlreadySent.length,this._isComposing?i8=this._textarea.value.substring(e.start,this._compositionPosition.start):i8=this._textarea.value.substring(e.start),i8.length>0&&this._coreService.triggerDataEvent(i8,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let e=this._textarea.value,i8=e.replace(t,"");this._dataAlreadySent=i8,e.length>t.length?this._coreService.triggerDataEvent(i8,!0):e.length<t.length?this._coreService.triggerDataEvent(`${b.DEL}`,!0):e.length===t.length&&e!==t&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(t){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i8=this._renderService.dimensions.css.cell.height,r5=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r5+"px",this._compositionView.style.height=i8+"px",this._compositionView.style.lineHeight=i8+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o2=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r5+"px",this._textarea.style.width=Math.max(o2.width,1)+"px",this._textarea.style.height=Math.max(o2.height,1)+"px",this._textarea.style.lineHeight=o2.height+"px"}t||setTimeout(()=>this.updateCompositionElements(!0),0)}}};$t$1=M$1([S(2,F$1),S(3,H$2),S(4,ge$2),S(5,ce$1)],$t$1);var ue$1=0,he$2=0,de$1=0,J$2=0,ps={css:"#00000000",rgba:0},j$1;(i8=>{function s15(r5,n,o2,l2){return l2!==void 0?`#${vt(r5)}${vt(n)}${vt(o2)}${vt(l2)}`:`#${vt(r5)}${vt(n)}${vt(o2)}`}i8.toCss=s15;function t(r5,n,o2,l2=255){return(r5<<24|n<<16|o2<<8|l2)>>>0}i8.toRgba=t;function e(r5,n,o2,l2){return{css:i8.toCss(r5,n,o2,l2),rgba:i8.toRgba(r5,n,o2,l2)}}i8.toColor=e})(j$1||(j$1={}));var U$2;(l2=>{function s15(a,u){if(J$2=(u.rgba&255)/255,J$2===1)return{css:u.css,rgba:u.rgba};let h2=u.rgba>>24&255,c=u.rgba>>16&255,d=u.rgba>>8&255,_2=a.rgba>>24&255,p=a.rgba>>16&255,m=a.rgba>>8&255;ue$1=_2+Math.round((h2-_2)*J$2),he$2=p+Math.round((c-p)*J$2),de$1=m+Math.round((d-m)*J$2);let f=j$1.toCss(ue$1,he$2,de$1),A2=j$1.toRgba(ue$1,he$2,de$1);return{css:f,rgba:A2}}l2.blend=s15;function t(a){return(a.rgba&255)===255}l2.isOpaque=t;function e(a,u,h2){let c=$r$1.ensureContrastRatio(a.rgba,u.rgba,h2);if(c)return j$1.toColor(c>>24&255,c>>16&255,c>>8&255)}l2.ensureContrastRatio=e;function i8(a){let u=(a.rgba|255)>>>0;return[ue$1,he$2,de$1]=$r$1.toChannels(u),{css:j$1.toCss(ue$1,he$2,de$1),rgba:u}}l2.opaque=i8;function r5(a,u){return J$2=Math.round(u*255),[ue$1,he$2,de$1]=$r$1.toChannels(a.rgba),{css:j$1.toCss(ue$1,he$2,de$1,J$2),rgba:j$1.toRgba(ue$1,he$2,de$1,J$2)}}l2.opacity=r5;function n(a,u){return J$2=a.rgba&255,r5(a,J$2*u/255)}l2.multiplyOpacity=n;function o2(a){return[a.rgba>>24&255,a.rgba>>16&255,a.rgba>>8&255]}l2.toColorRGB=o2})(U$2||(U$2={}));var z$1;(i8=>{let s15,t;try{let r5=document.createElement("canvas");r5.width=1,r5.height=1;let n=r5.getContext("2d",{willReadFrequently:!0});n&&(s15=n,s15.globalCompositeOperation="copy",t=s15.createLinearGradient(0,0,1,1))}catch{}function e(r5){if(r5.match(/#[\da-f]{3,8}/i))switch(r5.length){case 4:return ue$1=parseInt(r5.slice(1,2).repeat(2),16),he$2=parseInt(r5.slice(2,3).repeat(2),16),de$1=parseInt(r5.slice(3,4).repeat(2),16),j$1.toColor(ue$1,he$2,de$1);case 5:return ue$1=parseInt(r5.slice(1,2).repeat(2),16),he$2=parseInt(r5.slice(2,3).repeat(2),16),de$1=parseInt(r5.slice(3,4).repeat(2),16),J$2=parseInt(r5.slice(4,5).repeat(2),16),j$1.toColor(ue$1,he$2,de$1,J$2);case 7:return{css:r5,rgba:(parseInt(r5.slice(1),16)<<8|255)>>>0};case 9:return{css:r5,rgba:parseInt(r5.slice(1),16)>>>0}}let n=r5.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return ue$1=parseInt(n[1]),he$2=parseInt(n[2]),de$1=parseInt(n[3]),J$2=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),j$1.toColor(ue$1,he$2,de$1,J$2);if(!s15||!t)throw new Error("css.toColor: Unsupported css format");if(s15.fillStyle=t,s15.fillStyle=r5,typeof s15.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(s15.fillRect(0,0,1,1),[ue$1,he$2,de$1,J$2]=s15.getImageData(0,0,1,1).data,J$2!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:j$1.toRgba(ue$1,he$2,de$1,J$2),css:r5}}i8.toColor=e})(z$1||(z$1={}));var ve$1;(e=>{function s15(i8){return t(i8>>16&255,i8>>8&255,i8&255)}e.relativeLuminance=s15;function t(i8,r5,n){let o2=i8/255,l2=r5/255,a=n/255,u=o2<=.03928?o2/12.92:Math.pow((o2+.055)/1.055,2.4),h2=l2<=.03928?l2/12.92:Math.pow((l2+.055)/1.055,2.4),c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return u*.2126+h2*.7152+c*.0722}e.relativeLuminance2=t})(ve$1||(ve$1={}));var $r$1;(n=>{function s15(o2,l2){if(J$2=(l2&255)/255,J$2===1)return l2;let a=l2>>24&255,u=l2>>16&255,h2=l2>>8&255,c=o2>>24&255,d=o2>>16&255,_2=o2>>8&255;return ue$1=c+Math.round((a-c)*J$2),he$2=d+Math.round((u-d)*J$2),de$1=_2+Math.round((h2-_2)*J$2),j$1.toRgba(ue$1,he$2,de$1)}n.blend=s15;function t(o2,l2,a){let u=ve$1.relativeLuminance(o2>>8),h2=ve$1.relativeLuminance(l2>>8);if(Xe$1(u,h2)<a){if(h2<u){let p=e(o2,l2,a),m=Xe$1(u,ve$1.relativeLuminance(p>>8));if(m<a){let f=i8(o2,l2,a),A2=Xe$1(u,ve$1.relativeLuminance(f>>8));return m>A2?p:f}return p}let d=i8(o2,l2,a),_2=Xe$1(u,ve$1.relativeLuminance(d>>8));if(_2<a){let p=e(o2,l2,a),m=Xe$1(u,ve$1.relativeLuminance(p>>8));return _2>m?d:p}return d}}n.ensureContrastRatio=t;function e(o2,l2,a){let u=o2>>24&255,h2=o2>>16&255,c=o2>>8&255,d=l2>>24&255,_2=l2>>16&255,p=l2>>8&255,m=Xe$1(ve$1.relativeLuminance2(d,_2,p),ve$1.relativeLuminance2(u,h2,c));for(;m<a&&(d>0||_2>0||p>0);)d-=Math.max(0,Math.ceil(d*.1)),_2-=Math.max(0,Math.ceil(_2*.1)),p-=Math.max(0,Math.ceil(p*.1)),m=Xe$1(ve$1.relativeLuminance2(d,_2,p),ve$1.relativeLuminance2(u,h2,c));return(d<<24|_2<<16|p<<8|255)>>>0}n.reduceLuminance=e;function i8(o2,l2,a){let u=o2>>24&255,h2=o2>>16&255,c=o2>>8&255,d=l2>>24&255,_2=l2>>16&255,p=l2>>8&255,m=Xe$1(ve$1.relativeLuminance2(d,_2,p),ve$1.relativeLuminance2(u,h2,c));for(;m<a&&(d<255||_2<255||p<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),_2=Math.min(255,_2+Math.ceil((255-_2)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),m=Xe$1(ve$1.relativeLuminance2(d,_2,p),ve$1.relativeLuminance2(u,h2,c));return(d<<24|_2<<16|p<<8|255)>>>0}n.increaseLuminance=i8;function r5(o2){return[o2>>24&255,o2>>16&255,o2>>8&255,o2&255]}n.toChannels=r5})($r$1||($r$1={}));function vt(s15){let t=s15.toString(16);return t.length<2?"0"+t:t}function Xe$1(s15,t){return s15<t?(t+.05)/(s15+.05):(s15+.05)/(t+.05)}var Vr$1=class extends De$2{constructor(e,i8,r5){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i8,this._width=r5}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ct=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new q}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i8=[],r5=e.translateToString(!0),n=0,o2=0,l2=0,a=e.getFg(0),u=e.getBg(0);for(let h2=0;h2<e.getTrimmedLength();h2++)if(e.loadCell(h2,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==u){if(h2-n>1){let c=this._getJoinedRanges(r5,l2,o2,e,n);for(let d=0;d<c.length;d++)i8.push(c[d])}n=h2,l2=o2,a=this._workCell.fg,u=this._workCell.bg}o2+=this._workCell.getChars().length||we.length}if(this._bufferService.cols-n>1){let h2=this._getJoinedRanges(r5,l2,o2,e,n);for(let c=0;c<h2.length;c++)i8.push(h2[c])}return i8}_getJoinedRanges(t,e,i8,r5,n){let o2=t.substring(e,i8),l2=[];try{l2=this._characterJoiners[0].handler(o2)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let u=this._characterJoiners[a].handler(o2);for(let h2=0;h2<u.length;h2++)ct._mergeRanges(l2,u[h2])}catch(u){console.error(u)}return this._stringRangesToCellRanges(l2,r5,n),l2}_stringRangesToCellRanges(t,e,i8){let r5=0,n=!1,o2=0,l2=t[r5];if(l2){for(let a=i8;a<this._bufferService.cols;a++){let u=e.getWidth(a),h2=e.getString(a).length||we.length;if(u!==0){if(!n&&l2[0]<=o2&&(l2[0]=a,n=!0),l2[1]<=o2){if(l2[1]=a,l2=t[++r5],!l2)break;l2[0]<=o2?(l2[0]=a,n=!0):n=!1}o2+=h2}}l2&&(l2[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i8=!1;for(let r5=0;r5<t.length;r5++){let n=t[r5];if(i8){if(e[1]<=n[0])return t[r5-1][1]=e[1],t;if(e[1]<=n[1])return t[r5-1][1]=Math.max(e[1],n[1]),t.splice(r5,1),t;t.splice(r5,1),r5--}else{if(e[1]<=n[0])return t.splice(r5,0,e),t;if(e[1]<=n[1])return n[0]=Math.min(e[0],n[0]),t;e[0]<n[1]&&(n[0]=Math.min(e[0],n[0]),i8=!0);continue}}return i8?t[t.length-1][1]=e[1]:t.push(e),t}};ct=M$1([S(0,F$1)],ct);function Oa(s15){return 57508<=s15&&s15<=57558}function Ba(s15){return 9472<=s15&&s15<=9631}function $o(s15){return Oa(s15)||Ba(s15)}function Vo(){return{css:{canvas:qr(),cell:qr()},device:{canvas:qr(),cell:qr(),char:{width:0,height:0,left:0,top:0}}}}function qr(){return{width:0,height:0}}var Vt$1=class{constructor(t,e,i8,r5,n,o2,l2){this._document=t,this._characterJoinerService=e,this._optionsService=i8,this._coreBrowserService=r5,this._coreService=n,this._decorationService=o2,this._themeService=l2,this._workCell=new q,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(t,e,i8){this._selectionStart=t,this._selectionEnd=e,this._columnSelectMode=i8}createRow(t,e,i8,r5,n,o2,l2,a,u,h2,c){let d=[],_2=this._characterJoinerService.getJoinedCharacters(e),p=this._themeService.colors,m=t.getNoBgTrimmedLength();i8&&m<o2+1&&(m=o2+1);let f,A2=0,R="",O2=0,I2=0,k2=0,P=0,oe=!1,Me2=0,Pe2=!1,Ke2=0,di=0,V2=[],Qe=h2!==-1&&c!==-1;for(let y=0;y<m;y++){t.loadCell(y,this._workCell);let T=this._workCell.getWidth();if(T===0)continue;let g2=!1,w2=y>=di,E=y,x=this._workCell;if(_2.length>0&&y===_2[0][0]&&w2){let W=_2.shift(),An2=this._isCellInSelection(W[0],e);for(O2=W[0]+1;O2<W[1];O2++)w2&&(w2=An2===this._isCellInSelection(O2,e));w2&&(w2=!i8||o2<W[0]||o2>=W[1]),w2?(g2=!0,x=new Vr$1(this._workCell,t.translateToString(!0,W[0],W[1]),W[1]-W[0]),E=W[1]-1,T=x.getWidth()):di=W[1]}let N2=this._isCellInSelection(y,e),Z2=i8&&y===o2,te3=Qe&&y>=h2&&y<=c,Oe2=!1;this._decorationService.forEachDecorationAtCell(y,e,void 0,W=>{Oe2=!0});let ze2=x.getChars()||we;if(ze2===" "&&(x.isUnderline()||x.isOverline())&&(ze2=" "),Ke2=T*a-u.get(ze2,x.isBold(),x.isItalic()),!f)f=this._document.createElement("span");else if(A2&&(N2&&Pe2||!N2&&!Pe2&&x.bg===I2)&&(N2&&Pe2&&p.selectionForeground||x.fg===k2)&&x.extended.ext===P&&te3===oe&&Ke2===Me2&&!Z2&&!g2&&!Oe2&&w2){x.isInvisible()?R+=we:R+=ze2,A2++;continue}else A2&&(f.textContent=R),f=this._document.createElement("span"),A2=0,R="";if(I2=x.bg,k2=x.fg,P=x.extended.ext,oe=te3,Me2=Ke2,Pe2=N2,g2&&o2>=y&&o2<=E&&(o2=y),!this._coreService.isCursorHidden&&Z2&&this._coreService.isCursorInitialized){if(V2.push("xterm-cursor"),this._coreBrowserService.isFocused)l2&&V2.push("xterm-cursor-blink"),V2.push(r5==="bar"?"xterm-cursor-bar":r5==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(n)switch(n){case"outline":V2.push("xterm-cursor-outline");break;case"block":V2.push("xterm-cursor-block");break;case"bar":V2.push("xterm-cursor-bar");break;case"underline":V2.push("xterm-cursor-underline");break}}if(x.isBold()&&V2.push("xterm-bold"),x.isItalic()&&V2.push("xterm-italic"),x.isDim()&&V2.push("xterm-dim"),x.isInvisible()?R=we:R=x.getChars()||we,x.isUnderline()&&(V2.push(`xterm-underline-${x.extended.underlineStyle}`),R===" "&&(R=" "),!x.isUnderlineColorDefault()))if(x.isUnderlineColorRGB())f.style.textDecorationColor=`rgb(${De$2.toColorRGB(x.getUnderlineColor()).join(",")})`;else{let W=x.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&x.isBold()&&W<8&&(W+=8),f.style.textDecorationColor=p.ansi[W].css}x.isOverline()&&(V2.push("xterm-overline"),R===" "&&(R=" ")),x.isStrikethrough()&&V2.push("xterm-strikethrough"),te3&&(f.style.textDecoration="underline");let le2=x.getFgColor(),et2=x.getFgColorMode(),me2=x.getBgColor(),ht=x.getBgColorMode(),fi2=!!x.isInverse();if(fi2){let W=le2;le2=me2,me2=W;let An2=et2;et2=ht,ht=An2}let tt3,Qi2,pi2=!1;this._decorationService.forEachDecorationAtCell(y,e,void 0,W=>{W.options.layer!=="top"&&pi2||(W.backgroundColorRGB&&(ht=50331648,me2=W.backgroundColorRGB.rgba>>8&16777215,tt3=W.backgroundColorRGB),W.foregroundColorRGB&&(et2=50331648,le2=W.foregroundColorRGB.rgba>>8&16777215,Qi2=W.foregroundColorRGB),pi2=W.options.layer==="top")}),!pi2&&N2&&(tt3=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,me2=tt3.rgba>>8&16777215,ht=50331648,pi2=!0,p.selectionForeground&&(et2=50331648,le2=p.selectionForeground.rgba>>8&16777215,Qi2=p.selectionForeground)),pi2&&V2.push("xterm-decoration-top");let it2;switch(ht){case 16777216:case 33554432:it2=p.ansi[me2],V2.push(`xterm-bg-${me2}`);break;case 50331648:it2=j$1.toColor(me2>>16,me2>>8&255,me2&255),this._addStyle(f,`background-color:#${qo((me2>>>0).toString(16),"0",6)}`);break;case 0:default:fi2?(it2=p.foreground,V2.push("xterm-bg-257")):it2=p.background}switch(tt3||x.isDim()&&(tt3=U$2.multiplyOpacity(it2,.5)),et2){case 16777216:case 33554432:x.isBold()&&le2<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le2+=8),this._applyMinimumContrast(f,it2,p.ansi[le2],x,tt3,void 0)||V2.push(`xterm-fg-${le2}`);break;case 50331648:let W=j$1.toColor(le2>>16&255,le2>>8&255,le2&255);this._applyMinimumContrast(f,it2,W,x,tt3,Qi2)||this._addStyle(f,`color:#${qo(le2.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(f,it2,p.foreground,x,tt3,Qi2)||fi2&&V2.push("xterm-fg-257")}V2.length&&(f.className=V2.join(" "),V2.length=0),!Z2&&!g2&&!Oe2&&w2?A2++:f.textContent=R,Ke2!==this.defaultSpacing&&(f.style.letterSpacing=`${Ke2}px`),d.push(f),y=E}return f&&A2&&(f.textContent=R),d}_applyMinimumContrast(t,e,i8,r5,n,o2){if(this._optionsService.rawOptions.minimumContrastRatio===1||$o(r5.getCode()))return!1;let l2=this._getContrastCache(r5),a;if(!n&&!o2&&(a=l2.getColor(e.rgba,i8.rgba)),a===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(r5.isDim()?2:1);a=U$2.ensureContrastRatio(n||e,o2||i8,u),l2.setColor((n||e).rgba,(o2||i8).rgba,a??null)}return a?(this._addStyle(t,`color:${a.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,e){t.setAttribute("style",`${t.getAttribute("style")||""}${e};`)}_isCellInSelection(t,e){let i8=this._selectionStart,r5=this._selectionEnd;return!i8||!r5?!1:this._columnSelectMode?i8[0]<=r5[0]?t>=i8[0]&&e>=i8[1]&&t<r5[0]&&e<=r5[1]:t<i8[0]&&e>=i8[1]&&t>=r5[0]&&e<=r5[1]:e>i8[1]&&e<r5[1]||i8[1]===r5[1]&&e===i8[1]&&t>=i8[0]&&t<r5[0]||i8[1]<r5[1]&&e===r5[1]&&t<r5[0]||i8[1]<r5[1]&&e===i8[1]&&t>=i8[0]}};Vt$1=M$1([S(1,or),S(2,H$2),S(3,ae$1),S(4,ge$2),S(5,Be$1),S(6,Re)],Vt$1);function qo(s15,t,e){for(;s15.length<e;)s15=t+s15;return s15}var Yr$1=class{constructor(t,e){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=t.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i8=t.createElement("span");i8.classList.add("xterm-char-measure-element");let r5=t.createElement("span");r5.classList.add("xterm-char-measure-element"),r5.style.fontWeight="bold";let n=t.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontStyle="italic";let o2=t.createElement("span");o2.classList.add("xterm-char-measure-element"),o2.style.fontWeight="bold",o2.style.fontStyle="italic",this._measureElements=[i8,r5,n,o2],this._container.appendChild(i8),this._container.appendChild(r5),this._container.appendChild(n),this._container.appendChild(o2),e.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(t,e,i8,r5){t===this._font&&e===this._fontSize&&i8===this._weight&&r5===this._weightBold||(this._font=t,this._fontSize=e,this._weight=i8,this._weightBold=r5,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i8}`,this._measureElements[1].style.fontWeight=`${r5}`,this._measureElements[2].style.fontWeight=`${i8}`,this._measureElements[3].style.fontWeight=`${r5}`,this.clear())}get(t,e,i8){let r5=0;if(!e&&!i8&&t.length===1&&(r5=t.charCodeAt(0))<256){if(this._flat[r5]!==-9999)return this._flat[r5];let l2=this._measure(t,0);return l2>0&&(this._flat[r5]=l2),l2}let n=t;e&&(n+="B"),i8&&(n+="I");let o2=this._holey.get(n);if(o2===void 0){let l2=0;e&&(l2|=1),i8&&(l2|=2),o2=this._measure(t,l2),o2>0&&this._holey.set(n,o2)}return o2}_measure(t,e){let i8=this._measureElements[e];return i8.textContent=t.repeat(32),i8.offsetWidth/32}},ms$1=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i8,r5=!1){if(this.selectionStart=e,this.selectionEnd=i8,!e||!i8||e[0]===i8[0]&&e[1]===i8[1]){this.clear();return}let n=t.buffers.active.ydisp,o2=e[1]-n,l2=i8[1]-n,a=Math.max(o2,0),u=Math.min(l2,t.rows-1);if(a>=t.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r5,this.viewportStartRow=o2,this.viewportEndRow=l2,this.viewportCappedStartRow=a,this.viewportCappedEndRow=u,this.startCol=e[0],this.endCol=i8[0]}isCellSelected(t,e,i8){return this.hasSelection?(i8-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i8>=this.viewportCappedStartRow&&e<this.endCol&&i8<=this.viewportCappedEndRow:e<this.startCol&&i8>=this.viewportCappedStartRow&&e>=this.endCol&&i8<=this.viewportCappedEndRow:i8>this.viewportStartRow&&i8<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i8===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i8===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i8===this.viewportStartRow&&e>=this.startCol):!1}};function Yo(){return new ms$1}var _s$1="xterm-dom-renderer-owner-",Le="xterm-rows",jr="xterm-fg-",jo="xterm-bg-",ki$1="xterm-focus",Xr$1="xterm-selection",Na=1,Yt$1=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u,h2,c,d,_2,p,m){super(),this._terminal=e,this._document=i8,this._element=r5,this._screenElement=n,this._viewportElement=o2,this._helperContainer=l2,this._linkifier2=a,this._charSizeService=h2,this._optionsService=c,this._bufferService=d,this._coreService=_2,this._coreBrowserService=p,this._themeService=m,this._terminalClass=Na++,this._rowElements=[],this._selectionRenderModel=Yo(),this.onRequestRedraw=this._register(new v$1).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Le),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Xr$1),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Vo(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(f=>this._injectCss(f))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(Vt$1,document),this._element.classList.add(_s$1+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(f=>this._handleLinkHover(f))),this._register(this._linkifier2.onHideLinkUnderline(f=>this._handleLinkLeave(f))),this._register(C$2(()=>{this._element.classList.remove(_s$1+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Yr$1(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r5 of this._rowElements)r5.style.width=`${this.dimensions.css.canvas.width}px`,r5.style.height=`${this.dimensions.css.cell.height}px`,r5.style.lineHeight=`${this.dimensions.css.cell.height}px`,r5.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i8=`${this._terminalSelector} .${Le} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i8,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i8=`${this._terminalSelector} .${Le} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i8+=`${this._terminalSelector} .${Le} .xterm-dim { color: ${U$2.multiplyOpacity(e.foreground,.5).css};}`,i8+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r5=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,o2=`blink_block_${this._terminalClass}`;i8+=`@keyframes ${r5} { 50% { border-bottom-style: hidden; }}`,i8+=`@keyframes ${n} { 50% { box-shadow: none; }}`,i8+=`@keyframes ${o2} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i8+=`${this._terminalSelector} .${Le}.${ki$1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r5} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki$1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki$1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o2} 1s step-end infinite;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i8+=`${this._terminalSelector} .${Xr$1} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Xr$1} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Xr$1} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l2,a]of e.ansi.entries())i8+=`${this._terminalSelector} .${jr}${l2} { color: ${a.css}; }${this._terminalSelector} .${jr}${l2}.xterm-dim { color: ${U$2.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${jo}${l2} { background-color: ${a.css}; }`;i8+=`${this._terminalSelector} .${jr}257 { color: ${U$2.opaque(e.background).css}; }${this._terminalSelector} .${jr}257.xterm-dim { color: ${U$2.multiplyOpacity(U$2.opaque(e.background),.5).css}; }${this._terminalSelector} .${jo}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i8}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i8){for(let r5=this._rowElements.length;r5<=i8;r5++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>i8;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i8){this._refreshRowElements(e,i8),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(ki$1),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ki$1),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i8,r5){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i8,r5),this.renderRows(0,this._bufferService.rows-1),!e||!i8||(this._selectionRenderModel.update(this._terminal,e,i8,r5),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,o2=this._selectionRenderModel.viewportEndRow,l2=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(r5){let h2=e[0]>i8[0];u.appendChild(this._createSelectionElement(l2,h2?i8[0]:e[0],h2?e[0]:i8[0],a-l2+1))}else{let h2=n===l2?e[0]:0,c=l2===o2?i8[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l2,h2,c));let d=a-l2-1;if(u.appendChild(this._createSelectionElement(l2+1,0,this._bufferService.cols,d)),l2!==a){let _2=o2===a?i8[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,0,_2))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,i8,r5,n=1){let o2=this._document.createElement("div"),l2=i8*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r5-i8);return l2+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l2),o2.style.height=`${n*this.dimensions.css.cell.height}px`,o2.style.top=`${e*this.dimensions.css.cell.height}px`,o2.style.left=`${l2}px`,o2.style.width=`${a}px`,o2}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i8){let r5=this._bufferService.buffer,n=r5.ybase+r5.y,o2=Math.min(r5.x,this._bufferService.cols-1),l2=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h2=e;h2<=i8;h2++){let c=h2+r5.ydisp,d=this._rowElements[h2],_2=r5.lines.get(c);if(!d||!_2)break;d.replaceChildren(...this._rowFactory.createRow(_2,c,c===n,a,u,o2,l2,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${_s$1}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i8,r5,n,o2,l2){r5<0&&(e=0),n<0&&(i8=0);let a=this._bufferService.rows-1;r5=Math.max(Math.min(r5,a),0),n=Math.max(Math.min(n,a),0),o2=Math.min(o2,this._bufferService.cols);let u=this._bufferService.buffer,h2=u.ybase+u.y,c=Math.min(u.x,o2-1),d=this._optionsService.rawOptions.cursorBlink,_2=this._optionsService.rawOptions.cursorStyle,p=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=r5;m<=n;++m){let f=m+u.ydisp,A2=this._rowElements[m],R=u.lines.get(f);if(!A2||!R)break;A2.replaceChildren(...this._rowFactory.createRow(R,f,f===h2,_2,p,c,d,this.dimensions.css.cell.width,this._widthCache,l2?m===r5?e:0:-1,l2?(m===n?i8:o2)-1:-1))}}};Yt$1=M$1([S(7,xt$2),S(8,nt$1),S(9,H$2),S(10,F$1),S(11,ge$2),S(12,ae$1),S(13,Re)],Yt$1);var jt$1=class extends D$1{constructor(e,i8,r5){super(),this._optionsService=r5,this.width=0,this.height=0,this._onCharSizeChange=this._register(new v$1),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new vs$1(this._optionsService))}catch{this._measureStrategy=this._register(new bs(e,i8,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};jt$1=M$1([S(2,H$2)],jt$1);var Zr=class extends D$1{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i8){e!==void 0&&e>0&&i8!==void 0&&i8>0&&(this._result.width=e,this._result.height=i8)}},bs=class extends Zr{constructor(e,i8,r5){super(),this._document=e,this._parentElement=i8,this._optionsService=r5,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},vs$1=class extends Zr{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i8=this._ctx.measureText("W");if(!("width"in i8&&"fontBoundingBoxAscent"in i8&&"fontBoundingBoxDescent"in i8))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},Jr$1=class extends D$1{constructor(e,i8,r5){super(),this._textarea=e,this._window=i8,this.mainDocument=r5,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new gs$1(this._window)),this._onDprChange=this._register(new v$1),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new v$1),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register($.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(L$1(this._textarea,"focus",()=>this._isFocused=!0)),this._register(L$1(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},gs$1=class extends D$1{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ye$2),this._onDprChange=this._register(new v$1),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(C$2(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=L$1(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _a7;this._outerListener&&((_a7=this._resolutionMediaMatchList)==null||_a7.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Qr=class extends D$1{constructor(){super(),this.linkProviders=[],this._register(C$2(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i8=this.linkProviders.indexOf(e);i8!==-1&&this.linkProviders.splice(i8,1)}}}};function Ci$1(s15,t,e){let i8=e.getBoundingClientRect(),r5=s15.getComputedStyle(e),n=parseInt(r5.getPropertyValue("padding-left")),o2=parseInt(r5.getPropertyValue("padding-top"));return[t.clientX-i8.left-n,t.clientY-i8.top-o2]}function Xo(s15,t,e,i8,r5,n,o2,l2,a){if(!n)return;let u=Ci$1(s15,t,e);if(u)return u[0]=Math.ceil((u[0]+(a?o2/2:0))/o2),u[1]=Math.ceil(u[1]/l2),u[0]=Math.min(Math.max(u[0],1),i8+(a?1:0)),u[1]=Math.min(Math.max(u[1],1),r5),u}var Xt$1=class{constructor(t,e){this._renderService=t,this._charSizeService=e}getCoords(t,e,i8,r5,n){return Xo(window,t,e,i8,r5,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(t,e){let i8=Ci$1(window,t,e);if(this._charSizeService.hasValidSize)return i8[0]=Math.min(Math.max(i8[0],0),this._renderService.dimensions.css.canvas.width-1),i8[1]=Math.min(Math.max(i8[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i8[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i8[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i8[0]),y:Math.floor(i8[1])}}};Xt$1=M$1([S(0,ce$1),S(1,nt$1)],Xt$1);var en$1=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,e,i8){this._rowCount=i8,t=t!==void 0?t:0,e=e!==void 0?e:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,e):e,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}},tn={};Ll(tn,{getSafariVersion:()=>Ha,isChromeOS:()=>Ts$1,isFirefox:()=>Ss,isIpad:()=>Wa,isIphone:()=>Ua,isLegacyEdge:()=>Fa,isLinux:()=>Bi,isMac:()=>Zt$1,isNode:()=>Mi$1,isSafari:()=>Zo,isWindows:()=>Es});var Mi$1=typeof process<"u"&&"title"in process,Pi$1=Mi$1?"node":navigator.userAgent,Oi=Mi$1?"node":navigator.platform,Ss=Pi$1.includes("Firefox"),Fa=Pi$1.includes("Edge"),Zo=/^((?!chrome|android).)*safari/i.test(Pi$1);function Ha(){if(!Zo)return 0;let s15=Pi$1.match(/Version\/(\d+)/);return s15===null||s15.length<2?0:parseInt(s15[1])}var Zt$1=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Oi),Wa=Oi==="iPad",Ua=Oi==="iPhone",Es=["Windows","Win16","Win32","WinCE"].includes(Oi),Bi=Oi.indexOf("Linux")>=0,Ts$1=/\bCrOS\b/.test(Pi$1),rn=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i8=0,r5=t.timeRemaining(),n=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i8=Math.max(e,i8),n=t.timeRemaining(),i8*1.5>n){r5-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r5-e))}ms`),this._start();return}r5=n}this.clear()}},Is$1=class extends rn{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},ys=class extends rn{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Jt=!Mi$1&&"requestIdleCallback"in window?ys:Is$1,nn=class{constructor(){this._queue=new Jt}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},Qt$1=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u,h2){super(),this._rowCount=e,this._optionsService=r5,this._charSizeService=n,this._coreService=o2,this._coreBrowserService=u,this._renderer=this._register(new ye$2),this._pausedResizeTask=new nn,this._observerDisposable=this._register(new ye$2),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new v$1),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new v$1),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new v$1),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new v$1),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new en$1((c,d)=>this._renderRows(c,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xs(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(C$2(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var _a7;return(_a7=this._renderer.value)==null?void 0:_a7.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l2.onDecorationRegistered(()=>this._fullRefresh())),this._register(l2.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(h2.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i8),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,i8)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i8){if("IntersectionObserver"in e){let r5=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r5.observe(i8),this._observerDisposable.value=C$2(()=>r5.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i8,r5=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i8);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),i8=Math.max(i8,n.end)),r5||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i8,this._rowCount)}_renderRows(e,i8){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i8);return}e=Math.min(e,this._rowCount-1),i8=Math.min(i8,this._rowCount-1),this._renderer.value.renderRows(e,i8),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i8}),this._onRender.fire({start:e,end:i8}),this._isNextRenderRedrawOnly=!0}}resize(e,i8){this._rowCount=i8,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i8=>this.refreshRows(i8.start,i8.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _a7,_b;this._renderer.value&&((_b=(_a7=this._renderer.value).clearTextureAtlas)==null||_b.call(_a7),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i8){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var _a7;return(_a7=this._renderer.value)==null?void 0:_a7.handleResize(e,i8)}):this._renderer.value.handleResize(e,i8),this._fullRefresh())}handleCharSizeChanged(){var _a7;(_a7=this._renderer.value)==null||_a7.handleCharSizeChanged()}handleBlur(){var _a7;(_a7=this._renderer.value)==null||_a7.handleBlur()}handleFocus(){var _a7;(_a7=this._renderer.value)==null||_a7.handleFocus()}handleSelectionChanged(e,i8,r5){var _a7;this._selectionState.start=e,this._selectionState.end=i8,this._selectionState.columnSelectMode=r5,(_a7=this._renderer.value)==null||_a7.handleSelectionChanged(e,i8,r5)}handleCursorMove(){var _a7;(_a7=this._renderer.value)==null||_a7.handleCursorMove()}clear(){var _a7;(_a7=this._renderer.value)==null||_a7.clear()}};Qt$1=M$1([S(2,H$2),S(3,nt$1),S(4,ge$2),S(5,Be$1),S(6,F$1),S(7,ae$1),S(8,Re)],Qt$1);var xs=class{constructor(t,e,i8){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i8,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Jo(s15,t,e,i8){let r5=e.buffer.x,n=e.buffer.y;if(!e.buffer.hasScrollback)return Ga(r5,n,s15,t,e,i8)+sn(n,t,e,i8)+$a(r5,n,s15,t,e,i8);let o2;if(n===t)return o2=r5>s15?"D":"C",Fi$1(Math.abs(r5-s15),Ni(o2,i8));o2=n>t?"D":"C";let l2=Math.abs(n-t),a=za(n>t?s15:r5,e)+(l2-1)*e.cols+1+Ka(n>t?r5:s15);return Fi$1(a,Ni(o2,i8))}function Ka(s15,t){return s15-1}function za(s15,t){return t.cols-s15}function Ga(s15,t,e,i8,r5,n){return sn(t,i8,r5,n).length===0?"":Fi$1(el(s15,t,s15,t-gt(t,r5),!1,r5).length,Ni("D",n))}function sn(s15,t,e,i8){let r5=s15-gt(s15,e),n=t-gt(t,e),o2=Math.abs(r5-n)-Va(s15,t,e);return Fi$1(o2,Ni(Qo(s15,t),i8))}function $a(s15,t,e,i8,r5,n){let o2;sn(t,i8,r5,n).length>0?o2=i8-gt(i8,r5):o2=t;let l2=i8,a=qa(s15,t,e,i8,r5,n);return Fi$1(el(s15,o2,e,l2,a==="C",r5).length,Ni(a,n))}function Va(s15,t,e){var _a7;let i8=0,r5=s15-gt(s15,e),n=t-gt(t,e);for(let o2=0;o2<Math.abs(r5-n);o2++){let l2=Qo(s15,t)==="A"?-1:1;(_a7=e.buffer.lines.get(r5+l2*o2))!=null&&_a7.isWrapped&&i8++}return i8}function gt(s15,t){let e=0,i8=t.buffer.lines.get(s15),r5=i8==null?void 0:i8.isWrapped;for(;r5&&s15>=0&&s15<t.rows;)e++,i8=t.buffer.lines.get(--s15),r5=i8==null?void 0:i8.isWrapped;return e}function qa(s15,t,e,i8,r5,n){let o2;return sn(e,i8,r5,n).length>0?o2=i8-gt(i8,r5):o2=t,s15<e&&o2<=i8||s15>=e&&o2<i8?"C":"D"}function Qo(s15,t){return s15>t?"A":"B"}function el(s15,t,e,i8,r5,n){let o2=s15,l2=t,a="";for(;(o2!==e||l2!==i8)&&l2>=0&&l2<n.buffer.lines.length;)o2+=r5?1:-1,r5&&o2>n.cols-1?(a+=n.buffer.translateBufferLineToString(l2,!1,s15,o2),o2=0,s15=0,l2++):!r5&&o2<0&&(a+=n.buffer.translateBufferLineToString(l2,!1,0,s15+1),o2=n.cols-1,s15=o2,l2--);return a+n.buffer.translateBufferLineToString(l2,!1,s15,o2)}function Ni(s15,t){let e=t?"O":"[";return b.ESC+e+s15}function Fi$1(s15,t){s15=Math.floor(s15);let e="";for(let i8=0;i8<s15;i8++)e+=t;return e}var on=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function ws(s15,t){if(s15.start.y>s15.end.y)throw new Error(`Buffer range end (${s15.end.x}, ${s15.end.y}) cannot be before start (${s15.start.x}, ${s15.start.y})`);return t*(s15.end.y-s15.start.y)+(s15.end.x-s15.start.x+1)}var Ds=50,Ya=15,ja=50,Xa=500,Za=" ",Ja=new RegExp(Za,"g"),ei$1=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u,h2){super(),this._element=e,this._screenElement=i8,this._linkifier=r5,this._bufferService=n,this._coreService=o2,this._mouseService=l2,this._optionsService=a,this._renderService=u,this._coreBrowserService=h2,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new q,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new v$1),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new v$1),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new v$1),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new v$1),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new on(this._bufferService),this._activeSelectionMode=0,this._register(C$2(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i8=this._model.finalSelectionEnd;return!e||!i8?!1:e[0]!==i8[0]||e[1]!==i8[1]}get selectionText(){let e=this._model.finalSelectionStart,i8=this._model.finalSelectionEnd;if(!e||!i8)return"";let r5=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===i8[0])return"";let l2=e[0]<i8[0]?e[0]:i8[0],a=e[0]<i8[0]?i8[0]:e[0];for(let u=e[1];u<=i8[1];u++){let h2=r5.translateBufferLineToString(u,!0,l2,a);n.push(h2)}}else{let l2=e[1]===i8[1]?i8[0]:void 0;n.push(r5.translateBufferLineToString(e[1],!0,e[0],l2));for(let a=e[1]+1;a<=i8[1]-1;a++){let u=r5.lines.get(a),h2=r5.translateBufferLineToString(a,!0);u!=null&&u.isWrapped?n[n.length-1]+=h2:n.push(h2)}if(e[1]!==i8[1]){let a=r5.lines.get(i8[1]),u=r5.translateBufferLineToString(i8[1],!0,0,i8[0]);a&&a.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(l2=>l2.replace(Ja," ")).join(Es?`\r
23
- `:`
24
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Bi&&e&&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(e){let i8=this._getMouseBufferCoords(e),r5=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r5||!n||!i8?!1:this._areCoordsInSelection(i8,r5,n)}isCellInSelection(e,i8){let r5=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r5||!n?!1:this._areCoordsInSelection([e,i8],r5,n)}_areCoordsInSelection(e,i8,r5){return e[1]>i8[1]&&e[1]<r5[1]||i8[1]===r5[1]&&e[1]===i8[1]&&e[0]>=i8[0]&&e[0]<r5[0]||i8[1]<r5[1]&&e[1]===r5[1]&&e[0]<r5[0]||i8[1]<r5[1]&&e[1]===i8[1]&&e[0]>=i8[0]}_selectWordAtCursor(e,i8){var _a7,_b;let r5=(_b=(_a7=this._linkifier.currentLink)==null?void 0:_a7.link)==null?void 0:_b.range;if(r5)return this._model.selectionStart=[r5.start.x-1,r5.start.y-1],this._model.selectionStartLength=ws(r5,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,i8),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i8){this._model.clearSelection(),e=Math.max(e,0),i8=Math.min(i8,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i8],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i8=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i8)return i8[0]--,i8[1]--,i8[1]+=this._bufferService.buffer.ydisp,i8}_getMouseEventScrollAmount(e){let i8=Ci$1(this._coreBrowserService.window,e,this._screenElement)[1],r5=this._renderService.dimensions.css.canvas.height;return i8>=0&&i8<=r5?0:(i8>r5&&(i8-=r5),i8=Math.min(Math.max(i8,-Ds),Ds),i8/=Ds,i8/Math.abs(i8)+Math.round(i8*(Ya-1)))}shouldForceSelection(e){return Zt$1?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),ja)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i8=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i8&&i8.length!==this._model.selectionStart[0]&&i8.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i8=this._getMouseBufferCoords(e);i8&&(this._activeSelectionMode=2,this._selectLineAt(i8[1]))}shouldColumnSelect(e){return e.altKey&&!(Zt$1&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i8=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r5=this._bufferService.buffer;if(this._model.selectionEnd[1]<r5.lines.length){let n=r5.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]++}(!i8||i8[0]!==this._model.selectionEnd[0]||i8[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i8=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i8<Xa&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r5=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r5&&r5[0]!==void 0&&r5[1]!==void 0){let n=Jo(r5[0]-1,r5[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i8=this._model.finalSelectionEnd,r5=!!e&&!!i8&&(e[0]!==i8[0]||e[1]!==i8[1]);if(!r5){this._oldHasSelection&&this._fireOnSelectionChange(e,i8,r5);return}!e||!i8||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i8[0]!==this._oldSelectionEnd[0]||i8[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i8,r5)}_fireOnSelectionChange(e,i8,r5){this._oldSelectionStart=e,this._oldSelectionEnd=i8,this._oldHasSelection=r5,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i8=>this._handleTrim(i8))}_convertViewportColToCharacterIndex(e,i8){let r5=i8;for(let n=0;i8>=n;n++){let o2=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r5--:o2>1&&i8!==n&&(r5+=o2-1)}return r5}setSelection(e,i8,r5){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i8],this._model.selectionStartLength=r5,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i8,r5=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let o2=this._bufferService.buffer,l2=o2.lines.get(e[1]);if(!l2)return;let a=o2.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(l2,e[0]),h2=u,c=e[0]-u,d=0,_2=0,p=0,m=0;if(a.charAt(u)===" "){for(;u>0&&a.charAt(u-1)===" ";)u--;for(;h2<a.length&&a.charAt(h2+1)===" ";)h2++}else{let R=e[0],O2=e[0];l2.getWidth(R)===0&&(d++,R--),l2.getWidth(O2)===2&&(_2++,O2++);let I2=l2.getString(O2).length;for(I2>1&&(m+=I2-1,h2+=I2-1);R>0&&u>0&&!this._isCharWordSeparator(l2.loadCell(R-1,this._workCell));){l2.loadCell(R-1,this._workCell);let k2=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,R--):k2>1&&(p+=k2-1,u-=k2-1),u--,R--}for(;O2<l2.length&&h2+1<a.length&&!this._isCharWordSeparator(l2.loadCell(O2+1,this._workCell));){l2.loadCell(O2+1,this._workCell);let k2=this._workCell.getChars().length;this._workCell.getWidth()===2?(_2++,O2++):k2>1&&(m+=k2-1,h2+=k2-1),h2++,O2++}}h2++;let f=u+c-d+p,A2=Math.min(this._bufferService.cols,h2-u+d+_2-p-m);if(!(!i8&&a.slice(u,h2).trim()==="")){if(r5&&f===0&&l2.getCodePoint(0)!==32){let R=o2.lines.get(e[1]-1);if(R&&l2.isWrapped&&R.getCodePoint(this._bufferService.cols-1)!==32){let O2=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(O2){let I2=this._bufferService.cols-O2.start;f-=I2,A2+=I2}}}if(n&&f+A2===this._bufferService.cols&&l2.getCodePoint(this._bufferService.cols-1)!==32){let R=o2.lines.get(e[1]+1);if(R!=null&&R.isWrapped&&R.getCodePoint(0)!==32){let O2=this._getWordAt([0,e[1]+1],!1,!1,!0);O2&&(A2+=O2.length)}}return{start:f,length:A2}}}_selectWordAt(e,i8){let r5=this._getWordAt(e,i8);if(r5){for(;r5.start<0;)r5.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r5.start,e[1]],this._model.selectionStartLength=r5.length}}_selectToWordAt(e){let i8=this._getWordAt(e,!0);if(i8){let r5=e[1];for(;i8.start<0;)i8.start+=this._bufferService.cols,r5--;if(!this._model.areSelectionValuesReversed())for(;i8.start+i8.length>this._bufferService.cols;)i8.length-=this._bufferService.cols,r5++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i8.start:i8.start+i8.length,r5]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i8=this._bufferService.buffer.getWrappedRangeForLine(e),r5={start:{x:0,y:i8.first},end:{x:this._bufferService.cols-1,y:i8.last}};this._model.selectionStart=[0,i8.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=ws(r5,this._bufferService.cols)}};ei$1=M$1([S(3,F$1),S(4,ge$2),S(5,Dt$1),S(6,H$2),S(7,ce$1),S(8,ae$1)],ei$1);var Hi$1=class{constructor(){this._data={}}set(t,e,i8){this._data[t]||(this._data[t]={}),this._data[t][e]=i8}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},Wi$1=class{constructor(){this._color=new Hi$1,this._css=new Hi$1}setCss(t,e,i8){this._css.set(t,e,i8)}getCss(t,e){return this._css.get(t,e)}setColor(t,e,i8){this._color.set(t,e,i8)}getColor(t,e){return this._color.get(t,e)}clear(){this._color.clear(),this._css.clear()}},re$2=Object.freeze((()=>{let s15=[z$1.toColor("#2e3436"),z$1.toColor("#cc0000"),z$1.toColor("#4e9a06"),z$1.toColor("#c4a000"),z$1.toColor("#3465a4"),z$1.toColor("#75507b"),z$1.toColor("#06989a"),z$1.toColor("#d3d7cf"),z$1.toColor("#555753"),z$1.toColor("#ef2929"),z$1.toColor("#8ae234"),z$1.toColor("#fce94f"),z$1.toColor("#729fcf"),z$1.toColor("#ad7fa8"),z$1.toColor("#34e2e2"),z$1.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let e=0;e<216;e++){let i8=t[e/36%6|0],r5=t[e/6%6|0],n=t[e%6];s15.push({css:j$1.toCss(i8,r5,n),rgba:j$1.toRgba(i8,r5,n)})}for(let e=0;e<24;e++){let i8=8+e*10;s15.push({css:j$1.toCss(i8,i8,i8),rgba:j$1.toRgba(i8,i8,i8)})}return s15})()),St$1=z$1.toColor("#ffffff"),Ki=z$1.toColor("#000000"),tl=z$1.toColor("#ffffff"),il=Ki,Ui={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Qa=St$1,ti$1=class extends D$1{constructor(e){super(),this._optionsService=e,this._contrastCache=new Wi$1,this._halfContrastCache=new Wi$1,this._onChangeColors=this._register(new v$1),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:St$1,background:Ki,cursor:tl,cursorAccent:il,selectionForeground:void 0,selectionBackgroundTransparent:Ui,selectionBackgroundOpaque:U$2.blend(Ki,Ui),selectionInactiveBackgroundTransparent:Ui,selectionInactiveBackgroundOpaque:U$2.blend(Ki,Ui),scrollbarSliderBackground:U$2.opacity(St$1,.2),scrollbarSliderHoverBackground:U$2.opacity(St$1,.4),scrollbarSliderActiveBackground:U$2.opacity(St$1,.5),overviewRulerBorder:St$1,ansi:re$2.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)))}get colors(){return this._colors}_setTheme(e={}){let i8=this._colors;if(i8.foreground=K$2(e.foreground,St$1),i8.background=K$2(e.background,Ki),i8.cursor=U$2.blend(i8.background,K$2(e.cursor,tl)),i8.cursorAccent=U$2.blend(i8.background,K$2(e.cursorAccent,il)),i8.selectionBackgroundTransparent=K$2(e.selectionBackground,Ui),i8.selectionBackgroundOpaque=U$2.blend(i8.background,i8.selectionBackgroundTransparent),i8.selectionInactiveBackgroundTransparent=K$2(e.selectionInactiveBackground,i8.selectionBackgroundTransparent),i8.selectionInactiveBackgroundOpaque=U$2.blend(i8.background,i8.selectionInactiveBackgroundTransparent),i8.selectionForeground=e.selectionForeground?K$2(e.selectionForeground,ps):void 0,i8.selectionForeground===ps&&(i8.selectionForeground=void 0),U$2.isOpaque(i8.selectionBackgroundTransparent)&&(i8.selectionBackgroundTransparent=U$2.opacity(i8.selectionBackgroundTransparent,.3)),U$2.isOpaque(i8.selectionInactiveBackgroundTransparent)&&(i8.selectionInactiveBackgroundTransparent=U$2.opacity(i8.selectionInactiveBackgroundTransparent,.3)),i8.scrollbarSliderBackground=K$2(e.scrollbarSliderBackground,U$2.opacity(i8.foreground,.2)),i8.scrollbarSliderHoverBackground=K$2(e.scrollbarSliderHoverBackground,U$2.opacity(i8.foreground,.4)),i8.scrollbarSliderActiveBackground=K$2(e.scrollbarSliderActiveBackground,U$2.opacity(i8.foreground,.5)),i8.overviewRulerBorder=K$2(e.overviewRulerBorder,Qa),i8.ansi=re$2.slice(),i8.ansi[0]=K$2(e.black,re$2[0]),i8.ansi[1]=K$2(e.red,re$2[1]),i8.ansi[2]=K$2(e.green,re$2[2]),i8.ansi[3]=K$2(e.yellow,re$2[3]),i8.ansi[4]=K$2(e.blue,re$2[4]),i8.ansi[5]=K$2(e.magenta,re$2[5]),i8.ansi[6]=K$2(e.cyan,re$2[6]),i8.ansi[7]=K$2(e.white,re$2[7]),i8.ansi[8]=K$2(e.brightBlack,re$2[8]),i8.ansi[9]=K$2(e.brightRed,re$2[9]),i8.ansi[10]=K$2(e.brightGreen,re$2[10]),i8.ansi[11]=K$2(e.brightYellow,re$2[11]),i8.ansi[12]=K$2(e.brightBlue,re$2[12]),i8.ansi[13]=K$2(e.brightMagenta,re$2[13]),i8.ansi[14]=K$2(e.brightCyan,re$2[14]),i8.ansi[15]=K$2(e.brightWhite,re$2[15]),e.extendedAnsi){let r5=Math.min(i8.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r5;n++)i8.ansi[n+16]=K$2(e.extendedAnsi[n],re$2[n+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){for(let i8=0;i8<this._restoreColors.ansi.length;++i8)this._colors.ansi[i8]=this._restoreColors.ansi[i8];return}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]}}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()}}};ti$1=M$1([S(0,H$2)],ti$1);function K$2(s15,t){if(s15!==void 0)try{return z$1.toColor(s15)}catch{}return t}var Rs$1=class{constructor(...t){this._entries=new Map;for(let[e,i8]of t)this.set(e,i8)}set(t,e){let i8=this._entries.get(t);return this._entries.set(t,e),i8}forEach(t){for(let[e,i8]of this._entries.entries())t(e,i8)}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}},ln=class{constructor(){this._services=new Rs$1,this._services.set(xt$2,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i8=Xs(t).sort((o2,l2)=>o2.index-l2.index),r5=[];for(let o2 of i8){let l2=this._services.get(o2.id);if(!l2)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${o2.id._id}.`);r5.push(l2)}let n=i8.length>0?i8[0].index:e.length;if(e.length!==n)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${n+1} conflicts with ${e.length} static arguments`);return new t(...e,...r5)}},ec={trace:0,debug:1,info:2,warn:3,error:4,off:5},tc="xterm.js: ",ii$1=class extends D$1{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ec[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i8=0;i8<e.length;i8++)typeof e[i8]=="function"&&(e[i8]=e[i8]())}_log(e,i8,r5){this._evalLazyOptionalParams(r5),e.call(console,(this._optionsService.options.logger?"":tc)+i8,...r5)}trace(e,...i8){var _a7;this._logLevel<=0&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.trace.bind(this._optionsService.options.logger))??console.log,e,i8)}debug(e,...i8){var _a7;this._logLevel<=1&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.debug.bind(this._optionsService.options.logger))??console.log,e,i8)}info(e,...i8){var _a7;this._logLevel<=2&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.info.bind(this._optionsService.options.logger))??console.info,e,i8)}warn(e,...i8){var _a7;this._logLevel<=3&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.warn.bind(this._optionsService.options.logger))??console.warn,e,i8)}error(e,...i8){var _a7;this._logLevel<=4&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.error.bind(this._optionsService.options.logger))??console.error,e,i8)}};ii$1=M$1([S(0,H$2)],ii$1);var zi$1=class extends D$1{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new v$1),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new v$1),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new v$1),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i8=new Array(e);for(let r5=0;r5<Math.min(e,this.length);r5++)i8[r5]=this._array[this._getCyclicIndex(r5)];this._array=i8,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i8=this._length;i8<e;i8++)this._array[i8]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i8){this._array[this._getCyclicIndex(e)]=i8}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,i8,...r5){if(i8){for(let n=e;n<this._length-i8;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+i8)];this._length-=i8,this.onDeleteEmitter.fire({index:e,amount:i8})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r5.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r5.length;n++)this._array[this._getCyclicIndex(e+n)]=r5[n];if(r5.length&&this.onInsertEmitter.fire({index:e,amount:r5.length}),this._length+r5.length>this._maxLength){let n=this._length+r5.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r5.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i8,r5){if(!(i8<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r5<0)throw new Error("Cannot shift elements in list beyond index 0");if(r5>0){for(let o2=i8-1;o2>=0;o2--)this.set(e+o2+r5,this.get(e+o2));let n=e+i8+r5-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<i8;n++)this.set(e+n+r5,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},B$1=3,X$1=Object.freeze(new De$2),an=0,Ls=2,Ze$1=class s12{constructor(t,e,i8=!1){this.isWrapped=i8,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*B$1);let r5=e||q.fromCharData([0,ir,1,0]);for(let n=0;n<t;++n)this.setCell(n,r5);this.length=t}get(t){let e=this._data[t*B$1+0],i8=e&2097151;return[this._data[t*B$1+1],e&2097152?this._combined[t]:i8?Ce$1(i8):"",e>>22,e&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i8]}set(t,e){this._data[t*B$1+1]=e[0],e[1].length>1?(this._combined[t]=e[1],this._data[t*B$1+0]=t|2097152|e[2]<<22):this._data[t*B$1+0]=e[1].charCodeAt(0)|e[2]<<22}getWidth(t){return this._data[t*B$1+0]>>22}hasWidth(t){return this._data[t*B$1+0]&12582912}getFg(t){return this._data[t*B$1+1]}getBg(t){return this._data[t*B$1+2]}hasContent(t){return this._data[t*B$1+0]&4194303}getCodePoint(t){let e=this._data[t*B$1+0];return e&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):e&2097151}isCombined(t){return this._data[t*B$1+0]&2097152}getString(t){let e=this._data[t*B$1+0];return e&2097152?this._combined[t]:e&2097151?Ce$1(e&2097151):""}isProtected(t){return this._data[t*B$1+2]&536870912}loadCell(t,e){return an=t*B$1,e.content=this._data[an+0],e.fg=this._data[an+1],e.bg=this._data[an+2],e.content&2097152&&(e.combinedData=this._combined[t]),e.bg&268435456&&(e.extended=this._extendedAttrs[t]),e}setCell(t,e){e.content&2097152&&(this._combined[t]=e.combinedData),e.bg&268435456&&(this._extendedAttrs[t]=e.extended),this._data[t*B$1+0]=e.content,this._data[t*B$1+1]=e.fg,this._data[t*B$1+2]=e.bg}setCellFromCodepoint(t,e,i8,r5){r5.bg&268435456&&(this._extendedAttrs[t]=r5.extended),this._data[t*B$1+0]=e|i8<<22,this._data[t*B$1+1]=r5.fg,this._data[t*B$1+2]=r5.bg}addCodepointToCell(t,e,i8){let r5=this._data[t*B$1+0];r5&2097152?this._combined[t]+=Ce$1(e):r5&2097151?(this._combined[t]=Ce$1(r5&2097151)+Ce$1(e),r5&=-2097152,r5|=2097152):r5=e|1<<22,i8&&(r5&=-12582913,r5|=i8<<22),this._data[t*B$1+0]=r5}insertCells(t,e,i8){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i8),e<this.length-t){let r5=new q;for(let n=this.length-t-e-1;n>=0;--n)this.setCell(t+e+n,this.loadCell(t+n,r5));for(let n=0;n<e;++n)this.setCell(t+n,i8)}else for(let r5=t;r5<this.length;++r5)this.setCell(r5,i8);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i8)}deleteCells(t,e,i8){if(t%=this.length,e<this.length-t){let r5=new q;for(let n=0;n<this.length-t-e;++n)this.setCell(t+n,this.loadCell(t+e+n,r5));for(let n=this.length-e;n<this.length;++n)this.setCell(n,i8)}else for(let r5=t;r5<this.length;++r5)this.setCell(r5,i8);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i8),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i8)}replaceCells(t,e,i8,r5=!1){if(r5){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i8),e<this.length&&this.getWidth(e-1)===2&&!this.isProtected(e)&&this.setCellFromCodepoint(e,0,1,i8);t<e&&t<this.length;)this.isProtected(t)||this.setCell(t,i8),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i8),e<this.length&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e,0,1,i8);t<e&&t<this.length;)this.setCell(t++,i8)}resize(t,e){if(t===this.length)return this._data.length*4*Ls<this._data.buffer.byteLength;let i8=t*B$1;if(t>this.length){if(this._data.buffer.byteLength>=i8*4)this._data=new Uint32Array(this._data.buffer,0,i8);else{let r5=new Uint32Array(i8);r5.set(this._data),this._data=r5}for(let r5=this.length;r5<t;++r5)this.setCell(r5,e)}else{this._data=this._data.subarray(0,i8);let r5=Object.keys(this._combined);for(let o2=0;o2<r5.length;o2++){let l2=parseInt(r5[o2],10);l2>=t&&delete this._combined[l2]}let n=Object.keys(this._extendedAttrs);for(let o2=0;o2<n.length;o2++){let l2=parseInt(n[o2],10);l2>=t&&delete this._extendedAttrs[l2]}}return this.length=t,i8*4*Ls<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Ls<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,e=!1){if(e){for(let i8=0;i8<this.length;++i8)this.isProtected(i8)||this.setCell(i8,t);return}this._combined={},this._extendedAttrs={};for(let i8=0;i8<this.length;++i8)this.setCell(i8,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let e in t._combined)this._combined[e]=t._combined[e];this._extendedAttrs={};for(let e in t._extendedAttrs)this._extendedAttrs[e]=t._extendedAttrs[e];this.isWrapped=t.isWrapped}clone(){let t=new s12(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*B$1+0]&4194303)return t+(this._data[t*B$1+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*B$1+0]&4194303||this._data[t*B$1+2]&50331648)return t+(this._data[t*B$1+0]>>22);return 0}copyCellsFrom(t,e,i8,r5,n){let o2=t._data;if(n)for(let a=r5-1;a>=0;a--){for(let u=0;u<B$1;u++)this._data[(i8+a)*B$1+u]=o2[(e+a)*B$1+u];o2[(e+a)*B$1+2]&268435456&&(this._extendedAttrs[i8+a]=t._extendedAttrs[e+a])}else for(let a=0;a<r5;a++){for(let u=0;u<B$1;u++)this._data[(i8+a)*B$1+u]=o2[(e+a)*B$1+u];o2[(e+a)*B$1+2]&268435456&&(this._extendedAttrs[i8+a]=t._extendedAttrs[e+a])}let l2=Object.keys(t._combined);for(let a=0;a<l2.length;a++){let u=parseInt(l2[a],10);u>=e&&(this._combined[u-e+i8]=t._combined[u])}}translateToString(t,e,i8,r5){e=e??0,i8=i8??this.length,t&&(i8=Math.min(i8,this.getTrimmedLength())),r5&&(r5.length=0);let n="";for(;e<i8;){let o2=this._data[e*B$1+0],l2=o2&2097151,a=o2&2097152?this._combined[e]:l2?Ce$1(l2):we;if(n+=a,r5)for(let u=0;u<a.length;++u)r5.push(e);e+=o2>>22||1}return r5&&r5.push(e),n}};function sl(s15,t,e,i8,r5,n){let o2=[];for(let l2=0;l2<s15.length-1;l2++){let a=l2,u=s15.get(++a);if(!u.isWrapped)continue;let h2=[s15.get(l2)];for(;a<s15.length&&u.isWrapped;)h2.push(u),u=s15.get(++a);if(!n&&i8>=l2&&i8<a){l2+=h2.length-1;continue}let c=0,d=ri$1(h2,c,t),_2=1,p=0;for(;_2<h2.length;){let f=ri$1(h2,_2,t),A2=f-p,R=e-d,O2=Math.min(A2,R);h2[c].copyCellsFrom(h2[_2],p,d,O2,!1),d+=O2,d===e&&(c++,d=0),p+=O2,p===f&&(_2++,p=0),d===0&&c!==0&&h2[c-1].getWidth(e-1)===2&&(h2[c].copyCellsFrom(h2[c-1],e-1,d++,1,!1),h2[c-1].setCell(e-1,r5))}h2[c].replaceCells(d,e,r5);let m=0;for(let f=h2.length-1;f>0&&(f>c||h2[f].getTrimmedLength()===0);f--)m++;m>0&&(o2.push(l2+h2.length-m),o2.push(m)),l2+=h2.length-1}return o2}function ol(s15,t){let e=[],i8=0,r5=t[i8],n=0;for(let o2=0;o2<s15.length;o2++)if(r5===o2){let l2=t[++i8];s15.onDeleteEmitter.fire({index:o2-n,amount:l2}),o2+=l2-1,n+=l2,r5=t[++i8]}else e.push(o2);return{layout:e,countRemoved:n}}function ll(s15,t){let e=[];for(let i8=0;i8<t.length;i8++)e.push(s15.get(t[i8]));for(let i8=0;i8<e.length;i8++)s15.set(i8,e[i8]);s15.length=t.length}function al(s15,t,e){let i8=[],r5=s15.map((a,u)=>ri$1(s15,u,t)).reduce((a,u)=>a+u),n=0,o2=0,l2=0;for(;l2<r5;){if(r5-l2<e){i8.push(r5-l2);break}n+=e;let a=ri$1(s15,o2,t);n>a&&(n-=a,o2++);let u=s15[o2].getWidth(n-1)===2;u&&n--;let h2=u?e-1:e;i8.push(h2),l2+=h2}return i8}function ri$1(s15,t,e){if(t===s15.length-1)return s15[t].getTrimmedLength();let i8=!s15[t].hasContent(e-1)&&s15[t].getWidth(e-1)===1,r5=s15[t+1].getWidth(0)===2;return i8&&r5?e-1:e}var un$1=class un{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=un._nextId++,this._onDispose=this.register(new v$1),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ne(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};un$1._nextId=1;var cn$1=un$1,ne$1={},Je$1=ne$1.B;ne$1[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ne$1.A={"#":"£"};ne$1.B=void 0;ne$1[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ne$1.C=ne$1[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ne$1.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ne$1.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ne$1.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ne$1.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ne$1.E=ne$1[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ne$1.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ne$1.H=ne$1[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ne$1["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var cl=4294967295,$i=class{constructor(t,e,i8){this._hasScrollback=t,this._optionsService=e,this._bufferService=i8,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=X$1.clone(),this.savedCharset=Je$1,this.markers=[],this._nullCell=q.fromCharData([0,ir,1,0]),this._whitespaceCell=q.fromCharData([0,we,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Jt,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new zi$1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new rt$1),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new rt$1),this._whitespaceCell}getBlankLine(t,e){return new Ze$1(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>cl?cl:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=X$1);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new zi$1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i8=this.getNullCell(X$1),r5=0,n=this._getCorrectBufferLength(e);if(n>this.lines.maxLength&&(this.lines.maxLength=n),this.lines.length>0){if(this._cols<t)for(let l2=0;l2<this.lines.length;l2++)r5+=+this.lines.get(l2).resize(t,i8);let o2=0;if(this._rows<e)for(let l2=this._rows;l2<e;l2++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Ze$1(t,i8)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o2+1?(this.ybase--,o2++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ze$1(t,i8)));else for(let l2=this._rows;l2>e;l2--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){let l2=this.lines.length-n;l2>0&&(this.lines.trimStart(l2),this.ybase=Math.max(this.ybase-l2,0),this.ydisp=Math.max(this.ydisp-l2,0),this.savedY=Math.max(this.savedY-l2,0)),this.lines.maxLength=n}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),o2&&(this.y+=o2),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let o2=0;o2<this.lines.length;o2++)r5+=+this.lines.get(o2).resize(t,i8);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),r5>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i8=this._optionsService.rawOptions.reflowCursorLine,r5=sl(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(X$1),i8);if(r5.length>0){let n=ol(this.lines,r5);ll(this.lines,n.layout),this._reflowLargerAdjustViewport(t,e,n.countRemoved)}}_reflowLargerAdjustViewport(t,e,i8){let r5=this.getNullCell(X$1),n=i8;for(;n-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new Ze$1(t,r5))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i8,0)}_reflowSmaller(t,e){let i8=this._optionsService.rawOptions.reflowCursorLine,r5=this.getNullCell(X$1),n=[],o2=0;for(let l2=this.lines.length-1;l2>=0;l2--){let a=this.lines.get(l2);if(!a||!a.isWrapped&&a.getTrimmedLength()<=t)continue;let u=[a];for(;a.isWrapped&&l2>0;)a=this.lines.get(--l2),u.unshift(a);if(!i8){let I2=this.ybase+this.y;if(I2>=l2&&I2<l2+u.length)continue}let h2=u[u.length-1].getTrimmedLength(),c=al(u,this._cols,t),d=c.length-u.length,_2;this.ybase===0&&this.y!==this.lines.length-1?_2=Math.max(0,this.y-this.lines.maxLength+d):_2=Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let I2=0;I2<d;I2++){let k2=this.getBlankLine(X$1,!0);p.push(k2)}p.length>0&&(n.push({start:l2+u.length+o2,newLines:p}),o2+=p.length),u.push(...p);let m=c.length-1,f=c[m];f===0&&(m--,f=c[m]);let A2=u.length-d-1,R=h2;for(;A2>=0;){let I2=Math.min(R,f);if(u[m]===void 0)break;if(u[m].copyCellsFrom(u[A2],R-I2,f-I2,I2,!0),f-=I2,f===0&&(m--,f=c[m]),R-=I2,R===0){A2--;let k2=Math.max(A2,0);R=ri$1(u,k2,this._cols)}}for(let I2=0;I2<u.length;I2++)c[I2]<t&&u[I2].setCell(c[I2],r5);let O2=d-_2;for(;O2-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o2)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+e-1)}if(n.length>0){let l2=[],a=[];for(let f=0;f<this.lines.length;f++)a.push(this.lines.get(f));let u=this.lines.length,h2=u-1,c=0,d=n[c];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o2);let _2=0;for(let f=Math.min(this.lines.maxLength-1,u+o2-1);f>=0;f--)if(d&&d.start>h2+_2){for(let A2=d.newLines.length-1;A2>=0;A2--)this.lines.set(f--,d.newLines[A2]);f++,l2.push({index:h2+1,amount:d.newLines.length}),_2+=d.newLines.length,d=n[++c]}else this.lines.set(f,a[h2--]);let p=0;for(let f=l2.length-1;f>=0;f--)l2[f].index+=p,this.lines.onInsertEmitter.fire(l2[f]),p+=l2[f].amount;let m=Math.max(0,u+o2-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(t,e,i8=0,r5){let n=this.lines.get(t);return n?n.translateToString(e,i8,r5):""}getWrappedRangeForLine(t){let e=t,i8=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i8+1<this.lines.length&&this.lines.get(i8+1).isWrapped;)i8++;return{first:e,last:i8}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new cn$1(t);return this.markers.push(e),e.register(this.lines.onTrim(i8=>{e.line-=i8,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i8=>{e.line>=i8.index&&(e.line+=i8.amount)})),e.register(this.lines.onDelete(i8=>{e.line>=i8.index&&e.line<i8.index+i8.amount&&e.dispose(),e.line>i8.index&&(e.line-=i8.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},hn$1=class extends D$1{constructor(e,i8){super(),this._optionsService=e,this._bufferService=i8,this._onBufferActivate=this._register(new v$1),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 $i(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new $i(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,i8){this._normal.resize(e,i8),this._alt.resize(e,i8),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ks=2,Cs=1,ni=class extends D$1{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new v$1),this.onResize=this._onResize.event,this._onScroll=this._register(new v$1),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,ks),this.rows=Math.max(e.rawOptions.rows||0,Cs),this.buffers=this._register(new hn$1(e,this)),this._register(this.buffers.onBufferActivate(i8=>{this._onScroll.fire(i8.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i8){let r5=this.cols!==e,n=this.rows!==i8;this.cols=e,this.rows=i8,this.buffers.resize(e,i8),this._onResize.fire({cols:e,rows:i8,colsChanged:r5,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i8=!1){let r5=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r5.getBlankLine(e,i8),this._cachedBlankLine=n),n.isWrapped=i8;let o2=r5.ybase+r5.scrollTop,l2=r5.ybase+r5.scrollBottom;if(r5.scrollTop===0){let a=r5.lines.isFull;l2===r5.lines.length-1?a?r5.lines.recycle().copyFrom(n):r5.lines.push(n.clone()):r5.lines.splice(l2+1,0,n.clone()),a?this.isUserScrolling&&(r5.ydisp=Math.max(r5.ydisp-1,0)):(r5.ybase++,this.isUserScrolling||r5.ydisp++)}else{let a=l2-o2+1;r5.lines.shiftElements(o2+1,a-1,-1),r5.lines.set(l2,n.clone())}this.isUserScrolling||(r5.ydisp=r5.ybase),this._onScroll.fire(r5.ydisp)}scrollLines(e,i8){let r5=this.buffer;if(e<0){if(r5.ydisp===0)return;this.isUserScrolling=!0}else e+r5.ydisp>=r5.ybase&&(this.isUserScrolling=!1);let n=r5.ydisp;r5.ydisp=Math.max(Math.min(r5.ydisp+e,r5.ybase),0),n!==r5.ydisp&&(i8||this._onScroll.fire(r5.ydisp))}};ni=M$1([S(0,H$2)],ni);var si={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Zt$1,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},nc=["normal","bold","100","200","300","400","500","600","700","800","900"],dn$1=class extends D$1{constructor(e){super(),this._onOptionChange=this._register(new v$1),this.onOptionChange=this._onOptionChange.event;let i8={...si};for(let r5 in e)if(r5 in i8)try{let n=e[r5];i8[r5]=this._sanitizeAndValidateOption(r5,n)}catch(n){console.error(n)}this.rawOptions=i8,this.options={...i8},this._setupOptions(),this._register(C$2(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i8){return this.onOptionChange(r5=>{r5===e&&i8(this.rawOptions[e])})}onMultipleOptionChange(e,i8){return this.onOptionChange(r5=>{e.indexOf(r5)!==-1&&i8()})}_setupOptions(){let e=r5=>{if(!(r5 in si))throw new Error(`No option with key "${r5}"`);return this.rawOptions[r5]},i8=(r5,n)=>{if(!(r5 in si))throw new Error(`No option with key "${r5}"`);n=this._sanitizeAndValidateOption(r5,n),this.rawOptions[r5]!==n&&(this.rawOptions[r5]=n,this._onOptionChange.fire(r5))};for(let r5 in this.rawOptions){let n={get:e.bind(this,r5),set:i8.bind(this,r5)};Object.defineProperty(this.options,r5,n)}}_sanitizeAndValidateOption(e,i8){switch(e){case"cursorStyle":if(i8||(i8=si[e]),!sc(i8))throw new Error(`"${i8}" is not a valid value for ${e}`);break;case"wordSeparator":i8||(i8=si[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i8=="number"&&1<=i8&&i8<=1e3)break;i8=nc.includes(i8)?i8:si[e];break;case"cursorWidth":i8=Math.floor(i8);case"lineHeight":case"tabStopWidth":if(i8<1)throw new Error(`${e} cannot be less than 1, value: ${i8}`);break;case"minimumContrastRatio":i8=Math.max(1,Math.min(21,Math.round(i8*10)/10));break;case"scrollback":if(i8=Math.min(i8,4294967295),i8<0)throw new Error(`${e} cannot be less than 0, value: ${i8}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i8<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i8}`);break;case"rows":case"cols":if(!i8&&i8!==0)throw new Error(`${e} must be numeric, value: ${i8}`);break;case"windowsPty":i8=i8??{};break}return i8}};function sc(s15){return s15==="block"||s15==="underline"||s15==="bar"}function oi(s15,t=5){if(typeof s15!="object")return s15;let e=Array.isArray(s15)?[]:{};for(let i8 in s15)e[i8]=t<=1?s15[i8]:s15[i8]&&oi(s15[i8],t-1);return e}var ul=Object.freeze({insertMode:!1}),hl=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),li$1=class extends D$1{constructor(e,i8,r5){super(),this._bufferService=e,this._logService=i8,this._optionsService=r5,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new v$1),this.onData=this._onData.event,this._onUserInput=this._register(new v$1),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new v$1),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new v$1),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=oi(ul),this.decPrivateModes=oi(hl)}reset(){this.modes=oi(ul),this.decPrivateModes=oi(hl)}triggerDataEvent(e,i8=!1){if(this._optionsService.rawOptions.disableStdin)return;let r5=this._bufferService.buffer;i8&&this._optionsService.rawOptions.scrollOnUserInput&&r5.ybase!==r5.ydisp&&this._onRequestScrollToBottom.fire(),i8&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i8=>i8.charCodeAt(0))),this._onBinary.fire(e))}};li$1=M$1([S(0,F$1),S(1,nr$1),S(2,H$2)],li$1);var dl={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s15=>s15.button===4||s15.action!==1?!1:(s15.ctrl=!1,s15.alt=!1,s15.shift=!1,!0)},VT200:{events:19,restrict:s15=>s15.action!==32},DRAG:{events:23,restrict:s15=>!(s15.action===32&&s15.button===3)},ANY:{events:31,restrict:s15=>!0}};function Ms(s15,t){let e=(s15.ctrl?16:0)|(s15.shift?4:0)|(s15.alt?8:0);return s15.button===4?(e|=64,e|=s15.action):(e|=s15.button&3,s15.button&4&&(e|=64),s15.button&8&&(e|=128),s15.action===32?e|=32:s15.action===0&&!t&&(e|=3)),e}var Ps$1=String.fromCharCode,fl={DEFAULT:s15=>{let t=[Ms(s15,!1)+32,s15.col+32,s15.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Ps$1(t[0])}${Ps$1(t[1])}${Ps$1(t[2])}`},SGR:s15=>{let t=s15.action===0&&s15.button!==4?"m":"M";return`\x1B[<${Ms(s15,!0)};${s15.col};${s15.row}${t}`},SGR_PIXELS:s15=>{let t=s15.action===0&&s15.button!==4?"m":"M";return`\x1B[<${Ms(s15,!0)};${s15.x};${s15.y}${t}`}},ai=class extends D$1{constructor(e,i8,r5){super(),this._bufferService=e,this._coreService=i8,this._optionsService=r5,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new v$1),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(dl))this.addProtocol(n,dl[n]);for(let n of Object.keys(fl))this.addEncoding(n,fl[n]);this.reset()}addProtocol(e,i8){this._protocols[e]=i8}addEncoding(e,i8){this._encodings[e]=i8}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i8,r5){if(e.deltaY===0||e.shiftKey||i8===void 0||r5===void 0)return 0;let n=i8/r5,o2=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o2/=n+0,Math.abs(e.deltaY)<50&&(o2*=.3),this._wheelPartialScroll+=o2,o2=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o2*=this._bufferService.rows),o2}_applyScrollModifier(e,i8){return i8.altKey||i8.ctrlKey||i8.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i8=this._encodings[this._activeEncoding](e);return i8&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i8):this._coreService.triggerDataEvent(i8,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,i8,r5){if(r5){if(e.x!==i8.x||e.y!==i8.y)return!1}else if(e.col!==i8.col||e.row!==i8.row)return!1;return!(e.button!==i8.button||e.action!==i8.action||e.ctrl!==i8.ctrl||e.alt!==i8.alt||e.shift!==i8.shift)}};ai=M$1([S(0,F$1),S(1,ge$2),S(2,H$2)],ai);var Os=[[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]],ac=[[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]],se$1;function cc(s15,t){let e=0,i8=t.length-1,r5;if(s15<t[0][0]||s15>t[i8][1])return!1;for(;i8>=e;)if(r5=e+i8>>1,s15>t[r5][1])e=r5+1;else if(s15<t[r5][0])i8=r5-1;else return!0;return!1}var fn$1=class{constructor(){if(this.version="6",!se$1){se$1=new Uint8Array(65536),se$1.fill(1),se$1[0]=0,se$1.fill(0,1,32),se$1.fill(0,127,160),se$1.fill(2,4352,4448),se$1[9001]=2,se$1[9002]=2,se$1.fill(2,11904,42192),se$1[12351]=1,se$1.fill(2,44032,55204),se$1.fill(2,63744,64256),se$1.fill(2,65040,65050),se$1.fill(2,65072,65136),se$1.fill(2,65280,65377),se$1.fill(2,65504,65511);for(let t=0;t<Os.length;++t)se$1.fill(0,Os[t][0],Os[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?se$1[t]:cc(t,ac)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,e){let i8=this.wcwidth(t),r5=i8===0&&e!==0;if(r5){let n=Ae$2.extractWidth(e);n===0?r5=!1:n>i8&&(i8=n)}return Ae$2.createPropertyValue(0,i8,r5)}},Ae$2=class s13{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new v$1,this.onChange=this._onChange.event;let t=new fn$1;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,e,i8=!1){return(t&16777215)<<3|(e&3)<<1|(i8?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let e=0,i8=0,r5=t.length;for(let n=0;n<r5;++n){let o2=t.charCodeAt(n);if(55296<=o2&&o2<=56319){if(++n>=r5)return e+this.wcwidth(o2);let u=t.charCodeAt(n);56320<=u&&u<=57343?o2=(o2-55296)*1024+u-56320+65536:e+=this.wcwidth(u)}let l2=this.charProperties(o2,i8),a=s13.extractWidth(l2);s13.extractShouldJoin(l2)&&(a-=s13.extractWidth(i8)),e+=a,i8=l2}return e}charProperties(t,e){return this._activeProvider.charProperties(t,e)}},pn$1=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,e){this._charsets[t]=e,this.glevel===t&&(this.charset=e)}};function Bs(s15){var _a7;let e=(_a7=s15.buffer.lines.get(s15.buffer.ybase+s15.buffer.y-1))==null?void 0:_a7.get(s15.cols-1),i8=s15.buffer.lines.get(s15.buffer.ybase+s15.buffer.y);i8&&e&&(i8.isWrapped=e[3]!==0&&e[3]!==32)}var Vi$1=2147483647,uc=256,ci$1=class s14{constructor(t=32,e=32){if(this.maxLength=t,this.maxSubParamsLength=e,e>uc)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(e),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let e=new s14;if(!t.length)return e;for(let i8=Array.isArray(t[0])?1:0;i8<t.length;++i8){let r5=t[i8];if(Array.isArray(r5))for(let n=0;n<r5.length;++n)e.addSubParam(r5[n]);else e.addParam(r5)}return e}clone(){let t=new s14(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let e=0;e<this.length;++e){t.push(this.params[e]);let i8=this._subParamsIdx[e]>>8,r5=this._subParamsIdx[e]&255;r5-i8>0&&t.push(Array.prototype.slice.call(this._subParams,i8,r5))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Vi$1?Vi$1:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Vi$1?Vi$1:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let e=this._subParamsIdx[t]>>8,i8=this._subParamsIdx[t]&255;return i8-e>0?this._subParams.subarray(e,i8):null}getSubParamsAll(){let t={};for(let e=0;e<this.length;++e){let i8=this._subParamsIdx[e]>>8,r5=this._subParamsIdx[e]&255;r5-i8>0&&(t[e]=this._subParams.slice(i8,r5))}return t}addDigit(t){let e;if(this._rejectDigits||!(e=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i8=this._digitIsSub?this._subParams:this.params,r5=i8[e-1];i8[e-1]=~r5?Math.min(r5*10+t,Vi$1):t}},qi=[],mn$1=class{constructor(){this._state=0,this._active=qi,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let i8=this._handlers[t];return i8.push(e),{dispose:()=>{let r5=i8.indexOf(e);r5!==-1&&i8.splice(r5,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=qi}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=qi,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||qi,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,e,i8){if(!this._active.length)this._handlerFb(this._id,"PUT",It$1(t,e,i8));else for(let r5=this._active.length-1;r5>=0;r5--)this._active[r5].put(t,e,i8)}start(){this.reset(),this._state=1}put(t,e,i8){if(this._state!==3){if(this._state===1)for(;e<i8;){let r5=t[e++];if(r5===59){this._state=2,this._start();break}if(r5<48||57<r5){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r5-48}this._state===2&&i8-e>0&&this._put(t,e,i8)}}end(t,e=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let i8=!1,r5=this._active.length-1,n=!1;if(this._stack.paused&&(r5=this._stack.loopPosition-1,i8=e,n=this._stack.fallThrough,this._stack.paused=!1),!n&&i8===!1){for(;r5>=0&&(i8=this._active[r5].end(t),i8!==!0);r5--)if(i8 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r5,this._stack.fallThrough=!1,i8;r5--}for(;r5>=0;r5--)if(i8=this._active[r5].end(!1),i8 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r5,this._stack.fallThrough=!0,i8}this._active=qi,this._id=-1,this._state=0}}},pe$2=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,e,i8){this._hitLimit||(this._data+=It$1(t,e,i8),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data),e instanceof Promise))return e.then(i8=>(this._data="",this._hitLimit=!1,i8));return this._data="",this._hitLimit=!1,e}},Yi$1=[],_n$1=class{constructor(){this._handlers=Object.create(null),this._active=Yi$1,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yi$1}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let i8=this._handlers[t];return i8.push(e),{dispose:()=>{let r5=i8.indexOf(e);r5!==-1&&i8.splice(r5,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=Yi$1,this._ident=0}hook(t,e){if(this.reset(),this._ident=t,this._active=this._handlers[t]||Yi$1,!this._active.length)this._handlerFb(this._ident,"HOOK",e);else for(let i8=this._active.length-1;i8>=0;i8--)this._active[i8].hook(e)}put(t,e,i8){if(!this._active.length)this._handlerFb(this._ident,"PUT",It$1(t,e,i8));else for(let r5=this._active.length-1;r5>=0;r5--)this._active[r5].put(t,e,i8)}unhook(t,e=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let i8=!1,r5=this._active.length-1,n=!1;if(this._stack.paused&&(r5=this._stack.loopPosition-1,i8=e,n=this._stack.fallThrough,this._stack.paused=!1),!n&&i8===!1){for(;r5>=0&&(i8=this._active[r5].unhook(t),i8!==!0);r5--)if(i8 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r5,this._stack.fallThrough=!1,i8;r5--}for(;r5>=0;r5--)if(i8=this._active[r5].unhook(!1),i8 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r5,this._stack.fallThrough=!0,i8}this._active=Yi$1,this._ident=0}},ji=new ci$1;ji.addParam(0);var Xi=class{constructor(t){this._handler=t,this._data="",this._params=ji,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():ji,this._data="",this._hitLimit=!1}put(t,e,i8){this._hitLimit||(this._data+=It$1(t,e,i8),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i8=>(this._params=ji,this._data="",this._hitLimit=!1,i8));return this._params=ji,this._data="",this._hitLimit=!1,e}},Fs$1=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,e){this.table.fill(t<<4|e)}add(t,e,i8,r5){this.table[e<<8|t]=i8<<4|r5}addMany(t,e,i8,r5){for(let n=0;n<t.length;n++)this.table[e<<8|t[n]]=i8<<4|r5}},ke=160,hc=(function(){let s15=new Fs$1(4095),e=Array.apply(null,Array(256)).map((a,u)=>u),i8=(a,u)=>e.slice(a,u),r5=i8(32,127),n=i8(0,24);n.push(25),n.push.apply(n,i8(28,32));let o2=i8(0,14),l2;s15.setDefault(1,0),s15.addMany(r5,0,2,0);for(l2 in o2)s15.addMany([24,26,153,154],l2,3,0),s15.addMany(i8(128,144),l2,3,0),s15.addMany(i8(144,152),l2,3,0),s15.add(156,l2,0,0),s15.add(27,l2,11,1),s15.add(157,l2,4,8),s15.addMany([152,158,159],l2,0,7),s15.add(155,l2,11,3),s15.add(144,l2,11,9);return s15.addMany(n,0,3,0),s15.addMany(n,1,3,1),s15.add(127,1,0,1),s15.addMany(n,8,0,8),s15.addMany(n,3,3,3),s15.add(127,3,0,3),s15.addMany(n,4,3,4),s15.add(127,4,0,4),s15.addMany(n,6,3,6),s15.addMany(n,5,3,5),s15.add(127,5,0,5),s15.addMany(n,2,3,2),s15.add(127,2,0,2),s15.add(93,1,4,8),s15.addMany(r5,8,5,8),s15.add(127,8,5,8),s15.addMany([156,27,24,26,7],8,6,0),s15.addMany(i8(28,32),8,0,8),s15.addMany([88,94,95],1,0,7),s15.addMany(r5,7,0,7),s15.addMany(n,7,0,7),s15.add(156,7,0,0),s15.add(127,7,0,7),s15.add(91,1,11,3),s15.addMany(i8(64,127),3,7,0),s15.addMany(i8(48,60),3,8,4),s15.addMany([60,61,62,63],3,9,4),s15.addMany(i8(48,60),4,8,4),s15.addMany(i8(64,127),4,7,0),s15.addMany([60,61,62,63],4,0,6),s15.addMany(i8(32,64),6,0,6),s15.add(127,6,0,6),s15.addMany(i8(64,127),6,0,0),s15.addMany(i8(32,48),3,9,5),s15.addMany(i8(32,48),5,9,5),s15.addMany(i8(48,64),5,0,6),s15.addMany(i8(64,127),5,7,0),s15.addMany(i8(32,48),4,9,5),s15.addMany(i8(32,48),1,9,2),s15.addMany(i8(32,48),2,9,2),s15.addMany(i8(48,127),2,10,0),s15.addMany(i8(48,80),1,10,0),s15.addMany(i8(81,88),1,10,0),s15.addMany([89,90,92],1,10,0),s15.addMany(i8(96,127),1,10,0),s15.add(80,1,11,9),s15.addMany(n,9,0,9),s15.add(127,9,0,9),s15.addMany(i8(28,32),9,0,9),s15.addMany(i8(32,48),9,9,12),s15.addMany(i8(48,60),9,8,10),s15.addMany([60,61,62,63],9,9,10),s15.addMany(n,11,0,11),s15.addMany(i8(32,128),11,0,11),s15.addMany(i8(28,32),11,0,11),s15.addMany(n,10,0,10),s15.add(127,10,0,10),s15.addMany(i8(28,32),10,0,10),s15.addMany(i8(48,60),10,8,10),s15.addMany([60,61,62,63],10,0,11),s15.addMany(i8(32,48),10,9,12),s15.addMany(n,12,0,12),s15.add(127,12,0,12),s15.addMany(i8(28,32),12,0,12),s15.addMany(i8(32,48),12,9,12),s15.addMany(i8(48,64),12,0,11),s15.addMany(i8(64,127),12,12,13),s15.addMany(i8(64,127),10,12,13),s15.addMany(i8(64,127),9,12,13),s15.addMany(n,13,13,13),s15.addMany(r5,13,13,13),s15.add(127,13,0,13),s15.addMany([27,156,24,26],13,14,0),s15.add(ke,0,2,0),s15.add(ke,8,5,8),s15.add(ke,6,0,6),s15.add(ke,11,0,11),s15.add(ke,13,13,13),s15})(),bn$1=class extends D$1{constructor(e=hc){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new ci$1,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i8,r5,n)=>{},this._executeHandlerFb=i8=>{},this._csiHandlerFb=(i8,r5)=>{},this._escHandlerFb=i8=>{},this._errorHandlerFb=i8=>i8,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(C$2(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new mn$1),this._dcsParser=this._register(new _n$1),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i8=[64,126]){let r5=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r5=e.prefix.charCodeAt(0),r5&&60>r5||r5>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o2=0;o2<e.intermediates.length;++o2){let l2=e.intermediates.charCodeAt(o2);if(32>l2||l2>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r5<<=8,r5|=l2}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(i8[0]>n||n>i8[1])throw new Error(`final must be in range ${i8[0]} .. ${i8[1]}`);return r5<<=8,r5|=n,r5}identToString(e){let i8=[];for(;e;)i8.push(String.fromCharCode(e&255)),e>>=8;return i8.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i8){let r5=this._identifier(e,[48,126]);this._escHandlers[r5]===void 0&&(this._escHandlers[r5]=[]);let n=this._escHandlers[r5];return n.push(i8),{dispose:()=>{let o2=n.indexOf(i8);o2!==-1&&n.splice(o2,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i8){this._executeHandlers[e.charCodeAt(0)]=i8}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i8){let r5=this._identifier(e);this._csiHandlers[r5]===void 0&&(this._csiHandlers[r5]=[]);let n=this._csiHandlers[r5];return n.push(i8),{dispose:()=>{let o2=n.indexOf(i8);o2!==-1&&n.splice(o2,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i8){return this._dcsParser.registerHandler(this._identifier(e),i8)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i8){return this._oscParser.registerHandler(e,i8)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,i8,r5,n,o2){this._parseStack.state=e,this._parseStack.handlers=i8,this._parseStack.handlerPos=r5,this._parseStack.transition=n,this._parseStack.chunkPos=o2}parse(e,i8,r5){let n=0,o2=0,l2=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l2=this._parseStack.chunkPos+1;else{if(r5===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h2=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r5===!1&&h2>-1){for(;h2>=0&&(a=u[h2](this._params),a!==!0);h2--)if(a instanceof Promise)return this._parseStack.handlerPos=h2,a}this._parseStack.handlers=[];break;case 4:if(r5===!1&&h2>-1){for(;h2>=0&&(a=u[h2](),a!==!0);h2--)if(a instanceof Promise)return this._parseStack.handlerPos=h2,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(n!==24&&n!==26,r5),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(n!==24&&n!==26,r5),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l2=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=l2;u<i8;++u){switch(n=e[u],o2=this._transitions.table[this.currentState<<8|(n<160?n:ke)],o2>>4){case 2:for(let m=u+1;;++m){if(m>=i8||(n=e[m])<32||n>126&&n<ke){this._printHandler(e,u,m),u=m-1;break}if(++m>=i8||(n=e[m])<32||n>126&&n<ke){this._printHandler(e,u,m),u=m-1;break}if(++m>=i8||(n=e[m])<32||n>126&&n<ke){this._printHandler(e,u,m),u=m-1;break}if(++m>=i8||(n=e[m])<32||n>126&&n<ke){this._printHandler(e,u,m),u=m-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let c=this._csiHandlers[this._collect<<8|n],d=c?c.length-1:-1;for(;d>=0&&(a=c[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(3,c,d,o2,u),a;d<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++u<i8&&(n=e[u])>47&&n<60);u--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let _2=this._escHandlers[this._collect<<8|n],p=_2?_2.length-1:-1;for(;p>=0&&(a=_2[p](),a!==!0);p--)if(a instanceof Promise)return this._preserveStack(4,_2,p,o2,u),a;p<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let m=u+1;;++m)if(m>=i8||(n=e[m])===24||n===26||n===27||n>127&&n<ke){this._dcsParser.put(e,u,m),u=m-1;break}break;case 14:if(a=this._dcsParser.unhook(n!==24&&n!==26),a)return this._preserveStack(6,[],0,o2,u),a;n===27&&(o2|=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 m=u+1;;m++)if(m>=i8||(n=e[m])<32||n>127&&n<ke){this._oscParser.put(e,u,m),u=m-1;break}break;case 6:if(a=this._oscParser.end(n!==24&&n!==26),a)return this._preserveStack(5,[],0,o2,u),a;n===27&&(o2|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o2&15}}},dc=/^([\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})$/,fc=/^[\da-f]+$/;function Ws$1(s15){if(!s15)return;let t=s15.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let e=dc.exec(t);if(e){let i8=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/i8*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/i8*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/i8*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),fc.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,i8=[0,0,0];for(let r5=0;r5<3;++r5){let n=parseInt(t.slice(e*r5,e*r5+e),16);i8[r5]=e===1?n<<4:e===2?n:e===3?n>>4:n>>8}return i8}}function Hs$1(s15,t){let e=s15.toString(16),i8=e.length<2?"0"+e:e;switch(t){case 4:return e[0];case 8:return i8;case 12:return(i8+i8).slice(0,3);default:return i8+i8}}function ml(s15,t=16){let[e,i8,r5]=s15;return`rgb:${Hs$1(e,t)}/${Hs$1(i8,t)}/${Hs$1(r5,t)}`}var mc={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ut=131072,_l=10;function bl(s15,t){if(s15>24)return t.setWinLines||!1;switch(s15){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var vl=5e3,gl=0,vn=class extends D$1{constructor(e,i8,r5,n,o2,l2,a,u,h2=new bn$1){super(),this._bufferService=e,this._charsetService=i8,this._coreService=r5,this._logService=n,this._optionsService=o2,this._oscLinkService=l2,this._coreMouseService=a,this._unicodeService=u,this._parser=h2,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new er$1,this._utf8Decoder=new tr$1,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=X$1.clone(),this._eraseAttrDataInternal=X$1.clone(),this._onRequestBell=this._register(new v$1),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new v$1),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new v$1),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new v$1),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new v$1),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new v$1),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new v$1),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new v$1),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new v$1),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new v$1),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new v$1),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new v$1),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new v$1),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 Zi(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:d.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,d,_2)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:d,data:_2})}),this._parser.setDcsHandlerFallback((c,d,_2)=>{d==="HOOK"&&(_2=_2.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:d,payload:_2})}),this._parser.setPrintHandler((c,d,_2)=>this.print(c,d,_2)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(b.BEL,()=>this.bell()),this._parser.setExecuteHandler(b.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(b.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(b.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(b.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(b.BS,()=>this.backspace()),this._parser.setExecuteHandler(b.HT,()=>this.tab()),this._parser.setExecuteHandler(b.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(b.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ai$1.IND,()=>this.index()),this._parser.setExecuteHandler(Ai$1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ai$1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new pe$2(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new pe$2(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new pe$2(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new pe$2(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new pe$2(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new pe$2(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new pe$2(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new pe$2(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new pe$2(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new pe$2(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new pe$2(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new pe$2(c=>this.restoreCursorColor(c))),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(let c in ne$1)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Xi((c,d)=>this.requestStatusString(c,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,i8,r5,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i8,this._parseStack.decodedLength=r5,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i8,r5)=>setTimeout(()=>r5("#SLOW_TIMEOUT"),vl))]).catch(i8=>{if(i8!=="#SLOW_TIMEOUT")throw i8;console.warn(`async parser handler taking longer than ${vl} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i8){let r5,n=this._activeBuffer.x,o2=this._activeBuffer.y,l2=0,a=this._parseStack.paused;if(a){if(r5=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i8))return this._logSlowResolvingAsync(r5),r5;n=this._parseStack.cursorStartX,o2=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ut&&(l2=this._parseStack.position+ut)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<ut&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ut))),a||this._dirtyRowTracker.clearRange(),e.length>ut)for(let c=l2;c<e.length;c+=ut){let d=c+ut<e.length?c+ut:e.length,_2=typeof e=="string"?this._stringDecoder.decode(e.substring(c,d),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,d),this._parseBuffer);if(r5=this._parser.parse(this._parseBuffer,_2))return this._preserveStack(n,o2,_2,c),this._logSlowResolvingAsync(r5),r5}else if(!a){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r5=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,o2,c,0),this._logSlowResolvingAsync(r5),r5}(this._activeBuffer.x!==n||this._activeBuffer.y!==o2)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h2=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h2<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h2,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,i8,r5){let n,o2,l2=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h2=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,d=this._curAttrData,_2=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r5-i8>0&&_2.getWidth(this._activeBuffer.x-1)===2&&_2.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let p=this._parser.precedingJoinState;for(let m=i8;m<r5;++m){if(n=e[m],n<127&&l2){let O2=l2[String.fromCharCode(n)];O2&&(n=O2.charCodeAt(0))}let f=this._unicodeService.charProperties(n,p);o2=Ae$2.extractWidth(f);let A2=Ae$2.extractShouldJoin(f),R=A2?Ae$2.extractWidth(p):0;if(p=f,a&&this._onA11yChar.fire(Ce$1(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o2-R>u){if(h2){let O2=_2,I2=this._activeBuffer.x-R;for(this._activeBuffer.x=R,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),_2=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),R>0&&_2 instanceof Ze$1&&_2.copyCellsFrom(O2,I2,0,R,!1);I2<u;)O2.setCellFromCodepoint(I2++,0,1,d)}else if(this._activeBuffer.x=u-1,o2===2)continue}if(A2&&this._activeBuffer.x){let O2=_2.getWidth(this._activeBuffer.x-1)?1:2;_2.addCodepointToCell(this._activeBuffer.x-O2,n,o2);for(let I2=o2-R;--I2>=0;)_2.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(c&&(_2.insertCells(this._activeBuffer.x,o2-R,this._activeBuffer.getNullCell(d)),_2.getWidth(u-1)===2&&_2.setCellFromCodepoint(u-1,0,1,d)),_2.setCellFromCodepoint(this._activeBuffer.x++,n,o2,d),o2>0)for(;--o2;)_2.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=p,this._activeBuffer.x<u&&r5-i8>0&&_2.getWidth(this._activeBuffer.x)===0&&!_2.hasContent(this._activeBuffer.x)&&_2.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i8){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r5=>bl(r5.params[0],this._optionsService.rawOptions.windowOptions)?i8(r5):!0):this._parser.registerCsiHandler(e,i8)}registerDcsHandler(e,i8){return this._parser.registerDcsHandler(e,new Xi(i8))}registerEscHandler(e,i8){return this._parser.registerEscHandler(e,i8)}registerOscHandler(e,i8){return this._parser.registerOscHandler(e,new pe$2(i8))}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 _a7;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&&((_a7=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&_a7.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,i8){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i8):(this._activeBuffer.x=e,this._activeBuffer.y=i8),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i8){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i8)}cursorUp(e){let i8=this._activeBuffer.y-this._activeBuffer.scrollTop;return i8>=0?this._moveCursor(0,-Math.min(i8,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i8=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i8>=0?this._moveCursor(0,Math.min(i8,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i8=e.params[0];return i8===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i8===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i8=e.params[0]||1;for(;i8--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i8=e.params[0]||1;for(;i8--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i8=e.params[0];return i8===1&&(this._curAttrData.bg|=536870912),(i8===2||i8===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i8,r5,n=!1,o2=!1){let l2=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l2.replaceCells(i8,r5,this._activeBuffer.getNullCell(this._eraseAttrData()),o2),n&&(l2.isWrapped=!1)}_resetBufferLine(e,i8=!1){let r5=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r5&&(r5.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i8),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r5.isWrapped=!1)}eraseInDisplay(e,i8=!1){var _a7;this._restrictCursor(this._bufferService.cols);let r5;switch(e.params[0]){case 0:for(r5=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r5),this._eraseInBufferLine(r5++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i8);r5<this._bufferService.rows;r5++)this._resetBufferLine(r5,i8);this._dirtyRowTracker.markDirty(r5);break;case 1:for(r5=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r5),this._eraseInBufferLine(r5,0,this._activeBuffer.x+1,!0,i8),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r5+1).isWrapped=!1);r5--;)this._resetBufferLine(r5,i8);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r5=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r5-1);r5--&&!((_a7=this._activeBuffer.lines.get(this._activeBuffer.ybase+r5))!=null&&_a7.getTrimmedLength()););for(;r5>=0;r5--)this._bufferService.scroll(this._eraseAttrData())}else{for(r5=this._bufferService.rows,this._dirtyRowTracker.markDirty(r5-1);r5--;)this._resetBufferLine(r5,i8);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i8=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i8);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i8);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i8);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i8=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r5=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o2=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;i8--;)this._activeBuffer.lines.splice(o2-1,1),this._activeBuffer.lines.splice(r5,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i8=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r5=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;i8--;)this._activeBuffer.lines.splice(r5,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i8=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i8&&(i8.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i8=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i8&&(i8.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i8=e.params[0]||1;for(;i8--;)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(e){let i8=e.params[0]||1;for(;i8--;)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(X$1));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i8=e.params[0]||1;for(let r5=this._activeBuffer.scrollTop;r5<=this._activeBuffer.scrollBottom;++r5){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r5);n.deleteCells(0,i8,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i8=e.params[0]||1;for(let r5=this._activeBuffer.scrollTop;r5<=this._activeBuffer.scrollBottom;++r5){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r5);n.insertCells(0,i8,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i8=e.params[0]||1;for(let r5=this._activeBuffer.scrollTop;r5<=this._activeBuffer.scrollBottom;++r5){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r5);n.insertCells(this._activeBuffer.x,i8,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i8=e.params[0]||1;for(let r5=this._activeBuffer.scrollTop;r5<=this._activeBuffer.scrollBottom;++r5){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r5);n.deleteCells(this._activeBuffer.x,i8,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i8=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i8&&(i8.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i8=this._parser.precedingJoinState;if(!i8)return!0;let r5=e.params[0]||1,n=Ae$2.extractWidth(i8),o2=this._activeBuffer.x-n,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o2),u=new Uint32Array(a.length*r5),h2=0;for(let d=0;d<a.length;){let _2=a.codePointAt(d)||0;u[h2++]=_2,d+=_2>65535?2:1}let c=h2;for(let d=1;d<r5;++d)u.copyWithin(c,0,h2),c+=h2;return this.print(u,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(b.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(b.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(b.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(b.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(b.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i8=0;i8<e.length;i8++)switch(e.params[i8]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let i8=0;i8<e.length;i8++)switch(e.params[i8]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Je$1),this._charsetService.setgCharset(1,Je$1),this._charsetService.setgCharset(2,Je$1),this._charsetService.setgCharset(3,Je$1);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let i8=0;i8<e.length;i8++)switch(e.params[i8]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let i8=0;i8<e.length;i8++)switch(e.params[i8]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[i8]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,i8){(P=>(P[P.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",P[P.SET=1]="SET",P[P.RESET=2]="RESET",P[P.PERMANENTLY_SET=3]="PERMANENTLY_SET",P[P.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r5={}));let n=this._coreService.decPrivateModes,{activeProtocol:o2,activeEncoding:l2}=this._coreMouseService,a=this._coreService,{buffers:u,cols:h2}=this._bufferService,{active:c,alt:d}=u,_2=this._optionsService.rawOptions,p=(A2,R)=>(a.triggerDataEvent(`${b.ESC}[${i8?"":"?"}${A2};${R}$y`),!0),m=A2=>A2?1:2,f=e.params[0];return i8?f===2?p(f,4):f===4?p(f,m(a.modes.insertMode)):f===12?p(f,3):f===20?p(f,m(_2.convertEol)):p(f,0):f===1?p(f,m(n.applicationCursorKeys)):f===3?p(f,_2.windowOptions.setWinLines?h2===80?2:h2===132?1:0:0):f===6?p(f,m(n.origin)):f===7?p(f,m(n.wraparound)):f===8?p(f,3):f===9?p(f,m(o2==="X10")):f===12?p(f,m(_2.cursorBlink)):f===25?p(f,m(!a.isCursorHidden)):f===45?p(f,m(n.reverseWraparound)):f===66?p(f,m(n.applicationKeypad)):f===67?p(f,4):f===1e3?p(f,m(o2==="VT200")):f===1002?p(f,m(o2==="DRAG")):f===1003?p(f,m(o2==="ANY")):f===1004?p(f,m(n.sendFocus)):f===1005?p(f,4):f===1006?p(f,m(l2==="SGR")):f===1015?p(f,4):f===1016?p(f,m(l2==="SGR_PIXELS")):f===1048?p(f,1):f===47||f===1047||f===1049?p(f,m(c===d)):f===2004?p(f,m(n.bracketedPasteMode)):f===2026?p(f,m(n.synchronizedOutput)):p(f,0)}_updateAttrColor(e,i8,r5,n,o2){return i8===2?(e|=50331648,e&=-16777216,e|=De$2.fromColorRGB([r5,n,o2])):i8===5&&(e&=-50331904,e|=33554432|r5&255),e}_extractColor(e,i8,r5){let n=[0,0,-1,0,0,0],o2=0,l2=0;do{if(n[l2+o2]=e.params[i8+l2],e.hasSubParams(i8+l2)){let a=e.getSubParams(i8+l2),u=0;do n[1]===5&&(o2=1),n[l2+u+1+o2]=a[u];while(++u<a.length&&u+l2+1+o2<n.length);break}if(n[1]===5&&l2+o2>=2||n[1]===2&&l2+o2>=5)break;n[1]&&(o2=1)}while(++l2+i8<e.length&&l2+o2<n.length);for(let a=2;a<n.length;++a)n[a]===-1&&(n[a]=0);switch(n[0]){case 38:r5.fg=this._updateAttrColor(r5.fg,n[1],n[3],n[4],n[5]);break;case 48:r5.bg=this._updateAttrColor(r5.bg,n[1],n[3],n[4],n[5]);break;case 58:r5.extended=r5.extended.clone(),r5.extended.underlineColor=this._updateAttrColor(r5.extended.underlineColor,n[1],n[3],n[4],n[5])}return l2}_processUnderline(e,i8){i8.extended=i8.extended.clone(),(!~e||e>5)&&(e=1),i8.extended.underlineStyle=e,i8.fg|=268435456,e===0&&(i8.fg&=-268435457),i8.updateExtended()}_processSGR0(e){e.fg=X$1.fg,e.bg=X$1.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let i8=e.length,r5,n=this._curAttrData;for(let o2=0;o2<i8;o2++)r5=e.params[o2],r5>=30&&r5<=37?(n.fg&=-50331904,n.fg|=16777216|r5-30):r5>=40&&r5<=47?(n.bg&=-50331904,n.bg|=16777216|r5-40):r5>=90&&r5<=97?(n.fg&=-50331904,n.fg|=16777216|r5-90|8):r5>=100&&r5<=107?(n.bg&=-50331904,n.bg|=16777216|r5-100|8):r5===0?this._processSGR0(n):r5===1?n.fg|=134217728:r5===3?n.bg|=67108864:r5===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(o2)?e.getSubParams(o2)[0]:1,n)):r5===5?n.fg|=536870912:r5===7?n.fg|=67108864:r5===8?n.fg|=1073741824:r5===9?n.fg|=2147483648:r5===2?n.bg|=134217728:r5===21?this._processUnderline(2,n):r5===22?(n.fg&=-134217729,n.bg&=-134217729):r5===23?n.bg&=-67108865:r5===24?(n.fg&=-268435457,this._processUnderline(0,n)):r5===25?n.fg&=-536870913:r5===27?n.fg&=-67108865:r5===28?n.fg&=-1073741825:r5===29?n.fg&=2147483647:r5===39?(n.fg&=-67108864,n.fg|=X$1.fg&16777215):r5===49?(n.bg&=-67108864,n.bg|=X$1.bg&16777215):r5===38||r5===48||r5===58?o2+=this._extractColor(e,o2,n):r5===53?n.bg|=1073741824:r5===55?n.bg&=-1073741825:r5===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r5===100?(n.fg&=-67108864,n.fg|=X$1.fg&16777215,n.bg&=-67108864,n.bg|=X$1.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r5);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${b.ESC}[0n`);break;case 6:let i8=this._activeBuffer.y+1,r5=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${b.ESC}[${i8};${r5}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let i8=this._activeBuffer.y+1,r5=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${b.ESC}[?${i8};${r5}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=X$1.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(e){let i8=e.length===0?1:e.params[0];if(i8===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i8){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r5=i8%2===1;this._coreService.decPrivateModes.cursorBlink=r5}return!0}setScrollRegion(e){let i8=e.params[0]||1,r5;return(e.length<2||(r5=e.params[1])>this._bufferService.rows||r5===0)&&(r5=this._bufferService.rows),r5>i8&&(this._activeBuffer.scrollTop=i8-1,this._activeBuffer.scrollBottom=r5-1,this._setCursor(0,0)),!0}windowOptions(e){if(!bl(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i8=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i8!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${b.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i8===0||i8===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>_l&&this._windowTitleStack.shift()),(i8===0||i8===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>_l&&this._iconNameStack.shift());break;case 23:(i8===0||i8===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i8===0||i8===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i8=[],r5=e.split(";");for(;r5.length>1;){let n=r5.shift(),o2=r5.shift();if(/^\d+$/.exec(n)){let l2=parseInt(n);if(Sl(l2))if(o2==="?")i8.push({type:0,index:l2});else{let a=Ws$1(o2);a&&i8.push({type:1,index:l2,color:a})}}}return i8.length&&this._onColor.fire(i8),!0}setHyperlink(e){let i8=e.indexOf(";");if(i8===-1)return!0;let r5=e.slice(0,i8).trim(),n=e.slice(i8+1);return n?this._createHyperlink(r5,n):r5.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i8){this._getCurrentLinkId()&&this._finishHyperlink();let r5=e.split(":"),n,o2=r5.findIndex(l2=>l2.startsWith("id="));return o2!==-1&&(n=r5[o2].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:i8}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i8){let r5=e.split(";");for(let n=0;n<r5.length&&!(i8>=this._specialColors.length);++n,++i8)if(r5[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[i8]}]);else{let o2=Ws$1(r5[n]);o2&&this._onColor.fire([{type:1,index:this._specialColors[i8],color:o2}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i8=[],r5=e.split(";");for(let n=0;n<r5.length;++n)if(/^\d+$/.exec(r5[n])){let o2=parseInt(r5[n]);Sl(o2)&&i8.push({type:2,index:o2})}return i8.length&&this._onColor.fire(i8),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Je$1),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(mc[e[0]],ne$1[e[1]]||Je$1),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=X$1.clone(),this._eraseAttrDataInternal=X$1.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new q;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i8=0;i8<this._bufferService.rows;++i8){let r5=this._activeBuffer.ybase+this._activeBuffer.y+i8,n=this._activeBuffer.lines.get(r5);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i8){let r5=a=>(this._coreService.triggerDataEvent(`${b.ESC}${a}${b.ESC}\\`),!0),n=this._bufferService.buffer,o2=this._optionsService.rawOptions;return r5(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o2.cursorStyle]-(o2.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i8){this._dirtyRowTracker.markRangeDirty(e,i8)}},Zi=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(gl=t,t=e,e=gl),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Zi=M$1([S(0,F$1)],Zi);function Sl(s15){return 0<=s15&&s15<256}var _c=5e7,El=12,bc=50,gn$1=class extends D$1{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new v$1),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i8){if(i8!==void 0&&this._syncCalls>i8){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r5;for(;r5=this._writeBuffer.shift();){this._action(r5);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i8){if(this._pendingData>_c)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i8),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i8)}_innerWrite(e=0,i8=!0){let r5=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],o2=this._action(n,i8);if(o2){let a=u=>performance.now()-r5>=El?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(r5,u);o2.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(a);return}let l2=this._callbacks[this._bufferOffset];if(l2&&l2(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r5>=El)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>bc&&(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()}},ui$1=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){let e=this._bufferService.buffer;if(t.id===void 0){let a=e.addMarker(e.ybase+e.y),u={data:t,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(u,a)),this._dataByLinkId.set(u.id,u),u.id}let i8=t,r5=this._getEntryIdKey(i8),n=this._entriesWithId.get(r5);if(n)return this.addLineToLink(n.id,e.ybase+e.y),n.id;let o2=e.addMarker(e.ybase+e.y),l2={id:this._nextId++,key:this._getEntryIdKey(i8),data:i8,lines:[o2]};return o2.onDispose(()=>this._removeMarkerFromLink(l2,o2)),this._entriesWithId.set(l2.key,l2),this._dataByLinkId.set(l2.id,l2),l2.id}addLineToLink(t,e){let i8=this._dataByLinkId.get(t);if(i8&&i8.lines.every(r5=>r5.line!==e)){let r5=this._bufferService.buffer.addMarker(e);i8.lines.push(r5),r5.onDispose(()=>this._removeMarkerFromLink(i8,r5))}}getLinkData(t){var _a7;return(_a7=this._dataByLinkId.get(t))==null?void 0:_a7.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,e){let i8=t.lines.indexOf(e);i8!==-1&&(t.lines.splice(i8,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};ui$1=M$1([S(0,F$1)],ui$1);var Tl=!1,Sn$1=class extends D$1{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ye$2),this._onBinary=this._register(new v$1),this.onBinary=this._onBinary.event,this._onData=this._register(new v$1),this.onData=this._onData.event,this._onLineFeed=this._register(new v$1),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new v$1),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new v$1),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new v$1),this._instantiationService=new ln,this.optionsService=this._register(new dn$1(e)),this._instantiationService.setService(H$2,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ni)),this._instantiationService.setService(F$1,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ii$1)),this._instantiationService.setService(nr$1,this._logService),this.coreService=this._register(this._instantiationService.createInstance(li$1)),this._instantiationService.setService(ge$2,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(ai)),this._instantiationService.setService(rr,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ae$2)),this._instantiationService.setService(Js,this.unicodeService),this._charsetService=this._instantiationService.createInstance(pn$1),this._instantiationService.setService(Zs,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ui$1),this._instantiationService.setService(sr,this._oscLinkService),this._inputHandler=this._register(new vn(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register($.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register($.forward(this._bufferService.onResize,this._onResize)),this._register($.forward(this.coreService.onData,this._onData)),this._register($.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),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}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new gn$1((i8,r5)=>this._inputHandler.parse(i8,r5))),this._register($.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new v$1),this._onScroll.event(e=>{var _a7;(_a7=this._onScrollApi)==null||_a7.fire(e.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(e){for(let i8 in e)this.optionsService.options[i8]=e[i8]}write(e,i8){this._writeBuffer.write(e,i8)}writeSync(e,i8){this._logService.logLevel<=3&&!Tl&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Tl=!0),this._writeBuffer.writeSync(e,i8)}input(e,i8=!0){this.coreService.triggerDataEvent(e,i8)}resize(e,i8){isNaN(e)||isNaN(i8)||(e=Math.max(e,ks),i8=Math.max(i8,Cs),this._bufferService.resize(e,i8))}scroll(e,i8=!1){this._bufferService.scroll(e,i8)}scrollLines(e,i8){this._bufferService.scrollLines(e,i8)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i8=e-this._bufferService.buffer.ydisp;i8!==0&&this.scrollLines(i8)}registerEscHandler(e,i8){return this._inputHandler.registerEscHandler(e,i8)}registerDcsHandler(e,i8){return this._inputHandler.registerDcsHandler(e,i8)}registerCsiHandler(e,i8){return this._inputHandler.registerCsiHandler(e,i8)}registerOscHandler(e,i8){return this._inputHandler.registerOscHandler(e,i8)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i8=this.optionsService.rawOptions.windowsPty;i8&&i8.buildNumber!==void 0&&i8.buildNumber!==void 0?e=i8.backend==="conpty"&&i8.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Bs.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Bs(this._bufferService),!1))),this._windowsWrappingHeuristics.value=C$2(()=>{for(let i8 of e)i8.dispose()})}}},gc={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:["'",'"']};function Il(s15,t,e,i8){var _a7;let r5={type:0,cancel:!1,key:void 0},n=(s15.shiftKey?1:0)|(s15.altKey?2:0)|(s15.ctrlKey?4:0)|(s15.metaKey?8:0);switch(s15.keyCode){case 0:s15.key==="UIKeyInputUpArrow"?t?r5.key=b.ESC+"OA":r5.key=b.ESC+"[A":s15.key==="UIKeyInputLeftArrow"?t?r5.key=b.ESC+"OD":r5.key=b.ESC+"[D":s15.key==="UIKeyInputRightArrow"?t?r5.key=b.ESC+"OC":r5.key=b.ESC+"[C":s15.key==="UIKeyInputDownArrow"&&(t?r5.key=b.ESC+"OB":r5.key=b.ESC+"[B");break;case 8:r5.key=s15.ctrlKey?"\b":b.DEL,s15.altKey&&(r5.key=b.ESC+r5.key);break;case 9:if(s15.shiftKey){r5.key=b.ESC+"[Z";break}r5.key=b.HT,r5.cancel=!0;break;case 13:r5.key=s15.altKey?b.ESC+b.CR:b.CR,r5.cancel=!0;break;case 27:r5.key=b.ESC,s15.altKey&&(r5.key=b.ESC+b.ESC),r5.cancel=!0;break;case 37:if(s15.metaKey)break;n?r5.key=b.ESC+"[1;"+(n+1)+"D":t?r5.key=b.ESC+"OD":r5.key=b.ESC+"[D";break;case 39:if(s15.metaKey)break;n?r5.key=b.ESC+"[1;"+(n+1)+"C":t?r5.key=b.ESC+"OC":r5.key=b.ESC+"[C";break;case 38:if(s15.metaKey)break;n?r5.key=b.ESC+"[1;"+(n+1)+"A":t?r5.key=b.ESC+"OA":r5.key=b.ESC+"[A";break;case 40:if(s15.metaKey)break;n?r5.key=b.ESC+"[1;"+(n+1)+"B":t?r5.key=b.ESC+"OB":r5.key=b.ESC+"[B";break;case 45:!s15.shiftKey&&!s15.ctrlKey&&(r5.key=b.ESC+"[2~");break;case 46:n?r5.key=b.ESC+"[3;"+(n+1)+"~":r5.key=b.ESC+"[3~";break;case 36:n?r5.key=b.ESC+"[1;"+(n+1)+"H":t?r5.key=b.ESC+"OH":r5.key=b.ESC+"[H";break;case 35:n?r5.key=b.ESC+"[1;"+(n+1)+"F":t?r5.key=b.ESC+"OF":r5.key=b.ESC+"[F";break;case 33:s15.shiftKey?r5.type=2:s15.ctrlKey?r5.key=b.ESC+"[5;"+(n+1)+"~":r5.key=b.ESC+"[5~";break;case 34:s15.shiftKey?r5.type=3:s15.ctrlKey?r5.key=b.ESC+"[6;"+(n+1)+"~":r5.key=b.ESC+"[6~";break;case 112:n?r5.key=b.ESC+"[1;"+(n+1)+"P":r5.key=b.ESC+"OP";break;case 113:n?r5.key=b.ESC+"[1;"+(n+1)+"Q":r5.key=b.ESC+"OQ";break;case 114:n?r5.key=b.ESC+"[1;"+(n+1)+"R":r5.key=b.ESC+"OR";break;case 115:n?r5.key=b.ESC+"[1;"+(n+1)+"S":r5.key=b.ESC+"OS";break;case 116:n?r5.key=b.ESC+"[15;"+(n+1)+"~":r5.key=b.ESC+"[15~";break;case 117:n?r5.key=b.ESC+"[17;"+(n+1)+"~":r5.key=b.ESC+"[17~";break;case 118:n?r5.key=b.ESC+"[18;"+(n+1)+"~":r5.key=b.ESC+"[18~";break;case 119:n?r5.key=b.ESC+"[19;"+(n+1)+"~":r5.key=b.ESC+"[19~";break;case 120:n?r5.key=b.ESC+"[20;"+(n+1)+"~":r5.key=b.ESC+"[20~";break;case 121:n?r5.key=b.ESC+"[21;"+(n+1)+"~":r5.key=b.ESC+"[21~";break;case 122:n?r5.key=b.ESC+"[23;"+(n+1)+"~":r5.key=b.ESC+"[23~";break;case 123:n?r5.key=b.ESC+"[24;"+(n+1)+"~":r5.key=b.ESC+"[24~";break;default:if(s15.ctrlKey&&!s15.shiftKey&&!s15.altKey&&!s15.metaKey)s15.keyCode>=65&&s15.keyCode<=90?r5.key=String.fromCharCode(s15.keyCode-64):s15.keyCode===32?r5.key=b.NUL:s15.keyCode>=51&&s15.keyCode<=55?r5.key=String.fromCharCode(s15.keyCode-51+27):s15.keyCode===56?r5.key=b.DEL:s15.keyCode===219?r5.key=b.ESC:s15.keyCode===220?r5.key=b.FS:s15.keyCode===221&&(r5.key=b.GS);else if((!e||i8)&&s15.altKey&&!s15.metaKey){let l2=(_a7=gc[s15.keyCode])==null?void 0:_a7[s15.shiftKey?1:0];if(l2)r5.key=b.ESC+l2;else if(s15.keyCode>=65&&s15.keyCode<=90){let a=s15.ctrlKey?s15.keyCode-64:s15.keyCode+32,u=String.fromCharCode(a);s15.shiftKey&&(u=u.toUpperCase()),r5.key=b.ESC+u}else if(s15.keyCode===32)r5.key=b.ESC+(s15.ctrlKey?b.NUL:" ");else if(s15.key==="Dead"&&s15.code.startsWith("Key")){let a=s15.code.slice(3,4);s15.shiftKey||(a=a.toLowerCase()),r5.key=b.ESC+a,r5.cancel=!0}}else e&&!s15.altKey&&!s15.ctrlKey&&!s15.shiftKey&&s15.metaKey?s15.keyCode===65&&(r5.type=1):s15.key&&!s15.ctrlKey&&!s15.altKey&&!s15.metaKey&&s15.keyCode>=48&&s15.key.length===1?r5.key=s15.key:s15.key&&s15.ctrlKey&&(s15.key==="_"&&(r5.key=b.US),s15.key==="@"&&(r5.key=b.NUL));break}return r5}var ee$1=0,En$1=class{constructor(t){this._getKey=t,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Jt,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Jt,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort((n,o2)=>this._getKey(n)-this._getKey(o2)),e=0,i8=0,r5=new Array(this._array.length+this._insertedValues.length);for(let n=0;n<r5.length;n++)i8>=this._array.length||this._getKey(t[e])<=this._getKey(this._array[i8])?(r5[n]=t[e],e++):r5[n]=this._array[i8++];this._array=r5,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let e=this._getKey(t);if(e===void 0||(ee$1=this._search(e),ee$1===-1)||this._getKey(this._array[ee$1])!==e)return!1;do if(this._array[ee$1]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ee$1),!0;while(++ee$1<this._array.length&&this._getKey(this._array[ee$1])===e);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let t=this._deletedIndices.sort((n,o2)=>n-o2),e=0,i8=new Array(this._array.length-t.length),r5=0;for(let n=0;n<this._array.length;n++)t[e]===n?e++:i8[r5++]=this._array[n];this._array=i8,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ee$1=this._search(t),!(ee$1<0||ee$1>=this._array.length)&&this._getKey(this._array[ee$1])===t))do yield this._array[ee$1];while(++ee$1<this._array.length&&this._getKey(this._array[ee$1])===t)}forEachByKey(t,e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ee$1=this._search(t),!(ee$1<0||ee$1>=this._array.length)&&this._getKey(this._array[ee$1])===t))do e(this._array[ee$1]);while(++ee$1<this._array.length&&this._getKey(this._array[ee$1])===t)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(t){let e=0,i8=this._array.length-1;for(;i8>=e;){let r5=e+i8>>1,n=this._getKey(this._array[r5]);if(n>t)i8=r5-1;else if(n<t)e=r5+1;else{for(;r5>0&&this._getKey(this._array[r5-1])===t;)r5--;return r5}}return e}},Us$1=0,yl=0,Tn=class extends D$1{constructor(){super(),this._decorations=new En$1(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new v$1),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new v$1),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(C$2(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i8=new Ks(e);if(i8){let r5=i8.marker.onDispose(()=>i8.dispose()),n=i8.onDispose(()=>{n.dispose(),i8&&(this._decorations.delete(i8)&&this._onDecorationRemoved.fire(i8),r5.dispose())});this._decorations.insert(i8),this._onDecorationRegistered.fire(i8)}return i8}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i8,r5){let n=0,o2=0;for(let l2 of this._decorations.getKeyIterator(i8))n=l2.options.x??0,o2=n+(l2.options.width??1),e>=n&&e<o2&&(!r5||(l2.options.layer??"bottom")===r5)&&(yield l2)}forEachDecorationAtCell(e,i8,r5,n){this._decorations.forEachByKey(i8,o2=>{Us$1=o2.options.x??0,yl=Us$1+(o2.options.width??1),e>=Us$1&&e<yl&&(!r5||(o2.options.layer??"bottom")===r5)&&n(o2)})}},Ks=class extends Ee$2{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new v$1),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new v$1),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=z$1.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=z$1.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Sc=1e3,In$1=class{constructor(t,e=Sc){this._renderCallback=t,this._debounceThresholdMS=e,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(t,e,i8){this._rowCount=i8,t=t!==void 0?t:0,e=e!==void 0?e:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,e):e;let r5=performance.now();if(r5-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r5,this._innerRefresh();else if(!this._additionalRefreshRequested){let n=r5-this._lastRefreshMs,o2=this._debounceThresholdMS-n;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o2)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e)}},xl=20,Tt=class extends D$1{constructor(e,i8,r5,n){super(),this._terminal=e,this._coreBrowserService=r5,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o2=this._coreBrowserService.mainDocument;this._accessibilityContainer=o2.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o2.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l2=0;l2<this._terminal.rows;l2++)this._rowElements[l2]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l2]);if(this._topBoundaryFocusListener=l2=>this._handleBoundaryFocus(l2,0),this._bottomBoundaryFocusListener=l2=>this._handleBoundaryFocus(l2,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o2.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new In$1(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l2=>this._handleResize(l2.rows))),this._register(this._terminal.onRender(l2=>this._refreshRows(l2.start,l2.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l2=>this._handleChar(l2))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
25
- `))),this._register(this._terminal.onA11yTab(l2=>this._handleTab(l2))),this._register(this._terminal.onKey(l2=>this._handleKey(l2.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(L$1(o2,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(C$2(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i8=0;i8<e;i8++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<xl+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
26
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===xl+1&&(this._liveRegion.textContent+=_i$1.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i8){this._liveRegionDebouncer.refresh(e,i8,this._terminal.rows)}_renderRows(e,i8){let r5=this._terminal.buffer,n=r5.lines.length.toString();for(let o2=e;o2<=i8;o2++){let l2=r5.lines.get(r5.ydisp+o2),a=[],u=(l2==null?void 0:l2.translateToString(!0,void 0,void 0,a))||"",h2=(r5.ydisp+o2+1).toString(),c=this._rowElements[o2];c&&(u.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=u,this._rowColumns.set(c,a)),c.setAttribute("aria-posinset",h2),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i8){let r5=e.target,n=this._rowElements[i8===0?1:this._rowElements.length-2],o2=r5.getAttribute("aria-posinset"),l2=i8===0?"1":`${this._terminal.buffer.lines.length}`;if(o2===l2||e.relatedTarget!==n)return;let a,u;if(i8===0?(a=r5,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(a=this._rowElements.shift(),u=r5,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),i8===0){let h2=this._createAccessibilityTreeNode();this._rowElements.unshift(h2),this._rowContainer.insertAdjacentElement("afterbegin",h2)}else{let h2=this._createAccessibilityTreeNode();this._rowElements.push(h2),this._rowContainer.appendChild(h2)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i8===0?-1:1),this._rowElements[i8===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var _a7;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let i8={node:e.anchorNode,offset:e.anchorOffset},r5={node:e.focusNode,offset:e.focusOffset};if((i8.node.compareDocumentPosition(r5.node)&Node.DOCUMENT_POSITION_PRECEDING||i8.node===r5.node&&i8.offset>r5.offset)&&([i8,r5]=[r5,i8]),i8.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i8={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i8.node))return;let n=this._rowElements.slice(-1)[0];if(r5.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r5={node:n,offset:((_a7=n.textContent)==null?void 0:_a7.length)??0}),!this._rowContainer.contains(r5.node))return;let o2=({node:u,offset:h2})=>{let c=u instanceof Text?u.parentNode:u,d=parseInt(c==null?void 0:c.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let _2=this._rowColumns.get(c);if(!_2)return console.warn("columns is null. Race condition?"),null;let p=h2<_2.length?_2[h2]:_2.slice(-1)[0]+1;return p>=this._terminal.cols&&(++d,p=0),{row:d,column:p}},l2=o2(i8),a=o2(r5);if(!(!l2||!a)){if(l2.row>a.row||l2.row===a.row&&l2.column>=a.column)throw new Error("invalid range");this._terminal.select(l2.column,l2.row,(a.row-l2.row)*this._terminal.cols-l2.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i8=this._rowContainer.children.length;i8<this._terminal.rows;i8++)this._rowElements[i8]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i8]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var _a7,_b;e.style.transform="";let i8=e.getBoundingClientRect().width,r5=(_b=(_a7=this._rowColumns.get(e))==null?void 0:_a7.slice(-1))==null?void 0:_b[0];if(!r5)return;let n=r5*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/i8})`}};Tt=M$1([S(1,xt$2),S(2,ae$1),S(3,ce$1)],Tt);var hi=class extends D$1{constructor(e,i8,r5,n,o2){super(),this._element=e,this._mouseService=i8,this._renderService=r5,this._bufferService=n,this._linkProviderService=o2,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new v$1),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new v$1),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(C$2(()=>{var _a7;Ne(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(_a7=this._activeProviderReplies)==null||_a7.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(L$1(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(L$1(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(L$1(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(L$1(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i8=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i8)return;this._isMouseOut=!1;let r5=e.composedPath();for(let n=0;n<r5.length;n++){let o2=r5[n];if(o2.classList.contains("xterm"))break;if(o2.classList.contains("xterm-hover"))return}(!this._lastBufferCell||i8.x!==this._lastBufferCell.x||i8.y!==this._lastBufferCell.y)&&(this._handleHover(i8),this._lastBufferCell=i8)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i8){var _a7,_b;(!this._activeProviderReplies||!i8)&&((_a7=this._activeProviderReplies)==null||_a7.forEach(n=>{n==null||n.forEach(o2=>{o2.link.dispose&&o2.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r5=!1;for(let[n,o2]of this._linkProviderService.linkProviders.entries())i8?(_b=this._activeProviderReplies)!=null&&_b.get(n)&&(r5=this._checkLinkProviderResult(n,e,r5)):o2.provideLinks(e.y,l2=>{var _a8,_b2;if(this._isMouseOut)return;let a=l2==null?void 0:l2.map(u=>({link:u}));(_a8=this._activeProviderReplies)==null||_a8.set(n,a),r5=this._checkLinkProviderResult(n,e,r5),((_b2=this._activeProviderReplies)==null?void 0:_b2.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i8){let r5=new Set;for(let n=0;n<i8.size;n++){let o2=i8.get(n);if(o2)for(let l2=0;l2<o2.length;l2++){let a=o2[l2],u=a.link.range.start.y<e?0:a.link.range.start.x,h2=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let c=u;c<=h2;c++){if(r5.has(c)){o2.splice(l2--,1);break}r5.add(c)}}}}_checkLinkProviderResult(e,i8,r5){var _a7;if(!this._activeProviderReplies)return r5;let n=this._activeProviderReplies.get(e),o2=!1;for(let l2=0;l2<e;l2++)(!this._activeProviderReplies.has(l2)||this._activeProviderReplies.get(l2))&&(o2=!0);if(!o2&&n){let l2=n.find(a=>this._linkAtPosition(a.link,i8));l2&&(r5=!0,this._handleNewLink(l2))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r5)for(let l2=0;l2<this._activeProviderReplies.size;l2++){let a=(_a7=this._activeProviderReplies.get(l2))==null?void 0:_a7.find(u=>this._linkAtPosition(u.link,i8));if(a){r5=!0,this._handleNewLink(a);break}}return r5}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i8=this._positionFromMouseEvent(e,this._element,this._mouseService);i8&&this._mouseDownLink&&Ec(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i8)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i8){!this._currentLink||!this._lastMouseEvent||(!e||!i8||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i8)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ne(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i8=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i8&&this._linkAtPosition(e.link,i8)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var _a7,_b;return(_b=(_a7=this._currentLink)==null?void 0:_a7.state)==null?void 0:_b.decorations.pointerCursor},set:r5=>{var _a7;(_a7=this._currentLink)!=null&&_a7.state&&this._currentLink.state.decorations.pointerCursor!==r5&&(this._currentLink.state.decorations.pointerCursor=r5,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r5))}},underline:{get:()=>{var _a7,_b;return(_b=(_a7=this._currentLink)==null?void 0:_a7.state)==null?void 0:_b.decorations.underline},set:r5=>{var _a7,_b,_c2;(_a7=this._currentLink)!=null&&_a7.state&&((_c2=(_b=this._currentLink)==null?void 0:_b.state)==null?void 0:_c2.decorations.underline)!==r5&&(this._currentLink.state.decorations.underline=r5,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r5))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r5=>{if(!this._currentLink)return;let n=r5.start===0?0:r5.start+1+this._bufferService.buffer.ydisp,o2=this._bufferService.buffer.ydisp+1+r5.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=o2&&(this._clearCurrentLink(n,o2),this._lastMouseEvent)){let l2=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l2&&this._askForLink(l2,!1)}})))}_linkHover(e,i8,r5){var _a7;(_a7=this._currentLink)!=null&&_a7.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i8,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i8.hover&&i8.hover(r5,i8.text)}_fireUnderlineEvent(e,i8){let r5=e.range,n=this._bufferService.buffer.ydisp,o2=this._createLinkUnderlineEvent(r5.start.x-1,r5.start.y-n-1,r5.end.x,r5.end.y-n-1,void 0);(i8?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o2)}_linkLeave(e,i8,r5){var _a7;(_a7=this._currentLink)!=null&&_a7.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i8,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i8.leave&&i8.leave(r5,i8.text)}_linkAtPosition(e,i8){let r5=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,o2=i8.y*this._bufferService.cols+i8.x;return r5<=o2&&o2<=n}_positionFromMouseEvent(e,i8,r5){let n=r5.getCoords(e,i8,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i8,r5,n,o2){return{x1:e,y1:i8,x2:r5,y2:n,cols:this._bufferService.cols,fg:o2}}};hi=M$1([S(1,Dt$1),S(2,ce$1),S(3,F$1),S(4,lr)],hi);function Ec(s15,t){return s15.text===t.text&&s15.range.start.x===t.range.start.x&&s15.range.start.y===t.range.start.y&&s15.range.end.x===t.range.end.x&&s15.range.end.y===t.range.end.y}var yn$1=class extends Sn$1{constructor(e={}){super(e),this._linkifier=this._register(new ye$2),this.browser=tn,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ye$2),this._onCursorMove=this._register(new v$1),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new v$1),this.onKey=this._onKey.event,this._onRender=this._register(new v$1),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new v$1),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new v$1),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new v$1),this.onBell=this._onBell.event,this._onFocus=this._register(new v$1),this._onBlur=this._register(new v$1),this._onA11yCharEmitter=this._register(new v$1),this._onA11yTabEmitter=this._register(new v$1),this._onWillOpen=this._register(new v$1),this._setup(),this._decorationService=this._instantiationService.createInstance(Tn),this._instantiationService.setService(Be$1,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Qr),this._instantiationService.setService(lr,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(wt$1)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i8=>this.refresh((i8==null?void 0:i8.start)??0,(i8==null?void 0:i8.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i8=>this._reportWindowsOptions(i8))),this._register(this._inputHandler.onColor(i8=>this._handleColorEvent(i8))),this._register($.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register($.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register($.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register($.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i8=>this._afterResize(i8.cols,i8.rows))),this._register(C$2(()=>{var _a7,_b;this._customKeyEventHandler=void 0,(_b=(_a7=this.element)==null?void 0:_a7.parentNode)==null||_b.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i8 of e){let r5,n="";switch(i8.index){case 256:r5="foreground",n="10";break;case 257:r5="background",n="11";break;case 258:r5="cursor",n="12";break;default:r5="ansi",n="4;"+i8.index}switch(i8.type){case 0:let o2=U$2.toColorRGB(r5==="ansi"?this._themeService.colors.ansi[i8.index]:this._themeService.colors[r5]);this.coreService.triggerDataEvent(`${b.ESC}]${n};${ml(o2)}${fs.ST}`);break;case 1:if(r5==="ansi")this._themeService.modifyColors(l2=>l2.ansi[i8.index]=j$1.toColor(...i8.color));else{let l2=r5;this._themeService.modifyColors(a=>a[l2]=j$1.toColor(...i8.color))}break;case 2:this._themeService.restoreColor(i8.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Tt,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var _a7;return(_a7=this.textarea)==null?void 0:_a7.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i8=this.buffer.lines.get(e);if(!i8)return;let r5=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,o2=i8.getWidth(r5),l2=this._renderService.dimensions.css.cell.width*o2,a=this.buffer.y*this._renderService.dimensions.css.cell.height,u=r5*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=a+"px",this.textarea.style.width=l2+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(L$1(this.element,"copy",i8=>{this.hasSelection()&&Vs(i8,this._selectionService)}));let e=i8=>qs(i8,this.textarea,this.coreService,this.optionsService);this._register(L$1(this.textarea,"paste",e)),this._register(L$1(this.element,"paste",e)),Ss?this._register(L$1(this.element,"mousedown",i8=>{i8.button===2&&Pn$1(i8,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(L$1(this.element,"contextmenu",i8=>{Pn$1(i8,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Bi&&this._register(L$1(this.element,"auxclick",i8=>{i8.button===1&&Mn$1(i8,this.textarea,this.screenElement)}))}_bindKeys(){this._register(L$1(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(L$1(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(L$1(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(L$1(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(L$1(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(L$1(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(L$1(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var _a7;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((_a7=this.element)==null?void 0:_a7.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i8=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i8.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(L$1(this.screenElement,"mousemove",o2=>this.updateCursorStyle(o2))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i8.appendChild(this.screenElement);let r5=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",mi$1.get()),Ts$1||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r5.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Jr$1,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ae$1,this._coreBrowserService),this._register(L$1(this.textarea,"focus",o2=>this._handleTextAreaFocus(o2))),this._register(L$1(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(jt$1,this._document,this._helperContainer),this._instantiationService.setService(nt$1,this._charSizeService),this._themeService=this._instantiationService.createInstance(ti$1),this._instantiationService.setService(Re,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ct),this._instantiationService.setService(or,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Qt$1,this.rows,this.screenElement)),this._instantiationService.setService(ce$1,this._renderService),this._register(this._renderService.onRenderedViewportChange(o2=>this._onRender.fire(o2))),this.onResize(o2=>this._renderService.resize(o2.cols,o2.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance($t$1,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Xt$1),this._instantiationService.setService(Dt$1,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(hi,this.screenElement));this.element.appendChild(i8);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(zt$1,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o2=>{super.scrollLines(o2,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(ei$1,this.element,this.screenElement,n)),this._instantiationService.setService(Qs,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o2=>this.scrollLines(o2.amount,o2.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o2=>this._renderService.handleSelectionChanged(o2.start,o2.end,o2.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o2=>{this.textarea.value=o2,this.textarea.focus(),this.textarea.select()})),this._register($.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var _a8;this._selectionService.refresh(),(_a8=this._viewport)==null||_a8.queueSync()})),this._register(this._instantiationService.createInstance(Gt$1,this.screenElement)),this._register(L$1(this.element,"mousedown",o2=>this._selectionService.handleMouseDown(o2))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Tt,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o2=>this._handleScreenReaderModeOptionChange(o2))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bt$1,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o2=>{!this._overviewRulerRenderer&&o2&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bt$1,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Yt$1,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i8=this.element;function r5(l2){var _a7,_b,_c2,_d,_e3;let a=e._mouseService.getMouseReportCoords(l2,e.screenElement);if(!a)return!1;let u,h2;switch(l2.overrideType||l2.type){case"mousemove":h2=32,l2.buttons===void 0?(u=3,l2.button!==void 0&&(u=l2.button<3?l2.button:3)):u=l2.buttons&1?0:l2.buttons&4?1:l2.buttons&2?2:3;break;case"mouseup":h2=0,u=l2.button<3?l2.button:3;break;case"mousedown":h2=1,u=l2.button<3?l2.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l2)===!1)return!1;let c=l2.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(l2,(_d=(_c2=(_b=(_a7=e._renderService)==null?void 0:_a7.dimensions)==null?void 0:_b.device)==null?void 0:_c2.cell)==null?void 0:_d.height,(_e3=e._coreBrowserService)==null?void 0:_e3.dpr)===0)return!1;h2=c<0?0:1,u=4;break;default:return!1}return h2===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:u,action:h2,ctrl:l2.ctrlKey,alt:l2.altKey,shift:l2.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o2={mouseup:l2=>(r5(l2),l2.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(l2)),wheel:l2=>(r5(l2),this.cancel(l2,!0)),mousedrag:l2=>{l2.buttons&&r5(l2)},mousemove:l2=>{l2.buttons||r5(l2)}};this._register(this.coreMouseService.onProtocolChange(l2=>{l2?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l2)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l2&8?n.mousemove||(i8.addEventListener("mousemove",o2.mousemove),n.mousemove=o2.mousemove):(i8.removeEventListener("mousemove",n.mousemove),n.mousemove=null),l2&16?n.wheel||(i8.addEventListener("wheel",o2.wheel,{passive:!1}),n.wheel=o2.wheel):(i8.removeEventListener("wheel",n.wheel),n.wheel=null),l2&2?n.mouseup||(n.mouseup=o2.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),l2&4?n.mousedrag||(n.mousedrag=o2.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(L$1(i8,"mousedown",l2=>{if(l2.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l2)))return r5(l2),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(l2)})),this._register(L$1(i8,"wheel",l2=>{var _a7,_b,_c2,_d,_e3;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l2)===!1)return!1;if(!this.buffer.hasScrollback){if(l2.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l2,(_d=(_c2=(_b=(_a7=e._renderService)==null?void 0:_a7.dimensions)==null?void 0:_b.device)==null?void 0:_c2.cell)==null?void 0:_d.height,(_e3=e._coreBrowserService)==null?void 0:_e3.dpr)===0)return this.cancel(l2,!0);let h2=b.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l2.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h2,!0),this.cancel(l2,!0)}}},{passive:!1}))}refresh(e,i8){var _a7;(_a7=this._renderService)==null||_a7.refreshRows(e,i8)}updateCursorStyle(e){var _a7;(_a7=this._selectionService)!=null&&_a7.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i8){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i8),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i8=e-this._bufferService.buffer.ydisp;i8!==0&&this.scrollLines(i8)}paste(e){Cn(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i8=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i8}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i8,r5){this._selectionService.setSelection(e,i8,r5)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var _a7;(_a7=this._selectionService)==null||_a7.clearSelection()}selectAll(){var _a7;(_a7=this._selectionService)==null||_a7.selectAll()}selectLines(e,i8){var _a7;(_a7=this._selectionService)==null||_a7.selectLines(e,i8)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i8=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i8&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i8&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r5=Il(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r5.type===3||r5.type===2){let n=this.rows-1;return this.scrollLines(r5.type===2?-n:n),this.cancel(e,!0)}if(r5.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r5.cancel&&this.cancel(e,!0),!r5.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r5.key===b.ETX||r5.key===b.CR)&&(this.textarea.value=""),this._onKey.fire({key:r5.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r5.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i8){let r5=e.isMac&&!this.options.macOptionIsMeta&&i8.altKey&&!i8.ctrlKey&&!i8.metaKey||e.isWindows&&i8.altKey&&i8.ctrlKey&&!i8.metaKey||e.isWindows&&i8.getModifierState("AltGraph");return i8.type==="keypress"?r5:r5&&(!i8.keyCode||i8.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Tc(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i8;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i8=e.charCode;else if(e.which===null||e.which===void 0)i8=e.keyCode;else if(e.which!==0&&e.charCode!==0)i8=e.which;else return!1;return!i8||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i8=String.fromCharCode(i8),this._onKey.fire({key:i8,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i8,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i8=e.data;return this.coreService.triggerDataEvent(i8,!0),this.cancel(e),!0}return!1}resize(e,i8){if(e===this.cols&&i8===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i8)}_afterResize(e,i8){var _a7;(_a7=this._charSizeService)==null||_a7.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(X$1));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var _a7;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(_a7=this._selectionService)==null||_a7.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var _a7;(_a7=this._renderService)==null||_a7.clearTextureAtlas()}_reportFocus(){var _a7;(_a7=this.element)!=null&&_a7.classList.contains("focus")?this.coreService.triggerDataEvent(b.ESC+"[I"):this.coreService.triggerDataEvent(b.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i8=this._renderService.dimensions.css.canvas.width.toFixed(0),r5=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${b.ESC}[4;${r5};${i8}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),o2=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${b.ESC}[6;${o2};${n}t`);break}}cancel(e,i8){if(!(!this.options.cancelEvents&&!i8))return e.preventDefault(),e.stopPropagation(),!1}};function Tc(s15){return s15.keyCode===16||s15.keyCode===17||s15.keyCode===18}var xn$1=class{constructor(){this._addons=[]}dispose(){for(let t=this._addons.length-1;t>=0;t--)this._addons[t].instance.dispose()}loadAddon(t,e){let i8={instance:e,dispose:e.dispose,isDisposed:!1};this._addons.push(i8),e.dispose=()=>this._wrappedAddonDispose(i8),e.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let e=-1;for(let i8=0;i8<this._addons.length;i8++)if(this._addons[i8]===t){e=i8;break}if(e===-1)throw new Error("Could not dispose an addon that has not been loaded");t.isDisposed=!0,t.dispose.apply(t.instance),this._addons.splice(e,1)}},wn$1=class{constructor(t){this._line=t}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(t,e){if(!(t<0||t>=this._line.length))return e?(this._line.loadCell(t,e),e):this._line.loadCell(t,new q)}translateToString(t,e,i8){return this._line.translateToString(t,e,i8)}},Ji=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new wn$1(e)}getNullCell(){return new q}},Dn=class extends D$1{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new v$1),this.onBufferChange=this._onBufferChange.event,this._normal=new Ji(this._core.buffers.normal,"normal"),this._alternate=new Ji(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)}},Rn=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i8=>e(i8.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i8,r5)=>e(i8,r5.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},Ln$1=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}},Ic=["cols","rows"],Ue$1=0,Dl=class extends D$1{constructor(t){super(),this._core=this._register(new yn$1(t)),this._addonManager=this._register(new xn$1),this._publicOptions={...this._core.options};let e=r5=>this._core.options[r5],i8=(r5,n)=>{this._checkReadonlyOptions(r5),this._core.options[r5]=n};for(let r5 in this._core.options){let n={get:e.bind(this,r5),set:i8.bind(this,r5)};Object.defineProperty(this._publicOptions,r5,n)}}_checkReadonlyOptions(t){if(Ic.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Rn(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Ln$1(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 Dn(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i8){this._verifyIntegers(t,e,i8),this._core.select(t,e,i8)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
27
- `,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return mi$1.get()},set promptLabel(t){mi$1.set(t)},get tooMuchOutput(){return _i$1.get()},set tooMuchOutput(t){_i$1.set(t)}}}_verifyIntegers(...t){for(Ue$1 of t)if(Ue$1===1/0||isNaN(Ue$1)||Ue$1%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(Ue$1 of t)if(Ue$1&&(Ue$1===1/0||isNaN(Ue$1)||Ue$1%1!==0||Ue$1<0))throw new Error("This API only accepts positive integers")}};/**
28
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
29
- * @license MIT
30
- *
31
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
32
- * @license MIT
33
- *
34
- * Originally forked from (with the author's permission):
35
- * Fabrice Bellard's javascript vt100 for jslinux:
36
- * http://bellard.org/jslinux/
37
- * Copyright (c) 2011 Fabrice Bellard
38
- */var h=2,_$2=1,o=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var _a7;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let s15=this._terminal.options.scrollback===0?0:((_a7=this._terminal.options.overviewRuler)==null?void 0:_a7.width)||14,r5=window.getComputedStyle(this._terminal.element.parentElement),l2=parseInt(r5.getPropertyValue("height")),a=Math.max(0,parseInt(r5.getPropertyValue("width"))),i8=window.getComputedStyle(this._terminal.element),n={top:parseInt(i8.getPropertyValue("padding-top")),bottom:parseInt(i8.getPropertyValue("padding-bottom")),right:parseInt(i8.getPropertyValue("padding-right")),left:parseInt(i8.getPropertyValue("padding-left"))},m=n.top+n.bottom,d=n.right+n.left,c=l2-m,p=a-d-s15;return{cols:Math.max(h,Math.floor(p/t.css.cell.width)),rows:Math.max(_$2,Math.floor(c/t.css.cell.height))}}};/**
39
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
40
- * @license MIT
41
- *
42
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
43
- * @license MIT
44
- *
45
- * Originally forked from (with the author's permission):
46
- * Fabrice Bellard's javascript vt100 for jslinux:
47
- * http://bellard.org/jslinux/
48
- * Copyright (c) 2011 Fabrice Bellard
49
- */var Yi=(i8,e,t,n)=>{for(var s15=e,o2=i8.length-1,r5;o2>=0;o2--)(r5=i8[o2])&&(s15=r5(s15)||s15);return s15},Qi=(i8,e)=>(t,n)=>e(t,n,i8),pi=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?bt2.isErrorNoTelemetry(e)?new bt2(e.message+`
50
-
51
- `+e.stack):new Error(e.message+`
52
-
53
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Rr=new pi;function Pe$1(i8){Dr(i8)||Rr.onUnexpectedError(i8)}var fi="Canceled";function Dr(i8){return i8 instanceof Ye2?!0:i8 instanceof Error&&i8.name===fi&&i8.message===fi}var Ye2=class extends Error{constructor(){super(fi),this.name=this.message}},bt2=class i extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof i)return e;let t=new i;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},en2;(a=>{function i8(l2){return l2<0}a.isLessThan=i8;function e(l2){return l2<=0}a.isLessThanOrEqual=e;function t(l2){return l2>0}a.isGreaterThan=t;function n(l2){return l2===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(en2||(en2={}));function mi(i8,e){let t=this,n=!1,s15;return function(){return n||(n=!0,e||(s15=i8.apply(t,arguments))),s15}}var _i;(W=>{function i8(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}W.is=i8;let e=Object.freeze([]);function t(){return e}W.empty=t;function*n(E){yield E}W.single=n;function s15(E){return i8(E)?E:n(E)}W.wrap=s15;function o2(E){return E||e}W.from=o2;function*r5(E){for(let y=E.length-1;y>=0;y--)yield E[y]}W.reverse=r5;function a(E){return!E||E[Symbol.iterator]().next().done===!0}W.isEmpty=a;function l2(E){return E[Symbol.iterator]().next().value}W.first=l2;function u(E,y){let w2=0;for(let G2 of E)if(y(G2,w2++))return!0;return!1}W.some=u;function c(E,y){for(let w2 of E)if(y(w2))return w2}W.find=c;function*d(E,y){for(let w2 of E)y(w2)&&(yield w2)}W.filter=d;function*h2(E,y){let w2=0;for(let G2 of E)yield y(G2,w2++)}W.map=h2;function*f(E,y){let w2=0;for(let G2 of E)yield*y(G2,w2++)}W.flatMap=f;function*I2(...E){for(let y of E)yield*y}W.concat=I2;function L2(E,y,w2){let G2=w2;for(let ue2 of E)G2=y(G2,ue2);return G2}W.reduce=L2;function*M3(E,y,w2=E.length){for(y<0&&(y+=E.length),w2<0?w2+=E.length:w2>E.length&&(w2=E.length);y<w2;y++)yield E[y]}W.slice=M3;function q2(E,y=Number.POSITIVE_INFINITY){let w2=[];if(y===0)return[w2,E];let G2=E[Symbol.iterator]();for(let ue2=0;ue2<y;ue2++){let Se2=G2.next();if(Se2.done)return[w2,W.empty()];w2.push(Se2.value)}return[w2,{[Symbol.iterator](){return G2}}]}W.consume=q2;async function S2(E){let y=[];for await(let w2 of E)y.push(w2);return Promise.resolve(y)}W.asyncToArray=S2})(_i||(_i={}));function un2(i8){if(_i.is(i8)){let e=[];for(let t of i8)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i8)?[]:i8}else if(i8)return i8.dispose(),i8}function It(...i8){return O(()=>un2(i8))}function O(i8){return{dispose:mi(()=>{i8()})}}var xt$1=class xt{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{un2(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?xt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};xt$1.DISABLE_DISPOSED_WARNING=!1;var fe$1=xt$1,B=class{constructor(){this._store=new fe$1,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};B.None=Object.freeze({dispose(){}});var be$1=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var _a7;this._isDisposed||e===this._value||((_a7=this._value)==null||_a7.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var _a7;this._isDisposed=!0,(_a7=this._value)==null||_a7.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Lt=typeof process<"u"&&"title"in process,Ze=Lt?"node":navigator.userAgent,bi2=Lt?"node":navigator.platform,cn=Ze.includes("Firefox"),dn2=Ze.includes("Edge"),vi=/^((?!chrome|android).)*safari/i.test(Ze);function hn2(){if(!vi)return 0;let i8=Ze.match(/Version\/(\d+)/);return i8===null||i8.length<2?0:parseInt(i8[1])}bi2.indexOf("Linux")>=0;var pn2="",K$1=0,V=0,C$1=0,U$1=0,Z={css:"#00000000",rgba:0},X;(n=>{function i8(s15,o2,r5,a){return a!==void 0?`#${Oe(s15)}${Oe(o2)}${Oe(r5)}${Oe(a)}`:`#${Oe(s15)}${Oe(o2)}${Oe(r5)}`}n.toCss=i8;function e(s15,o2,r5,a=255){return(s15<<24|o2<<16|r5<<8|a)>>>0}n.toRgba=e;function t(s15,o2,r5,a){return{css:n.toCss(s15,o2,r5,a),rgba:n.toRgba(s15,o2,r5,a)}}n.toColor=t})(X||(X={}));var Ue;(a=>{function i8(l2,u){if(U$1=(u.rgba&255)/255,U$1===1)return{css:u.css,rgba:u.rgba};let c=u.rgba>>24&255,d=u.rgba>>16&255,h2=u.rgba>>8&255,f=l2.rgba>>24&255,I2=l2.rgba>>16&255,L2=l2.rgba>>8&255;K$1=f+Math.round((c-f)*U$1),V=I2+Math.round((d-I2)*U$1),C$1=L2+Math.round((h2-L2)*U$1);let M3=X.toCss(K$1,V,C$1),q2=X.toRgba(K$1,V,C$1);return{css:M3,rgba:q2}}a.blend=i8;function e(l2){return(l2.rgba&255)===255}a.isOpaque=e;function t(l2,u,c){let d=Te$1.ensureContrastRatio(l2.rgba,u.rgba,c);if(d)return X.toColor(d>>24&255,d>>16&255,d>>8&255)}a.ensureContrastRatio=t;function n(l2){let u=(l2.rgba|255)>>>0;return[K$1,V,C$1]=Te$1.toChannels(u),{css:X.toCss(K$1,V,C$1),rgba:u}}a.opaque=n;function s15(l2,u){return U$1=Math.round(u*255),[K$1,V,C$1]=Te$1.toChannels(l2.rgba),{css:X.toCss(K$1,V,C$1,U$1),rgba:X.toRgba(K$1,V,C$1,U$1)}}a.opacity=s15;function o2(l2,u){return U$1=l2.rgba&255,s15(l2,U$1*u/255)}a.multiplyOpacity=o2;function r5(l2){return[l2.rgba>>24&255,l2.rgba>>16&255,l2.rgba>>8&255]}a.toColorRGB=r5})(Ue||(Ue={}));var Fr2;(n=>{let i8,e;try{let s15=document.createElement("canvas");s15.width=1,s15.height=1;let o2=s15.getContext("2d",{willReadFrequently:!0});o2&&(i8=o2,i8.globalCompositeOperation="copy",e=i8.createLinearGradient(0,0,1,1))}catch{}function t(s15){if(s15.match(/#[\da-f]{3,8}/i))switch(s15.length){case 4:return K$1=parseInt(s15.slice(1,2).repeat(2),16),V=parseInt(s15.slice(2,3).repeat(2),16),C$1=parseInt(s15.slice(3,4).repeat(2),16),X.toColor(K$1,V,C$1);case 5:return K$1=parseInt(s15.slice(1,2).repeat(2),16),V=parseInt(s15.slice(2,3).repeat(2),16),C$1=parseInt(s15.slice(3,4).repeat(2),16),U$1=parseInt(s15.slice(4,5).repeat(2),16),X.toColor(K$1,V,C$1,U$1);case 7:return{css:s15,rgba:(parseInt(s15.slice(1),16)<<8|255)>>>0};case 9:return{css:s15,rgba:parseInt(s15.slice(1),16)>>>0}}let o2=s15.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o2)return K$1=parseInt(o2[1]),V=parseInt(o2[2]),C$1=parseInt(o2[3]),U$1=Math.round((o2[5]===void 0?1:parseFloat(o2[5]))*255),X.toColor(K$1,V,C$1,U$1);if(!i8||!e)throw new Error("css.toColor: Unsupported css format");if(i8.fillStyle=e,i8.fillStyle=s15,typeof i8.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i8.fillRect(0,0,1,1),[K$1,V,C$1,U$1]=i8.getImageData(0,0,1,1).data,U$1!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:X.toRgba(K$1,V,C$1,U$1),css:s15}}n.toColor=t})(Fr2||(Fr2={}));var Y$1;(t=>{function i8(n){return e(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=i8;function e(n,s15,o2){let r5=n/255,a=s15/255,l2=o2/255,u=r5<=.03928?r5/12.92:Math.pow((r5+.055)/1.055,2.4),c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),d=l2<=.03928?l2/12.92:Math.pow((l2+.055)/1.055,2.4);return u*.2126+c*.7152+d*.0722}t.relativeLuminance2=e})(Y$1||(Y$1={}));var Te$1;(o2=>{function i8(r5,a){if(U$1=(a&255)/255,U$1===1)return a;let l2=a>>24&255,u=a>>16&255,c=a>>8&255,d=r5>>24&255,h2=r5>>16&255,f=r5>>8&255;return K$1=d+Math.round((l2-d)*U$1),V=h2+Math.round((u-h2)*U$1),C$1=f+Math.round((c-f)*U$1),X.toRgba(K$1,V,C$1)}o2.blend=i8;function e(r5,a,l2){let u=Y$1.relativeLuminance(r5>>8),c=Y$1.relativeLuminance(a>>8);if(ve(u,c)<l2){if(c<u){let I2=t(r5,a,l2),L2=ve(u,Y$1.relativeLuminance(I2>>8));if(L2<l2){let M3=n(r5,a,l2),q2=ve(u,Y$1.relativeLuminance(M3>>8));return L2>q2?I2:M3}return I2}let h2=n(r5,a,l2),f=ve(u,Y$1.relativeLuminance(h2>>8));if(f<l2){let I2=t(r5,a,l2),L2=ve(u,Y$1.relativeLuminance(I2>>8));return f>L2?h2:I2}return h2}}o2.ensureContrastRatio=e;function t(r5,a,l2){let u=r5>>24&255,c=r5>>16&255,d=r5>>8&255,h2=a>>24&255,f=a>>16&255,I2=a>>8&255,L2=ve(Y$1.relativeLuminance2(h2,f,I2),Y$1.relativeLuminance2(u,c,d));for(;L2<l2&&(h2>0||f>0||I2>0);)h2-=Math.max(0,Math.ceil(h2*.1)),f-=Math.max(0,Math.ceil(f*.1)),I2-=Math.max(0,Math.ceil(I2*.1)),L2=ve(Y$1.relativeLuminance2(h2,f,I2),Y$1.relativeLuminance2(u,c,d));return(h2<<24|f<<16|I2<<8|255)>>>0}o2.reduceLuminance=t;function n(r5,a,l2){let u=r5>>24&255,c=r5>>16&255,d=r5>>8&255,h2=a>>24&255,f=a>>16&255,I2=a>>8&255,L2=ve(Y$1.relativeLuminance2(h2,f,I2),Y$1.relativeLuminance2(u,c,d));for(;L2<l2&&(h2<255||f<255||I2<255);)h2=Math.min(255,h2+Math.ceil((255-h2)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),I2=Math.min(255,I2+Math.ceil((255-I2)*.1)),L2=ve(Y$1.relativeLuminance2(h2,f,I2),Y$1.relativeLuminance2(u,c,d));return(h2<<24|f<<16|I2<<8|255)>>>0}o2.increaseLuminance=n;function s15(r5){return[r5>>24&255,r5>>16&255,r5>>8&255,r5&255]}o2.toChannels=s15})(Te$1||(Te$1={}));function Oe(i8){let e=i8.toString(16);return e.length<2?"0"+e:e}function ve(i8,e){return i8<e?(e+.05)/(i8+.05):(i8+.05)/(e+.05)}function F(i8){if(!i8)throw new Error("value must not be falsy");return i8}function Rt(i8){return 57508<=i8&&i8<=57558}function fn2(i8){return 57520<=i8&&i8<=57527}function kr2(i8){return 57344<=i8&&i8<=63743}function Pr(i8){return 9472<=i8&&i8<=9631}function Br2(i8){return i8>=128512&&i8<=128591||i8>=127744&&i8<=128511||i8>=128640&&i8<=128767||i8>=9728&&i8<=9983||i8>=9984&&i8<=10175||i8>=65024&&i8<=65039||i8>=129280&&i8<=129535||i8>=127462&&i8<=127487}function mn2(i8,e,t,n){return e===1&&t>Math.ceil(n*1.5)&&i8!==void 0&&i8>255&&!Br2(i8)&&!Rt(i8)&&!kr2(i8)}function Dt(i8){return Rt(i8)||Pr(i8)}function _n2(){return{css:{canvas:wt2(),cell:wt2()},device:{canvas:wt2(),cell:wt2(),char:{width:0,height:0,left:0,top:0}}}}function wt2(){return{width:0,height:0}}function bn2(i8,e,t=0){return(i8-(Math.round(e)*2-t))%(Math.round(e)*2)}var j=0,z=0,me$1=!1,ge$1=!1,Mt2=!1,J$1,Ti=0,At=class{constructor(e,t,n,s15,o2,r5){this._terminal=e,this._optionService=t,this._selectionRenderModel=n,this._decorationService=s15,this._coreBrowserService=o2,this._themeService=r5,this.result={fg:0,bg:0,ext:0}}resolve(e,t,n,s15){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,z=0,j=0,ge$1=!1,me$1=!1,Mt2=!1,J$1=this._themeService.colors,Ti=0,e.getCode()!==0&&e.extended.underlineStyle===4){let r5=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Ti=t*s15%(Math.round(r5)*2)}if(this._decorationService.forEachDecorationAtCell(t,n,"bottom",r5=>{r5.backgroundColorRGB&&(z=r5.backgroundColorRGB.rgba>>8&16777215,ge$1=!0),r5.foregroundColorRGB&&(j=r5.foregroundColorRGB.rgba>>8&16777215,me$1=!0)}),Mt2=this._selectionRenderModel.isCellSelected(this._terminal,t,n),Mt2){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:z=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:z=(this.result.fg&16777215)<<8|255;break;case 0:default:z=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:z=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:z=(this.result.bg&16777215)<<8|255;break}z=Te$1.blend(z,(this._coreBrowserService.isFocused?J$1.selectionBackgroundOpaque:J$1.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else z=(this._coreBrowserService.isFocused?J$1.selectionBackgroundOpaque:J$1.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(ge$1=!0,J$1.selectionForeground&&(j=J$1.selectionForeground.rgba>>8&16777215,me$1=!0),Dt(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)j=(this._coreBrowserService.isFocused?J$1.selectionBackgroundOpaque:J$1.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:j=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:j=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:j=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:j=(this.result.fg&16777215)<<8|255;break;case 0:default:j=this._themeService.colors.foreground.rgba}j=Te$1.blend(j,(this._coreBrowserService.isFocused?J$1.selectionBackgroundOpaque:J$1.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}me$1=!0}}this._decorationService.forEachDecorationAtCell(t,n,"top",r5=>{r5.backgroundColorRGB&&(z=r5.backgroundColorRGB.rgba>>8&16777215,ge$1=!0),r5.foregroundColorRGB&&(j=r5.foregroundColorRGB.rgba>>8&16777215,me$1=!0)}),ge$1&&(Mt2?z=e.bg&-16777216&-134217729|z|50331648:z=e.bg&-16777216|z|50331648),me$1&&(j=e.fg&-16777216&-67108865|j|50331648),this.result.fg&67108864&&(ge$1&&!me$1&&((this.result.bg&50331648)===0?j=this.result.fg&-134217728|J$1.background.rgba>>8&16777215&16777215|50331648:j=this.result.fg&-134217728|this.result.bg&67108863,me$1=!0),!ge$1&&me$1&&((this.result.fg&50331648)===0?z=this.result.bg&-67108864|J$1.foreground.rgba>>8&16777215&16777215|50331648:z=this.result.bg&-67108864|this.result.fg&67108863,ge$1=!0)),J$1=void 0,this.result.bg=ge$1?z:this.result.bg,this.result.fg=me$1?j:this.result.fg,this.result.ext&=536870911,this.result.ext|=Ti<<29&3758096384}},gn2=.5,St=cn||dn2?"bottom":"ideographic",Hr={"▀":[{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}]},Wr2={"░":[[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]]},Gr2={"─":{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:(i8,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(i8,e)=>`M${.5-i8},0 L${.5-i8},1 M${.5+i8},0 L${.5+i8},1`},"╒":{1:(i8,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(i8,e)=>`M${.5-i8},1 L${.5-i8},.5 L1,.5 M${.5+i8},.5 L${.5+i8},1`},"╔":{1:(i8,e)=>`M1,${.5-e} L${.5-i8},${.5-e} L${.5-i8},1 M1,${.5+e} L${.5+i8},${.5+e} L${.5+i8},1`},"╕":{1:(i8,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(i8,e)=>`M${.5+i8},1 L${.5+i8},.5 L0,.5 M${.5-i8},.5 L${.5-i8},1`},"╗":{1:(i8,e)=>`M0,${.5+e} L${.5-i8},${.5+e} L${.5-i8},1 M0,${.5-e} L${.5+i8},${.5-e} L${.5+i8},1`},"╘":{1:(i8,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(i8,e)=>`M1,.5 L${.5-i8},.5 L${.5-i8},0 M${.5+i8},.5 L${.5+i8},0`},"╚":{1:(i8,e)=>`M1,${.5-e} L${.5+i8},${.5-e} L${.5+i8},0 M1,${.5+e} L${.5-i8},${.5+e} L${.5-i8},0`},"╛":{1:(i8,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(i8,e)=>`M0,.5 L${.5+i8},.5 L${.5+i8},0 M${.5-i8},.5 L${.5-i8},0`},"╝":{1:(i8,e)=>`M0,${.5-e} L${.5-i8},${.5-e} L${.5-i8},0 M0,${.5+e} L${.5+i8},${.5+e} L${.5+i8},0`},"╞":{1:(i8,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(i8,e)=>`M${.5-i8},0 L${.5-i8},1 M${.5+i8},0 L${.5+i8},1 M${.5+i8},.5 L1,.5`},"╠":{1:(i8,e)=>`M${.5-i8},0 L${.5-i8},1 M1,${.5+e} L${.5+i8},${.5+e} L${.5+i8},1 M1,${.5-e} L${.5+i8},${.5-e} L${.5+i8},0`},"╡":{1:(i8,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(i8,e)=>`M0,.5 L${.5-i8},.5 M${.5-i8},0 L${.5-i8},1 M${.5+i8},0 L${.5+i8},1`},"╣":{1:(i8,e)=>`M${.5+i8},0 L${.5+i8},1 M0,${.5+e} L${.5-i8},${.5+e} L${.5-i8},1 M0,${.5-e} L${.5-i8},${.5-e} L${.5-i8},0`},"╤":{1:(i8,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(i8,e)=>`M0,.5 L1,.5 M${.5-i8},.5 L${.5-i8},1 M${.5+i8},.5 L${.5+i8},1`},"╦":{1:(i8,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-i8},${.5+e} L${.5-i8},1 M1,${.5+e} L${.5+i8},${.5+e} L${.5+i8},1`},"╧":{1:(i8,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(i8,e)=>`M0,.5 L1,.5 M${.5-i8},.5 L${.5-i8},0 M${.5+i8},.5 L${.5+i8},0`},"╩":{1:(i8,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-i8},${.5-e} L${.5-i8},0 M1,${.5-e} L${.5+i8},${.5-e} L${.5+i8},0`},"╪":{1:(i8,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(i8,e)=>`M0,.5 L1,.5 M${.5-i8},0 L${.5-i8},1 M${.5+i8},0 L${.5+i8},1`},"╬":{1:(i8,e)=>`M0,${.5+e} L${.5-i8},${.5+e} L${.5-i8},1 M1,${.5+e} L${.5+i8},${.5+e} L${.5+i8},1 M0,${.5-e} L${.5-i8},${.5-e} L${.5-i8},0 M1,${.5-e} L${.5+i8},${.5-e} L${.5+i8},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:(i8,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(i8,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(i8,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(i8,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},et={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{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}};et[""]=et[""];et[""]=et[""];function yn2(i8,e,t,n,s15,o2,r5,a){let l2=Hr[e];if(l2)return $r(i8,l2,t,n,s15,o2),!0;let u=Wr2[e];if(u)return Kr2(i8,u,t,n,s15,o2),!0;let c=Gr2[e];if(c)return Vr2(i8,c,t,n,s15,o2,a),!0;let d=et[e];return d?(Cr(i8,d,t,n,s15,o2,r5,a),!0):!1}function $r(i8,e,t,n,s15,o2){for(let r5=0;r5<e.length;r5++){let a=e[r5],l2=s15/8,u=o2/8;i8.fillRect(t+a.x*l2,n+a.y*u,a.w*l2,a.h*u)}}var xn2=new Map;function Kr2(i8,e,t,n,s15,o2){let r5=xn2.get(e);r5||(r5=new Map,xn2.set(e,r5));let a=i8.fillStyle;if(typeof a!="string")throw new Error(`Unexpected fillStyle type "${a}"`);let l2=r5.get(a);if(!l2){let u=e[0].length,c=e.length,d=i8.canvas.ownerDocument.createElement("canvas");d.width=u,d.height=c;let h2=F(d.getContext("2d")),f=new ImageData(u,c),I2,L2,M3,q2;if(a.startsWith("#"))I2=parseInt(a.slice(1,3),16),L2=parseInt(a.slice(3,5),16),M3=parseInt(a.slice(5,7),16),q2=a.length>7&&parseInt(a.slice(7,9),16)||1;else if(a.startsWith("rgba"))[I2,L2,M3,q2]=a.substring(5,a.length-1).split(",").map(S2=>parseFloat(S2));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);for(let S2=0;S2<c;S2++)for(let W=0;W<u;W++)f.data[(S2*u+W)*4]=I2,f.data[(S2*u+W)*4+1]=L2,f.data[(S2*u+W)*4+2]=M3,f.data[(S2*u+W)*4+3]=e[S2][W]*(q2*255);h2.putImageData(f,0,0),l2=F(i8.createPattern(d,null)),r5.set(a,l2)}i8.fillStyle=l2,i8.fillRect(t,n,s15,o2)}function Vr2(i8,e,t,n,s15,o2,r5){i8.strokeStyle=i8.fillStyle;for(let[a,l2]of Object.entries(e)){i8.beginPath(),i8.lineWidth=r5*Number.parseInt(a);let u;if(typeof l2=="function"){let d=.15/o2*s15;u=l2(.15,d)}else u=l2;for(let c of u.split(" ")){let d=c[0],h2=In2[d];if(!h2){console.error(`Could not find drawing instructions for "${d}"`);continue}let f=c.substring(1).split(",");!f[0]||!f[1]||h2(i8,Ln2(f,s15,o2,t,n,!0,r5))}i8.stroke(),i8.closePath()}}function Cr(i8,e,t,n,s15,o2,r5,a){let l2=new Path2D;l2.rect(t,n,s15,o2),i8.clip(l2),i8.beginPath();let u=r5/12;i8.lineWidth=a*u;for(let c of e.d.split(" ")){let d=c[0],h2=In2[d];if(!h2){console.error(`Could not find drawing instructions for "${d}"`);continue}let f=c.substring(1).split(",");!f[0]||!f[1]||h2(i8,Ln2(f,s15,o2,t,n,!1,a,(e.leftPadding??0)*(u/2),(e.rightPadding??0)*(u/2)))}e.type===1?(i8.strokeStyle=i8.fillStyle,i8.stroke()):i8.fill(),i8.closePath()}function En2(i8,e,t=0){return Math.max(Math.min(i8,e),t)}var In2={C:(i8,e)=>i8.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(i8,e)=>i8.lineTo(e[0],e[1]),M:(i8,e)=>i8.moveTo(e[0],e[1])};function Ln2(i8,e,t,n,s15,o2,r5,a=0,l2=0){let u=i8.map(c=>parseFloat(c)||parseInt(c));if(u.length<2)throw new Error("Too few arguments for instruction");for(let c=0;c<u.length;c+=2)u[c]*=e-a*r5-l2*r5,o2&&u[c]!==0&&(u[c]=En2(Math.round(u[c]+.5)-.5,e,0)),u[c]+=n+a*r5;for(let c=1;c<u.length;c+=2)u[c]*=t,o2&&u[c]!==0&&(u[c]=En2(Math.round(u[c]+.5)-.5,t,0)),u[c]+=s15;return u}var Ot=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},tt$1=class{constructor(){this._data=new Ot}set(e,t,n,s15,o2){this._data.get(e,t)||this._data.set(e,t,new Ot),this._data.get(e,t).set(n,s15,o2)}get(e,t,n,s15){var _a7;return(_a7=this._data.get(e,t))==null?void 0:_a7.get(n,s15)}clear(){this._data.clear()}},Ft=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,n=0,s15=e.timeRemaining(),o2=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),o2=e.timeRemaining(),n*1.5>o2){s15-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s15-t))}ms`),this._start();return}s15=o2}this.clear()}},gi=class extends Ft{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},xi2=class extends Ft{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},wn2=!Lt&&"requestIdleCallback"in window?xi2:gi,he$1=class i2{constructor(){this.fg=0,this.bg=0,this.extended=new it$1}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new i2;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},it$1=class i3{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new i3(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},zr2=globalThis.performance&&typeof globalThis.performance.now=="function",kt2=class i4{static create(e){return new i4(e)}constructor(e){this._now=zr2&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ee;(se2=>{se2.None=()=>B.None;function t(v3,p){return h2(v3,()=>{},0,void 0,!0,void 0,p)}se2.defer=t;function n(v3){return(p,g2=null,b2)=>{let m=!1,_2;return _2=v3(T=>{if(!m)return _2?_2.dispose():m=!0,p.call(g2,T)},null,b2),m&&_2.dispose(),_2}}se2.once=n;function s15(v3,p,g2){return c((b2,m=null,_2)=>v3(T=>b2.call(m,p(T)),null,_2),g2)}se2.map=s15;function o2(v3,p,g2){return c((b2,m=null,_2)=>v3(T=>{p(T),b2.call(m,T)},null,_2),g2)}se2.forEach=o2;function r5(v3,p,g2){return c((b2,m=null,_2)=>v3(T=>p(T)&&b2.call(m,T),null,_2),g2)}se2.filter=r5;function a(v3){return v3}se2.signal=a;function l2(...v3){return(p,g2=null,b2)=>{let m=It(...v3.map(_2=>_2(T=>p.call(g2,T))));return d(m,b2)}}se2.any=l2;function u(v3,p,g2,b2){let m=g2;return s15(v3,_2=>(m=p(m,_2),m),b2)}se2.reduce=u;function c(v3,p){let g2,b2={onWillAddFirstListener(){g2=v3(m.fire,m)},onDidRemoveLastListener(){g2==null||g2.dispose()}},m=new D2(b2);return p==null||p.add(m),m.event}function d(v3,p){return p instanceof Array?p.push(v3):p&&p.add(v3),v3}function h2(v3,p,g2=100,b2=!1,m=!1,_2,T){let x,R,$2,P=0,de2,Re2={leakWarningThreshold:_2,onWillAddFirstListener(){x=v3(ie3=>{P++,R=p(R,ie3),b2&&!$2&&(oe.fire(R),R=void 0),de2=()=>{let N2=R;R=void 0,$2=void 0,(!b2||P>1)&&oe.fire(N2),P=0},typeof g2=="number"?(clearTimeout($2),$2=setTimeout(de2,g2)):$2===void 0&&($2=0,queueMicrotask(de2))})},onWillRemoveListener(){m&&P>0&&(de2==null||de2())},onDidRemoveLastListener(){de2=void 0,x.dispose()}},oe=new D2(Re2);return T==null||T.add(oe),oe.event}se2.debounce=h2;function f(v3,p=0,g2){return se2.debounce(v3,(b2,m)=>b2?(b2.push(m),b2):[m],p,void 0,!0,void 0,g2)}se2.accumulate=f;function I2(v3,p=(b2,m)=>b2===m,g2){let b2=!0,m;return r5(v3,_2=>{let T=b2||!p(_2,m);return b2=!1,m=_2,T},g2)}se2.latch=I2;function L2(v3,p,g2){return[se2.filter(v3,p,g2),se2.filter(v3,b2=>!p(b2),g2)]}se2.split=L2;function M3(v3,p=!1,g2=[],b2){let m=g2.slice(),_2=v3(R=>{m?m.push(R):x.fire(R)});b2&&b2.add(_2);let T=()=>{m==null||m.forEach(R=>x.fire(R)),m=null},x=new D2({onWillAddFirstListener(){_2||(_2=v3(R=>x.fire(R)),b2&&b2.add(_2))},onDidAddFirstListener(){m&&(p?setTimeout(T):T())},onDidRemoveLastListener(){_2&&_2.dispose(),_2=null}});return b2&&b2.add(x),x.event}se2.buffer=M3;function q2(v3,p){return(b2,m,_2)=>{let T=p(new W);return v3(function(x){let R=T.evaluate(x);R!==S2&&b2.call(m,R)},void 0,_2)}}se2.chain=q2;let S2=Symbol("HaltChainable");class W{constructor(){this.steps=[]}map(p){return this.steps.push(p),this}forEach(p){return this.steps.push(g2=>(p(g2),g2)),this}filter(p){return this.steps.push(g2=>p(g2)?g2:S2),this}reduce(p,g2){let b2=g2;return this.steps.push(m=>(b2=p(b2,m),b2)),this}latch(p=(g2,b2)=>g2===b2){let g2=!0,b2;return this.steps.push(m=>{let _2=g2||!p(m,b2);return g2=!1,b2=m,_2?m:S2}),this}evaluate(p){for(let g2 of this.steps)if(p=g2(p),p===S2)break;return p}}function E(v3,p,g2=b2=>b2){let b2=(...x)=>T.fire(g2(...x)),m=()=>v3.on(p,b2),_2=()=>v3.removeListener(p,b2),T=new D2({onWillAddFirstListener:m,onDidRemoveLastListener:_2});return T.event}se2.fromNodeEventEmitter=E;function y(v3,p,g2=b2=>b2){let b2=(...x)=>T.fire(g2(...x)),m=()=>v3.addEventListener(p,b2),_2=()=>v3.removeEventListener(p,b2),T=new D2({onWillAddFirstListener:m,onDidRemoveLastListener:_2});return T.event}se2.fromDOMEventEmitter=y;function w2(v3){return new Promise(p=>n(v3)(p))}se2.toPromise=w2;function G2(v3){let p=new D2;return v3.then(g2=>{p.fire(g2)},()=>{p.fire(void 0)}).finally(()=>{p.dispose()}),p.event}se2.fromPromise=G2;function ue2(v3,p){return v3(g2=>p.fire(g2))}se2.forward=ue2;function Se2(v3,p,g2){return p(g2),v3(b2=>p(b2))}se2.runAndSubscribe=Se2;class ce2{constructor(p,g2){this._observable=p,this._counter=0,this._hasChanged=!1;let b2={onWillAddFirstListener:()=>{p.addObserver(this)},onDidRemoveLastListener:()=>{p.removeObserver(this)}};this.emitter=new D2(b2),g2&&g2.add(this.emitter)}beginUpdate(p){this._counter++}handlePossibleChange(p){}handleChange(p,g2){this._hasChanged=!0}endUpdate(p){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function we2(v3,p){return new ce2(v3,p).emitter.event}se2.fromObservable=we2;function A2(v3){return(p,g2,b2)=>{let m=0,_2=!1,T={beginUpdate(){m++},endUpdate(){m--,m===0&&(v3.reportChanges(),_2&&(_2=!1,p.call(g2)))},handlePossibleChange(){},handleChange(){_2=!0}};v3.addObserver(T),v3.reportChanges();let x={dispose(){v3.removeObserver(T)}};return b2 instanceof fe$1?b2.add(x):Array.isArray(b2)&&b2.push(x),x}}se2.fromObservableLight=A2})(ee||(ee={}));var We$1=class We{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${We._idPool++}`,We.all.add(this)}start(e){this._stopWatch=new kt2,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};We$1.all=new Set,We$1._idPool=0;var Ei=We$1,Mn=-1,Bt=class Bt2{constructor(e,t,n=(Bt2._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){var _a7;(_a7=this._stacks)==null||_a7.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||(this._stacks=new Map);let s15=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s15+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[o2,r5]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r5}):`;console.warn(a),console.warn(o2);let l2=new Ii(a,o2);this._errorHandler(l2)}return()=>{let o2=this._stacks.get(e.value)||0;this._stacks.set(e.value,o2-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,s15]of this._stacks)(!e||t<s15)&&(e=[n,s15],t=s15);return e}};Bt._idPool=1;var yi2=Bt,nt=class i5{constructor(e){this.value=e}static create(){let e=new Error;return new i5(e.stack??"")}print(){console.warn(this.value.split(`
54
- `).slice(2).join(`
55
- `))}},Ii=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Li=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Xr=0,Ge$1=class{constructor(e){this.value=e,this.id=Xr++}},Yr2=2,Pt2,D2=class{constructor(e){var _a7,_b,_c2,_d;this._size=0,this._options=e,this._leakageMon=(_a7=this._options)!=null&&_a7.leakWarningThreshold?new yi2((e==null?void 0:e.onListenerError)??Pe$1,((_b=this._options)==null?void 0:_b.leakWarningThreshold)??Mn):void 0,this._perfMon=(_c2=this._options)!=null&&_c2._profName?new Ei(this._options._profName):void 0,this._deliveryQueue=(_d=this._options)==null?void 0:_d.deliveryQueue}dispose(){var _a7,_b,_c2,_d;this._disposed||(this._disposed=!0,((_a7=this._deliveryQueue)==null?void 0:_a7.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(_c2=(_b=this._options)==null?void 0:_b.onDidRemoveLastListener)==null||_c2.call(_b),(_d=this._leakageMon)==null||_d.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var _a7,_b,_c2,_d,_e3;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l2=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l2);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new Li(`${l2}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(((_a7=this._options)==null?void 0:_a7.onListenerError)||Pe$1)(c),B.None}if(this._disposed)return B.None;t&&(e=e.bind(t));let s15=new Ge$1(e),o2;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s15.stack=nt.create(),o2=this._leakageMon.check(s15.stack,this._size+1)),this._listeners?this._listeners instanceof Ge$1?(this._deliveryQueue??(this._deliveryQueue=new wi),this._listeners=[this._listeners,s15]):this._listeners.push(s15):((_c2=(_b=this._options)==null?void 0:_b.onWillAddFirstListener)==null||_c2.call(_b,this),this._listeners=s15,(_e3=(_d=this._options)==null?void 0:_d.onDidAddFirstListener)==null||_e3.call(_d,this)),this._size++;let a=O(()=>{o2==null||o2(),this._removeListener(s15)});return n instanceof fe$1?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var _a7,_b,_c2,_d;if((_b=(_a7=this._options)==null?void 0:_a7.onWillRemoveListener)==null||_b.call(_a7,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(_d=(_c2=this._options)==null?void 0:_c2.onDidRemoveLastListener)==null||_d.call(_c2,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let s15=this._deliveryQueue.current===this;if(this._size*Yr2<=t.length){let o2=0;for(let r5=0;r5<t.length;r5++)t[r5]?t[o2++]=t[r5]:s15&&(this._deliveryQueue.end--,o2<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=o2}}_deliver(e,t){var _a7;if(!e)return;let n=((_a7=this._options)==null?void 0:_a7.onListenerError)||Pe$1;if(!n){e.value(t);return}try{e.value(t)}catch(s15){n(s15)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var _a7,_b,_c2,_d;if((_a7=this._deliveryQueue)!=null&&_a7.current&&(this._deliverQueue(this._deliveryQueue),(_b=this._perfMon)==null||_b.stop()),(_c2=this._perfMon)==null||_c2.start(this._size),this._listeners)if(this._listeners instanceof Ge$1)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}(_d=this._perfMon)==null||_d.stop()}hasListeners(){return this._size>0}},wi=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},An={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}},rt=2,st$1,ae=class i6{constructor(e,t,n){this._document=e,this._config=t,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new tt$1,this._cacheMapCombined=new tt$1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new he$1,this._textureSize=512,this._onAddTextureAtlasCanvas=new D2,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new D2,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Sn2(e,this._config.deviceCellWidth*4+rt*2,this._config.deviceCellHeight+rt*2),this._tmpCtx=F(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new wn2;for(let t=33;t<126;t++)e.enqueue(()=>{if(!this._cacheMap.get(t,0,0,0)){let n=this._drawToCache(t,0,0,0,!1,void 0);this._cacheMap.set(t,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(i6.maxAtlasPages&&this._pages.length>=Math.max(4,i6.maxAtlasPages)){let t=this._pages.filter(u=>u.canvas.width*2<=(i6.maxTextureSize||4096)).sort((u,c)=>c.canvas.width!==u.canvas.width?c.canvas.width-u.canvas.width:c.percentageUsed-u.percentageUsed),n=-1,s15=0;for(let u=0;u<t.length;u++)if(t[u].canvas.width!==s15)n=u,s15=t[u].canvas.width;else if(u-n===3)break;let o2=t.slice(n,n+4),r5=o2.map(u=>u.glyphs[0].texturePage).sort((u,c)=>u>c?1:-1),a=this.pages.length-o2.length,l2=this._mergePages(o2,a);l2.version++;for(let u=r5.length-1;u>=0;u--)this._deletePage(r5[u]);this.pages.push(l2),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(l2.canvas)}let e=new ot$1(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,t){let n=e[0].canvas.width*2,s15=new ot$1(this._document,n,e);for(let[o2,r5]of e.entries()){let a=o2*r5.canvas.width%n,l2=Math.floor(o2/2)*r5.canvas.height;s15.ctx.drawImage(r5.canvas,a,l2);for(let c of r5.glyphs)c.texturePage=t,c.sizeClipSpace.x=c.size.x/n,c.sizeClipSpace.y=c.size.y/n,c.texturePosition.x+=a,c.texturePosition.y+=l2,c.texturePositionClipSpace.x=c.texturePosition.x/n,c.texturePositionClipSpace.y=c.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(r5.canvas);let u=this._activePages.indexOf(r5);u!==-1&&this._activePages.splice(u,1)}return s15}_deletePage(e){this._pages.splice(e,1);for(let t=e;t<this._pages.length;t++){let n=this._pages[t];for(let s15 of n.glyphs)s15.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,t,n,s15,o2,r5){return this._getFromCacheMap(this._cacheMapCombined,e,t,n,s15,o2,r5)}getRasterizedGlyph(e,t,n,s15,o2,r5){return this._getFromCacheMap(this._cacheMap,e,t,n,s15,o2,r5)}_getFromCacheMap(e,t,n,s15,o2,r5,a){return st$1=e.get(t,n,s15,o2),st$1||(st$1=this._drawToCache(t,n,s15,o2,r5,a),e.set(t,n,s15,o2,st$1)),st$1}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,n,s15){if(this._config.allowTransparency)return Z;let o2;switch(e){case 16777216:case 33554432:o2=this._getColorFromAnsiIndex(t);break;case 50331648:let r5=he$1.toColorRGB(t);o2=X.toColor(r5[0],r5[1],r5[2]);break;case 0:default:n?o2=Ue.opaque(this._config.colors.foreground):o2=this._config.colors.background;break}return this._config.allowTransparency||(o2=Ue.opaque(o2)),o2}_getForegroundColor(e,t,n,s15,o2,r5,a,l2,u,c){let d=this._getMinimumContrastColor(e,t,n,s15,o2,r5,a,u,l2,c);if(d)return d;let h2;switch(o2){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&u&&r5<8&&(r5+=8),h2=this._getColorFromAnsiIndex(r5);break;case 50331648:let f=he$1.toColorRGB(r5);h2=X.toColor(f[0],f[1],f[2]);break;case 0:default:a?h2=this._config.colors.background:h2=this._config.colors.foreground}return this._config.allowTransparency&&(h2=Ue.opaque(h2)),l2&&(h2=Ue.multiplyOpacity(h2,gn2)),h2}_resolveBackgroundRgba(e,t,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;case 0:default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,n,s15){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s15&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;case 0:default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,n,s15,o2,r5,a,l2,u,c){if(this._config.minimumContrastRatio===1||c)return;let d=this._getContrastCache(u),h2=d.getColor(e,s15);if(h2!==void 0)return h2||void 0;let f=this._resolveBackgroundRgba(t,n,a),I2=this._resolveForegroundRgba(o2,r5,a,l2),L2=Te$1.ensureContrastRatio(f,I2,this._config.minimumContrastRatio/(u?2:1));if(!L2){d.setColor(e,s15,null);return}let M3=X.toColor(L2>>24&255,L2>>16&255,L2>>8&255);return d.setColor(e,s15,M3),M3}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,t,n,s15,o2,r5){let a=typeof e=="number"?String.fromCharCode(e):e;r5&&this._tmpCanvas.parentElement!==r5&&(this._tmpCanvas.style.display="none",r5.append(this._tmpCanvas));let l2=Math.min(this._config.deviceCellWidth*Math.max(a.length,2)+rt*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<l2&&(this._tmpCanvas.width=l2);let u=Math.min(this._config.deviceCellHeight+rt*4,this._textureSize);if(this._tmpCanvas.height<u&&(this._tmpCanvas.height=u),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=t,this._workAttributeData.extended.ext=s15,!!this._workAttributeData.isInvisible())return An;let d=!!this._workAttributeData.isBold(),h2=!!this._workAttributeData.isInverse(),f=!!this._workAttributeData.isDim(),I2=!!this._workAttributeData.isItalic(),L2=!!this._workAttributeData.isUnderline(),M3=!!this._workAttributeData.isStrikethrough(),q2=!!this._workAttributeData.isOverline(),S2=this._workAttributeData.getFgColor(),W=this._workAttributeData.getFgColorMode(),E=this._workAttributeData.getBgColor(),y=this._workAttributeData.getBgColorMode();if(h2){let x=S2;S2=E,E=x;let R=W;W=y,y=R}let w2=this._getBackgroundColor(y,E,h2,f);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=w2.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let G2=d?this._config.fontWeightBold:this._config.fontWeight,ue2=I2?"italic":"";this._tmpCtx.font=`${ue2} ${G2} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=St;let Se2=a.length===1&&Rt(a.charCodeAt(0)),ce2=a.length===1&&fn2(a.charCodeAt(0)),we2=this._getForegroundColor(t,y,E,n,W,S2,h2,f,d,Dt(a.charCodeAt(0)));this._tmpCtx.fillStyle=we2.css;let A2=ce2?0:rt*2,se2=!1;this._config.customGlyphs!==!1&&(se2=yn2(this._tmpCtx,a,A2,A2,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let v3=!Se2,p;if(typeof e=="number"?p=this._unicodeService.wcwidth(e):p=this._unicodeService.getStringCellWidth(e),L2){this._tmpCtx.save();let x=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),R=x%2===1?.5:0;if(this._tmpCtx.lineWidth=x,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())v3=!1,this._tmpCtx.strokeStyle=`rgb(${he$1.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{v3=!1;let ie3=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ie3<8&&(ie3+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ie3).css}this._tmpCtx.beginPath();let $2=A2,P=Math.ceil(A2+this._config.deviceCharHeight)-R-(o2?x*2:0),de2=P+x,Re2=P+x*2,oe=this._workAttributeData.getUnderlineVariantOffset();for(let ie3=0;ie3<p;ie3++){this._tmpCtx.save();let N2=$2+ie3*this._config.deviceCellWidth,ne2=$2+(ie3+1)*this._config.deviceCellWidth,di=N2+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(N2,P),this._tmpCtx.lineTo(ne2,P),this._tmpCtx.moveTo(N2,Re2),this._tmpCtx.lineTo(ne2,Re2);break;case 3:let ft2=x<=1?Re2:Math.ceil(A2+this._config.deviceCharHeight-x/2)-R,mt2=x<=1?P:Math.ceil(A2+this._config.deviceCharHeight+x/2)-R,qi2=new Path2D;qi2.rect(N2,P,this._config.deviceCellWidth,Re2-P),this._tmpCtx.clip(qi2),this._tmpCtx.moveTo(N2-this._config.deviceCellWidth/2,de2),this._tmpCtx.bezierCurveTo(N2-this._config.deviceCellWidth/2,mt2,N2,mt2,N2,de2),this._tmpCtx.bezierCurveTo(N2,ft2,di,ft2,di,de2),this._tmpCtx.bezierCurveTo(di,mt2,ne2,mt2,ne2,de2),this._tmpCtx.bezierCurveTo(ne2,ft2,ne2+this._config.deviceCellWidth/2,ft2,ne2+this._config.deviceCellWidth/2,de2);break;case 4:let _t2=oe===0?0:oe>=x?x*2-oe:x-oe;oe>=x||_t2===0?(this._tmpCtx.setLineDash([Math.round(x),Math.round(x)]),this._tmpCtx.moveTo(N2+_t2,P),this._tmpCtx.lineTo(ne2,P)):(this._tmpCtx.setLineDash([Math.round(x),Math.round(x)]),this._tmpCtx.moveTo(N2,P),this._tmpCtx.lineTo(N2+_t2,P),this._tmpCtx.moveTo(N2+_t2+x,P),this._tmpCtx.lineTo(ne2,P)),oe=bn2(ne2-N2,x,oe);break;case 5:let Er=.6,yr2=.3,hi2=ne2-N2,ji2=Math.floor(Er*hi2),Xi2=Math.floor(yr2*hi2),Ir2=hi2-ji2-Xi2;this._tmpCtx.setLineDash([ji2,Xi2,Ir2]),this._tmpCtx.moveTo(N2,P),this._tmpCtx.lineTo(ne2,P);break;case 1:default:this._tmpCtx.moveTo(N2,P),this._tmpCtx.lineTo(ne2,P);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!se2&&this._config.fontSize>=12&&!this._config.allowTransparency&&a!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let ie3=this._tmpCtx.measureText(a);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ie3&&ie3.actualBoundingBoxDescent>0){this._tmpCtx.save();let N2=new Path2D;N2.rect($2,P-Math.ceil(x/2),this._config.deviceCellWidth*p,Re2-P+Math.ceil(x/2)),this._tmpCtx.clip(N2),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=w2.css,this._tmpCtx.strokeText(a,A2,A2+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(q2){let x=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),R=x%2===1?.5:0;this._tmpCtx.lineWidth=x,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(A2,A2+R),this._tmpCtx.lineTo(A2+this._config.deviceCharWidth*p,A2+R),this._tmpCtx.stroke()}if(se2||this._tmpCtx.fillText(a,A2,A2+this._config.deviceCharHeight),a==="_"&&!this._config.allowTransparency){let x=Di2(this._tmpCtx.getImageData(A2,A2,this._config.deviceCellWidth,this._config.deviceCellHeight),w2,we2,v3);if(x)for(let R=1;R<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=w2.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(a,A2,A2+this._config.deviceCharHeight-R),x=Di2(this._tmpCtx.getImageData(A2,A2,this._config.deviceCellWidth,this._config.deviceCellHeight),w2,we2,v3),!!x);R++);}if(M3){let x=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),R=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=x,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(A2,A2+Math.floor(this._config.deviceCharHeight/2)-R),this._tmpCtx.lineTo(A2+this._config.deviceCharWidth*p,A2+Math.floor(this._config.deviceCharHeight/2)-R),this._tmpCtx.stroke()}this._tmpCtx.restore();let g2=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),b2;if(this._config.allowTransparency?b2=Jr2(g2):b2=Di2(g2,w2,we2,v3),b2)return An;let m=this._findGlyphBoundingBox(g2,this._workBoundingBox,l2,ce2,se2,A2),_2,T;for(;;){if(this._activePages.length===0){let x=this._createNewPage();_2=x,T=x.currentRow,T.height=m.size.y;break}_2=this._activePages[this._activePages.length-1],T=_2.currentRow;for(let x of this._activePages)m.size.y<=x.currentRow.height&&(_2=x,T=x.currentRow);for(let x=this._activePages.length-1;x>=0;x--)for(let R of this._activePages[x].fixedRows)R.height<=T.height&&m.size.y<=R.height&&(_2=this._activePages[x],T=R);if(m.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new ot$1(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),_2=this._overflowSizePage,T=this._overflowSizePage.currentRow,T.x+m.size.x>=_2.canvas.width&&(T.x=0,T.y+=T.height,T.height=0);break}if(T.y+m.size.y>=_2.canvas.height||T.height>m.size.y+2){let x=!1;if(_2.currentRow.y+_2.currentRow.height+m.size.y>=_2.canvas.height){let R;for(let $2 of this._activePages)if($2.currentRow.y+$2.currentRow.height+m.size.y<$2.canvas.height){R=$2;break}if(R)_2=R;else if(i6.maxAtlasPages&&this._pages.length>=i6.maxAtlasPages&&T.y+m.size.y<=_2.canvas.height&&T.height>=m.size.y&&T.x+m.size.x<=_2.canvas.width)x=!0;else{let $2=this._createNewPage();_2=$2,T=$2.currentRow,T.height=m.size.y,x=!0}}x||(_2.currentRow.height>0&&_2.fixedRows.push(_2.currentRow),T={x:0,y:_2.currentRow.y+_2.currentRow.height,height:m.size.y},_2.fixedRows.push(T),_2.currentRow={x:0,y:T.y+T.height,height:0})}if(T.x+m.size.x<=_2.canvas.width)break;T===_2.currentRow?(T.x=0,T.y+=T.height,T.height=0):_2.fixedRows.splice(_2.fixedRows.indexOf(T),1)}return m.texturePage=this._pages.indexOf(_2),m.texturePosition.x=T.x,m.texturePosition.y=T.y,m.texturePositionClipSpace.x=T.x/_2.canvas.width,m.texturePositionClipSpace.y=T.y/_2.canvas.height,m.sizeClipSpace.x/=_2.canvas.width,m.sizeClipSpace.y/=_2.canvas.height,T.height=Math.max(T.height,m.size.y),T.x+=m.size.x,_2.ctx.putImageData(g2,m.texturePosition.x-this._workBoundingBox.left,m.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,m.size.x,m.size.y),_2.addGlyph(m),_2.version++,m}_findGlyphBoundingBox(e,t,n,s15,o2,r5){t.top=0;let a=s15?this._config.deviceCellHeight:this._tmpCanvas.height,l2=s15?this._config.deviceCellWidth:n,u=!1;for(let c=0;c<a;c++){for(let d=0;d<l2;d++){let h2=c*this._tmpCanvas.width*4+d*4+3;if(e.data[h2]!==0){t.top=c,u=!0;break}}if(u)break}t.left=0,u=!1;for(let c=0;c<r5+l2;c++){for(let d=0;d<a;d++){let h2=d*this._tmpCanvas.width*4+c*4+3;if(e.data[h2]!==0){t.left=c,u=!0;break}}if(u)break}t.right=l2,u=!1;for(let c=r5+l2-1;c>=r5;c--){for(let d=0;d<a;d++){let h2=d*this._tmpCanvas.width*4+c*4+3;if(e.data[h2]!==0){t.right=c,u=!0;break}}if(u)break}t.bottom=a,u=!1;for(let c=a-1;c>=0;c--){for(let d=0;d<l2;d++){let h2=c*this._tmpCanvas.width*4+d*4+3;if(e.data[h2]!==0){t.bottom=c,u=!0;break}}if(u)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:t.right-t.left+1,y:t.bottom-t.top+1},sizeClipSpace:{x:t.right-t.left+1,y:t.bottom-t.top+1},offset:{x:-t.left+r5+(s15||o2?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-t.top+r5+(s15||o2?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},ot$1=class{constructor(e,t,n){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],n)for(let s15 of n)this._glyphs.push(...s15.glyphs),this._usedPixels+=s15._usedPixels;this.canvas=Sn2(e,t,t),this.ctx=F(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}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 Di2(i8,e,t,n){let s15=e.rgba>>>24,o2=e.rgba>>>16&255,r5=e.rgba>>>8&255,a=t.rgba>>>24,l2=t.rgba>>>16&255,u=t.rgba>>>8&255,c=Math.floor((Math.abs(s15-a)+Math.abs(o2-l2)+Math.abs(r5-u))/12),d=!0;for(let h2=0;h2<i8.data.length;h2+=4)i8.data[h2]===s15&&i8.data[h2+1]===o2&&i8.data[h2+2]===r5||n&&Math.abs(i8.data[h2]-s15)+Math.abs(i8.data[h2+1]-o2)+Math.abs(i8.data[h2+2]-r5)<c?i8.data[h2+3]=0:d=!1;return d}function Jr2(i8){for(let e=0;e<i8.data.length;e+=4)if(i8.data[e+3]>0)return!1;return!0}function Sn2(i8,e,t){let n=i8.createElement("canvas");return n.width=e,n.height=t,n}function On(i8,e,t,n,s15,o2,r5,a){let l2={foreground:o2.foreground,background:o2.background,cursor:Z,cursorAccent:Z,selectionForeground:Z,selectionBackgroundTransparent:Z,selectionBackgroundOpaque:Z,selectionInactiveBackgroundTransparent:Z,selectionInactiveBackgroundOpaque:Z,overviewRulerBorder:Z,scrollbarSliderBackground:Z,scrollbarSliderHoverBackground:Z,scrollbarSliderActiveBackground:Z,ansi:o2.ansi.slice(),contrastCache:o2.contrastCache,halfContrastCache:o2.halfContrastCache};return{customGlyphs:s15.customGlyphs,devicePixelRatio:r5,deviceMaxTextureSize:a,letterSpacing:s15.letterSpacing,lineHeight:s15.lineHeight,deviceCellWidth:i8,deviceCellHeight:e,deviceCharWidth:t,deviceCharHeight:n,fontFamily:s15.fontFamily,fontSize:s15.fontSize,fontWeight:s15.fontWeight,fontWeightBold:s15.fontWeightBold,allowTransparency:s15.allowTransparency,drawBoldTextInBrightColors:s15.drawBoldTextInBrightColors,minimumContrastRatio:s15.minimumContrastRatio,colors:l2}}function Mi(i8,e){for(let t=0;t<i8.colors.ansi.length;t++)if(i8.colors.ansi[t].rgba!==e.colors.ansi[t].rgba)return!1;return i8.devicePixelRatio===e.devicePixelRatio&&i8.customGlyphs===e.customGlyphs&&i8.lineHeight===e.lineHeight&&i8.letterSpacing===e.letterSpacing&&i8.fontFamily===e.fontFamily&&i8.fontSize===e.fontSize&&i8.fontWeight===e.fontWeight&&i8.fontWeightBold===e.fontWeightBold&&i8.allowTransparency===e.allowTransparency&&i8.deviceCharWidth===e.deviceCharWidth&&i8.deviceCharHeight===e.deviceCharHeight&&i8.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&i8.minimumContrastRatio===e.minimumContrastRatio&&i8.colors.foreground.rgba===e.colors.foreground.rgba&&i8.colors.background.rgba===e.colors.background.rgba}function Fn(i8){return(i8&50331648)===16777216||(i8&50331648)===33554432}var le=[];function Nt(i8,e,t,n,s15,o2,r5,a,l2){let u=On(n,s15,o2,r5,e,t,a,l2);for(let h2=0;h2<le.length;h2++){let f=le[h2],I2=f.ownedBy.indexOf(i8);if(I2>=0){if(Mi(f.config,u))return f.atlas;f.ownedBy.length===1?(f.atlas.dispose(),le.splice(h2,1)):f.ownedBy.splice(I2,1);break}}for(let h2=0;h2<le.length;h2++){let f=le[h2];if(Mi(f.config,u))return f.ownedBy.push(i8),f.atlas}let c=i8._core,d={atlas:new ae(document,u,c.unicodeService),config:u,ownedBy:[i8]};return le.push(d),d.atlas}function Ai(i8){for(let e=0;e<le.length;e++){let t=le[e].ownedBy.indexOf(i8);if(t!==-1){le[e].ownedBy.length===1?(le[e].atlas.dispose(),le.splice(e,1)):le[e].ownedBy.splice(t,1);break}}}var Ut2=600,Ht=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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(e=Ut2){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=Ut2-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=Ut2-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Ut2)},e)}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()}};function Si(i8,e,t){let n=new e.ResizeObserver(s15=>{let o2=s15.find(l2=>l2.target===i8);if(!o2)return;if(!("devicePixelContentBoxSize"in o2)){n==null||n.disconnect(),n=void 0;return}let r5=o2.devicePixelContentBoxSize[0].inlineSize,a=o2.devicePixelContentBoxSize[0].blockSize;r5>0&&a>0&&t(r5,a)});try{n.observe(i8,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return O(()=>n==null?void 0:n.disconnect())}function kn(i8){return i8>65535?(i8-=65536,String.fromCharCode((i8>>10)+55296)+String.fromCharCode(i8%1024+56320)):String.fromCharCode(i8)}var at=class i7 extends he$1{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new it$1,this.combinedData=""}static fromCharData(t){let n=new i7;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?kn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let s15=t[1].charCodeAt(0);if(55296<=s15&&s15<=56319){let o2=t[1].charCodeAt(1);56320<=o2&&o2<=57343?this.content=(s15-55296)*1024+o2-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Gt2=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function $t2(i8,e,t){let n=F(i8.createProgram());if(i8.attachShader(n,F(Pn(i8,i8.VERTEX_SHADER,e))),i8.attachShader(n,F(Pn(i8,i8.FRAGMENT_SHADER,t))),i8.linkProgram(n),i8.getProgramParameter(n,i8.LINK_STATUS))return n;console.error(i8.getProgramInfoLog(n)),i8.deleteProgram(n)}function Pn(i8,e,t){let n=F(i8.createShader(e));if(i8.shaderSource(n,t),i8.compileShader(n),i8.getShaderParameter(n,i8.COMPILE_STATUS))return n;console.error(i8.getShaderInfoLog(n)),i8.deleteShader(n)}function Bn(i8,e){let t=Math.min(i8.length*2,e),n=new Float32Array(t);for(let s15=0;s15<i8.length;s15++)n[s15]=i8[s15];return n}var Wt2=class{constructor(e){this.texture=e,this.version=-1}},is=`#version 300 es
56
- layout (location = 0) in vec2 a_unitquad;
57
- layout (location = 1) in vec2 a_cellpos;
58
- layout (location = 2) in vec2 a_offset;
59
- layout (location = 3) in vec2 a_size;
60
- layout (location = 4) in float a_texpage;
61
- layout (location = 5) in vec2 a_texcoord;
62
- layout (location = 6) in vec2 a_texsize;
63
-
64
- uniform mat4 u_projection;
65
- uniform vec2 u_resolution;
66
-
67
- out vec2 v_texcoord;
68
- flat out int v_texpage;
69
-
70
- void main() {
71
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
72
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
73
- v_texpage = int(a_texpage);
74
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
75
- }`;function ns(i8){let e="";for(let t=1;t<i8;t++)e+=` else if (v_texpage == ${t}) { outColor = texture(u_texture[${t}], v_texcoord); }`;return`#version 300 es
76
- precision lowp float;
77
-
78
- in vec2 v_texcoord;
79
- flat in int v_texpage;
80
-
81
- uniform sampler2D u_texture[${i8}];
82
-
83
- out vec4 outColor;
84
-
85
- void main() {
86
- if (v_texpage == 0) {
87
- outColor = texture(u_texture[0], v_texcoord);
88
- } ${e}
89
- }`}var De$1=11,Ve=De$1*Float32Array.BYTES_PER_ELEMENT,rs=2,H$1=0,k$1,Fi=0,lt$1=0,Kt=class extends B{constructor(t,n,s15,o2){super(),this._terminal=t,this._gl=n,this._dimensions=s15,this._optionsService=o2,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r5=this._gl;ae.maxAtlasPages===void 0&&(ae.maxAtlasPages=Math.min(32,F(r5.getParameter(r5.MAX_TEXTURE_IMAGE_UNITS))),ae.maxTextureSize=F(r5.getParameter(r5.MAX_TEXTURE_SIZE))),this._program=F($t2(r5,is,ns(ae.maxAtlasPages))),this._register(O(()=>r5.deleteProgram(this._program))),this._projectionLocation=F(r5.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=F(r5.getUniformLocation(this._program,"u_resolution")),this._textureLocation=F(r5.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r5.createVertexArray(),r5.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),l2=r5.createBuffer();this._register(O(()=>r5.deleteBuffer(l2))),r5.bindBuffer(r5.ARRAY_BUFFER,l2),r5.bufferData(r5.ARRAY_BUFFER,a,r5.STATIC_DRAW),r5.enableVertexAttribArray(0),r5.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let u=new Uint8Array([0,1,2,3]),c=r5.createBuffer();this._register(O(()=>r5.deleteBuffer(c))),r5.bindBuffer(r5.ELEMENT_ARRAY_BUFFER,c),r5.bufferData(r5.ELEMENT_ARRAY_BUFFER,u,r5.STATIC_DRAW),this._attributesBuffer=F(r5.createBuffer()),this._register(O(()=>r5.deleteBuffer(this._attributesBuffer))),r5.bindBuffer(r5.ARRAY_BUFFER,this._attributesBuffer),r5.enableVertexAttribArray(2),r5.vertexAttribPointer(2,2,r5.FLOAT,!1,Ve,0),r5.vertexAttribDivisor(2,1),r5.enableVertexAttribArray(3),r5.vertexAttribPointer(3,2,r5.FLOAT,!1,Ve,2*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(3,1),r5.enableVertexAttribArray(4),r5.vertexAttribPointer(4,1,r5.FLOAT,!1,Ve,4*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(4,1),r5.enableVertexAttribArray(5),r5.vertexAttribPointer(5,2,r5.FLOAT,!1,Ve,5*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(5,1),r5.enableVertexAttribArray(6),r5.vertexAttribPointer(6,2,r5.FLOAT,!1,Ve,7*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(6,1),r5.enableVertexAttribArray(1),r5.vertexAttribPointer(1,2,r5.FLOAT,!1,Ve,9*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(1,1),r5.useProgram(this._program);let d=new Int32Array(ae.maxAtlasPages);for(let h2=0;h2<ae.maxAtlasPages;h2++)d[h2]=h2;r5.uniform1iv(this._textureLocation,d),r5.uniformMatrix4fv(this._projectionLocation,!1,Gt2),this._atlasTextures=[];for(let h2=0;h2<ae.maxAtlasPages;h2++){let f=new Wt2(F(r5.createTexture()));this._register(O(()=>r5.deleteTexture(f.texture))),r5.activeTexture(r5.TEXTURE0+h2),r5.bindTexture(r5.TEXTURE_2D,f.texture),r5.texParameteri(r5.TEXTURE_2D,r5.TEXTURE_WRAP_S,r5.CLAMP_TO_EDGE),r5.texParameteri(r5.TEXTURE_2D,r5.TEXTURE_WRAP_T,r5.CLAMP_TO_EDGE),r5.texImage2D(r5.TEXTURE_2D,0,r5.RGBA,1,1,0,r5.RGBA,r5.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[h2]=f}r5.enable(r5.BLEND),r5.blendFunc(r5.SRC_ALPHA,r5.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,n,s15,o2,r5,a,l2,u,c){this._updateCell(this._vertices.attributes,t,n,s15,o2,r5,a,l2,u,c)}_updateCell(t,n,s15,o2,r5,a,l2,u,c,d){if(H$1=(s15*this._terminal.cols+n)*De$1,o2===0||o2===void 0){t.fill(0,H$1,H$1+De$1-1-rs);return}this._atlas&&(u&&u.length>1?k$1=this._atlas.getRasterizedGlyphCombinedChar(u,r5,a,l2,!1,this._terminal.element):k$1=this._atlas.getRasterizedGlyph(o2,r5,a,l2,!1,this._terminal.element),Fi=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r5!==d&&k$1.offset.x>Fi?(lt$1=k$1.offset.x-Fi,t[H$1]=-(k$1.offset.x-lt$1)+this._dimensions.device.char.left,t[H$1+1]=-k$1.offset.y+this._dimensions.device.char.top,t[H$1+2]=(k$1.size.x-lt$1)/this._dimensions.device.canvas.width,t[H$1+3]=k$1.size.y/this._dimensions.device.canvas.height,t[H$1+4]=k$1.texturePage,t[H$1+5]=k$1.texturePositionClipSpace.x+lt$1/this._atlas.pages[k$1.texturePage].canvas.width,t[H$1+6]=k$1.texturePositionClipSpace.y,t[H$1+7]=k$1.sizeClipSpace.x-lt$1/this._atlas.pages[k$1.texturePage].canvas.width,t[H$1+8]=k$1.sizeClipSpace.y):(t[H$1]=-k$1.offset.x+this._dimensions.device.char.left,t[H$1+1]=-k$1.offset.y+this._dimensions.device.char.top,t[H$1+2]=k$1.size.x/this._dimensions.device.canvas.width,t[H$1+3]=k$1.size.y/this._dimensions.device.canvas.height,t[H$1+4]=k$1.texturePage,t[H$1+5]=k$1.texturePositionClipSpace.x,t[H$1+6]=k$1.texturePositionClipSpace.y,t[H$1+7]=k$1.sizeClipSpace.x,t[H$1+8]=k$1.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&mn2(o2,c,k$1.size.x,this._dimensions.device.cell.width)&&(t[H$1+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,n=t.cols*t.rows*De$1;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let s15=0;for(;s15<this._vertices.attributesBuffers.length;s15++)this._vertices.count!==n?this._vertices.attributesBuffers[s15]=new Float32Array(n):this._vertices.attributesBuffers[s15].fill(0);this._vertices.count=n,s15=0;for(let o2=0;o2<t.rows;o2++)for(let r5=0;r5<t.cols;r5++)this._vertices.attributes[s15+9]=r5/t.cols,this._vertices.attributes[s15+10]=o2/t.rows,s15+=De$1}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let s15=this._vertices.attributesBuffers[this._activeBuffer],o2=0;for(let r5=0;r5<t.lineLengths.length;r5++){let a=r5*this._terminal.cols*De$1,l2=this._vertices.attributes.subarray(a,a+t.lineLengths[r5]*De$1);s15.set(l2,o2),o2+=l2.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,s15.subarray(0,o2),n.STREAM_DRAW);for(let r5=0;r5<this._atlas.pages.length;r5++)this._atlas.pages[r5].version!==this._atlasTextures[r5].version&&this._bindAtlasPageTexture(n,this._atlas,r5);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,o2/De$1)}setAtlas(t){this._atlas=t;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(t,n,s15){t.activeTexture(t.TEXTURE0+s15),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[s15].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n.pages[s15].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[s15].version=n.pages[s15].version}setDimensions(t){this._dimensions=t}},ki=class{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(e,t,n,s15=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let o2=e.buffers.active.ydisp,r5=t[1]-o2,a=n[1]-o2,l2=Math.max(r5,0),u=Math.min(a,e.rows-1);if(l2>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s15,this.viewportStartRow=r5,this.viewportEndRow=a,this.viewportCappedStartRow=l2,this.viewportCappedEndRow=u,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function Nn(){return new ki}var Ce=4,ze=1,qe$1=2,Ct2=3,Un=2147483648,Vt2=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Nn()}resize(e,t){let n=e*t*Ce;n!==this.cells.length&&(this.cells=new Uint32Array(n),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},ss2=`#version 300 es
90
- layout (location = 0) in vec2 a_position;
91
- layout (location = 1) in vec2 a_size;
92
- layout (location = 2) in vec4 a_color;
93
- layout (location = 3) in vec2 a_unitquad;
94
-
95
- uniform mat4 u_projection;
96
-
97
- out vec4 v_color;
98
-
99
- void main() {
100
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
101
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
102
- v_color = a_color;
103
- }`,os=`#version 300 es
104
- precision lowp float;
105
-
106
- in vec4 v_color;
107
-
108
- out vec4 outColor;
109
-
110
- void main() {
111
- outColor = v_color;
112
- }`,Ee$1=8,Pi=Ee$1*Float32Array.BYTES_PER_ELEMENT,as=20*Ee$1,zt2=class{constructor(){this.attributes=new Float32Array(as),this.count=0}},xe=0,Hn=0,Wn2=0,Gn=0,$n=0,Kn=0,Vn=0,qt=class extends B{constructor(t,n,s15,o2){super(),this._terminal=t,this._gl=n,this._dimensions=s15,this._themeService=o2,this._vertices=new zt2,this._verticesCursor=new zt2;let r5=this._gl;this._program=F($t2(r5,ss2,os)),this._register(O(()=>r5.deleteProgram(this._program))),this._projectionLocation=F(r5.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r5.createVertexArray(),r5.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),l2=r5.createBuffer();this._register(O(()=>r5.deleteBuffer(l2))),r5.bindBuffer(r5.ARRAY_BUFFER,l2),r5.bufferData(r5.ARRAY_BUFFER,a,r5.STATIC_DRAW),r5.enableVertexAttribArray(3),r5.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let u=new Uint8Array([0,1,2,3]),c=r5.createBuffer();this._register(O(()=>r5.deleteBuffer(c))),r5.bindBuffer(r5.ELEMENT_ARRAY_BUFFER,c),r5.bufferData(r5.ELEMENT_ARRAY_BUFFER,u,r5.STATIC_DRAW),this._attributesBuffer=F(r5.createBuffer()),this._register(O(()=>r5.deleteBuffer(this._attributesBuffer))),r5.bindBuffer(r5.ARRAY_BUFFER,this._attributesBuffer),r5.enableVertexAttribArray(0),r5.vertexAttribPointer(0,2,r5.FLOAT,!1,Pi,0),r5.vertexAttribDivisor(0,1),r5.enableVertexAttribArray(1),r5.vertexAttribPointer(1,2,r5.FLOAT,!1,Pi,2*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(1,1),r5.enableVertexAttribArray(2),r5.vertexAttribPointer(2,4,r5.FLOAT,!1,Pi,4*Float32Array.BYTES_PER_ELEMENT),r5.vertexAttribDivisor(2,1),this._updateCachedColors(o2.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,Gt2),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,t.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let n=this._terminal,s15=this._vertices,o2=1,r5,a,l2,u,c,d,h2,f,I2,L2,M3;for(r5=0;r5<n.rows;r5++){for(l2=-1,u=0,c=0,d=!1,a=0;a<n.cols;a++)h2=(r5*n.cols+a)*Ce,f=t.cells[h2+ze],I2=t.cells[h2+qe$1],L2=!!(I2&67108864),(f!==u||I2!==c&&(d||L2))&&((u!==0||d&&c!==0)&&(M3=o2++*Ee$1,this._updateRectangle(s15,M3,c,u,l2,a,r5)),l2=a,u=f,c=I2,d=L2);(u!==0||d&&c!==0)&&(M3=o2++*Ee$1,this._updateRectangle(s15,M3,c,u,l2,n.cols,r5))}s15.count=o2}updateCursor(t){let n=this._verticesCursor,s15=t.cursor;if(!s15||s15.style==="block"){n.count=0;return}let o2,r5=0;(s15.style==="bar"||s15.style==="outline")&&(o2=r5++*Ee$1,this._addRectangleFloat(n.attributes,o2,s15.x*this._dimensions.device.cell.width,s15.y*this._dimensions.device.cell.height,s15.style==="bar"?s15.dpr*s15.cursorWidth:s15.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(s15.style==="underline"||s15.style==="outline")&&(o2=r5++*Ee$1,this._addRectangleFloat(n.attributes,o2,s15.x*this._dimensions.device.cell.width,(s15.y+1)*this._dimensions.device.cell.height-s15.dpr,s15.width*this._dimensions.device.cell.width,s15.dpr,this._cursorFloat)),s15.style==="outline"&&(o2=r5++*Ee$1,this._addRectangleFloat(n.attributes,o2,s15.x*this._dimensions.device.cell.width,s15.y*this._dimensions.device.cell.height,s15.width*this._dimensions.device.cell.width,s15.dpr,this._cursorFloat),o2=r5++*Ee$1,this._addRectangleFloat(n.attributes,o2,(s15.x+s15.width)*this._dimensions.device.cell.width-s15.dpr,s15.y*this._dimensions.device.cell.height,s15.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=r5}_updateRectangle(t,n,s15,o2,r5,a,l2){if(s15&67108864)switch(s15&50331648){case 16777216:case 33554432:xe=this._themeService.colors.ansi[s15&255].rgba;break;case 50331648:xe=(s15&16777215)<<8;break;case 0:default:xe=this._themeService.colors.foreground.rgba}else switch(o2&50331648){case 16777216:case 33554432:xe=this._themeService.colors.ansi[o2&255].rgba;break;case 50331648:xe=(o2&16777215)<<8;break;case 0:default:xe=this._themeService.colors.background.rgba}t.attributes.length<n+4&&(t.attributes=Bn(t.attributes,this._terminal.rows*this._terminal.cols*Ee$1)),Hn=r5*this._dimensions.device.cell.width,Wn2=l2*this._dimensions.device.cell.height,Gn=(xe>>24&255)/255,$n=(xe>>16&255)/255,Kn=(xe>>8&255)/255,Vn=1,this._addRectangle(t.attributes,n,Hn,Wn2,(a-r5)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Gn,$n,Kn,Vn)}_addRectangle(t,n,s15,o2,r5,a,l2,u,c,d){t[n]=s15/this._dimensions.device.canvas.width,t[n+1]=o2/this._dimensions.device.canvas.height,t[n+2]=r5/this._dimensions.device.canvas.width,t[n+3]=a/this._dimensions.device.canvas.height,t[n+4]=l2,t[n+5]=u,t[n+6]=c,t[n+7]=d}_addRectangleFloat(t,n,s15,o2,r5,a,l2){t[n]=s15/this._dimensions.device.canvas.width,t[n+1]=o2/this._dimensions.device.canvas.height,t[n+2]=r5/this._dimensions.device.canvas.width,t[n+3]=a/this._dimensions.device.canvas.height,t[n+4]=l2[0],t[n+5]=l2[1],t[n+6]=l2[2],t[n+7]=l2[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},jt2=class extends B{constructor(t,n,s15,o2,r5,a,l2,u){super(),this._container=n,this._alpha=r5,this._coreBrowserService=a,this._optionsService=l2,this._themeService=u,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${s15}-layer`),this._canvas.style.zIndex=o2.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(c=>{this._refreshCharAtlas(t,c),this.reset(t)})),this._register(O(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=F(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,n,s15){}handleSelectionChanged(t,n,s15,o2=!1){}_setTransparency(t,n){if(n===this._alpha)return;let s15=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,s15),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Nt(t,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,n,s15=1){this._ctx.fillRect(t*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,s15*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,n,s15,o2){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,n*this._deviceCellHeight,s15*this._deviceCellWidth,o2*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,n*this._deviceCellHeight,s15*this._deviceCellWidth,o2*this._deviceCellHeight))}_fillCharTrueColor(t,n,s15,o2){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=St,this._clipCell(s15,o2,n.getWidth()),this._ctx.fillText(n.getChars(),s15*this._deviceCellWidth+this._deviceCharLeft,o2*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,n,s15){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,n*this._deviceCellHeight,s15*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,n,s15){let o2=n?t.options.fontWeightBold:t.options.fontWeight;return`${s15?"italic":""} ${o2} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Xt2=class extends jt2{constructor(e,t,n,s15,o2,r5,a){super(n,e,"link",t,!0,o2,r5,a),this._register(s15.onShowLinkUnderline(l2=>this._handleShowLinkUnderline(l2))),this._register(s15.onHideLinkUnderline(l2=>this._handleHideLinkUnderline(l2)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&Fn(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},te$1=typeof window=="object"?window:globalThis,Zt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new D2,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new D2,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Zt.INSTANCE=new Zt;var Qt2=Zt;function us2(i8,e,t){typeof e=="string"&&(e=i8.matchMedia(e)),e.addEventListener("change",t)}Qt2.INSTANCE.onDidChangeZoomLevel;Qt2.INSTANCE.onDidChangeFullscreen;var je$1=typeof navigator=="object"?navigator.userAgent:"";je$1.indexOf("Firefox")>=0;je$1.indexOf("AppleWebKit")>=0;var zn=je$1.indexOf("Chrome")>=0;!zn&&je$1.indexOf("Safari")>=0;je$1.indexOf("Electron/")>=0;je$1.indexOf("Android")>=0;var Yt2=!1;if(typeof te$1.matchMedia=="function"){let i8=te$1.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=te$1.matchMedia("(display-mode: fullscreen)");Yt2=i8.matches,us2(te$1,i8,({matches:t})=>{Yt2&&e.matches||(Yt2=t)})}var Xe="en",ti2=!1,Xn=!1,ei2,ii2=Xe,jn2=Xe,ms2,ye$1,Ie=globalThis,re$1,_a4;typeof Ie.vscode<"u"&&typeof Ie.vscode.process<"u"?re$1=Ie.vscode.process:typeof process<"u"&&typeof((_a4=process==null?void 0:process.versions)==null?void 0:_a4.node)=="string"&&(re$1=process);var _a5,Qn=typeof((_a5=re$1==null?void 0:re$1.versions)==null?void 0:_a5.electron)=="string",_s=Qn&&(re$1==null?void 0:re$1.type)==="renderer",_a6;if(typeof re$1=="object"){re$1.platform,re$1.platform,ti2=re$1.platform==="linux",ti2&&re$1.env.SNAP&&re$1.env.SNAP_REVISION,re$1.env.CI||re$1.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ei2=Xe,ii2=Xe;let i8=re$1.env.VSCODE_NLS_CONFIG;if(i8)try{let e=JSON.parse(i8);ei2=e.userLocale,jn2=e.osLocale,ii2=e.resolvedLanguage||Xe,ms2=(_a6=e.languagePack)==null?void 0:_a6.translationsConfigFile}catch{}Xn=!0}else typeof navigator=="object"&&!_s?(ye$1=navigator.userAgent,ye$1.indexOf("Windows")>=0,ye$1.indexOf("Macintosh")>=0,(ye$1.indexOf("Macintosh")>=0||ye$1.indexOf("iPad")>=0||ye$1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ti2=ye$1.indexOf("Linux")>=0,(ye$1==null?void 0:ye$1.indexOf("Mobi"))>=0,ii2=globalThis._VSCODE_NLS_LANGUAGE||Xe,ei2=navigator.language.toLowerCase(),jn2=ei2):console.error("Unable to resolve platform.");var ri=Xn,_e2=ye$1,Me$1=ii2,vs2;(n=>{function i8(){return Me$1}n.value=i8;function e(){return Me$1.length===2?Me$1==="en":Me$1.length>=3?Me$1[0]==="e"&&Me$1[1]==="n"&&Me$1[2]==="-":!1}n.isDefaultVariant=e;function t(){return Me$1==="en"}n.isDefault=t})(vs2||(vs2={}));var Ts=typeof Ie.postMessage=="function"&&!Ie.importScripts;(()=>{if(Ts){let i8=[];Ie.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,s15=i8.length;n<s15;n++){let o2=i8[n];if(o2.id===t.data.vscodeScheduleAsyncWork){i8.splice(n,1),o2.callback();return}}});let e=0;return t=>{let n=++e;i8.push({id:n,callback:t}),Ie.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i8=>setTimeout(i8)})();var gs2=!!(_e2&&_e2.indexOf("Chrome")>=0);_e2&&_e2.indexOf("Firefox")>=0;!gs2&&_e2&&_e2.indexOf("Safari")>=0;_e2&&_e2.indexOf("Edg/")>=0;_e2&&_e2.indexOf("Android")>=0;var Ae$1=typeof navigator=="object"?navigator:{};ri||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ae$1&&Ae$1.clipboard&&Ae$1.clipboard.writeText,ri||Ae$1&&Ae$1.clipboard&&Ae$1.clipboard.readText;var dt=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Hi2=new dt,Jn=new dt,er2=new dt;new Array(230);var tr2;(r5=>{function i8(a){return Hi2.keyCodeToStr(a)}r5.toString=i8;function e(a){return Hi2.strToKeyCode(a)}r5.fromString=e;function t(a){return Jn.keyCodeToStr(a)}r5.toUserSettingsUS=t;function n(a){return er2.keyCodeToStr(a)}r5.toUserSettingsGeneral=n;function s15(a){return Jn.strToKeyCode(a)||er2.strToKeyCode(a)}r5.fromUserSettings=s15;function o2(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Hi2.keyCodeToStr(a)}r5.toElectronAccelerator=o2})(tr2||(tr2={}));var nr=Object.freeze(function(i8,e){let t=setTimeout(i8.bind(e),0);return{dispose(){clearTimeout(t)}}}),Is2;(n=>{function i8(s15){return s15===n.None||s15===n.Cancelled||s15 instanceof Wi2?!0:!s15||typeof s15!="object"?!1:typeof s15.isCancellationRequested=="boolean"&&typeof s15.onCancellationRequested=="function"}n.isCancellationToken=i8,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ee.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nr})})(Is2||(Is2={}));var Wi2=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?nr:(this._emitter||(this._emitter=new D2),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Rs2;(t=>{async function i8(n){let s15,o2=await Promise.all(n.map(r5=>r5.then(a=>a,a=>{s15||(s15=a)})));if(typeof s15<"u")throw s15;return o2}t.settled=i8;function e(n){return new Promise(async(s15,o2)=>{try{await n(s15,o2)}catch(r5){o2(r5)}})}t.withAsyncBody=e})(Rs2||(Rs2={}));var Q2=class Q3{static fromArray(e){return new Q3(t=>{t.emitMany(e)})}static fromPromise(e){return new Q3(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Q3(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new Q3(async t=>{await Promise.all(e.map(async n=>{for await(let s15 of n)t.emitOne(s15)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new D2,queueMicrotask(async()=>{let n={emitOne:s15=>this.emitOne(s15),emitMany:s15=>this.emitMany(s15),reject:s15=>this.reject(s15)};try{await Promise.resolve(e(n)),this.resolve()}catch(s15){this.reject(s15)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await ee.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var _a7;return(_a7=this._onReturn)==null||_a7.call(this),{done:!0,value:void 0}}}}static map(e,t){return new Q3(async n=>{for await(let s15 of e)n.emitOne(t(s15))})}map(e){return Q3.map(this,e)}static filter(e,t){return new Q3(async n=>{for await(let s15 of e)t(s15)&&n.emitOne(s15)})}filter(e){return Q3.filter(this,e)}static coalesce(e){return Q3.filter(e,t=>!!t)}coalesce(){return Q3.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return Q3.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Q2.EMPTY=Q2.fromArray([]);var{getWindow:Fs2}=(function(){let i8=new Map,e={window:te$1,disposables:new fe$1};i8.set(te$1.vscodeWindowId,e);let t=new D2,n=new D2,s15=new D2;function o2(r5,a){return(typeof r5=="number"?i8.get(r5):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s15.event,onDidUnregisterWindow:n.event,registerWindow(r5){if(i8.has(r5.vscodeWindowId))return B.None;let a=new fe$1,l2={window:r5,disposables:a.add(new fe$1)};return i8.set(r5.vscodeWindowId,l2),a.add(O(()=>{i8.delete(r5.vscodeWindowId),n.fire(r5)})),a.add(li2(r5,Ps.BEFORE_UNLOAD,()=>{s15.fire(r5)})),t.fire(l2),a},getWindows(){return i8.values()},getWindowsCount(){return i8.size},getWindowId(r5){return r5.vscodeWindowId},hasWindow(r5){return i8.has(r5)},getWindowById:o2,getWindow(r5){var _a7;let a=r5;if((_a7=a==null?void 0:a.ownerDocument)!=null&&_a7.defaultView)return a.ownerDocument.defaultView.window;let l2=r5;return l2!=null&&l2.view?l2.view.window:te$1},getDocument(r5){return Fs2(r5).document}}})(),Vi=class{constructor(e,t,n,s15){this._node=e,this._type=t,this._handler=n,this._options=s15||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function li2(i8,e,t,n){return new Vi(i8,e,t,n)}var Ps={BEFORE_UNLOAD:"beforeunload"},ui2=class extends B{constructor(t,n,s15,o2,r5,a,l2,u,c){super(),this._terminal=t,this._characterJoinerService=n,this._charSizeService=s15,this._coreBrowserService=o2,this._coreService=r5,this._decorationService=a,this._optionsService=l2,this._themeService=u,this._cursorBlinkStateManager=new be$1,this._charAtlasDisposable=this._register(new be$1),this._observerDisposable=this._register(new be$1),this._model=new Vt2,this._workCell=new at,this._workCell2=new at,this._rectangleRenderer=this._register(new be$1),this._glyphRenderer=this._register(new be$1),this._onChangeTextureAtlas=this._register(new D2),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new D2),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new D2),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new D2),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new D2),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new At(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Xt2(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,l2,this._themeService)],this.dimensions=_n2(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(l2.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(li2(this._canvas,"webglcontextlost",h2=>{console.log("webglcontextlost event received"),h2.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(h2)},3e3)})),this._register(li2(this._canvas,"webglcontextrestored",h2=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,Ai(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Si(this._canvas,this._coreBrowserService.window,(h2,f)=>this._setCanvasDevicePixelDimensions(h2,f)),this._register(this._coreBrowserService.onWindowChange(h2=>{this._observerDisposable.value=Si(this._canvas,h2,(f,I2)=>this._setCanvasDevicePixelDimensions(f,I2))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(O(()=>{var _a7;for(let h2 of this._renderLayers)h2.dispose();(_a7=this._canvas.parentElement)==null||_a7.removeChild(this._canvas),Ai(this._terminal)}))}get textureAtlas(){var _a7;return(_a7=this._charAtlas)==null?void 0:_a7.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,n){var _a7,_b,_c2,_d;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let s15 of this._renderLayers)s15.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(_a7=this._rectangleRenderer.value)==null||_a7.setDimensions(this.dimensions),(_b=this._rectangleRenderer.value)==null||_b.handleResize(),(_c2=this._glyphRenderer.value)==null||_c2.setDimensions(this.dimensions),(_d=this._glyphRenderer.value)==null||_d.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var _a7;for(let t of this._renderLayers)t.handleBlur(this._terminal);(_a7=this._cursorBlinkStateManager.value)==null||_a7.pause(),this._requestRedrawViewport()}handleFocus(){var _a7;for(let t of this._renderLayers)t.handleFocus(this._terminal);(_a7=this._cursorBlinkStateManager.value)==null||_a7.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,n,s15){for(let o2 of this._renderLayers)o2.handleSelectionChanged(this._terminal,t,n,s15);this._model.selection.update(this._core,t,n,s15),this._requestRedrawViewport()}handleCursorMove(){var _a7;for(let t of this._renderLayers)t.handleCursorMove(this._terminal);(_a7=this._cursorBlinkStateManager.value)==null||_a7.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new qt(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Kt(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var _a7;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=Nt(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=It(ee.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),ee.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),(_a7=this._glyphRenderer.value)==null||_a7.setAtlas(this._charAtlas)}_clearModel(t){var _a7;this._model.clear(),t&&((_a7=this._glyphRenderer.value)==null||_a7.clear())}clearTextureAtlas(){var _a7;(_a7=this._charAtlas)==null||_a7.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var _a7;this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);(_a7=this._cursorBlinkStateManager.value)==null||_a7.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,n){var _a7;if(!this._isAttached)if((_a7=this._core.screenElement)!=null&&_a7.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let s15 of this._renderLayers)s15.handleGridChanged(this._terminal,t,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new Ht(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,n){let s15=this._core,o2=this._workCell,r5,a,l2,u,c,d,h2=0,f=!0,I2,L2,M3,q2,S2,W,E,y,w2;t=mr(t,s15.rows-1,0),n=mr(n,s15.rows-1,0);let G2=this._coreService.decPrivateModes.cursorStyle??s15.options.cursorStyle??"block",ue2=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Se2=ue2-s15.buffer.ydisp,ce2=Math.min(this._terminal.buffer.active.cursorX,s15.cols-1),we2=-1,A2=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let se2=!1;for(a=t;a<=n;a++)for(l2=a+s15.buffer.ydisp,u=s15.buffer.lines.get(l2),this._model.lineLengths[a]=0,M3=ue2===l2,h2=0,c=this._characterJoinerService.getJoinedCharacters(l2),y=0;y<s15.cols;y++){if(r5=this._cellColorResolver.result.bg,u.loadCell(y,o2),y===0&&(r5=this._cellColorResolver.result.bg),d=!1,f=y>=h2,I2=y,c.length>0&&y===c[0][0]&&f){L2=c.shift();let v3=this._model.selection.isCellSelected(this._terminal,L2[0],l2);for(E=L2[0]+1;E<L2[1];E++)f&&(f=v3===this._model.selection.isCellSelected(this._terminal,E,l2));f&&(f=!M3||ce2<L2[0]||ce2>=L2[1]),f?(d=!0,o2=new Ci(o2,u.translateToString(!0,L2[0],L2[1]),L2[1]-L2[0]),I2=L2[1]-1):h2=L2[1]}if(q2=o2.getChars(),S2=o2.getCode(),E=(a*s15.cols+y)*Ce,this._cellColorResolver.resolve(o2,y,l2,this.dimensions.device.cell.width),A2&&l2===ue2&&(y===ce2&&(this._model.cursor={x:ce2,y:Se2,width:o2.getWidth(),style:this._coreBrowserService.isFocused?G2:s15.options.cursorInactiveStyle,cursorWidth:s15.options.cursorWidth,dpr:this._devicePixelRatio},we2=ce2+o2.getWidth()-1),y>=ce2&&y<=we2&&(this._coreBrowserService.isFocused&&G2==="block"||this._coreBrowserService.isFocused===!1&&s15.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),S2!==0&&(this._model.lineLengths[a]=y+1),!(this._model.cells[E]===S2&&this._model.cells[E+ze]===this._cellColorResolver.result.bg&&this._model.cells[E+qe$1]===this._cellColorResolver.result.fg&&this._model.cells[E+Ct2]===this._cellColorResolver.result.ext)&&(se2=!0,q2.length>1&&(S2|=Un),this._model.cells[E]=S2,this._model.cells[E+ze]=this._cellColorResolver.result.bg,this._model.cells[E+qe$1]=this._cellColorResolver.result.fg,this._model.cells[E+Ct2]=this._cellColorResolver.result.ext,W=o2.getWidth(),this._glyphRenderer.value.updateCell(y,a,S2,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,q2,W,r5),d)){for(o2=this._workCell,y++;y<=I2;y++)w2=(a*s15.cols+y)*Ce,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,pn2,0,0),this._model.cells[w2]=0,this._model.cells[w2+ze]=this._cellColorResolver.result.bg,this._model.cells[w2+qe$1]=this._cellColorResolver.result.fg,this._model.cells[w2+Ct2]=this._cellColorResolver.result.ext;y--}}se2&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,n){this._canvas.width===t&&this._canvas.height===n||(this._canvas.width=t,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},Ci=class extends he$1{constructor(t,n,s15){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=n,this._width=s15}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function mr(i8,e,t=0){return Math.max(Math.min(i8,e),t)}var _r="di$target",br2="di$dependencies",zi2=new Map;function pe$1(i8){if(zi2.has(i8))return zi2.get(i8);let e=function(t,n,s15){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Us(e,t,s15)};return e._id=i8,zi2.set(i8,e),e}function Us(i8,e,t){e[_r]===e?e[br2].push({id:i8,index:t}):(e[br2]=[{id:i8,index:t}],e[_r]=e)}pe$1("BufferService");pe$1("CoreMouseService");pe$1("CoreService");pe$1("CharsetService");pe$1("InstantiationService");pe$1("LogService");var vr=pe$1("OptionsService");pe$1("OscLinkService");pe$1("UnicodeService");pe$1("DecorationService");var Hs={trace:0,debug:1,info:2,warn:3,error:4,off:5},Ws="xterm.js: ",ci=class extends B{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Hs[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let n=0;n<t.length;n++)typeof t[n]=="function"&&(t[n]=t[n]())}_log(t,n,s15){this._evalLazyOptionalParams(s15),t.call(console,(this._optionsService.options.logger?"":Ws)+n,...s15)}trace(t,...n){var _a7;this._logLevel<=0&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.trace.bind(this._optionsService.options.logger))??console.log,t,n)}debug(t,...n){var _a7;this._logLevel<=1&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.debug.bind(this._optionsService.options.logger))??console.log,t,n)}info(t,...n){var _a7;this._logLevel<=2&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.info.bind(this._optionsService.options.logger))??console.info,t,n)}warn(t,...n){var _a7;this._logLevel<=3&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.warn.bind(this._optionsService.options.logger))??console.warn,t,n)}error(t,...n){var _a7;this._logLevel<=4&&this._log(((_a7=this._optionsService.options.logger)==null?void 0:_a7.error.bind(this._optionsService.options.logger))??console.error,t,n)}};ci=Yi([Qi(0,vr)],ci);var xr=class extends B{constructor(t){if(vi&&hn2()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new D2),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new D2),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new D2),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new D2),this.onContextLoss=this._onContextLoss.event}activate(t){let n=t._core;if(!t.element){this._register(n.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let s15=n.coreService,o2=n.optionsService,r5=n,a=r5._renderService,l2=r5._characterJoinerService,u=r5._charSizeService,c=r5._coreBrowserService,d=r5._decorationService;r5._logService;let f=r5._themeService;this._renderer=this._register(new ui2(t,l2,u,c,s15,d,o2,f,this._preserveDrawingBuffer)),this._register(ee.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(ee.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(ee.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(ee.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(O(()=>{if(this._terminal._core._store._isDisposed)return;let I2=this._terminal._core._renderService;I2.setRenderer(this._terminal._core._createRenderer()),I2.handleResize(t.cols,t.rows)}))}get textureAtlas(){var _a7;return(_a7=this._renderer)==null?void 0:_a7.textureAtlas}clearTextureAtlas(){var _a7;(_a7=this._renderer)==null||_a7.clearTextureAtlas()}};/**
113
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
114
- * @license MIT
115
- *
116
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
117
- * @license MIT
118
- *
119
- * Originally forked from (with the author's permission):
120
- * Fabrice Bellard's javascript vt100 for jslinux:
121
- * http://bellard.org/jslinux/
122
- * Copyright (c) 2011 Fabrice Bellard
123
- */var v2=class{constructor(e,t,n,o2={}){this._terminal=e,this._regex=t,this._handler=n,this._options=o2}provideLinks(e,t){let n=g.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(n,o2)=>{if(this._options.hover){let{range:p}=t;this._options.hover(n,o2,p)}},t))}};function k(l2){try{let e=new URL(l2),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return l2.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}var g=class l{static computeLink(e,t,n,o2){let p=new RegExp(t.source,(t.flags||"")+"g"),[i8,r5]=l._getWindowedLineStrings(e-1,n),s15=i8.join(""),a,d=[];for(;a=p.exec(s15);){let u=a[0];if(!k(u))continue;let[c,h2]=l._mapStrIdx(n,r5,0,a.index),[m,f]=l._mapStrIdx(n,c,h2,u.length);if(c===-1||h2===-1||m===-1||f===-1)continue;let b2={start:{x:h2+1,y:c+1},end:{x:f,y:m+1}};d.push({range:b2,text:u,activate:o2})}return d}static _getWindowedLineStrings(e,t){let n,o2=e,p=e,i8=0,r5="",s15=[];if(n=t.buffer.active.getLine(e)){let a=n.translateToString(!0);if(n.isWrapped&&a[0]!==" "){for(i8=0;(n=t.buffer.active.getLine(--o2))&&i8<2048&&(r5=n.translateToString(!0),i8+=r5.length,s15.push(r5),!(!n.isWrapped||r5.indexOf(" ")!==-1)););s15.reverse()}for(s15.push(a),i8=0;(n=t.buffer.active.getLine(++p))&&n.isWrapped&&i8<2048&&(r5=n.translateToString(!0),i8+=r5.length,s15.push(r5),r5.indexOf(" ")===-1););}return[s15,o2]}static _mapStrIdx(e,t,n,o2){let p=e.buffer.active,i8=p.getNullCell(),r5=n;for(;o2;){let s15=p.getLine(t);if(!s15)return[-1,-1];for(let a=r5;a<s15.length;++a){s15.getCell(a,i8);let d=i8.getChars();if(i8.getWidth()&&(o2-=d.length||1,a===s15.length-1&&d==="")){let c=p.getLine(t+1);c&&c.isWrapped&&(c.getCell(0,i8),i8.getWidth()===2&&(o2+=1))}if(o2<0)return[t,a]}t++,r5=0}return[t,r5]}},_$1=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function w$1(l2,e){let t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var L=class{constructor(e=w$1,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||_$1;this._linkProvider=this._terminal.registerLinkProvider(new v2(this._terminal,n,this._handler,t))}dispose(){var _a7;(_a7=this._linkProvider)==null||_a7.dispose()}};/**
124
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
125
- * @license MIT
126
- *
127
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
128
- * @license MIT
129
- *
130
- * Originally forked from (with the author's permission):
131
- * Fabrice Bellard's javascript vt100 for jslinux:
132
- * http://bellard.org/jslinux/
133
- * Copyright (c) 2011 Fabrice Bellard
134
- */var ue=[[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]],qe2=[[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]],A;function He(r5,e){let t=0,n=e.length-1,o2;if(r5<e[0][0]||r5>e[n][1])return!1;for(;n>=t;)if(o2=t+n>>1,r5>e[o2][1])t=o2+1;else if(r5<e[o2][0])n=o2-1;else return!0;return!1}var H=class{constructor(){if(this.version="6",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160),A.fill(2,4352,4448),A[9001]=2,A[9002]=2,A.fill(2,11904,42192),A[12351]=1,A.fill(2,44032,55204),A.fill(2,63744,64256),A.fill(2,65040,65050),A.fill(2,65072,65136),A.fill(2,65280,65377),A.fill(2,65504,65511);for(let e=0;e<ue.length;++e)A.fill(0,ue[e][0],ue[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?A[e]:He(e,qe2)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),o2=n===0&&t!==0;if(o2){let d=w.extractWidth(t);d===0?o2=!1:d>n&&(n=d)}return w.createPropertyValue(0,n,o2)}},de=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?J.isErrorNoTelemetry(e)?new J(e.message+`
135
-
136
- `+e.stack):new Error(e.message+`
137
-
138
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Ge2=new de;function Y(r5){Je(r5)||Ge2.onUnexpectedError(r5)}var ce="Canceled";function Je(r5){return r5 instanceof G?!0:r5 instanceof Error&&r5.name===ce&&r5.message===ce}var G=class extends Error{constructor(){super(ce),this.name=this.message}},J=class r extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof r)return e;let t=new r;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function pe2(r5,e){let t=this,n=!1,o2;return function(){return n||(n=!0,e||(o2=r5.apply(t,arguments))),o2}}var Be;(E=>{function r5(p){return p<0}E.isLessThan=r5;function e(p){return p<=0}E.isLessThanOrEqual=e;function t(p){return p>0}E.isGreaterThan=t;function n(p){return p===0}E.isNeitherLessOrGreaterThan=n,E.greaterThan=1,E.lessThan=-1,E.neitherLessOrGreaterThan=0})(Be||(Be={}));var fe;(le2=>{function r5(u){return u&&typeof u=="object"&&typeof u[Symbol.iterator]=="function"}le2.is=r5;let e=Object.freeze([]);function t(){return e}le2.empty=t;function*n(u){yield u}le2.single=n;function o2(u){return r5(u)?u:n(u)}le2.wrap=o2;function d(u){return u||e}le2.from=d;function*v3(u){for(let f=u.length-1;f>=0;f--)yield u[f]}le2.reverse=v3;function E(u){return!u||u[Symbol.iterator]().next().done===!0}le2.isEmpty=E;function p(u){return u[Symbol.iterator]().next().value}le2.first=p;function b2(u,f){let m=0;for(let g2 of u)if(f(g2,m++))return!0;return!1}le2.some=b2;function D3(u,f){for(let m of u)if(f(m))return m}le2.find=D3;function*T(u,f){for(let m of u)f(m)&&(yield m)}le2.filter=T;function*B2(u,f){let m=0;for(let g2 of u)yield f(g2,m++)}le2.map=B2;function*L2(u,f){let m=0;for(let g2 of u)yield*f(g2,m++)}le2.flatMap=L2;function*oe(...u){for(let f of u)yield*f}le2.concat=oe;function z2(u,f,m){let g2=m;for(let W of u)g2=f(g2,W);return g2}le2.reduce=z2;function*k2(u,f,m=u.length){for(f<0&&(f+=u.length),m<0?m+=u.length:m>u.length&&(m=u.length);f<m;f++)yield u[f]}le2.slice=k2;function ae2(u,f=Number.POSITIVE_INFINITY){let m=[];if(f===0)return[m,u];let g2=u[Symbol.iterator]();for(let W=0;W<f;W++){let xe2=g2.next();if(xe2.done)return[m,le2.empty()];m.push(xe2.value)}return[m,{[Symbol.iterator](){return g2}}]}le2.consume=ae2;async function V2(u){let f=[];for await(let m of u)f.push(m);return Promise.resolve(f)}le2.asyncToArray=V2})(fe||(fe={}));function Pe(r5){if(fe.is(r5)){let e=[];for(let t of r5)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(r5)?[]:r5}else if(r5)return r5.dispose(),r5}function Me(...r5){return me(()=>Pe(r5))}function me(r5){return{dispose:pe2(()=>{r5()})}}var te=class te2{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Pe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?te2.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};te.DISABLE_DISPOSED_WARNING=!1;var U=te,_=class{constructor(){this._store=new U,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_.None=Object.freeze({dispose(){}});var tt2=globalThis.performance&&typeof globalThis.performance.now=="function",ne=class r2{static create(e){return new r2(e)}constructor(e){this._now=tt2&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},it;(Q4=>{Q4.None=()=>_.None;function t(l2,i8){return B2(l2,()=>{},0,void 0,!0,void 0,i8)}Q4.defer=t;function n(l2){return(i8,a=null,s15)=>{let x=!1,c;return c=l2(h2=>{if(!x)return c?c.dispose():x=!0,i8.call(a,h2)},null,s15),x&&c.dispose(),c}}Q4.once=n;function o2(l2,i8,a){return D3((s15,x=null,c)=>l2(h2=>s15.call(x,i8(h2)),null,c),a)}Q4.map=o2;function d(l2,i8,a){return D3((s15,x=null,c)=>l2(h2=>{i8(h2),s15.call(x,h2)},null,c),a)}Q4.forEach=d;function v3(l2,i8,a){return D3((s15,x=null,c)=>l2(h2=>i8(h2)&&s15.call(x,h2),null,c),a)}Q4.filter=v3;function E(l2){return l2}Q4.signal=E;function p(...l2){return(i8,a=null,s15)=>{let x=Me(...l2.map(c=>c(h2=>i8.call(a,h2))));return T(x,s15)}}Q4.any=p;function b2(l2,i8,a,s15){let x=a;return o2(l2,c=>(x=i8(x,c),x),s15)}Q4.reduce=b2;function D3(l2,i8){let a,s15={onWillAddFirstListener(){a=l2(x.fire,x)},onDidRemoveLastListener(){a==null||a.dispose()}},x=new C(s15);return i8==null||i8.add(x),x.event}function T(l2,i8){return i8 instanceof Array?i8.push(l2):i8&&i8.add(l2),l2}function B2(l2,i8,a=100,s15=!1,x=!1,c,h2){let F2,y,S2,$2=0,j2,Ce2={leakWarningThreshold:c,onWillAddFirstListener(){F2=l2(Qe=>{$2++,y=i8(y,Qe),s15&&!S2&&(q2.fire(y),y=void 0),j2=()=>{let $e2=y;y=void 0,S2=void 0,(!s15||$2>1)&&q2.fire($e2),$2=0},typeof a=="number"?(clearTimeout(S2),S2=setTimeout(j2,a)):S2===void 0&&(S2=0,queueMicrotask(j2))})},onWillRemoveListener(){x&&$2>0&&(j2==null||j2())},onDidRemoveLastListener(){j2=void 0,F2.dispose()}},q2=new C(Ce2);return h2==null||h2.add(q2),q2.event}Q4.debounce=B2;function L2(l2,i8=0,a){return Q4.debounce(l2,(s15,x)=>s15?(s15.push(x),s15):[x],i8,void 0,!0,void 0,a)}Q4.accumulate=L2;function oe(l2,i8=(s15,x)=>s15===x,a){let s15=!0,x;return v3(l2,c=>{let h2=s15||!i8(c,x);return s15=!1,x=c,h2},a)}Q4.latch=oe;function z2(l2,i8,a){return[Q4.filter(l2,i8,a),Q4.filter(l2,s15=>!i8(s15),a)]}Q4.split=z2;function k2(l2,i8=!1,a=[],s15){let x=a.slice(),c=l2(y=>{x?x.push(y):F2.fire(y)});s15&&s15.add(c);let h2=()=>{x==null||x.forEach(y=>F2.fire(y)),x=null},F2=new C({onWillAddFirstListener(){c||(c=l2(y=>F2.fire(y)),s15&&s15.add(c))},onDidAddFirstListener(){x&&(i8?setTimeout(h2):h2())},onDidRemoveLastListener(){c&&c.dispose(),c=null}});return s15&&s15.add(F2),F2.event}Q4.buffer=k2;function ae2(l2,i8){return(s15,x,c)=>{let h2=i8(new le2);return l2(function(F2){let y=h2.evaluate(F2);y!==V2&&s15.call(x,y)},void 0,c)}}Q4.chain=ae2;let V2=Symbol("HaltChainable");class le2{constructor(){this.steps=[]}map(i8){return this.steps.push(i8),this}forEach(i8){return this.steps.push(a=>(i8(a),a)),this}filter(i8){return this.steps.push(a=>i8(a)?a:V2),this}reduce(i8,a){let s15=a;return this.steps.push(x=>(s15=i8(s15,x),s15)),this}latch(i8=(a,s15)=>a===s15){let a=!0,s15;return this.steps.push(x=>{let c=a||!i8(x,s15);return a=!1,s15=x,c?x:V2}),this}evaluate(i8){for(let a of this.steps)if(i8=a(i8),i8===V2)break;return i8}}function u(l2,i8,a=s15=>s15){let s15=(...F2)=>h2.fire(a(...F2)),x=()=>l2.on(i8,s15),c=()=>l2.removeListener(i8,s15),h2=new C({onWillAddFirstListener:x,onDidRemoveLastListener:c});return h2.event}Q4.fromNodeEventEmitter=u;function f(l2,i8,a=s15=>s15){let s15=(...F2)=>h2.fire(a(...F2)),x=()=>l2.addEventListener(i8,s15),c=()=>l2.removeEventListener(i8,s15),h2=new C({onWillAddFirstListener:x,onDidRemoveLastListener:c});return h2.event}Q4.fromDOMEventEmitter=f;function m(l2){return new Promise(i8=>n(l2)(i8))}Q4.toPromise=m;function g2(l2){let i8=new C;return l2.then(a=>{i8.fire(a)},()=>{i8.fire(void 0)}).finally(()=>{i8.dispose()}),i8.event}Q4.fromPromise=g2;function W(l2,i8){return l2(a=>i8.fire(a))}Q4.forward=W;function xe2(l2,i8,a){return i8(a),l2(s15=>i8(s15))}Q4.runAndSubscribe=xe2;class ze2{constructor(i8,a){this._observable=i8,this._counter=0,this._hasChanged=!1;let s15={onWillAddFirstListener:()=>{i8.addObserver(this)},onDidRemoveLastListener:()=>{i8.removeObserver(this)}};this.emitter=new C(s15),a&&a.add(this.emitter)}beginUpdate(i8){this._counter++}handlePossibleChange(i8){}handleChange(i8,a){this._hasChanged=!0}endUpdate(i8){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ut2(l2,i8){return new ze2(l2,i8).emitter.event}Q4.fromObservable=ut2;function dt2(l2){return(i8,a,s15)=>{let x=0,c=!1,h2={beginUpdate(){x++},endUpdate(){x--,x===0&&(l2.reportChanges(),c&&(c=!1,i8.call(a)))},handlePossibleChange(){},handleChange(){c=!0}};l2.addObserver(h2),l2.reportChanges();let F2={dispose(){l2.removeObserver(h2)}};return s15 instanceof U?s15.add(F2):Array.isArray(s15)&&s15.push(F2),F2}}Q4.fromObservableLight=dt2})(it||(it={}));var M=class M2{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${M2._idPool++}`,M2.all.add(this)}start(e){this._stopWatch=new ne,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};M.all=new Set,M._idPool=0;var be2=M,We2=-1,ie=class ie2{constructor(e,t,n=(ie2._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){var _a7;(_a7=this._stacks)==null||_a7.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||(this._stacks=new Map);let o2=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,o2+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[d,v3]=this.getMostFrequentStack(),E=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${v3}):`;console.warn(E),console.warn(d);let p=new De(E,d);this._errorHandler(p)}return()=>{let d=this._stacks.get(e.value)||0;this._stacks.set(e.value,d-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,o2]of this._stacks)(!e||t<o2)&&(e=[n,o2],t=o2);return e}};ie._idPool=1;var Ee=ie,K=class r3{constructor(e){this.value=e}static create(){let e=new Error;return new r3(e.stack??"")}print(){console.warn(this.value.split(`
139
- `).slice(2).join(`
140
- `))}},De=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Ae=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},st=0,N=class{constructor(e){this.value=e,this.id=st++}},ot2=2,re,C=class{constructor(e){var _a7,_b,_c2,_d;this._size=0,this._options=e,this._leakageMon=(_a7=this._options)!=null&&_a7.leakWarningThreshold?new Ee((e==null?void 0:e.onListenerError)??Y,((_b=this._options)==null?void 0:_b.leakWarningThreshold)??We2):void 0,this._perfMon=(_c2=this._options)!=null&&_c2._profName?new be2(this._options._profName):void 0,this._deliveryQueue=(_d=this._options)==null?void 0:_d.deliveryQueue}dispose(){var _a7,_b,_c2,_d;this._disposed||(this._disposed=!0,((_a7=this._deliveryQueue)==null?void 0:_a7.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(_c2=(_b=this._options)==null?void 0:_b.onDidRemoveLastListener)==null||_c2.call(_b),(_d=this._leakageMon)==null||_d.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var _a7,_b,_c2,_d,_e3;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let b2=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],D3=new Ae(`${p}. HINT: Stack shows most frequent listener (${b2[1]}-times)`,b2[0]);return(((_a7=this._options)==null?void 0:_a7.onListenerError)||Y)(D3),_.None}if(this._disposed)return _.None;t&&(e=e.bind(t));let o2=new N(e),d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o2.stack=K.create(),d=this._leakageMon.check(o2.stack,this._size+1)),this._listeners?this._listeners instanceof N?(this._deliveryQueue??(this._deliveryQueue=new Fe),this._listeners=[this._listeners,o2]):this._listeners.push(o2):((_c2=(_b=this._options)==null?void 0:_b.onWillAddFirstListener)==null||_c2.call(_b,this),this._listeners=o2,(_e3=(_d=this._options)==null?void 0:_d.onDidAddFirstListener)==null||_e3.call(_d,this)),this._size++;let E=me(()=>{d==null||d(),this._removeListener(o2)});return n instanceof U?n.add(E):Array.isArray(n)&&n.push(E),E}),this._event}_removeListener(e){var _a7,_b,_c2,_d;if((_b=(_a7=this._options)==null?void 0:_a7.onWillRemoveListener)==null||_b.call(_a7,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(_d=(_c2=this._options)==null?void 0:_c2.onDidRemoveLastListener)==null||_d.call(_c2,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let o2=this._deliveryQueue.current===this;if(this._size*ot2<=t.length){let d=0;for(let v3=0;v3<t.length;v3++)t[v3]?t[d++]=t[v3]:o2&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=d}}_deliver(e,t){var _a7;if(!e)return;let n=((_a7=this._options)==null?void 0:_a7.onListenerError)||Y;if(!n){e.value(t);return}try{e.value(t)}catch(o2){n(o2)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var _a7,_b,_c2,_d;if((_a7=this._deliveryQueue)!=null&&_a7.current&&(this._deliverQueue(this._deliveryQueue),(_b=this._perfMon)==null||_b.stop()),(_c2=this._perfMon)==null||_c2.start(this._size),this._listeners)if(this._listeners instanceof N)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}(_d=this._perfMon)==null||_d.stop()}hasListeners(){return this._size>0}},Fe=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},w=class r4{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new C,this.onChange=this._onChange.event;let e=new H;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=0,o2=e.length;for(let d=0;d<o2;++d){let v3=e.charCodeAt(d);if(55296<=v3&&v3<=56319){if(++d>=o2)return t+this.wcwidth(v3);let b2=e.charCodeAt(d);56320<=b2&&b2<=57343?v3=(v3-55296)*1024+b2-56320+65536:t+=this.wcwidth(b2)}let E=this.charProperties(v3,n),p=r4.extractWidth(E);r4.extractShouldJoin(E)&&(p-=r4.extractWidth(n)),t+=p,n=E}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},ye2=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],lt2=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],ge=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],xt2=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],I;function je(r5,e){let t=0,n=e.length-1,o2;if(r5<e[0][0]||r5>e[n][1])return!1;for(;n>=t;)if(o2=t+n>>1,r5>e[o2][1])t=o2+1;else if(r5<e[o2][0])n=o2-1;else return!0;return!1}var se=class{constructor(){if(this.version="11",!I){I=new Uint8Array(65536),I.fill(1),I[0]=0,I.fill(0,1,32),I.fill(0,127,160);for(let e=0;e<ye2.length;++e)I.fill(0,ye2[e][0],ye2[e][1]+1);for(let e=0;e<ge.length;++e)I.fill(2,ge[e][0],ge[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?I[e]:je(e,lt2)?0:je(e,xt2)?2:1}charProperties(e,t){let n=this.wcwidth(e),o2=n===0&&t!==0;if(o2){let d=w.extractWidth(t);d===0?o2=!1:d>n&&(n=d)}return w.createPropertyValue(0,n,o2)}},Ke=class{activate(e){e.unicode.register(new se)}dispose(){}};export{Dl as D,Ke as K,L,o,xr as x};