@sma1lboy/rove 0.9.290 → 0.9.291

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 (96) hide show
  1. package/dist/cli/{chunk-gw8k0np0.js → chunk-0hccatz5.js} +1 -1
  2. package/dist/cli/{chunk-pbk2yfvv.js → chunk-0qqdh6e8.js} +15 -13
  3. package/dist/cli/{chunk-x8nz1fjt.js → chunk-11mk67hk.js} +1 -1
  4. package/dist/cli/{chunk-g7v0favq.js → chunk-17a25ek7.js} +7 -1
  5. package/dist/cli/{chunk-1sv8pqd5.js → chunk-2p7j8mkg.js} +1 -1
  6. package/dist/cli/{chunk-wwzgtqjr.js → chunk-2t3nkk6m.js} +1 -1
  7. package/dist/cli/{chunk-w2p3csad.js → chunk-32vxnb8a.js} +1 -1
  8. package/dist/cli/{chunk-xdf9dq6e.js → chunk-36hg5a23.js} +1 -1
  9. package/dist/cli/{chunk-t6bwmhef.js → chunk-3xcp1a6b.js} +1 -1
  10. package/dist/cli/{chunk-b60b7pwz.js → chunk-4nmapgtb.js} +3 -3
  11. package/dist/cli/chunk-56jbgq4v.js +2 -0
  12. package/dist/cli/{chunk-c6es8af1.js → chunk-5k3ja2c6.js} +1 -1
  13. package/dist/cli/{chunk-4gh60hy3.js → chunk-5q5a6frn.js} +1 -1
  14. package/dist/cli/{chunk-acq8t3f0.js → chunk-5rxa2ntw.js} +1 -1
  15. package/dist/cli/{chunk-j5200rz1.js → chunk-6h4g5x21.js} +1 -1
  16. package/dist/cli/{chunk-5pjnsgpq.js → chunk-6j0b1bxn.js} +1 -1
  17. package/dist/cli/{chunk-879qe7k5.js → chunk-6tv5n081.js} +1 -1
  18. package/dist/cli/{chunk-ahg4mfkk.js → chunk-764kk6as.js} +1 -1
  19. package/dist/cli/{chunk-2dw5nnst.js → chunk-76rq2c45.js} +1 -1
  20. package/dist/cli/{chunk-ttn6n5s6.js → chunk-7h3c37kb.js} +1 -1
  21. package/dist/cli/{chunk-c9chdgpd.js → chunk-7wpj701m.js} +1 -1
  22. package/dist/cli/{chunk-e386zv6q.js → chunk-82at7tfx.js} +2 -2
  23. package/dist/cli/{chunk-qa5a7d6k.js → chunk-8t19x73d.js} +1 -1
  24. package/dist/cli/{chunk-cjckb6v5.js → chunk-91dpbzmw.js} +1 -1
  25. package/dist/cli/{chunk-7pmvpmyh.js → chunk-94ycmvhm.js} +1 -1
  26. package/dist/cli/{chunk-1f1pp6g9.js → chunk-980txnp4.js} +1 -1
  27. package/dist/cli/{chunk-5s913ckh.js → chunk-afqr5br9.js} +1 -1
  28. package/dist/cli/{chunk-hsw0j462.js → chunk-beg86ddx.js} +1 -1
  29. package/dist/cli/{chunk-8zhm9zcy.js → chunk-bmq5c0gr.js} +4 -4
  30. package/dist/cli/{chunk-7826y9er.js → chunk-bpwz5krr.js} +1 -1
  31. package/dist/cli/{chunk-w8swtyh2.js → chunk-cfyz12qh.js} +1 -1
  32. package/dist/cli/{chunk-rrzr54cj.js → chunk-cs0x0qsh.js} +1 -1
  33. package/dist/cli/{chunk-9st57yhx.js → chunk-cw36b74h.js} +1 -1
  34. package/dist/cli/{chunk-zsfb3hv4.js → chunk-dkkftq46.js} +1 -1
  35. package/dist/cli/chunk-dvzy00ez.js +2 -0
  36. package/dist/cli/{chunk-bfw71kgp.js → chunk-ebqkrta2.js} +1 -1
  37. package/dist/cli/{chunk-tsv1pnwd.js → chunk-f45y02je.js} +1 -1
  38. package/dist/cli/{chunk-483nxy54.js → chunk-f4hrqed9.js} +1 -1
  39. package/dist/cli/{chunk-d14hd9er.js → chunk-ff1a55fm.js} +1 -1
  40. package/dist/cli/chunk-fsn9587t.js +2 -0
  41. package/dist/cli/{chunk-9abnv2rp.js → chunk-fteqrhtb.js} +1 -1
  42. package/dist/cli/chunk-gbe6hggt.js +3 -0
  43. package/dist/cli/{chunk-bbm2nx1k.js → chunk-gx80fxx1.js} +1 -1
  44. package/dist/cli/{chunk-c66qf8cb.js → chunk-gxxmmbq0.js} +1 -1
  45. package/dist/cli/{chunk-z6pdf6t9.js → chunk-gzj05xc0.js} +2 -2
  46. package/dist/cli/{chunk-jxxqe6xa.js → chunk-h4c927gw.js} +1 -1
  47. package/dist/cli/{chunk-sh6m9nvx.js → chunk-hjc5nsbk.js} +1 -1
  48. package/dist/cli/{chunk-wmj6d98x.js → chunk-hzehn98e.js} +1 -1
  49. package/dist/cli/{chunk-4n6vnb3c.js → chunk-j3cbkdhb.js} +1 -1
  50. package/dist/cli/{chunk-wk6mnxnj.js → chunk-j8wpqhhx.js} +1 -1
  51. package/dist/cli/{chunk-ssaeqq6t.js → chunk-jbj1wz0j.js} +1 -1
  52. package/dist/cli/{chunk-et43fdyh.js → chunk-k5tb5gj8.js} +1 -1
  53. package/dist/cli/{chunk-edv4kzn7.js → chunk-k80qm8dx.js} +1 -1
  54. package/dist/cli/{chunk-er2w0ypm.js → chunk-mxceph13.js} +1 -1
  55. package/dist/cli/chunk-n77eha4e.js +2 -0
  56. package/dist/cli/{chunk-xs295wcy.js → chunk-nbf35cg6.js} +1 -1
  57. package/dist/cli/{chunk-h08b9tnf.js → chunk-p87ctphg.js} +1 -1
  58. package/dist/cli/{chunk-69ct2a9t.js → chunk-phr7pbms.js} +1 -1
  59. package/dist/cli/{chunk-fp8vt81w.js → chunk-qp3bten7.js} +1 -1
  60. package/dist/cli/{chunk-wdwhqcf8.js → chunk-rvk3s3gc.js} +1 -1
  61. package/dist/cli/chunk-rvrqz6v7.js +2 -0
  62. package/dist/cli/{chunk-rqktbpmr.js → chunk-sa8y7ze9.js} +1 -1
  63. package/dist/cli/{chunk-kvwbd2jt.js → chunk-sc2hs83x.js} +2 -2
  64. package/dist/cli/{chunk-nytbnhsb.js → chunk-settdwms.js} +1 -1
  65. package/dist/cli/{chunk-mcsh9g8m.js → chunk-txgmfq0q.js} +1 -1
  66. package/dist/cli/{chunk-096d8t1w.js → chunk-vbz6wzgj.js} +1 -1
  67. package/dist/cli/{chunk-f6183qkp.js → chunk-veggy4rm.js} +1 -1
  68. package/dist/cli/{chunk-ne08tr9j.js → chunk-vmrgfd92.js} +1 -1
  69. package/dist/cli/{chunk-ak8qgzjj.js → chunk-vn7dne52.js} +2 -2
  70. package/dist/cli/{chunk-hsnj8gk8.js → chunk-wjf4ec0v.js} +1 -1
  71. package/dist/cli/{chunk-k2pqj8tp.js → chunk-wpbsedjt.js} +2 -2
  72. package/dist/cli/chunk-x4sj1sg7.js +2 -0
  73. package/dist/cli/{chunk-h5c4x18y.js → chunk-xan4qe8h.js} +1 -1
  74. package/dist/cli/{chunk-zethrf0q.js → chunk-xdz6dzhn.js} +1 -1
  75. package/dist/cli/{chunk-zw9725x3.js → chunk-xkpnrbs5.js} +1 -1
  76. package/dist/cli/chunk-y0e28qha.js +3 -0
  77. package/dist/cli/chunk-y7cjpxc7.js +2 -0
  78. package/dist/cli/index.js +3 -3
  79. package/dist/cli/rove.js +1 -1
  80. package/dist/skills/rove/SKILL.md +1 -43
  81. package/dist/skills/rove/references/api-flags.md +1 -1
  82. package/dist/web/assets/index-ljCJBGsx.js +83 -0
  83. package/dist/web/assets/{term-mount-ZA8nuqiR.js → term-mount-KhDcabQ_.js} +2 -2
  84. package/dist/web/index.html +1 -1
  85. package/package.json +3 -3
  86. package/dist/cli/chunk-2bms37we.js +0 -2
  87. package/dist/cli/chunk-5dkx02g8.js +0 -3
  88. package/dist/cli/chunk-h0m7vvw0.js +0 -2
  89. package/dist/cli/chunk-h9f4k6m3.js +0 -2
  90. package/dist/cli/chunk-he640w8c.js +0 -3
  91. package/dist/cli/chunk-hffc0cpc.js +0 -2
  92. package/dist/cli/chunk-n4z1kjsr.js +0 -2
  93. package/dist/cli/chunk-r1kbb3sd.js +0 -2
  94. package/dist/cli/chunk-xtqfs6pg.js +0 -3
  95. package/dist/cli/chunk-xxenxxtt.js +0 -2
  96. package/dist/web/assets/index-DenH5E3i.js +0 -63
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./index-DenH5E3i.js";var f=0,p=0,m=0,h=0,g;(e=>{function t(e,t,n,r){return r===void 0?`#${x(e)}${x(t)}${x(n)}`:`#${x(e)}${x(t)}${x(n)}${x(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(g||={});var _;(e=>{function t(e,t){if(h=(t.rgba&255)/255,h===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return f=a+Math.round((n-a)*h),p=o+Math.round((r-o)*h),m=s+Math.round((i-s)*h),{css:g.toCss(f,p,m),rgba:g.toRgba(f,p,m)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=b.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return g.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[f,p,m]=b.toChannels(t),{css:g.toCss(f,p,m),rgba:t}}e.opaque=i;function a(e,t){return h=Math.round(t*255),[f,p,m]=b.toChannels(e.rgba),{css:g.toCss(f,p,m,h),rgba:g.toRgba(f,p,m,h)}}e.opacity=a;function o(e,t){return h=e.rgba&255,a(e,h*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(_||={});var v;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return f=parseInt(e.slice(1,2).repeat(2),16),p=parseInt(e.slice(2,3).repeat(2),16),m=parseInt(e.slice(3,4).repeat(2),16),g.toColor(f,p,m);case 5:return f=parseInt(e.slice(1,2).repeat(2),16),p=parseInt(e.slice(2,3).repeat(2),16),m=parseInt(e.slice(3,4).repeat(2),16),h=parseInt(e.slice(4,5).repeat(2),16),g.toColor(f,p,m,h);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return f=parseInt(r[1]),p=parseInt(r[2]),m=parseInt(r[3]),h=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),g.toColor(f,p,m,h);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[f,p,m,h]=t.getImageData(0,0,1,1).data,h!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:g.toRgba(f,p,m,h),css:e}}e.toColor=r})(v||={});var y;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(y||={});var b;(e=>{function t(e,t){if(h=(t&255)/255,h===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return f=a+Math.round((n-a)*h),p=o+Math.round((r-o)*h),m=s+Math.round((i-s)*h),g.toRgba(f,p,m)}e.blend=t;function n(e,t,n){let a=y.relativeLuminance(e>>8),o=y.relativeLuminance(t>>8);if(S(a,o)<n){if(o<a){let o=r(e,t,n),s=S(a,y.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>S(a,y.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=S(a,y.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>S(a,y.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(b||={});function x(e){let t=e.toString(16);return t.length<2?`0`+t:t}function S(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var ee=Object.freeze((()=>{let e=[v.toColor(`#2e3436`),v.toColor(`#cc0000`),v.toColor(`#4e9a06`),v.toColor(`#c4a000`),v.toColor(`#3465a4`),v.toColor(`#75507b`),v.toColor(`#06989a`),v.toColor(`#d3d7cf`),v.toColor(`#555753`),v.toColor(`#ef2929`),v.toColor(`#8ae234`),v.toColor(`#fce94f`),v.toColor(`#729fcf`),v.toColor(`#ad7fa8`),v.toColor(`#34e2e2`),v.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:g.toCss(r,i,a),rgba:g.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:g.toCss(n,n,n),rgba:g.toRgba(n,n,n)})}return e})());function C(e,t,n){return Math.max(t,Math.min(e,n))}function te(e){switch(e){case`&`:return`&amp;`;case`<`:return`&lt;`}return e}var w=class{constructor(e){this._buffer=e}serialize(e,t){let n=this._buffer.getNullCell(),r=this._buffer.getNullCell(),i=n,a=e.start.y,o=e.end.y,s=e.start.x,c=e.end.x;this._beforeSerialize(o-a,a,o);for(let t=a;t<=o;t++){let a=this._buffer.getLine(t);if(a){let o=t===e.start.y?s:0,l=t===e.end.y?c:a.length;for(let e=o;e<l;e++){let o=a.getCell(e,i===n?r:n);if(!o){console.warn(`Can't get cell at row=${t}, col=${e}`);continue}this._nextCell(o,i,t,e),i=o}}this._rowEnd(t,t===o)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,n,r){}_rowEnd(e,t){}_beforeSerialize(e,t,n){}_afterSerialize(){}_serializeString(e){return``}};function T(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function E(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function D(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var ne=class extends w{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow=``,this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,n){this._allRows=Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){this._nullCellCount>0&&!E(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let n=``;if(!t){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let t=this._buffer.getLine(e),r=this._buffer.getLine(e+1);if(!r.isWrapped)n=`\r
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./index-ljCJBGsx.js";var f=0,p=0,m=0,h=0,g;(e=>{function t(e,t,n,r){return r===void 0?`#${x(e)}${x(t)}${x(n)}`:`#${x(e)}${x(t)}${x(n)}${x(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(g||={});var _;(e=>{function t(e,t){if(h=(t.rgba&255)/255,h===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return f=a+Math.round((n-a)*h),p=o+Math.round((r-o)*h),m=s+Math.round((i-s)*h),{css:g.toCss(f,p,m),rgba:g.toRgba(f,p,m)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=b.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return g.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[f,p,m]=b.toChannels(t),{css:g.toCss(f,p,m),rgba:t}}e.opaque=i;function a(e,t){return h=Math.round(t*255),[f,p,m]=b.toChannels(e.rgba),{css:g.toCss(f,p,m,h),rgba:g.toRgba(f,p,m,h)}}e.opacity=a;function o(e,t){return h=e.rgba&255,a(e,h*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(_||={});var v;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return f=parseInt(e.slice(1,2).repeat(2),16),p=parseInt(e.slice(2,3).repeat(2),16),m=parseInt(e.slice(3,4).repeat(2),16),g.toColor(f,p,m);case 5:return f=parseInt(e.slice(1,2).repeat(2),16),p=parseInt(e.slice(2,3).repeat(2),16),m=parseInt(e.slice(3,4).repeat(2),16),h=parseInt(e.slice(4,5).repeat(2),16),g.toColor(f,p,m,h);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return f=parseInt(r[1]),p=parseInt(r[2]),m=parseInt(r[3]),h=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),g.toColor(f,p,m,h);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[f,p,m,h]=t.getImageData(0,0,1,1).data,h!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:g.toRgba(f,p,m,h),css:e}}e.toColor=r})(v||={});var y;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(y||={});var b;(e=>{function t(e,t){if(h=(t&255)/255,h===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return f=a+Math.round((n-a)*h),p=o+Math.round((r-o)*h),m=s+Math.round((i-s)*h),g.toRgba(f,p,m)}e.blend=t;function n(e,t,n){let a=y.relativeLuminance(e>>8),o=y.relativeLuminance(t>>8);if(S(a,o)<n){if(o<a){let o=r(e,t,n),s=S(a,y.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>S(a,y.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=S(a,y.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>S(a,y.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=S(y.relativeLuminance2(o,s,c),y.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(b||={});function x(e){let t=e.toString(16);return t.length<2?`0`+t:t}function S(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var ee=Object.freeze((()=>{let e=[v.toColor(`#2e3436`),v.toColor(`#cc0000`),v.toColor(`#4e9a06`),v.toColor(`#c4a000`),v.toColor(`#3465a4`),v.toColor(`#75507b`),v.toColor(`#06989a`),v.toColor(`#d3d7cf`),v.toColor(`#555753`),v.toColor(`#ef2929`),v.toColor(`#8ae234`),v.toColor(`#fce94f`),v.toColor(`#729fcf`),v.toColor(`#ad7fa8`),v.toColor(`#34e2e2`),v.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:g.toCss(r,i,a),rgba:g.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:g.toCss(n,n,n),rgba:g.toRgba(n,n,n)})}return e})());function C(e,t,n){return Math.max(t,Math.min(e,n))}function te(e){switch(e){case`&`:return`&amp;`;case`<`:return`&lt;`}return e}var w=class{constructor(e){this._buffer=e}serialize(e,t){let n=this._buffer.getNullCell(),r=this._buffer.getNullCell(),i=n,a=e.start.y,o=e.end.y,s=e.start.x,c=e.end.x;this._beforeSerialize(o-a,a,o);for(let t=a;t<=o;t++){let a=this._buffer.getLine(t);if(a){let o=t===e.start.y?s:0,l=t===e.end.y?c:a.length;for(let e=o;e<l;e++){let o=a.getCell(e,i===n?r:n);if(!o){console.warn(`Can't get cell at row=${t}, col=${e}`);continue}this._nextCell(o,i,t,e),i=o}}this._rowEnd(t,t===o)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,n,r){}_rowEnd(e,t){}_beforeSerialize(e,t,n){}_afterSerialize(){}_serializeString(e){return``}};function T(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function E(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function D(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var ne=class extends w{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow=``,this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,n){this._allRows=Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){this._nullCellCount>0&&!E(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let n=``;if(!t){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let t=this._buffer.getLine(e),r=this._buffer.getLine(e+1);if(!r.isWrapped)n=`\r
2
2
  `,this._lastCursorRow=e+1,this._lastCursorCol=0;else{n=``;let i=t.getCell(t.length-1,this._thisRowLastChar),a=t.getCell(t.length-2,this._thisRowLastSecondChar),o=r.getCell(0,this._nextRowFirstChar),s=o.getWidth()>1,c=!1;(o.getChars()&&s?this._nullCellCount<=1:this._nullCellCount<=0)&&((i.getChars()||i.getWidth()===0)&&E(i,o)&&(c=!0),s&&(a.getChars()||a.getWidth()===0)&&E(i,o)&&E(a,o)&&(c=!0)),c||(n=`-`.repeat(this._nullCellCount+1),n+=`\x1B[1D\x1B[1X`,this._nullCellCount>0&&(n+=`\x1B[A`,n+=`\x1B[${t.length-this._nullCellCount}C`,n+=`\x1B[${this._nullCellCount}X`,n+=`\x1B[${t.length-this._nullCellCount}D`,n+=`\x1B[B`),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=n,this._currentRow=``,this._nullCellCount=0}_diffStyle(e,t){let n=[],r=!T(e,t),i=!E(e,t),a=!D(e,t);if(r||i||a){if(e.isAttributeDefault())t.isAttributeDefault()||n.push(0);else{if(r){let t=e.getFgColor();e.isFgRGB()?n.push(38,2,t>>>16&255,t>>>8&255,t&255):e.isFgPalette()?t>=16?n.push(38,5,t):n.push(t&8?90+(t&7):30+(t&7)):n.push(39)}if(i){let t=e.getBgColor();e.isBgRGB()?n.push(48,2,t>>>16&255,t>>>8&255,t&255):e.isBgPalette()?t>=16?n.push(48,5,t):n.push(t&8?100+(t&7):40+(t&7)):n.push(49)}a&&(e.isInverse()!==t.isInverse()&&n.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&n.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&n.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&n.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&n.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&n.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&n.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&n.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&n.push(e.isStrikethrough()?9:29))}}return n}_nextCell(e,t,n,r){if(e.getWidth()===0)return;let i=e.getChars()===``,a=this._diffStyle(e,this._cursorStyle);if(i?!E(this._cursorStyle,e):a.length>0){this._nullCellCount>0&&(E(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=r,this._currentRow+=`\x1B[${a.join(`;`)}m`;let e=this._buffer.getLine(n);e!==void 0&&(e.getCell(r,this._cursorStyle),this._cursorStyleRow=n,this._cursorStyleCol=r)}i?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(E(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=r+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let n=``;for(let e=0;e<t;e++)n+=this._allRows[e],e+1<t&&(n+=this._allRowSeparators[e]);if(!e){let e=this._buffer.baseY+this._buffer.cursorY,t=this._buffer.cursorX;(e!==this._lastCursorRow||t!==this._lastCursorCol)&&((e=>{e>0?n+=`\x1B[${e}B`:e<0&&(n+=`\x1B[${-e}A`)})(e-this._lastCursorRow),(e=>{e>0?n+=`\x1B[${e}C`:e<0&&(n+=`\x1B[${-e}D`)})(t-this._lastCursorCol))}let r=this._terminal._core._inputHandler._curAttrData,i=this._diffStyle(r,this._cursorStyle);return i.length>0&&(n+=`\x1B[${i.join(`;`)}m`),n}},re=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,n){let r=t.length,i=n===void 0?r:C(n+e.rows,0,r);return this._serializeBufferByRange(e,t,{start:r-i,end:r-1},!1)}_serializeBufferByRange(e,t,n,r){return new ne(t,e).serialize({start:{x:0,y:typeof n.start==`number`?n.start:n.start.line},end:{x:e.cols,y:typeof n.end==`number`?n.end:n.end.line}},r)}_serializeBufferAsHTML(e,t){let n=e.buffer.active,r=new ie(n,e,t),i=t.onlySelection??!1,a=t.range;if(a)return r.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:e.cols,y:(a.endLine,a.endLine)}});if(!i){let i=n.length,a=t.scrollback,o=a===void 0?i:C(a+e.rows,0,i);return r.serialize({start:{x:0,y:i-o},end:{x:e.cols,y:i-1}})}let o=this._terminal?.getSelectionPosition();return o===void 0?``:r.serialize({start:{x:o.start.x,y:o.start.y},end:{x:o.end.x,y:o.end.y}})}_serializeModes(e){let t=``,n=e.modes;if(n.applicationCursorKeysMode&&(t+=`\x1B[?1h`),n.applicationKeypadMode&&(t+=`\x1B[?66h`),n.bracketedPasteMode&&(t+=`\x1B[?2004h`),n.insertMode&&(t+=`\x1B[4h`),n.originMode&&(t+=`\x1B[?6h`),n.reverseWraparoundMode&&(t+=`\x1B[?45h`),n.sendFocusMode&&(t+=`\x1B[?1004h`),n.wraparoundMode===!1&&(t+=`\x1B[?7l`),n.mouseTrackingMode!==`none`)switch(n.mouseTrackingMode){case`x10`:t+=`\x1B[?9h`;break;case`vt200`:t+=`\x1B[?1000h`;break;case`drag`:t+=`\x1B[?1002h`;break;case`any`:t+=`\x1B[?1003h`}return t}serialize(e){if(!this._terminal)throw Error(`Cannot use addon until it has been loaded`);let t=e?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e?.scrollback);if(!e?.excludeAltBuffer&&this._terminal.buffer.active.type===`alternate`){let e=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);t+=`\x1B[?1049h\x1B[H${e}`}return e?.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw Error(`Cannot use addon until it has been loaded`);return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},ie=class extends w{constructor(e,t,n){super(e),this._terminal=t,this._options=n,this._currentRow=``,this._htmlContent=``,this._ansiColors=t._core._themeService?t._core._themeService.colors.ansi:ee}_padStart(e,t,n){return t>>=0,n??=` `,e.length>t?e:(t-=e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e)}_beforeSerialize(e,t,n){this._htmlContent+=`<html><body><!--StartFragment--><pre>`;let r=`#000000`,i=`#ffffff`;(this._options.includeGlobalBackground??!1)&&(r=this._terminal.options.theme?.foreground??`#ffffff`,i=this._terminal.options.theme?.background??`#000000`);let a=[];a.push(`color: `+r+`;`),a.push(`background-color: `+i+`;`),a.push(`font-family: `+this._terminal.options.fontFamily+`;`),a.push(`font-size: `+this._terminal.options.fontSize+`px;`),this._htmlContent+=`<div style='`+a.join(` `)+`'>`}_afterSerialize(){this._htmlContent+=`</div>`,this._htmlContent+=`</pre><!--EndFragment--></body></html>`}_rowEnd(e,t){this._htmlContent+=`<div><span>`+this._currentRow+`</span></div>`,this._currentRow=``}_getHexColor(e,t){let n=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return`#`+[n>>16&255,n>>8&255,n&255].map(e=>this._padStart(e.toString(16),2,`0`)).join(``);if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[n].css}_diffStyle(e,t){let n=[],r=!T(e,t),i=!E(e,t),a=!D(e,t);if(r||i||a){let t=this._getHexColor(e,!0);t&&n.push(`color: `+t+`;`);let r=this._getHexColor(e,!1);return r&&n.push(`background-color: `+r+`;`),e.isInverse()&&n.push(`color: #000000; background-color: #BFBFBF;`),e.isBold()&&n.push(`font-weight: bold;`),e.isUnderline()&&e.isOverline()?n.push(`text-decoration: overline underline;`):e.isUnderline()?n.push(`text-decoration: underline;`):e.isOverline()&&n.push(`text-decoration: overline;`),e.isBlink()&&n.push(`text-decoration: blink;`),e.isInvisible()&&n.push(`visibility: hidden;`),e.isItalic()&&n.push(`font-style: italic;`),e.isDim()&&n.push(`opacity: 0.5;`),e.isStrikethrough()&&n.push(`text-decoration: line-through;`),n}}_nextCell(e,t,n,r){if(e.getWidth()===0)return;let i=e.getChars()===``,a=this._diffStyle(e,t);a&&(this._currentRow+=a.length===0?`</span><span>`:`</span><span style='`+a.join(` `)+`'>`),i?this._currentRow+=` `:this._currentRow+=te(e.getChars())}_serializeString(){return this._htmlContent}},O=[[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]],k=[[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 ae(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var oe=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<O.length;++e)A.fill(0,O[e][0],O[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?A[e]:ae(e,k)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=We.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return We.createPropertyValue(0,n,r)}},se=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?fe.isErrorNoTelemetry(e)?new fe(e.message+`
3
3
 
4
4
  `+e.stack):Error(e.message+`
@@ -90,4 +90,4 @@ out vec4 outColor;
90
90
 
91
91
  void main() {
92
92
  outColor = v_color;
93
- }`,Pf=8,Ff=Pf*Float32Array.BYTES_PER_ELEMENT,If=20*Pf,Lf=class{constructor(){this.attributes=new Float32Array(If),this.count=0}},Rf=0,zf=0,Bf=0,Vf=0,Hf=0,Uf=0,Wf=0,Gf=class extends xu{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new Lf,this._verticesCursor=new Lf;let i=this._gl;this._program=X(ff(i,Mf,Nf)),this._register(vu(()=>i.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(vu(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(vu(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(vu(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,Ff,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Ff,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,Ff,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,df),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.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(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*Ef,d=e.cells[u+Df],f=e.cells[u+Of],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*Pf,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*Pf,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*Pf,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:Rf=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Rf=(n&16777215)<<8;break;default:Rf=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:Rf=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Rf=(r&16777215)<<8;break;default:Rf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=mf(e.attributes,this._terminal.rows*this._terminal.cols*Pf)),zf=i*this._dimensions.device.cell.width,Bf=o*this._dimensions.device.cell.height,Vf=(Rf>>24&255)/255,Hf=(Rf>>16&255)/255,Uf=(Rf>>8&255)/255,Wf=1,this._addRectangle(e.attributes,t,zf,Bf,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Vf,Hf,Uf,Wf)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},Kf=class extends xu{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,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-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(vu(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=X(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=rf(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*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(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=sd,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},qf=class extends Kf{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}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&&tf(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()}},Jf=typeof window==`object`?window:globalThis,Yf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,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}};Yf.INSTANCE=new Yf;var Xf=Yf;function Zf(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Xf.INSTANCE.onDidChangeZoomLevel,Xf.INSTANCE.onDidChangeFullscreen;var Qf=typeof navigator==`object`?navigator.userAgent:``;Qf.indexOf(`Firefox`);var $f=Qf.indexOf(`AppleWebKit`)>=0;!(Qf.indexOf(`Chrome`)>=0)&&Qf.indexOf(`Safari`),Qf.indexOf(`Electron/`),Qf.indexOf(`Android`);var ep=!1;if(typeof Jf.matchMedia==`function`){let e=Jf.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=Jf.matchMedia(`(display-mode: fullscreen)`);ep=e.matches,Zf(Jf,e,({matches:e})=>{ep&&t.matches||(ep=e)})}function tp(){return ep}var np=`en`,rp=!1,ip=!1,ap=!1,op=np,sp,cp=globalThis,lp;typeof cp.vscode<`u`&&typeof cp.vscode.process<`u`?lp=cp.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(lp=process);var up=typeof lp?.versions?.electron==`string`&&lp?.type===`renderer`;if(typeof lp==`object`){lp.platform,lp.platform,rp=lp.platform===`linux`,rp&&lp.env.SNAP&&lp.env.SNAP_REVISION,lp.env.CI||lp.env.BUILD_ARTIFACTSTAGINGDIRECTORY,op=np;let e=lp.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,op=t.resolvedLanguage||np,t.languagePack?.translationsConfigFile}catch{}ip=!0}else typeof navigator==`object`&&!up?(sp=navigator.userAgent,sp.indexOf(`Windows`),sp.indexOf(`Macintosh`),(sp.indexOf(`Macintosh`)>=0||sp.indexOf(`iPad`)>=0||sp.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,rp=sp.indexOf(`Linux`)>=0,sp?.indexOf(`Mobi`),ap=!0,op=globalThis._VSCODE_NLS_LANGUAGE||np,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var dp=ip;ap&&typeof cp.importScripts==`function`&&cp.origin;var fp=sp,pp=op,mp;(e=>{function t(){return pp}e.value=t;function n(){return pp.length===2?pp===`en`:pp.length>=3&&pp[0]===`e`&&pp[1]===`n`&&pp[2]===`-`}e.isDefaultVariant=n;function r(){return pp===`en`}e.isDefault=r})(mp||={});var hp=typeof cp.postMessage==`function`&&!cp.importScripts;(()=>{if(hp){let e=[];cp.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),cp.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var gp=!!(fp&&fp.indexOf(`Chrome`)>=0);fp&&fp.indexOf(`Firefox`),!gp&&fp&&fp.indexOf(`Safari`),fp&&fp.indexOf(`Edg/`),fp&&fp.indexOf(`Android`);var _p=typeof navigator==`object`?navigator:{};dp||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||_p&&_p.clipboard&&_p.clipboard.writeText,dp||_p&&_p.clipboard&&_p.clipboard.readText,dp||tp()||_p.keyboard,`ontouchstart`in Jf||_p.maxTouchPoints,Jf.PointerEvent&&(`ontouchstart`in Jf||navigator.maxTouchPoints);var vp=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}},yp=new vp,bp=new vp,xp=new vp;Array(230);var Sp;(e=>{function t(e){return yp.keyCodeToStr(e)}e.toString=t;function n(e){return yp.strToKeyCode(e)}e.fromString=n;function r(e){return bp.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return xp.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return bp.strToKeyCode(e)||xp.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return yp.keyCodeToStr(e)}e.toElectronAccelerator=o})(Sp||={});var Cp=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),wp;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Tp?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Md.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Cp})})(wp||={});var Tp=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?Cp:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Ep;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Ep||={});var Dp=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 t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.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 Md.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.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())}};Dp.EMPTY=Dp.fromArray([]);function Op(e){return kp(e,0)}function kp(e,t){switch(typeof e){case`object`:return e===null?Ap(349,t):Array.isArray(e)?Np(e,t):Pp(e,t);case`string`:return Mp(e,t);case`boolean`:return jp(e,t);case`number`:return Ap(e,t);case`undefined`:return Ap(937,t);default:return Ap(617,t)}}function Ap(e,t){return(t<<5)-t+e|0}function jp(e,t){return Ap(e?433:863,t)}function Mp(e,t){t=Ap(149417,t);for(let n=0,r=e.length;n<r;n++)t=Ap(e.charCodeAt(n),t);return t}function Np(e,t){return t=Ap(104579,t),e.reduce((e,t)=>kp(t,e),t)}function Pp(e,t){return t=Ap(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Mp(n,t),kp(e[n],t)),t)}var{registerWindow:Fp,getWindow:Ip,getDocument:Lp,getWindows:Rp,getWindowsCount:zp,getWindowId:Bp,getWindowById:Vp,hasWindow:Hp,onDidRegisterWindow:Up,onWillUnregisterWindow:Wp,onDidUnregisterWindow:Gp}=function(){let e=new Map,t={window:Jf,disposables:new bu};e.set(Jf.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return xu.None;let a=new bu,o={window:t,disposables:a.add(new bu)};return e.set(t.vscodeWindowId,o),a.add(vu(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(qp(t,Yp.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:Jf},getDocument(e){return Ip(e).document}}}(),Kp=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!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,null)}};function qp(e,t,n,r){return new Kp(e,t,n,r)}var Jp=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Jp.None=new Jp(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Op(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(vu(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var Yp={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:$f?`webkitAnimationStart`:`animationstart`,ANIMATION_END:$f?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:$f?`webkitAnimationIteration`:`animationiteration`},Xp=class extends xu{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new Su,this._charAtlasDisposable=this._register(new Su),this._observerDisposable=this._register(new Su),this._model=new jf,this._workCell=new uf,this._workCell2=new uf,this._rectangleRenderer=this._register(new Su),this._glyphRenderer=this._register(new Su),this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Z),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ad(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new qf(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=Yu(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(qp(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(qp(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,af(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=cf(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=cf(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(vu(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),af(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Gf(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Cf(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=rf(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!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=_u(Md.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Md.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),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 sf(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=Qp(e,n.rows-1,0),t=Qp(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,C=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),te=-1,w=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let T=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||C<p[0]||C>=p[1],d?(l=!0,r=new Zp(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*Ef,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),w&&o===S&&(y===C&&(this._model.cursor={x:C,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},te=C+r.getWidth()-1),y>=C&&y<=te&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.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)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+Df]!==this._cellColorResolver.result.bg||this._model.cells[v+Of]!==this._cellColorResolver.result.fg||this._model.cells[v+kf]!==this._cellColorResolver.result.ext)&&(T=!0,h.length>1&&(g|=Af),this._model.cells[v]=g,this._model.cells[v+Df]=this._cellColorResolver.result.bg,this._model.cells[v+Of]=this._cellColorResolver.result.fg,this._model.cells[v+kf]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*Ef,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,Au,0,0),this._model.cells[b]=0,this._model.cells[b+Df]=this._cellColorResolver.result.bg,this._model.cells[b+Of]=this._cellColorResolver.result.fg,this._model.cells[b+kf]=this._cellColorResolver.result.ext;y--}}T&&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(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},Zp=class extends Dd{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Qp(e,t,n=0){return Math.max(Math.min(e,t),n)}var $p=`di$target`,em=`di$dependencies`,tm=new Map;function nm(e){if(tm.has(e))return tm.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);rm(t,e,r)};return t._id=e,tm.set(e,t),t}function rm(e,t,n){t[$p]===t?t[em].push({id:e,index:n}):(t[em]=[{id:e,index:n}],t[$p]=t)}nm(`BufferService`),nm(`CoreMouseService`),nm(`CoreService`),nm(`CharsetService`),nm(`InstantiationService`),nm(`LogService`);var im=nm(`OptionsService`);nm(`OscLinkService`),nm(`UnicodeService`),nm(`DecorationService`);var am={trace:0,debug:1,info:2,warn:3,error:4,off:5},om=`xterm.js: `,sm=class extends xu{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),cm=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=am[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:om)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};sm=eu([tu(0,im)],sm);var cm,lm=class extends xu{constructor(e){if(Ou&&ku()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new Xp(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(Md.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Md.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Md.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Md.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(vu(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},um=!1;function dm(){if(um)return;um=!0;let e=document.createElement(`canvas`).getContext(`2d`);if(!e||(e.font=` 12px monospace`,e.font.startsWith(`12px`)))return;let t=Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype,`font`),{get:n,set:r}=t??{};!t||!n||!r||Object.defineProperty(CanvasRenderingContext2D.prototype,"font",{...t,set(e){r.call(this,typeof e==`string`?e.trim():e)}})}function fm(e){let t=null,n=null;try{dm();let r=new Set(e.element?.querySelectorAll(`canvas`)),i=new lm;i.onContextLoss(()=>{i.dispose(),t=null});let a=0;i.onRemoveTextureAtlasCanvas(()=>{a||=requestAnimationFrame(()=>{a=0,t?.clearTextureAtlas(),e.refresh(0,e.rows-1)})}),e.loadAddon(i),t=i,n=[...e.element?.querySelectorAll(`canvas`)??[]].find(e=>!r.has(e)&&!e.classList.contains(`xterm-link-layer`))??null}catch{}let r=new ResizeObserver(()=>{let n=e._core?._renderService;t&&n&&!n._isPaused&&typeof n._renderRows==`function`&&n._renderRows(0,e.rows-1)});if(n)try{r.observe(n,{box:`device-pixel-content-box`})}catch{}let i=()=>{t&&(t.clearTextureAtlas(),e.refresh(0,e.rows-1))};return document.fonts.addEventListener(`loadingdone`,i),{dispose(){document.fonts.removeEventListener(`loadingdone`,i),r.disconnect(),n?.getContext(`webgl2`)?.getExtension(`WEBGL_lose_context`)?.loseContext()}}}function pm(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function mm(e){return!e||typeof e!=`object`||!(`stream`in e)||typeof e.stream!=`string`?null:{stream:e.stream,...`data`in e&&typeof e.data==`string`?{data:e.data}:{},...`code`in e&&(typeof e.code==`number`||e.code===null)?{code:e.code}:{}}}var hm=65536,gm=20;function _m(e){let t=0,n=null,r=()=>{n!==null&&window.clearTimeout(n),n=null,t>0&&e(t),t=0};return{parsed(e){t+=e,t>=hm?r():n??=window.setTimeout(r,gm)},dispose(){n!==null&&window.clearTimeout(n),n=null,t=0}}}function vm(e){return!e||typeof e!=`object`||!(`stream`in e)||!(`replay`in e)?null:typeof e.stream==`string`&&typeof e.replay==`string`?{stream:e.stream,replay:e.replay}:null}var ym=8;function bm(e){return e.type!==`keydown`||e.key.toLowerCase()!==`c`||e.altKey?null:e.metaKey||e.ctrlKey&&e.shiftKey?`copy`:e.ctrlKey?`interrupt-or-copy`:null}var xm=new WeakMap,Sm=new Uint8Array([27,99]);function Cm(e){let t=new Uint8Array(Sm.length+e.length);return t.set(Sm),t.set(e,Sm.length),t}function wm(a){let{client:d,el:f,taskId:p,tabId:m}=a,h=new Hc({fontFamily:o,fontSize:13,lineHeight:1.15,theme:i.get()??c,cursorBlink:!0,scrollback:e.get().prefs.scrollbackRows,allowProposedApi:!0,overviewRuler:{width:ym},scrollOnUserInput:!1}),g=new rl(h);h.loadAddon(g);let _=new re;h.loadAddon(_),h.loadAddon(new Qe),h.unicode.activeVersion=`11`,h.loadAddon(new it),h.open(f);let v=fm(h),y=bl(h);g.fit();let b=Wc(h,f,_),x=!1;a.snapshot&&b.raise(a.snapshot),a.focusOnMount&&h.focus();let S=t(p,m,a.leafId),ee=xm.get(d);ee||(ee=new Map,xm.set(d,ee));let C=ee.get(S)??{owners:0,attached:!1};C.owners++,ee.set(S,C);let te=()=>void d.request(`term.detach`,{stream:S}).catch(()=>{}),w=null,T=!1,E=null,D=!1,ne=Cl(e=>{w&&T&&d.request(`term.input`,{stream:w,data:e}).catch(()=>{})}),ie=_m(e=>{w&&d.request(`term.ack`,{stream:w,chars:e}).catch(()=>{})}),O=(e,t,n)=>{y.push(e),h.write(e,()=>{n?.(),ie.parsed(t)})},k=d.on(`term.data`,e=>{let t=mm(e);if(!t?.data||t.stream!==S)return;let n=pm(t.data);E?E.push({bytes:n,chars:t.data.length}):w&&O(n,t.data.length)}),A=d.on(`term.reset`,e=>{let t=vm(e);!t||t.stream!==S||!w||E||ne.replay(e=>O(Cm(pm(t.replay)),t.replay.length,e))}),ae=d.on(`term.exit`,e=>{let t=mm(e);!t||t.stream!==S||(T=!1,a.setNotice({kind:`exited`,code:t.code??null}),a.onExit(t.code??null))}),oe=!1,se=null,ce=()=>{let e=h.buffer.active;for(let t=0;t<h.rows;t++)if(e.getLine(e.viewportY+t)?.translateToString(!0).trim())return!0;return!1},le=e=>{if(!oe){if(e&&!ce()){se??=h.onWriteParsed(()=>le(!0));return}oe=!0,se?.dispose(),e?requestAnimationFrame(()=>requestAnimationFrame(()=>a.onPainted?.())):a.onPainted?.()}},ue=async()=>{E=[],w=null;try{let e=await d.request(`term.attach`,{taskId:p,tabId:m,...a.leafId&&a.leafId!==`leaf-1`?{leafId:a.leafId}:{},cols:h.cols,rows:h.rows,acks:!0}),t=ee.get(S);if(t?t.attached=!0:te(),D)return;Fe.reset(),x&&!b.raised&&b.raise(b.snapshot()),x=!0,Me=null,Ne=!0,ne.replay(t=>{let n=pm(e.replay);y.push(n),h.write(Cm(n),()=>{Ne=!1,t(),le(!0)})});for(let e of E)O(e.bytes,e.chars);if(w=e.stream,T=e.alive,e.alive&&h.rows>2){let{cols:t,rows:n}=h,r=e.stream;d.request(`term.resize`,{stream:r,cols:t,rows:n-1}).then(()=>new Promise(e=>window.setTimeout(e,60))).then(()=>w===r?d.request(`term.resize`,{stream:r,cols:h.cols,rows:h.rows}):void 0).then(()=>window.setTimeout(b.lower,250)).catch(b.lower)}else b.lower();e.alive&&document.activeElement===h.textarea&&n.set(e.stream),a.setNotice(e.alive?{kind:`none`}:e.restored?{kind:`restored`}:{kind:`exited`,code:null})}catch(e){if(D)return;e instanceof l&&e.code===`TAB_NOT_LIVE`?a.setNotice({kind:`notLive`}):e instanceof l&&e.code===`NOT_CONNECTED`||a.setNotice({kind:`failed`,message:e instanceof Error?e.message:String(e)})}finally{E=null,w||(b.lower(),le(!1))}},de=()=>f.clientWidth>0&&f.clientHeight>0,fe=!1,pe=d.onOpen(()=>{fe=!de(),fe||ue()}),me=null,he=h.onData(e=>{if(me&&e.length===1){let t=me;me=null,t(),ne.forward(s(e))}else ne.forward(e)}),ge=$c(h,e=>ne.forward(e)),_e=0,ve=()=>{!w||!T||(_e=Date.now(),d.request(`term.resize`,{stream:w,cols:h.cols,rows:h.rows}).catch(()=>{}))},ye=h.onKey(()=>{Date.now()-_e>1e3&&ve()}),be=null,xe=h.onResize(({cols:e,rows:t})=>{be!==null&&window.clearTimeout(be),be=window.setTimeout(()=>{w&&T&&d.request(`term.resize`,{stream:w,cols:e,rows:t}).catch(()=>{})},80)}),Se=()=>{r.get()!==null||!de()||(g.fit(),fe&&(fe=!1,ue()))},Ce=new ResizeObserver(Se);Ce.observe(f);let we=r.subscribe(Se),Te=e.subscribe(()=>{h.options.scrollback=e.get().prefs.scrollbackRows}),Ee=()=>{f.style.backgroundColor=(i.get()??c).background??``};Ee();let De=i.subscribe(()=>{h.options.theme=i.get()??c,Ee()});h.attachCustomKeyEventHandler(e=>{if(e.type===`keydown`&&e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`v`&&/Mac|iPhone|iPad/.test(navigator.platform))return a.pasteImage(),!1;let t=bm(e);if(!t)return!0;let n=h.getSelection();return n.trim().length===0?t===`interrupt-or-copy`:(a.copyText(n),h.clearSelection(),!1)});let Oe=!1,ke=e=>{Oe=e.button===0},Ae=()=>{if(!Oe)return;Oe=!1;let e=h.getSelection();e.trim().length>0&&a.copyText(e)};f.addEventListener(`mousedown`,ke),document.addEventListener(`mouseup`,Ae);let je=h.textarea,Me=null,Ne=!1,Pe=0,Fe=ql(h,()=>{Me=null}),Ie=Yl(f,h,Fe),Le=Zl(f,h,Fe),Re=e=>{e.target instanceof Element&&e.target.closest(`.scrollbar`)&&(Me=null,Fe.reset())};f.addEventListener(`mousedown`,Re,{capture:!0});let ze=()=>u(f);f.addEventListener(`wheel`,ze,{capture:!0,passive:!0}),f.addEventListener(`touchmove`,ze,{capture:!0,passive:!0});let Be=()=>{if(!Ne&&h.buffer.active.type===`normal`){let e=zl(h.buffer.active);Me===null&&e>0&&(Me=e),Pe=performance.now()}return!1},Ve=h.parser.registerCsiHandler({final:`J`},e=>e[0]===3&&Be()),He=h.parser.registerEscHandler({final:`c`},Be),Ue=()=>{Me=null,Fe.reset(),zl(h.buffer.active)>0&&h.scrollToBottom()},We=h.onKey(Ue);je?.addEventListener(`paste`,Ue),je?.addEventListener(`compositionend`,Ue);let Ge=()=>a.onScrolled(zl(h.buffer.active)),Ke=h.onScroll(Ge),qe=h.onWriteParsed(()=>{Me!==null&&performance.now()-Pe>1e3&&(Me=null);let e=Bl(Me,h.buffer.active);e!==null&&h.scrollToLine(e),Ge()}),Je=e=>{Me=null,Fe.reset(),e()},Ye=()=>{n.set(w),ve(),a.onFocusChange(!0)},Xe=()=>a.onFocusChange(!1);return je?.addEventListener(`focus`,Ye),je?.addEventListener(`blur`,Xe),{term:h,stream:S,scrollLines:e=>Je(()=>h.scrollLines(e)),scrollToTop:()=>Je(()=>h.scrollToTop()),scrollToBottom:()=>Je(()=>h.scrollToBottom()),armCtrl:e=>{me=e},reattach:ue,snapshot:b.snapshot,dispose(){D=!0,b.lower(),Ce.disconnect(),Ie(),Le(),Fe.dispose(),f.removeEventListener(`mousedown`,Re,{capture:!0}),f.removeEventListener(`wheel`,ze,{capture:!0}),f.removeEventListener(`touchmove`,ze,{capture:!0}),je?.removeEventListener(`paste`,Ue),je?.removeEventListener(`compositionend`,Ue),Ve.dispose(),He.dispose(),We.dispose(),De(),Te(),we(),be!==null&&window.clearTimeout(be),f.removeEventListener(`mousedown`,ke),document.removeEventListener(`mouseup`,Ae),je?.removeEventListener(`focus`,Ye),je?.removeEventListener(`blur`,Xe),Ke.dispose(),qe.dispose(),he.dispose(),ge(),ye.dispose(),xe.dispose(),pe(),k(),ae(),A(),ie.dispose(),w&&n.get()===w&&n.set(null),C.owners--,C.owners===0&&(ee.delete(S),C.attached&&te()),y.dispose(),h.dispose(),v.dispose()}}}export{wm as mountTerminal};
93
+ }`,Pf=8,Ff=Pf*Float32Array.BYTES_PER_ELEMENT,If=20*Pf,Lf=class{constructor(){this.attributes=new Float32Array(If),this.count=0}},Rf=0,zf=0,Bf=0,Vf=0,Hf=0,Uf=0,Wf=0,Gf=class extends xu{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new Lf,this._verticesCursor=new Lf;let i=this._gl;this._program=X(ff(i,Mf,Nf)),this._register(vu(()=>i.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(vu(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(vu(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(vu(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,Ff,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Ff,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,Ff,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,df),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.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(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*Ef,d=e.cells[u+Df],f=e.cells[u+Of],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*Pf,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*Pf,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*Pf,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*Pf,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:Rf=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Rf=(n&16777215)<<8;break;default:Rf=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:Rf=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Rf=(r&16777215)<<8;break;default:Rf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=mf(e.attributes,this._terminal.rows*this._terminal.cols*Pf)),zf=i*this._dimensions.device.cell.width,Bf=o*this._dimensions.device.cell.height,Vf=(Rf>>24&255)/255,Hf=(Rf>>16&255)/255,Uf=(Rf>>8&255)/255,Wf=1,this._addRectangle(e.attributes,t,zf,Bf,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Vf,Hf,Uf,Wf)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},Kf=class extends xu{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,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-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(vu(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=X(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=rf(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*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(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=sd,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},qf=class extends Kf{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}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&&tf(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()}},Jf=typeof window==`object`?window:globalThis,Yf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,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}};Yf.INSTANCE=new Yf;var Xf=Yf;function Zf(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Xf.INSTANCE.onDidChangeZoomLevel,Xf.INSTANCE.onDidChangeFullscreen;var Qf=typeof navigator==`object`?navigator.userAgent:``;Qf.indexOf(`Firefox`);var $f=Qf.indexOf(`AppleWebKit`)>=0;!(Qf.indexOf(`Chrome`)>=0)&&Qf.indexOf(`Safari`),Qf.indexOf(`Electron/`),Qf.indexOf(`Android`);var ep=!1;if(typeof Jf.matchMedia==`function`){let e=Jf.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=Jf.matchMedia(`(display-mode: fullscreen)`);ep=e.matches,Zf(Jf,e,({matches:e})=>{ep&&t.matches||(ep=e)})}function tp(){return ep}var np=`en`,rp=!1,ip=!1,ap=!1,op=np,sp,cp=globalThis,lp;typeof cp.vscode<`u`&&typeof cp.vscode.process<`u`?lp=cp.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(lp=process);var up=typeof lp?.versions?.electron==`string`&&lp?.type===`renderer`;if(typeof lp==`object`){lp.platform,lp.platform,rp=lp.platform===`linux`,rp&&lp.env.SNAP&&lp.env.SNAP_REVISION,lp.env.CI||lp.env.BUILD_ARTIFACTSTAGINGDIRECTORY,op=np;let e=lp.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,op=t.resolvedLanguage||np,t.languagePack?.translationsConfigFile}catch{}ip=!0}else typeof navigator==`object`&&!up?(sp=navigator.userAgent,sp.indexOf(`Windows`),sp.indexOf(`Macintosh`),(sp.indexOf(`Macintosh`)>=0||sp.indexOf(`iPad`)>=0||sp.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,rp=sp.indexOf(`Linux`)>=0,sp?.indexOf(`Mobi`),ap=!0,op=globalThis._VSCODE_NLS_LANGUAGE||np,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var dp=ip;ap&&typeof cp.importScripts==`function`&&cp.origin;var fp=sp,pp=op,mp;(e=>{function t(){return pp}e.value=t;function n(){return pp.length===2?pp===`en`:pp.length>=3&&pp[0]===`e`&&pp[1]===`n`&&pp[2]===`-`}e.isDefaultVariant=n;function r(){return pp===`en`}e.isDefault=r})(mp||={});var hp=typeof cp.postMessage==`function`&&!cp.importScripts;(()=>{if(hp){let e=[];cp.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),cp.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var gp=!!(fp&&fp.indexOf(`Chrome`)>=0);fp&&fp.indexOf(`Firefox`),!gp&&fp&&fp.indexOf(`Safari`),fp&&fp.indexOf(`Edg/`),fp&&fp.indexOf(`Android`);var _p=typeof navigator==`object`?navigator:{};dp||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||_p&&_p.clipboard&&_p.clipboard.writeText,dp||_p&&_p.clipboard&&_p.clipboard.readText,dp||tp()||_p.keyboard,`ontouchstart`in Jf||_p.maxTouchPoints,Jf.PointerEvent&&(`ontouchstart`in Jf||navigator.maxTouchPoints);var vp=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}},yp=new vp,bp=new vp,xp=new vp;Array(230);var Sp;(e=>{function t(e){return yp.keyCodeToStr(e)}e.toString=t;function n(e){return yp.strToKeyCode(e)}e.fromString=n;function r(e){return bp.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return xp.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return bp.strToKeyCode(e)||xp.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return yp.keyCodeToStr(e)}e.toElectronAccelerator=o})(Sp||={});var Cp=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),wp;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Tp?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Md.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Cp})})(wp||={});var Tp=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?Cp:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Ep;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Ep||={});var Dp=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 t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.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 Md.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.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())}};Dp.EMPTY=Dp.fromArray([]);function Op(e){return kp(e,0)}function kp(e,t){switch(typeof e){case`object`:return e===null?Ap(349,t):Array.isArray(e)?Np(e,t):Pp(e,t);case`string`:return Mp(e,t);case`boolean`:return jp(e,t);case`number`:return Ap(e,t);case`undefined`:return Ap(937,t);default:return Ap(617,t)}}function Ap(e,t){return(t<<5)-t+e|0}function jp(e,t){return Ap(e?433:863,t)}function Mp(e,t){t=Ap(149417,t);for(let n=0,r=e.length;n<r;n++)t=Ap(e.charCodeAt(n),t);return t}function Np(e,t){return t=Ap(104579,t),e.reduce((e,t)=>kp(t,e),t)}function Pp(e,t){return t=Ap(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Mp(n,t),kp(e[n],t)),t)}var{registerWindow:Fp,getWindow:Ip,getDocument:Lp,getWindows:Rp,getWindowsCount:zp,getWindowId:Bp,getWindowById:Vp,hasWindow:Hp,onDidRegisterWindow:Up,onWillUnregisterWindow:Wp,onDidUnregisterWindow:Gp}=function(){let e=new Map,t={window:Jf,disposables:new bu};e.set(Jf.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return xu.None;let a=new bu,o={window:t,disposables:a.add(new bu)};return e.set(t.vscodeWindowId,o),a.add(vu(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(qp(t,Yp.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:Jf},getDocument(e){return Ip(e).document}}}(),Kp=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!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,null)}};function qp(e,t,n,r){return new Kp(e,t,n,r)}var Jp=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Jp.None=new Jp(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Op(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(vu(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var Yp={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:$f?`webkitAnimationStart`:`animationstart`,ANIMATION_END:$f?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:$f?`webkitAnimationIteration`:`animationiteration`},Xp=class extends xu{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new Su,this._charAtlasDisposable=this._register(new Su),this._observerDisposable=this._register(new Su),this._model=new jf,this._workCell=new uf,this._workCell2=new uf,this._rectangleRenderer=this._register(new Su),this._glyphRenderer=this._register(new Su),this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Z),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ad(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new qf(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=Yu(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(qp(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(qp(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,af(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=cf(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=cf(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(vu(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),af(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Gf(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Cf(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=rf(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!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=_u(Md.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Md.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),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 sf(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=Qp(e,n.rows-1,0),t=Qp(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,C=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),te=-1,w=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let T=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||C<p[0]||C>=p[1],d?(l=!0,r=new Zp(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*Ef,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),w&&o===S&&(y===C&&(this._model.cursor={x:C,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},te=C+r.getWidth()-1),y>=C&&y<=te&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.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)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+Df]!==this._cellColorResolver.result.bg||this._model.cells[v+Of]!==this._cellColorResolver.result.fg||this._model.cells[v+kf]!==this._cellColorResolver.result.ext)&&(T=!0,h.length>1&&(g|=Af),this._model.cells[v]=g,this._model.cells[v+Df]=this._cellColorResolver.result.bg,this._model.cells[v+Of]=this._cellColorResolver.result.fg,this._model.cells[v+kf]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*Ef,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,Au,0,0),this._model.cells[b]=0,this._model.cells[b+Df]=this._cellColorResolver.result.bg,this._model.cells[b+Of]=this._cellColorResolver.result.fg,this._model.cells[b+kf]=this._cellColorResolver.result.ext;y--}}T&&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(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},Zp=class extends Dd{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Qp(e,t,n=0){return Math.max(Math.min(e,t),n)}var $p=`di$target`,em=`di$dependencies`,tm=new Map;function nm(e){if(tm.has(e))return tm.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);rm(t,e,r)};return t._id=e,tm.set(e,t),t}function rm(e,t,n){t[$p]===t?t[em].push({id:e,index:n}):(t[em]=[{id:e,index:n}],t[$p]=t)}nm(`BufferService`),nm(`CoreMouseService`),nm(`CoreService`),nm(`CharsetService`),nm(`InstantiationService`),nm(`LogService`);var im=nm(`OptionsService`);nm(`OscLinkService`),nm(`UnicodeService`),nm(`DecorationService`);var am={trace:0,debug:1,info:2,warn:3,error:4,off:5},om=`xterm.js: `,sm=class extends xu{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),cm=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=am[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:om)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};sm=eu([tu(0,im)],sm);var cm,lm=class extends xu{constructor(e){if(Ou&&ku()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new Xp(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(Md.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Md.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Md.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Md.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(vu(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},um=!1;function dm(){if(um)return;um=!0;let e=document.createElement(`canvas`).getContext(`2d`);if(!e||(e.font=` 12px monospace`,e.font.startsWith(`12px`)))return;let t=Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype,`font`),{get:n,set:r}=t??{};!t||!n||!r||Object.defineProperty(CanvasRenderingContext2D.prototype,"font",{...t,set(e){r.call(this,typeof e==`string`?e.trim():e)}})}function fm(e){let t=null,n=null;try{dm();let r=new Set(e.element?.querySelectorAll(`canvas`)),i=new lm;i.onContextLoss(()=>{i.dispose(),t=null});let a=0;i.onRemoveTextureAtlasCanvas(()=>{a||=requestAnimationFrame(()=>{a=0,t?.clearTextureAtlas(),e.refresh(0,e.rows-1)})}),e.loadAddon(i),t=i,n=[...e.element?.querySelectorAll(`canvas`)??[]].find(e=>!r.has(e)&&!e.classList.contains(`xterm-link-layer`))??null}catch{}let r=new ResizeObserver(()=>{let n=e._core?._renderService;t&&n&&!n._isPaused&&typeof n._renderRows==`function`&&n._renderRows(0,e.rows-1)});if(n)try{r.observe(n,{box:`device-pixel-content-box`})}catch{}let i=()=>{t&&(t.clearTextureAtlas(),e.refresh(0,e.rows-1))};return document.fonts.addEventListener(`loadingdone`,i),{dispose(){document.fonts.removeEventListener(`loadingdone`,i),r.disconnect(),n?.getContext(`webgl2`)?.getExtension(`WEBGL_lose_context`)?.loseContext()}}}function pm(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function mm(e){return!e||typeof e!=`object`||!(`stream`in e)||typeof e.stream!=`string`?null:{stream:e.stream,...`data`in e&&typeof e.data==`string`?{data:e.data}:{},...`code`in e&&(typeof e.code==`number`||e.code===null)?{code:e.code}:{}}}var hm=65536,gm=20;function _m(e){let t=0,n=null,r=()=>{n!==null&&window.clearTimeout(n),n=null,t>0&&e(t),t=0};return{parsed(e){t+=e,t>=hm?r():n??=window.setTimeout(r,gm)},dispose(){n!==null&&window.clearTimeout(n),n=null,t=0}}}function vm(e){return!e||typeof e!=`object`||!(`stream`in e)||!(`replay`in e)?null:typeof e.stream==`string`&&typeof e.replay==`string`?{stream:e.stream,replay:e.replay}:null}var ym=8;function bm(e){return e.type!==`keydown`||e.key.toLowerCase()!==`c`||e.altKey?null:e.metaKey||e.ctrlKey&&e.shiftKey?`copy`:e.ctrlKey?`interrupt-or-copy`:null}var xm=new WeakMap,Sm=new Uint8Array([27,99]);function Cm(e){let t=new Uint8Array(Sm.length+e.length);return t.set(Sm),t.set(e,Sm.length),t}function wm(a){let{client:d,el:f,taskId:p,tabId:m}=a,h=new Hc({fontFamily:o,fontSize:13,lineHeight:1.15,theme:i.get()??c,cursorBlink:!0,scrollback:e.get().prefs.scrollbackRows,allowProposedApi:!0,overviewRuler:{width:ym},scrollOnUserInput:!1}),g=new rl(h);h.loadAddon(g);let _=new re;h.loadAddon(_),h.loadAddon(new Qe),h.unicode.activeVersion=`11`,h.loadAddon(new it),h.open(f);let v=fm(h),y=bl(h);g.fit();let b=Wc(h,f,_),x=!1;a.snapshot&&b.raise(a.snapshot),a.focusOnMount&&h.focus();let S=l(p,m,a.leafId),ee=xm.get(d);ee||(ee=new Map,xm.set(d,ee));let C=ee.get(S)??{owners:0,attached:!1};C.owners++,ee.set(S,C);let te=()=>void d.request(`term.detach`,{stream:S}).catch(()=>{}),w=null,T=!1,E=null,D=!1,ne=Cl(e=>{w&&T&&d.request(`term.input`,{stream:w,data:e}).catch(()=>{})}),ie=_m(e=>{w&&d.request(`term.ack`,{stream:w,chars:e}).catch(()=>{})}),O=(e,t,n)=>{y.push(e),h.write(e,()=>{n?.(),ie.parsed(t)})},k=d.on(`term.data`,e=>{let t=mm(e);if(!t?.data||t.stream!==S)return;let n=pm(t.data);E?E.push({bytes:n,chars:t.data.length}):w&&O(n,t.data.length)}),A=d.on(`term.reset`,e=>{let t=vm(e);!t||t.stream!==S||!w||E||ne.replay(e=>O(Cm(pm(t.replay)),t.replay.length,e))}),ae=d.on(`term.exit`,e=>{let t=mm(e);!t||t.stream!==S||(T=!1,a.setNotice({kind:`exited`,code:t.code??null}),a.onExit(t.code??null))}),oe=!1,se=null,ce=()=>{let e=h.buffer.active;for(let t=0;t<h.rows;t++)if(e.getLine(e.viewportY+t)?.translateToString(!0).trim())return!0;return!1},le=e=>{if(!oe){if(e&&!ce()){se??=h.onWriteParsed(()=>le(!0));return}oe=!0,se?.dispose(),e?requestAnimationFrame(()=>requestAnimationFrame(()=>a.onPainted?.())):a.onPainted?.()}},ue=async()=>{E=[],w=null;try{let e=await d.request(`term.attach`,{taskId:p,tabId:m,...a.leafId&&a.leafId!==`leaf-1`?{leafId:a.leafId}:{},cols:h.cols,rows:h.rows,acks:!0}),t=ee.get(S);if(t?t.attached=!0:te(),D)return;Fe.reset(),x&&!b.raised&&b.raise(b.snapshot()),x=!0,Me=null,Ne=!0,ne.replay(t=>{let n=pm(e.replay);y.push(n),h.write(Cm(n),()=>{Ne=!1,t(),le(!0)})});for(let e of E)O(e.bytes,e.chars);if(w=e.stream,T=e.alive,e.alive&&h.rows>2){let{cols:t,rows:n}=h,r=e.stream;d.request(`term.resize`,{stream:r,cols:t,rows:n-1}).then(()=>new Promise(e=>window.setTimeout(e,60))).then(()=>w===r?d.request(`term.resize`,{stream:r,cols:h.cols,rows:h.rows}):void 0).then(()=>window.setTimeout(b.lower,250)).catch(b.lower)}else b.lower();e.alive&&document.activeElement===h.textarea&&n.set(e.stream),a.setNotice(e.alive?{kind:`none`}:e.restored?{kind:`restored`}:{kind:`exited`,code:null})}catch(e){if(D)return;e instanceof t&&e.code===`TAB_NOT_LIVE`?a.setNotice({kind:`notLive`}):e instanceof t&&e.code===`NOT_CONNECTED`||a.setNotice({kind:`failed`,message:e instanceof Error?e.message:String(e)})}finally{E=null,w||(b.lower(),le(!1))}},de=()=>f.clientWidth>0&&f.clientHeight>0,fe=!1,pe=d.onOpen(()=>{fe=!de(),fe||ue()}),me=null,he=h.onData(e=>{if(me&&e.length===1){let t=me;me=null,t(),ne.forward(s(e))}else ne.forward(e)}),ge=$c(h,e=>ne.forward(e)),_e=0,ve=()=>{!w||!T||(_e=Date.now(),d.request(`term.resize`,{stream:w,cols:h.cols,rows:h.rows}).catch(()=>{}))},ye=h.onKey(()=>{Date.now()-_e>1e3&&ve()}),be=null,xe=h.onResize(({cols:e,rows:t})=>{be!==null&&window.clearTimeout(be),be=window.setTimeout(()=>{w&&T&&d.request(`term.resize`,{stream:w,cols:e,rows:t}).catch(()=>{})},80)}),Se=()=>{r.get()!==null||!de()||(g.fit(),fe&&(fe=!1,ue()))},Ce=new ResizeObserver(Se);Ce.observe(f);let we=r.subscribe(Se),Te=e.subscribe(()=>{h.options.scrollback=e.get().prefs.scrollbackRows}),Ee=()=>{f.style.backgroundColor=(i.get()??c).background??``};Ee();let De=i.subscribe(()=>{h.options.theme=i.get()??c,Ee()});h.attachCustomKeyEventHandler(e=>{if(e.type===`keydown`&&e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`v`&&/Mac|iPhone|iPad/.test(navigator.platform))return a.pasteImage(),!1;let t=bm(e);if(!t)return!0;let n=h.getSelection();return n.trim().length===0?t===`interrupt-or-copy`:(a.copyText(n),h.clearSelection(),!1)});let Oe=!1,ke=e=>{Oe=e.button===0},Ae=()=>{if(!Oe)return;Oe=!1;let e=h.getSelection();e.trim().length>0&&a.copyText(e)};f.addEventListener(`mousedown`,ke),document.addEventListener(`mouseup`,Ae);let je=h.textarea,Me=null,Ne=!1,Pe=0,Fe=ql(h,()=>{Me=null}),Ie=Yl(f,h,Fe),Le=Zl(f,h,Fe),Re=e=>{e.target instanceof Element&&e.target.closest(`.scrollbar`)&&(Me=null,Fe.reset())};f.addEventListener(`mousedown`,Re,{capture:!0});let ze=()=>u(f);f.addEventListener(`wheel`,ze,{capture:!0,passive:!0}),f.addEventListener(`touchmove`,ze,{capture:!0,passive:!0});let Be=()=>{if(!Ne&&h.buffer.active.type===`normal`){let e=zl(h.buffer.active);Me===null&&e>0&&(Me=e),Pe=performance.now()}return!1},Ve=h.parser.registerCsiHandler({final:`J`},e=>e[0]===3&&Be()),He=h.parser.registerEscHandler({final:`c`},Be),Ue=()=>{Me=null,Fe.reset(),zl(h.buffer.active)>0&&h.scrollToBottom()},We=h.onKey(Ue);je?.addEventListener(`paste`,Ue),je?.addEventListener(`compositionend`,Ue);let Ge=()=>a.onScrolled(zl(h.buffer.active)),Ke=h.onScroll(Ge),qe=h.onWriteParsed(()=>{Me!==null&&performance.now()-Pe>1e3&&(Me=null);let e=Bl(Me,h.buffer.active);e!==null&&h.scrollToLine(e),Ge()}),Je=e=>{Me=null,Fe.reset(),e()},Ye=()=>{n.set(w),ve(),a.onFocusChange(!0)},Xe=()=>a.onFocusChange(!1);return je?.addEventListener(`focus`,Ye),je?.addEventListener(`blur`,Xe),{term:h,stream:S,scrollLines:e=>Je(()=>h.scrollLines(e)),scrollToTop:()=>Je(()=>h.scrollToTop()),scrollToBottom:()=>Je(()=>h.scrollToBottom()),armCtrl:e=>{me=e},reattach:ue,snapshot:b.snapshot,dispose(){D=!0,b.lower(),Ce.disconnect(),Ie(),Le(),Fe.dispose(),f.removeEventListener(`mousedown`,Re,{capture:!0}),f.removeEventListener(`wheel`,ze,{capture:!0}),f.removeEventListener(`touchmove`,ze,{capture:!0}),je?.removeEventListener(`paste`,Ue),je?.removeEventListener(`compositionend`,Ue),Ve.dispose(),He.dispose(),We.dispose(),De(),Te(),we(),be!==null&&window.clearTimeout(be),f.removeEventListener(`mousedown`,ke),document.removeEventListener(`mouseup`,Ae),je?.removeEventListener(`focus`,Ye),je?.removeEventListener(`blur`,Xe),Ke.dispose(),qe.dispose(),he.dispose(),ge(),ye.dispose(),xe.dispose(),pe(),k(),ae(),A(),ie.dispose(),w&&n.get()===w&&n.set(null),C.owners--,C.owners===0&&(ee.delete(S),C.attached&&te()),y.dispose(),h.dispose(),v.dispose()}}}export{wm as mountTerminal};
@@ -11,7 +11,7 @@
11
11
  <meta name="apple-mobile-web-app-capable" content="yes" />
12
12
  <meta name="apple-mobile-web-app-title" content="rove" />
13
13
  <title>rove</title>
14
- <script type="module" crossorigin src="/assets/index-DenH5E3i.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-ljCJBGsx.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-Bx7q_9X7.css">
16
16
  </head>
17
17
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sma1lboy/rove",
4
- "version": "0.9.290",
4
+ "version": "0.9.291",
5
5
  "description": "Rove: all your coding agents, in one place. An agentic development environment (ADE) for your terminal: Claude Code, Codex, Copilot and more, side by side in isolated worktrees, handing tasks to each other.",
6
6
  "keywords": [
7
7
  "terminal",
@@ -106,8 +106,8 @@
106
106
  "@vitest/coverage-v8": "2.1.9",
107
107
  "knip": "^6.14.2",
108
108
  "react-devtools-core": "^7.0.1",
109
- "rove-bridge": "0.0.51",
110
- "rove-weixin": "0.0.51",
109
+ "rove-bridge": "0.0.52",
110
+ "rove-weixin": "0.0.52",
111
111
  "typescript": "5.8.2",
112
112
  "vitest": "2.1.9"
113
113
  },
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-ak8qgzjj.js";import"./chunk-f6183qkp.js";import"./chunk-w14jz8pd.js";import"./chunk-btvs2v81.js";import"./chunk-38hnq4aq.js";import"./chunk-ejkar8qk.js";import"./chunk-rz19rphb.js";import"./chunk-67k0f144.js";import"./chunk-2xsxcdp6.js";import"./chunk-xtqfs6pg.js";import"./chunk-17e2tgyg.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-psxhek7n.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-gw8k0np0.js";import"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-qkehg2c1.js";import"./chunk-k6gx8sqh.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-d14hd9er.js";import"./chunk-ttn6n5s6.js";import"./chunk-5s913ckh.js";import"./chunk-e5dv15e5.js";import"./chunk-49zrnjq1.js";import"./chunk-mqfvzdpr.js";import"./chunk-c66qf8cb.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{defaultUiPrefsStatePath,resolveProductHomeDir}from"./chunk-8143k3t6.js";import{preRenameStateDir}from"./chunk-g6wb8p4p.js";import{ROVE_STATE_DIR_BASENAME}from"./chunk-nc46gddg.js";import{createHash}from"crypto";import{readFileSync}from"fs";import path from"path";var WORKTREE_ROOT_DIR="worktrees",REPO_LOCAL_ROVE_WORKTREE_ROOT_SUBPATH=".rove/worktrees",LEGACY_ROVE_WORKTREE_ROOT_SUBPATH=".claude/worktrees",REPO_LOCAL_MANAGED_WORKTREE_ROOT_SUBPATHS=[REPO_LOCAL_ROVE_WORKTREE_ROOT_SUBPATH,LEGACY_ROVE_WORKTREE_ROOT_SUBPATH],WORKTREE_BASE_KEY="worktree.basePath",PROJECT_DIR_TOKEN="$project_dir";function repoWorktreeDirName(repo){let safeBase=(path.basename(repo)||"repo").replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"repo",hash=createHash("sha1").update(path.resolve(repo)).digest("hex").slice(0,12);return`${safeBase}-${hash}`}function hasProjectDirToken(raw){let trimmed=raw.trim();return trimmed===PROJECT_DIR_TOKEN||trimmed.startsWith(`${PROJECT_DIR_TOKEN}/`)||process.platform==="win32"&&trimmed.startsWith(`${PROJECT_DIR_TOKEN}\\`)}function normalizeWorktreeBase(raw,projectDir){if(typeof raw!=="string")return null;let trimmed=raw.trim();if(!trimmed)return null;if(hasProjectDirToken(trimmed)){if(!projectDir)return null;let rest=trimmed.slice(PROJECT_DIR_TOKEN.length).replace(process.platform==="win32"?/^[/\\]+/:/^\/+/,"");return path.resolve(projectDir,rest)}let home=resolveProductHomeDir();if(trimmed==="~")return home;let expanded=trimmed.startsWith("~/")||process.platform==="win32"&&trimmed.startsWith("~\\")?path.join(home,trimmed.slice(2)):trimmed;return path.isAbsolute(expanded)?expanded:path.resolve(home,expanded)}function readWorktreeBaseOverride(projectDir){try{let raw=JSON.parse(readFileSync(defaultUiPrefsStatePath(),"utf8"));if(!raw||typeof raw!=="object"||Array.isArray(raw))return null;let value=raw[WORKTREE_BASE_KEY];return normalizeWorktreeBase(typeof value==="string"?value:null,projectDir)}catch{return null}}function defaultLocalWorktreesRoot(){return path.join(resolveProductHomeDir(),ROVE_STATE_DIR_BASENAME,WORKTREE_ROOT_DIR)}function legacyLocalWorktreesRoot(){return path.join(preRenameStateDir(resolveProductHomeDir()),WORKTREE_ROOT_DIR)}function worktreeRootFor(repo,override){if(!path.isAbsolute(repo))throw Error(`worktreeRootFor: repo must be an absolute path, got: ${repo}`);return path.join(override??defaultLocalWorktreesRoot(),repoWorktreeDirName(repo))}function managedWorktreeRootsFor(repo,override){if(!path.isAbsolute(repo))throw Error(`managedWorktreeRootsFor: repo must be an absolute path, got: ${repo}`);let dirName=repoWorktreeDirName(repo);return[...new Set([worktreeRootFor(repo,override),path.join(defaultLocalWorktreesRoot(),dirName),path.join(legacyLocalWorktreesRoot(),dirName),...REPO_LOCAL_MANAGED_WORKTREE_ROOT_SUBPATHS.map((subpath)=>path.join(repo,subpath))])]}
3
- export{WORKTREE_BASE_KEY,PROJECT_DIR_TOKEN,hasProjectDirToken,normalizeWorktreeBase,readWorktreeBaseOverride,defaultLocalWorktreesRoot,legacyLocalWorktreesRoot,worktreeRootFor,managedWorktreeRootsFor};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{DAEMON_UNREACHABLE_MESSAGE,argvToParams,booleanFlagsOf,callVerb,errorBody,errorEnvelope,executeVerb,isDaemonUnreachable,paramsToFlags,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-ahg4mfkk.js";import"./chunk-ak8qgzjj.js";import"./chunk-f6183qkp.js";import"./chunk-w14jz8pd.js";import"./chunk-btvs2v81.js";import"./chunk-38hnq4aq.js";import"./chunk-ejkar8qk.js";import"./chunk-rz19rphb.js";import"./chunk-67k0f144.js";import"./chunk-2xsxcdp6.js";import"./chunk-xtqfs6pg.js";import"./chunk-17e2tgyg.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-psxhek7n.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-gw8k0np0.js";import"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-qkehg2c1.js";import"./chunk-k6gx8sqh.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-d14hd9er.js";import"./chunk-ttn6n5s6.js";import"./chunk-5s913ckh.js";import"./chunk-e5dv15e5.js";import"./chunk-49zrnjq1.js";import"./chunk-mqfvzdpr.js";import"./chunk-c66qf8cb.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{toApiError,successEnvelope,runVerb,repeatableFlagsOf,paramsToFlags,isDaemonUnreachable,executeVerb,errorEnvelope,errorBody,callVerb,booleanFlagsOf,argvToParams,DAEMON_UNREACHABLE_MESSAGE};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Orchestrator}from"./chunk-7826y9er.js";import"./chunk-zw9725x3.js";import"./chunk-n8z4nb8v.js";import"./chunk-w2p3csad.js";import"./chunk-7f02vk0v.js";import"./chunk-4dt1gfb3.js";import{PLACEHOLDER_TASK_TITLE}from"./chunk-2xsxcdp6.js";import"./chunk-xtqfs6pg.js";import"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-k6gx8sqh.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-xmwp6je4.js";import"./chunk-6xppe9bj.js";import"./chunk-mqfvzdpr.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{PLACEHOLDER_TASK_TITLE,Orchestrator};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{managedWorktreeRootsFor,readWorktreeBaseOverride}from"./chunk-5dkx02g8.js";import{pathIdentity,pathSyntax,pathWithin,samePath}from"./chunk-pn5ygqn6.js";import{arch,cpus,freemem,loadavg,platform,totalmem}from"os";var mb=(bytes)=>Math.round(bytes/1024/1024);function readMachineLoad(){let cores=Math.max(1,cpus().length);return{platform:platform(),arch:arch(),cores,memTotalMb:mb(totalmem()),memFreeMb:mb(freemem()),...platform()==="win32"?{}:{load:Math.round((loadavg()[0]??0)/cores*100)/100},at:new Date().toISOString()}}import{existsSync}from"fs";import{homedir}from"os";import path from"path";function ownerFirst(a,b){let rank=(t)=>t.sharesWorkspaceOf?1:0;return rank(a)-rank(b)||(a.id<b.id?-1:a.id>b.id?1:0)}function resolvePtyOwner(tasks,taskId,tabId){if(!tabId)return taskId;return tasks.find((t)=>t.ptyAlias?.taskId===taskId&&t.ptyAlias.tabId===tabId)?.id??taskId}function crossesRepoBoundary(wt,cwd){let syntax=pathSyntax(cwd);for(let dir=cwd;!samePath(dir,wt);dir=syntax.dirname(dir)){if(existsSync(syntax.join(dir,".git")))return!0;if(samePath(dir,syntax.dirname(dir)))break}return!1}function worktreesOf(t){return[t.worktreePath,...(t.extraRepos??[]).map((x)=>x.worktreePath)].filter((p)=>!!p)}function matchTaskByCwd(tasks,cwd){let target=pathIdentity(cwd),best,bestWt="";for(let t of tasks)for(let worktree of worktreesOf(t)){let wt=pathIdentity(worktree);if(pathWithin(wt,target)===null)continue;if(samePath(wt,homedir())&&!samePath(wt,target))continue;if(!best||wt.length>bestWt.length||wt.length===bestWt.length&&ownerFirst(t,best)<0)best=t,bestWt=wt}if(best&&crossesRepoBoundary(bestWt,target))return;return best?.id}function tasksAtWorktreePath(tasks,worktreePath){let target=pathIdentity(worktreePath);return tasks.filter((t)=>worktreesOf(t).some((wt)=>pathIdentity(wt)===target)).sort(ownerFirst).map((t)=>t.id)}function findAdoptableWorktree(tasks,cwd){let target=pathIdentity(cwd),repos=new Set,known=new Set;for(let t of tasks){if(t.repo&&path.isAbsolute(t.repo))repos.add(pathIdentity(t.repo));for(let wt of worktreesOf(t))known.add(pathIdentity(wt))}for(let repo of repos)for(let root of managedWorktreeRootsFor(repo,readWorktreeBaseOverride(repo)).map(pathIdentity)){let prefix=root.endsWith("/")?root:`${root}/`,rest=pathWithin(root,target);if(!rest)continue;let name=rest.split("/")[0];if(!name)continue;let worktreePath=`${prefix}${name}`;if(known.has(worktreePath))return;return{repo,worktreePath}}return}var DISPATCH_PROMPT_HEAD_CHARS=160;var SETTLED=new Set(["done","failed"]);function next(status,state){if(state==="error"||state==="dead")return"failed";if(state==="running"&&(status==="delivered"||status==="asking"))return"working";if(state==="permission_needed"&&(status==="delivered"||status==="working"))return"asking";if((state==="turn_complete"||state==="idle")&&(status==="working"||status==="asking"))return"done";return}class DispatchLedger{bus;rows=[];seq=1;rev=0;expiry=null;relayed=new Set;off;now;constructor(bus,now){this.bus=bus;this.now=now??Date.now,this.off=bus.onPublish((event)=>{if(event.channel==="engine-state")this.take(event.payload);else if(event.channel==="machines")this.takeRelayed(event.payload)})}list(){return{rows:this.rows,rev:this.rev}}record(input){let at=this.now(),row={id:`x-${this.seq++}`,kind:input.kind,from:input.from,...input.routine?{routine:input.routine}:{},to:input.to,promptHead:input.promptHead.replace(/\s+/g," ").trim().slice(0,160),at,status:input.delivered?"delivered":"failed",statusAt:at,...input.reason?{reason:input.reason}:{},...input.deliveryId?{deliveryId:input.deliveryId}:{}};return this.rows=[...this.rows,row],this.publish(),row}close(){this.off(),this.clearExpiry()}take(payload){let p=payload;if(typeof p.taskId!=="string"||typeof p.state!=="string")return;let tabId=typeof p.tabId==="string"&&p.tabId?p.tabId:null,at=typeof p.at==="number"?p.at:this.now(),changed=!1;if(this.rows=this.rows.map((row)=>{if(SETTLED.has(row.status)||row.to.taskId!==p.taskId||at<row.at)return row;if(row.to.tabId!==null&&tabId!==null&&row.to.tabId!==tabId)return row;let status=next(row.status,p.state);if(!status)return row;return changed=!0,{...row,to:row.to.tabId===null&&tabId!==null?{...row.to,tabId}:row.to,status,statusAt:at,...status==="failed"?{reason:p.state}:{}}}),changed)this.publish()}takeRelayed(payload){let activity=payload?.live?.activity;if(!activity||typeof activity!=="object")return;let seen=new Set;for(let[taskId,reading]of Object.entries(activity)){if(!reading||typeof reading!=="object")continue;seen.add(taskId),this.take({...reading,taskId})}for(let taskId of this.relayed)if(!seen.has(taskId))this.take({taskId,state:"idle",at:this.now()});this.relayed=seen}publish(){this.rows=prune(this.rows,this.now()),this.rev+=1,this.bus.publish("dispatch.snapshot",this.list()),this.scheduleExpiry()}scheduleExpiry(){this.clearExpiry();let open=this.rows.filter((r)=>!SETTLED.has(r.status));if(open.length===0)return;let due=Math.min(...open.map((r)=>r.statusAt))+21600000;this.expiry=setTimeout(()=>{if(this.expiry=null,prune(this.rows,this.now()).length!==this.rows.length)this.publish();else this.scheduleExpiry()},Math.max(0,due-this.now())),this.expiry.unref?.()}clearExpiry(){if(this.expiry)clearTimeout(this.expiry);this.expiry=null}}function prune(rows,now){let open=rows.filter((r)=>!SETTLED.has(r.status)&&now-r.statusAt<21600000).slice(-100),settled=rows.filter((r)=>SETTLED.has(r.status)).slice(-40),keep=new Set([...open,...settled]);return rows.filter((r)=>keep.has(r))}
3
- export{resolvePtyOwner,matchTaskByCwd,tasksAtWorktreePath,findAdoptableWorktree,DISPATCH_PROMPT_HEAD_CHARS,DispatchLedger,readMachineLoad};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{INBOUND_CLASSES,INBOUND_KEY,deniedClasses,inboundClassOf,inboundRefusal,setInbound}from"./chunk-wwzgtqjr.js";import"./chunk-ak8qgzjj.js";import"./chunk-f6183qkp.js";import"./chunk-w14jz8pd.js";import"./chunk-btvs2v81.js";import"./chunk-38hnq4aq.js";import"./chunk-ejkar8qk.js";import"./chunk-rz19rphb.js";import"./chunk-67k0f144.js";import"./chunk-2xsxcdp6.js";import"./chunk-xtqfs6pg.js";import"./chunk-17e2tgyg.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-psxhek7n.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-gw8k0np0.js";import"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-qkehg2c1.js";import"./chunk-k6gx8sqh.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-d14hd9er.js";import"./chunk-ttn6n5s6.js";import"./chunk-5s913ckh.js";import"./chunk-e5dv15e5.js";import"./chunk-49zrnjq1.js";import"./chunk-mqfvzdpr.js";import"./chunk-c66qf8cb.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{setInbound,inboundRefusal,inboundClassOf,deniedClasses,INBOUND_KEY,INBOUND_CLASSES};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{invokeVerb,runApiSubcommand}from"./chunk-2dw5nnst.js";import{executeVerb,toApiError}from"./chunk-ahg4mfkk.js";import{API_SCHEMA_VERSION,API_VERBS,VERBS,VERB_GROUPS,VerbArgs,apiUsage,buildCountPlan,defaultApiRuntime,deliverPrompt,findVerb,fullSchema,parseAgentsSpec,parseFlags,schemaIndex,validateAgainstSpec,verbHelp,verbSchema}from"./chunk-ak8qgzjj.js";import"./chunk-f6183qkp.js";import"./chunk-w14jz8pd.js";import"./chunk-btvs2v81.js";import"./chunk-38hnq4aq.js";import"./chunk-ejkar8qk.js";import"./chunk-rz19rphb.js";import"./chunk-67k0f144.js";import"./chunk-2xsxcdp6.js";import"./chunk-xtqfs6pg.js";import"./chunk-17e2tgyg.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-psxhek7n.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-gw8k0np0.js";import"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-qkehg2c1.js";import"./chunk-k6gx8sqh.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-d14hd9er.js";import"./chunk-ttn6n5s6.js";import"./chunk-5s913ckh.js";import"./chunk-e5dv15e5.js";import"./chunk-49zrnjq1.js";import"./chunk-mqfvzdpr.js";import"./chunk-c66qf8cb.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import{ApiError}from"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{verbSchema,verbHelp,validateAgainstSpec,toApiError,schemaIndex,runApiSubcommand,parseFlags,parseAgentsSpec,invokeVerb,fullSchema,findVerb,executeVerb,deliverPrompt,defaultApiRuntime,buildCountPlan,apiUsage,VerbArgs,VERB_GROUPS,VERBS,ApiError,API_VERBS,API_SCHEMA_VERSION};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{GitWorktreeManager}from"./chunk-w2p3csad.js";import"./chunk-xtqfs6pg.js";import"./chunk-5dkx02g8.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-xmwp6je4.js";import"./chunk-6xppe9bj.js";import"./chunk-catrr0z3.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-7kysxgbq.js";import"./chunk-pn5ygqn6.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{GitWorktreeManager};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,defaultLocalWorktreesRoot,legacyLocalWorktreesRoot,managedWorktreeRootsFor,normalizeWorktreeBase,worktreeRootFor}from"./chunk-5dkx02g8.js";import{execHostForRepo}from"./chunk-y849hsgp.js";import{getRemoteRepoConfig,isRemoteRepoKey}from"./chunk-bgmpczgm.js";import{errorMessage}from"./chunk-9gctbddn.js";import{loadStateFile}from"./chunk-p84bhs57.js";import{pathWithin}from"./chunk-pn5ygqn6.js";class IllegalTransitionError extends Error{from;to;taskId;constructor(from,to,taskId){super(`illegal transition for task ${taskId}: ${from} -> ${to}`);this.from=from;this.to=to;this.taskId=taskId;this.name="IllegalTransitionError"}}class TaskNotFoundError extends Error{constructor(taskId){super(`task not found: ${taskId}`);this.name="TaskNotFoundError"}}class CannotDeleteMainTaskError extends Error{constructor(){super("cannot delete a main task; remove the repo from saved repos instead");this.name="CannotDeleteMainTaskError"}}var DIRTY_WORKTREE_CODE="DIRTY_WORKTREE";function describeDirtyWorktreeWork(ignored,dirty=[]){if(dirty.length>0)return`uncommitted or untracked changes: ${namePaths(dirty)}`;return ignored==="unknown"?"gitignored work this check could not read (git status --ignored failed) \u2014 nothing here can confirm it is empty":ignored.length>0?`gitignored work git status cannot see: ${ignored.join(", ")}`:"uncommitted or untracked changes"}var DIRTY_PATHS_SHOWN=10;function namePaths(paths){let shown=paths.slice(0,DIRTY_PATHS_SHOWN).join(", "),more=paths.length-DIRTY_PATHS_SHOWN;return more>0?`${shown} (+${more} more)`:shown}function dirtyRefusalReason(err){let message=errorMessage(err),at=message.indexOf(DIRTY_WORKTREE_CODE);if(at<0)return null;return message.slice(at+DIRTY_WORKTREE_CODE.length).replace(/^:\s*/,"")}class DirtyWorktreeError extends Error{taskId;ignored;dirty;repo;also;constructor(taskId,ignored=[],dirty=[],repo,also=[]){let where=repo?` (${repo})`:"",rest=also.map((f)=>`; also ${f.repo}: ${describeDirtyWorktreeWork(f.ignored,f.dirty)}`).join("");super(`${DIRTY_WORKTREE_CODE}: task ${taskId} worktree${where} has ${describeDirtyWorktreeWork(ignored,dirty)}${rest}`);this.taskId=taskId;this.ignored=ignored;this.dirty=dirty;this.repo=repo;this.also=also;this.name="DirtyWorktreeError"}}class WorktreeRemoveFailedError extends Error{taskId;cause;constructor(taskId,cause){super(`failed to remove worktree for task ${taskId}: ${errorMessage(cause)}`);this.taskId=taskId;this.cause=cause;this.name="WorktreeRemoveFailedError"}}var TASK_DELETING_CODE="TASK_DELETING";class TaskDeletingError extends Error{taskId;constructor(taskId){super(`${TASK_DELETING_CODE}: task ${taskId} is being deleted`);this.taskId=taskId;this.name="TaskDeletingError"}}var MAIN_CHECKOUT_DIRTY_CODE="MAIN_CHECKOUT_DIRTY";class MainCheckoutDirtyError extends Error{repo;dir;constructor(repo,dir){super(`${MAIN_CHECKOUT_DIRTY_CODE}: base checkout at ${dir} has uncommitted changes; commit them before landing (never git stash \u2014 the stash stack is shared by every worktree of this repo)`);this.repo=repo;this.dir=dir;this.name="MainCheckoutDirtyError"}}var EMPTY_BRANCH_CODE="EMPTY_BRANCH";class EmptyBranchError extends Error{branch;landedOn;constructor(branch,landedOn){super(`${EMPTY_BRANCH_CODE}: '${branch}' has no commits ahead of '${landedOn}' \u2014 landing it would be a no-op (the worker may not have delivered anything)`);this.branch=branch;this.landedOn=landedOn;this.name="EmptyBranchError"}}var EMPTY_BRANCH_DIRTY_WORKTREE_CODE="EMPTY_BRANCH_DIRTY_WORKTREE";class EmptyBranchDirtyWorktreeError extends Error{branch;landedOn;worktreePath;files;constructor(branch,landedOn,worktreePath,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${EMPTY_BRANCH_DIRTY_WORKTREE_CODE}: '${branch}' has no commits ahead of '${landedOn}' but its worktree ${worktreePath} has uncommitted changes (${list}) \u2014 commit them in the worktree first, then land again`);this.branch=branch;this.landedOn=landedOn;this.worktreePath=worktreePath;this.files=files;this.name="EmptyBranchDirtyWorktreeError"}}var MISSING_REF_CODE="MISSING_REF";class MissingRefError extends Error{branch;landedOn;dir;constructor(branch,landedOn,dir){super(`${MISSING_REF_CODE}: '${branch}' does not resolve in the base repo at ${dir} (comparing against '${landedOn}') \u2014 the branch was renamed or deleted outside Rove; re-point the task with \`rove api update --branch\` or recreate the branch`);this.branch=branch;this.landedOn=landedOn;this.dir=dir;this.name="MissingRefError"}}var LAND_CONFLICT_CODE="LAND_CONFLICT";class LandConflictError extends Error{taskId;branch;files;constructor(taskId,branch,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${LAND_CONFLICT_CODE}: merging '${branch}' hit conflicts, merge aborted \u2014 conflicted files: ${list}`);this.taskId=taskId;this.branch=branch;this.files=files;this.name="LandConflictError"}}var GIT_COMMAND_FAILED_CODE="GIT_COMMAND_FAILED";class GitCommandFailedError extends Error{command;stderr;constructor(command,stderr,hint){let detail=stderr.trim()||"(git printed nothing on stderr)";super(`${GIT_COMMAND_FAILED_CODE}: \`git ${command}\` failed \u2014 ${detail}${hint?`; ${hint}`:""}`);this.command=command;this.stderr=stderr;this.name="GitCommandFailedError"}}var WORKTREE_NAME_TAKEN_CODE="WORKTREE_NAME_TAKEN";class WorktreeNameTakenError extends Error{worktreeName;constructor(worktreeName){super(`${WORKTREE_NAME_TAKEN_CODE}: worktree name '${worktreeName}' is already in use in this repo \u2014 pick another, or omit --worktree-name for a generated one`);this.worktreeName=worktreeName;this.name="WorktreeNameTakenError"}}var INVALID_WORKTREE_NAME_CODE="INVALID_WORKTREE_NAME";class InvalidWorktreeNameError extends Error{worktreeName;constructor(worktreeName){super(`${INVALID_WORKTREE_NAME_CODE}: worktree name '${worktreeName}' must be a single path segment of letters, digits, '.', '_' or '-' (no '/', no '..', not starting with '.')`);this.worktreeName=worktreeName;this.name="InvalidWorktreeNameError"}}var NOT_A_GIT_REPO_CODE="NOT_A_GIT_REPO";class NotAGitRepoError extends Error{dir;constructor(dir){super(`${NOT_A_GIT_REPO_CODE}: ${dir} is not inside a git repository, so a child cannot get its own worktree \u2014 pass --no-worktree to share the directory`);this.dir=dir;this.name="NotAGitRepoError"}}var NOT_A_LINKED_REPO_CODE="NOT_A_LINKED_REPO";class NotALinkedRepoError extends Error{link;available;constructor(link,available){super(`${NOT_A_LINKED_REPO_CODE}: '${link}' is not a top-level symlink to a git checkout in the parent workspace (linked repos: ${available.length>0?available.join(", "):"none"})`);this.link=link;this.available=available;this.name="NotALinkedRepoError"}}var REMOTE_PARENT_UNSUPPORTED_CODE="REMOTE_PARENT_UNSUPPORTED";class RemoteParentUnsupportedError extends Error{taskId;constructor(taskId){super(`${REMOTE_PARENT_UNSUPPORTED_CODE}: task ${taskId} lives on a remote project \u2014 add the child from that machine's rove`);this.taskId=taskId;this.name="RemoteParentUnsupportedError"}}class ReparentRefusedError extends Error{code;constructor(code,detail){super(`${code}: ${detail}`);this.code=code;this.name="ReparentRefusedError"}}class MoveRefusedError extends Error{code;constructor(code,detail){super(`${code}: ${detail}`);this.code=code;this.name="MoveRefusedError"}}var TOO_MANY_REPOS_CODE="TOO_MANY_REPOS";class TooManyReposError extends Error{constructor(count,cap){super(`${TOO_MANY_REPOS_CODE}: ${count} repos exceed the cap of ${cap} per task (the first is the primary)`);this.name="TooManyReposError"}}var REPO_DUPLICATE_CODE="REPO_DUPLICATE";class RepoDuplicateError extends Error{repo;constructor(repo){super(`${REPO_DUPLICATE_CODE}: ${repo} is listed more than once (a subdirectory resolves to its repo root)`);this.repo=repo;this.name="RepoDuplicateError"}}var REMOTE_EXTRA_UNSUPPORTED_CODE="REMOTE_EXTRA_UNSUPPORTED";class RemoteExtraUnsupportedError extends Error{repo;constructor(repo){super(`${REMOTE_EXTRA_UNSUPPORTED_CODE}: ${repo} is a remote project \u2014 a task spanning several repos must keep all of them local`);this.repo=repo;this.name="RemoteExtraUnsupportedError"}}class ExtraRepoNotGitError extends Error{repo;constructor(repo){super(`${NOT_A_GIT_REPO_CODE}: ${repo} is not a git repository \u2014 every repo of a task needs one to cut its worktree and branch from`);this.repo=repo;this.name="ExtraRepoNotGitError"}}var FORK_UNSUPPORTED_CODE="FORK_UNSUPPORTED";class ForkUnsupportedError extends Error{constructor(reason){super(`${FORK_UNSUPPORTED_CODE}: ${reason}`);this.name="ForkUnsupportedError"}}import fs from"fs";import path from"path";var WORKTREE_BASE_CUSTOM_KEY="worktree.basePath.custom",PROJECT_SIBLING_BASE=`${PROJECT_DIR_TOKEN}/..`;function worktreeBaseKindOf(raw){let trimmed=raw.trim();if(!trimmed)return"default";if(trimmed.replace(/\/+$/,"")===PROJECT_SIBLING_BASE)return"nextToProject";return"custom"}function getWorktreeBaseOverride(projectDir){let value=loadStateFile()[WORKTREE_BASE_KEY];return normalizeWorktreeBase(typeof value==="string"?value:null,projectDir)}function worktreeRootFor2(repo){return worktreeRootFor(repo,getWorktreeBaseOverride(repo))}function managedWorktreeRootsFor2(repo){return managedWorktreeRootsFor(repo,getWorktreeBaseOverride(repo))}function worktreePathFor(repo,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`worktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return path.join(worktreeRootFor2(repo),slug)}async function listWorktreeDirNames(repo){if(isRemoteRepoKey(repo)){let basePath=getRemoteRepoConfig(repo)?.basePath;if(!basePath)return[];let names2=new Set,host=execHostForRepo(repo),entries=await Promise.all(remoteManagedWorktreeRootsFor(basePath).map((root)=>host.readdir(root)));for(let list of entries)for(let name of list)names2.add(name);return[...names2]}let names=new Set;for(let root of managedWorktreeRootsFor2(repo))try{for(let e of fs.readdirSync(root,{withFileTypes:!0}))if(e.isDirectory())names.add(e.name)}catch{}return[...names]}function managedWorktreeRootForPath(repo,candidate){if(!path.isAbsolute(repo)||!path.isAbsolute(candidate))return null;let target=canonicalize(candidate);for(let rootPath of managedWorktreeRootsFor2(repo)){let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel!==null&&rel!=="")return rootPath}return null}function isRoveManagedPath(repo,candidate){return managedWorktreeRootForPath(repo,candidate)!==null}function isUnderManagedWorktreesRoot(candidate,projectDir){if(!path.isAbsolute(candidate))return!1;let target=canonicalize(candidate),roots=[getWorktreeBaseOverride(projectDir)??"",defaultLocalWorktreesRoot(),legacyLocalWorktreesRoot()];for(let rootPath of roots){if(!rootPath)continue;let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel===null)continue;if(rel.split("/").filter(Boolean).length===2)return!0}return!1}function remoteWorktreeRootFor(basePath){return`${stripTrailingSlash(basePath)}/.rove/worktrees`}function remoteManagedWorktreeRootsFor(basePath){let base=stripTrailingSlash(basePath);return[`${base}/.rove/worktrees`,`${base}/.rove/worktrees`]}function remoteWorktreePathFor(basePath,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`remoteWorktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return`${remoteWorktreeRootFor(basePath)}/${slug}`}function remoteManagedRootForPath(basePath,candidate){for(let root of remoteManagedWorktreeRootsFor(basePath))if(candidate===root||candidate.startsWith(`${root}/`))return root;return null}function stripTrailingSlash(p){return p.length>1&&p.endsWith("/")?p.replace(/\/+$/,""):p}function requireAbsolute(name,value){if(!value||!path.isAbsolute(value))throw Error(`${name} must be an absolute path, got: ${JSON.stringify(value)}`)}function canonicalize(p){try{return fs.realpathSync(p)}catch{return path.resolve(p)}}
3
- export{IllegalTransitionError,TaskNotFoundError,CannotDeleteMainTaskError,DIRTY_WORKTREE_CODE,describeDirtyWorktreeWork,dirtyRefusalReason,DirtyWorktreeError,WorktreeRemoveFailedError,TASK_DELETING_CODE,TaskDeletingError,MainCheckoutDirtyError,EmptyBranchError,EMPTY_BRANCH_DIRTY_WORKTREE_CODE,EmptyBranchDirtyWorktreeError,MissingRefError,LandConflictError,GitCommandFailedError,WorktreeNameTakenError,InvalidWorktreeNameError,NotAGitRepoError,NotALinkedRepoError,REMOTE_PARENT_UNSUPPORTED_CODE,RemoteParentUnsupportedError,ReparentRefusedError,MoveRefusedError,TooManyReposError,RepoDuplicateError,RemoteExtraUnsupportedError,ExtraRepoNotGitError,FORK_UNSUPPORTED_CODE,ForkUnsupportedError,WORKTREE_BASE_CUSTOM_KEY,PROJECT_SIBLING_BASE,worktreeBaseKindOf,worktreePathFor,listWorktreeDirNames,managedWorktreeRootForPath,isRoveManagedPath,isUnderManagedWorktreesRoot,remoteWorktreePathFor,remoteManagedRootForPath,requireAbsolute,canonicalize};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{AUTO_MACHINE,LOCAL_MACHINE,addStaysHere,autoMachineFor,forwardVerb,invokeRouted,machineDaemonSocket,machineLoad,machinePtySocket,machineTasks,pickMachine,repoHosts,repoWanted,requireMachine,routeTarget}from"./chunk-c9chdgpd.js";import"./chunk-he640w8c.js";import"./chunk-5dkx02g8.js";import"./chunk-x0f8a3ez.js";import"./chunk-tsv1pnwd.js";import"./chunk-rj5g5zv1.js";import"./chunk-e5r66sx1.js";import"./chunk-han0d078.js";import"./chunk-yx4mar9e.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-0mw4pd9k.js";import"./chunk-catrr0z3.js";import"./chunk-ewdanfd9.js";import"./chunk-tn9gtf18.js";import"./chunk-y849hsgp.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-g7v0favq.js";import"./chunk-cmp64q4j.js";import"./chunk-yx3q2rek.js";import"./chunk-wy3wataa.js";import"./chunk-av0n24rf.js";import"./chunk-w7zv47mp.js";import"./chunk-q3cnqs5k.js";import"./chunk-88cap497.js";import"./chunk-8yce2acw.js";import"./chunk-29b3pj9h.js";import"./chunk-96kvwzj8.js";import"./chunk-bgmpczgm.js";import"./chunk-40dgv828.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-p84bhs57.js";import"./chunk-hkqcc1t4.js";import"./chunk-1tmmkk54.js";import"./chunk-7kysxgbq.js";import"./chunk-yfwn3fj5.js";import"./chunk-vfrxywtx.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-w8da1czv.js";import"./chunk-k0yjcgd8.js";import"./chunk-yt15y085.js";import"./chunk-7kgksv06.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{routeTarget,requireMachine,repoWanted,repoHosts,pickMachine,machineTasks,machinePtySocket,machineLoad,machineDaemonSocket,invokeRouted,forwardVerb,autoMachineFor,addStaysHere,LOCAL_MACHINE,AUTO_MACHINE};