phirepass-widgets 0.0.118 → 0.0.120

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 (25) hide show
  1. package/dist/cjs/index-C3v5xmUo.js +0 -1
  2. package/dist/cjs/phirepass-rdp.cjs.entry.js +1 -1
  3. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +1 -1
  4. package/dist/cjs/phirepass-terminal.cjs.entry.js +6 -4
  5. package/dist/cjs/{protocol-DCBMfc2u.js → protocol-eJBbdh77.js} +5 -5
  6. package/dist/collection/components/phirepass-terminal/phirepass-terminal.css +7 -0
  7. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +5 -3
  8. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  9. package/dist/{phirepass-widgets/p-CsYQJXY2.js → components/p-B5gxndLM.js} +1 -1
  10. package/dist/components/phirepass-rdp.js +1 -1
  11. package/dist/components/phirepass-sftp-client.js +1 -1
  12. package/dist/components/phirepass-terminal.js +2 -2
  13. package/dist/esm/index-BVOulYtW.js +0 -1
  14. package/dist/esm/phirepass-rdp.entry.js +1 -1
  15. package/dist/esm/phirepass-sftp-client.entry.js +1 -1
  16. package/dist/esm/phirepass-terminal.entry.js +6 -4
  17. package/dist/esm/{protocol-CsYQJXY2.js → protocol-B5gxndLM.js} +4 -4
  18. package/dist/phirepass-widgets/{p-c1c616ca.entry.js → p-1cf04c4a.entry.js} +1 -1
  19. package/dist/phirepass-widgets/{p-7ea2fdbc.entry.js → p-573c0400.entry.js} +2 -2
  20. package/dist/phirepass-widgets/{p-f1bc04a8.entry.js → p-6410eb75.entry.js} +1 -1
  21. package/dist/{components/p-CsYQJXY2.js → phirepass-widgets/p-B5gxndLM.js} +1 -1
  22. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  23. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  24. package/dist/types/components.d.ts +2 -2
  25. package/package.json +4 -4
@@ -116,7 +116,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
116
116
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
117
117
  return import(
118
118
  /* @vite-ignore */
119
- /* turbopackIgnore: true */
120
119
  /* webpackInclude: /\.entry\.js$/ */
121
120
  /* webpackExclude: /\.system\.entry\.js$/ */
122
121
  /* webpackMode: "lazy" */
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-C3v5xmUo.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
4
+ var protocol = require('./protocol-eJBbdh77.js');
5
5
 
6
6
  /**
7
7
  * RDP's display-control PDU describes a monitor in whole, even pixels within
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-C3v5xmUo.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
4
+ var protocol = require('./protocol-eJBbdh77.js');
5
5
 
6
6
  const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-C3v5xmUo.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
4
+ var protocol = require('./protocol-eJBbdh77.js');
5
5
 
6
6
  /**
7
7
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
@@ -214,7 +214,7 @@ var m=0,p=0,g=0,b=0;var I;(r=>{function u(t,a,s,i){return i!==void 0?`#${B(t)}${
214
214
  *--------------------------------------------------------------------------------------------*/
215
215
  var st=Object.create;var be=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var N=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var lt=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of At(e))!at.call(r,s)&&s!==t&&be(r,s,{get:()=>e[s],enumerable:!(i=nt(e,s))||i.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?st(ot(r)):{},lt(!r||!r.__esModule?be(t,"default",{value:r,enumerable:true}):t,r));var W=N(u=>{Object.defineProperty(u,"__esModule",{value:true});u.DEFAULT_FOREGROUND=u.DEFAULT_BACKGROUND=u.PALETTE_ANSI_256=u.PALETTE_VT340_GREY=u.PALETTE_VT340_COLOR=u.normalizeHLS=u.normalizeRGB=u.nearestColorIndex=u.fromRGBA8888=u.toRGBA8888=u.alpha=u.blue=u.green=u.red=u.BIG_ENDIAN=void 0;u.BIG_ENDIAN=new Uint8Array(new Uint32Array([4278190080]).buffer)[0]===255;u.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly.");function we(r){return r&255}u.red=we;function xe(r){return r>>>8&255}u.green=xe;function ye(r){return r>>>16&255}u.blue=ye;function ct(r){return r>>>24&255}u.alpha=ct;function m(r,e,t,i=255){return ((i&255)<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}u.toRGBA8888=m;function dt(r){return [r&255,r>>8&255,r>>16&255,r>>>24]}u.fromRGBA8888=dt;function ht(r,e){let t=we(r),i=xe(r),s=ye(r),n=Number.MAX_SAFE_INTEGER,A=-1;for(let o=0;o<e.length;++o){let a=t-e[o][0],c=i-e[o][1],h=s-e[o][2],l=a*a+c*c+h*h;if(!l)return o;l<n&&(n=l,A=o);}return A}u.nearestColorIndex=ht;function de(r,e,t){return Math.max(r,Math.min(t,e))}function he(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?e+(r-e)*6*t:t*2<1?r:t*3<2?e+(r-e)*(4-t*6):e}function gt(r,e,t){if(!t){let n=Math.round(e*255);return m(n,n,n)}let i=e<.5?e*(1+t):e+t-e*t,s=2*e-i;return m(de(0,255,Math.round(he(i,s,r+1/3)*255)),de(0,255,Math.round(he(i,s,r)*255)),de(0,255,Math.round(he(i,s,r-1/3)*255)))}function g(r,e,t){return (4278190080|Math.round(t/100*255)<<16|Math.round(e/100*255)<<8|Math.round(r/100*255))>>>0}u.normalizeRGB=g;function ut(r,e,t){return gt((r+240%360)/360,e/100,t/100)}u.normalizeHLS=ut;u.PALETTE_VT340_COLOR=new Uint32Array([g(0,0,0),g(20,20,80),g(80,13,13),g(20,80,20),g(80,20,80),g(20,80,80),g(80,80,20),g(53,53,53),g(26,26,26),g(33,33,60),g(60,26,26),g(33,60,33),g(60,33,60),g(33,60,60),g(60,60,33),g(80,80,80)]);u.PALETTE_VT340_GREY=new Uint32Array([g(0,0,0),g(13,13,13),g(26,26,26),g(40,40,40),g(6,6,6),g(20,20,20),g(33,33,33),g(46,46,46),g(0,0,0),g(13,13,13),g(26,26,26),g(40,40,40),g(6,6,6),g(20,20,20),g(33,33,33),g(46,46,46)]);u.PALETTE_ANSI_256=(()=>{let r=[m(0,0,0),m(205,0,0),m(0,205,0),m(205,205,0),m(0,0,238),m(205,0,205),m(0,250,205),m(229,229,229),m(127,127,127),m(255,0,0),m(0,255,0),m(255,255,0),m(92,92,255),m(255,0,255),m(0,255,255),m(255,255,255)],e=[0,95,135,175,215,255];for(let t=0;t<6;++t)for(let i=0;i<6;++i)for(let s=0;s<6;++s)r.push(m(e[t],e[i],e[s]));for(let t=8;t<=238;t+=10)r.push(m(t,t,t));return new Uint32Array(r)})();u.DEFAULT_BACKGROUND=m(0,0,0,255);u.DEFAULT_FOREGROUND=m(255,255,255,255);});var Ke=N(re=>{Object.defineProperty(re,"__esModule",{value:true});re.InWasm=void 0;function R(r){if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<t.length;++i)t[i]=e.charCodeAt(i);return t}function Tt(r){if(r.d){let{t:e,s:t,d:i}=r,s,n,A=WebAssembly;return e===2?t?()=>s||(s=R(i)):()=>Promise.resolve(s||(s=R(i))):e===1?t?()=>n||(n=new A.Module(s||(s=R(i)))):()=>n?Promise.resolve(n):A.compile(s||(s=R(i))).then(o=>n=o):t?o=>new A.Instance(n||(n=new A.Module(s||(s=R(i)))),o):o=>n?A.instantiate(n,o):A.instantiate(s||(s=R(i)),o).then(a=>(n=a.module)&&a.instance)}if(typeof _wasmCtx>"u")throw new Error('must run "inwasm"');_wasmCtx.add(r);}re.InWasm=Tt;});var Oe=N(Ce=>{Object.defineProperty(Ce,"__esModule",{value:true});var bt=Ke(),wt=(0, bt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqxAwKuAQEFf0GIKCgCAEGgKGohAUGEKCgCACIAQYAoKAIAQQFrQXxxIgJIBEAgAkGgKGohAyAAQaAoaiEAA0AgAC0AA0ECdCgCgCAgAC0AAkECdCgCgBggAC0AAUECdCgCgBAgAC0AAEECdCgCgAhycnIiBEH///8HSwRAQQEPCyABIAQ2AgAgAUEDaiEBIABBBGoiACADSQ0ACwtBhCggAjYCAEGIKCABQaAoazYCAEEAC/4BAQZ/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQQEhAxAADQFBgCgoAgAhAUGEKCgCACEAC0EBIQMgASAAayIEQQJIDQAgAEGhKGotAABBAnQoAoAQIABBoChqLQAAQQJ0KAKACHIhAQJAIARBAkYEQEEBIQIMAQtBASECIAAtAKIoIgVBPUcEQEECIQIgBUECdCgCgBggAXIhAQsgBEEERw0AIAAtAKMoIgBBPUYNACACQQFqIQIgAEECdCgCgCAgAXIhAQsgAUH///8HSw0AQYgoKAIAQaAoaiABNgIAQYgoQYgoKAIAIAJqIgA2AgAgAEGQKCgCAEchAwsgAwsAdglwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQEFY2xhbmdWMTguMC4wIChodHRwczovL2dpdGh1Yi5jb20vbGx2bS9sbHZtLXByb2plY3QgZDFlNjg1ZGY0NWRjNTk0NGI0M2QyNTQ3ZDAxMzhjZDRhM2VlNGVmZSkALA90YXJnZXRfZmVhdHVyZXMCKw9tdXRhYmxlLWdsb2JhbHMrCHNpZ24tZXh0"}),x=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(r=>r.charCodeAt(0))),L=new Uint32Array(1024);L.fill(4278190080);for(let r=0;r<x.length;++r)L[x[r]]=r<<2;for(let r=0;r<x.length;++r)L[256+x[r]]=r>>4|(r<<4&255)<<8;for(let r=0;r<x.length;++r)L[512+x[r]]=r>>2<<8|(r<<6&255)<<16;for(let r=0;r<x.length;++r)L[768+x[r]]=r<<16;var xt=new Uint8Array(0),me=class{constructor(e){this.keepSize=e;}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):xt}release(){this._inst&&(this._mem.buffer.byteLength>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0));}init(e){let t=this._m32,i=(Math.ceil(e/3)+1288)*4;this._inst?this._mem.buffer.byteLength<i&&(this._mem.grow(Math.ceil((i-this._mem.buffer.byteLength)/65536)),t=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,1288*4)):(this._mem=new WebAssembly.Memory({initial:Math.ceil(i/65536)}),this._inst=wt({env:{memory:this._mem}}),t=new Uint32Array(this._mem.buffer,0),t.set(L,256),this._d=new Uint8Array(this._mem.buffer,1288*4)),t[1284]=e,t[1283]=Math.ceil(e/3)*4,t[1280]=0,t[1281]=0,t[1282]=0,this._m32=t;}put(e,t,i){if(!this._inst)return 1;let s=this._m32;return i-t+s[1280]>s[1283]?1:(this._d.set(e.subarray(t,i),s[1280]),s[1280]+=i-t,s[1280]-s[1281]>=131072?this._inst.exports.dec():0)}end(){return this._inst?this._inst.exports.end():1}};Ce.default=me;});var je=N(oe=>{Object.defineProperty(oe,"__esModule",{value:true});oe.LIMITS=void 0;oe.LIMITS={CHUNK_SIZE:16384,PALETTE_SIZE:4096,MAX_WIDTH:16384,BYTES:"AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hlaWdodAAOGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtfaW5pdGlhbGl6ZQACCXN0YWNrU2F2ZQARDHN0YWNrUmVzdG9yZQASCnN0YWNrQWxsb2MAEwkMAQBBAQsGCgcJDxACDAEBCq5UEgMAAQsFAEGgCAsGAEGQiQELBgBBsIkCCwUAQZAJC+okAQh/QeQIKAIAIQVB4AgoAgAhA0HoCCgCACEIIAFBkIkBaiIJQf8BOgAAIAAgAUgEQCAAQZCJAWohBgNAIAMhBCAGQQFqIQECQCAGLQAAQf8AcSIDQTBrQQlLBEAgASEGDAELQewIKAIAQQJ0Q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GAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8HcSECQQAhAQNAIAFBCXQiBkEQckHAiQpqQbCJAkGABPwKAAAgBkGQBHJBwIkKakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsgAUEHdEEEcgVBBAshASAFBEAgAUECdEHAiQpqQbCJAkGABPwKAAALIARBAUgNACADQQFxIQUgBwR/IANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQdCJDmpBsIkCQYAE/AoAACAGQZAEckHQiQ5qQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACyABQQd0QQRyBUEECyEBIAUEQCABQQJ0QdCJDmpBsIkCQYAE/AoAAAsgBEEBSA0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ABarJDAAC0Q5UhBQJ9IAGyQwAAyEKVIgNDAAAAP10EQCADIAZDAACAP5KUDAELIAYgA0MAAIA/IAaTlJILIQcgAyADkiEGAkAgBUOrqqo+kiIEQwAAAABdBEAgBEMAAIA/kiEEDAELIARDAACAP15FDQAgBEMAAIC/kiEECyAGIAeTIQMgBUMAAAAAXSEAAn8CfSADIAcgA5NDAADAQJQgBJSSIARDq6oqPl0NABogByAEQwAAAD9dDQAaIAMgBEOrqio/XUUNABogAyAHIAOTIARDAADAwJRDAACAQJKUkgtDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALIQECQCAABEAgBUMAAIA/kiEEDAELIAUiBEMAAIA/XkUNACAFQwAAgL+SIQQLIAVDq6qqvpIiBUMAAAAAXSECAn8CfSADIAcgA5NDAADAQJQgBJSSIARDq6oqPl0NABogByAEQwAAAD9dDQAaIAMgBEOrqio/XUUNABogAyAHIAOTIARDAADAwJRDAACAQJKUkgtDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALIQACQCACBEAgBUMAAIA/kiEFDAELIAVDAACAP15FDQAgBUMAAIC/kiEFCwJAIAVDq6oqPl0EQCADIAcgA5NDAADAQJQgBZSSIQcMAQsgBUMAAAA/XQ0AIAVDq6oqP11FBEAgAyEHDAELIAMgByADkyAFQwAAwMCUQwAAgECSlJIhBwsgAEEIdAJ/IAdDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF"};});var Xe=N(b=>{Object.defineProperty(b,"__esModule",{value:true});b.decodeAsync=b.decode=b.Decoder=b.DecoderAsync=void 0;var U=W(),Q=je();function kt(r){if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<t.length;++i)t[i]=e.charCodeAt(i);return t}var Ve=kt(Q.LIMITS.BYTES),K,ae=new Uint32Array,_e=class{constructor(){this.bandHandler=e=>1,this.modeHandler=e=>1;}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}},Mt={memoryLimit:2048*65536,sixelColor:U.DEFAULT_FOREGROUND,fillColor:U.DEFAULT_BACKGROUND,palette:U.PALETTE_VT340_COLOR,paletteLimit:Q.LIMITS.PALETTE_SIZE,truncate:true};function Ze(r){let e=new _e,t={env:{handle_band:e.handle_band.bind(e),mode_parsed:e.mode_parsed.bind(e)}};return WebAssembly.instantiate(K||Ve,t).then(i=>(K=K||i.module,new O(r,i.instance||i,e)))}b.DecoderAsync=Ze;var O=class{constructor(e,t,i){if(this._PIXEL_OFFSET=Q.LIMITS.MAX_WIDTH+4,this._canvas=ae,this._bandWidths=[],this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},Mt,e),this._opts.paletteLimit>Q.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${Q.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else {let s=K||(K=new WebAssembly.Module(Ve));t=new WebAssembly.Instance(s,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}});}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),Q.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),Q.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(U.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0);}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(e===2){let t=this.width*this.height;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t);}this._maxWidth=this._width;}else if(e===1)if(this._level===2){let t=Math.min(this._rasterWidth,Q.LIMITS.MAX_WIDTH)*this._rasterHeight;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t);}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){let i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&i*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");let s=new Uint32Array(Math.ceil(i/65536)*65536);s.set(this._canvas),this._canvas=s;}}_handle_band(e){let t=this._PIXEL_OFFSET,i=this._lastOffset;if(this._mode===2){let s=this.height-this._currentHeight,n=0;for(;n<6&&s>0;)this._canvas.set(this._pSrc.subarray(t*n,t*n+e),i+e*n),n++,s--;this._lastOffset+=e*n,this._currentHeight+=n;}else if(this._mode===1){this._realloc(i,e*6),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let s=0;s<6;++s)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),i+e*s);this._bandWidths.push(e),this._lastOffset+=e*6,this._currentHeight+=6;}return 0}get width(){return this._mode!==1?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return this._mode!==1?this._height:this._wasm.current_width()?this._bandWidths.length*6+this._wasm.current_height():this._bandWidths.length*6}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return {width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,s=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,s?1:0),t&&this._palette.set(t.subarray(0,Q.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0;}decode(e,t=0,i=e.length){let s=t;for(;s<i;){let n=Math.min(i-s,Q.LIMITS.CHUNK_SIZE);this._chunk.set(e.subarray(s,s+=n)),this._wasm.decode(0,n);}}decodeString(e,t=0,i=e.length){let s=t;for(;s<i;){let n=Math.min(i-s,Q.LIMITS.CHUNK_SIZE);for(let A=0,o=s;A<n;++A,++o)this._chunk[A]=e.charCodeAt(o);s+=n,this._wasm.decode(0,n);}}get data32(){if(this._mode===0||!this.width||!this.height)return ae;let e=this._wasm.current_width();if(this._mode===2){let t=this.height-this._currentHeight;if(t>0){let i=this._PIXEL_OFFSET,s=this._lastOffset,n=0;for(;n<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*n,i*n+e),s+e*n),n++,t--;t&&this._canvas.fill(this._fillColor,s+e*n);}return this._canvas.subarray(0,this.width*this.height)}if(this._mode===1){if(this._minWidth===this._maxWidth){let n=false;if(e)if(e!==this._minWidth)n=true;else {let A=this._PIXEL_OFFSET,o=this._lastOffset;this._realloc(o,e*6);for(let a=0;a<6;++a)this._canvas.set(this._pSrc.subarray(A*a,A*a+e),o+e*a);}if(!n)return this._canvas.subarray(0,this.width*this.height)}let t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,s=0;for(let n=0;n<this._bandWidths.length;++n){let A=this._bandWidths[n];for(let o=0;o<6;++o)t.set(this._canvas.subarray(s,s+=A),i),i+=this.width;}if(e){let n=this._PIXEL_OFFSET,A=this._wasm.current_height();for(let o=0;o<A;++o)t.set(this._pSrc.subarray(n*o,n*o+e),i+this.width*o);}return t}return ae}get data8(){return new Uint8ClampedArray(this.data32.buffer,0,this.width*this.height*4)}release(){this._canvas=ae,this._bandWidths.length=0,this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._wasm.init(U.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0);}};b.Decoder=O;function Rt(r,e){let t=new O(e);return t.init(),typeof r=="string"?t.decodeString(r):t.decode(r),{width:t.width,height:t.height,data32:t.data32,data8:t.data8}}b.decode=Rt;async function Lt(r,e){let t=await Ze(e);return t.init(),typeof r=="string"?t.decodeString(r):t.decode(r),{width:t.width,height:t.height,data32:t.data32,data8:t.data8}}b.decodeAsync=Lt;});var fe=Y(W());var ke;(o=>{function r(a){return a<0}o.isLessThan=r;function e(a){return a<=0}o.isLessThanOrEqual=e;function t(a){return a>0}o.isGreaterThan=t;function i(a){return a===0}o.isNeitherLessOrGreaterThan=i,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0;})(ke||={});function Ge(r,e){let t=this,i=false,s;return function(){if(i)return s;if(i=true,e);else s=r.apply(t,arguments);return s}}var ue;(rt=>{function r(d){return d&&typeof d=="object"&&typeof d[Symbol.iterator]=="function"}rt.is=r;let e=Object.freeze([]);function t(){return e}rt.empty=t;function*i(d){yield d;}rt.single=i;function s(d){return r(d)?d:i(d)}rt.wrap=s;function n(d){return d||e}rt.from=n;function*A(d){for(let p=d.length-1;p>=0;p--)yield d[p];}rt.reverse=A;function o(d){return !d||d[Symbol.iterator]().next().done===true}rt.isEmpty=o;function a(d){return d[Symbol.iterator]().next().value}rt.first=a;function c(d,p){let f=0;for(let D of d)if(p(D,f++))return true;return false}rt.some=c;function h(d,p){for(let f of d)if(p(f))return f}rt.find=h;function*l(d,p){for(let f of d)p(f)&&(yield f);}rt.filter=l;function*I(d,p){let f=0;for(let D of d)yield p(D,f++);}rt.map=I;function*E(d,p){let f=0;for(let D of d)yield*p(D,f++);}rt.flatMap=E;function*C(...d){for(let p of d)yield*p;}rt.concat=C;function _(d,p,f){let D=f;for(let P of d)D=p(D,P);return D}rt.reduce=_;function*B(d,p,f=d.length){for(p<0&&(p+=d.length),f<0?f+=d.length:f>d.length&&(f=d.length);p<f;p++)yield d[p];}rt.slice=B;function y(d,p=Number.POSITIVE_INFINITY){let f=[];if(p===0)return [f,d];let D=d[Symbol.iterator]();for(let P=0;P<p;P++){let Te=D.next();if(Te.done)return [f,rt.empty()];f.push(Te.value);}return [f,{[Symbol.iterator](){return D}}]}rt.consume=y;async function k(d){let p=[];for await(let f of d)p.push(f);return Promise.resolve(p)}rt.asyncToArray=k;})(ue||={});function ee(r){return r}function H(r,e){}function mt(r){if(ue.is(r)){let e=[];for(let t of r)if(t)try{t.dispose();}catch(i){e.push(i);}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function Ue(r){let e=ee({dispose:Ge(()=>{r();})});return e}var X=class X{constructor(){this._toDispose=new Set;this._isDisposed=false;}dispose(){this._isDisposed||(this._isDisposed=true,this.clear());}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{mt(this._toDispose);}finally{this._toDispose.clear();}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?X.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose();}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),H());}};X.DISABLE_DISPOSED_WARNING=false;var Ie=X,v=class{constructor(){this._store=new Ie;}dispose(){this._store.dispose();}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};v.None=Object.freeze({dispose(){}});var V=class{constructor(){this._isDisposed=false;}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e);}clear(){this.value=void 0;}dispose(){this._isDisposed=true,this._value?.dispose(),this._value=void 0;}clearAndLeak(){let e=this._value;return this._value=void 0,e}};var Ct=4096,pe=24,T=class r extends v{constructor(t){super();this._terminal=t;this._optionsRefresh=this._register(new V);this._oldOpen=this._terminal._core.open,this._terminal._core.open=i=>{this._oldOpen?.call(this._terminal._core,i),this._open();},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(i=>{i==="fontSize"&&(this.rescaleCanvas(),this._renderService?.refreshRows(0,this._terminal.rows));}),this._register(Ue(()=>{this.removeLayerFromDom(),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this.canvas=void 0,this._ctx=void 0,this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0;}));}static createCanvas(t,i,s){let n=(t||document).createElement("canvas");return n.width=i|0,n.height=s|0,n}static createImageData(t,i,s,n){if(typeof ImageData!="function"){let A=t.createImageData(i,s);return n&&A.data.set(new Uint8ClampedArray(n,0,i*s*4)),A}return n?new ImageData(new Uint8ClampedArray(n,0,i*s*4),i,s):new ImageData(i,s)}static createImageBitmap(t){return typeof createImageBitmap!="function"?Promise.resolve(void 0):createImageBitmap(t)}showPlaceholder(t){t?!this._placeholder&&this.cellSize.height!==-1&&this._createPlaceHolder(Math.max(this.cellSize.height+1,pe)):(this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),this._renderService?.refreshRows(0,this._terminal.rows);}get dimensions(){return this._renderService?.dimensions}get cellSize(){return {width:this.dimensions?.css.cell.width||-1,height:this.dimensions?.css.cell.height||-1}}clearLines(t,i){this._ctx?.clearRect(0,t*(this.dimensions?.css.cell.height||0),this.dimensions?.css.canvas.width||0,(++i-t)*(this.dimensions?.css.cell.height||0));}clearAll(){this._ctx?.clearRect(0,0,this.canvas?.width||0,this.canvas?.height||0);}draw(t,i,s,n,A=1){if(!this._ctx)return;let{width:o,height:a}=this.cellSize;if(o===-1||a===-1)return;this._rescaleImage(t,o,a);let c=t.actual,h=Math.ceil(c.width/o),l=i%h*o,I=Math.floor(i/h)*a,E=s*o,C=n*a,_=A*o+l>c.width?c.width-l:A*o,B=I+a>c.height?c.height-I:a;this._ctx.drawImage(c,Math.floor(l),Math.floor(I),Math.ceil(_),Math.ceil(B),Math.floor(E),Math.floor(C),Math.ceil(_),Math.ceil(B));}extractTile(t,i){let{width:s,height:n}=this.cellSize;if(s===-1||n===-1)return;this._rescaleImage(t,s,n);let A=t.actual,o=Math.ceil(A.width/s),a=i%o*s,c=Math.floor(i/o)*n,h=s+a>A.width?A.width-a:s,l=c+n>A.height?A.height-c:n,I=r.createCanvas(this.document,h,l),E=I.getContext("2d");if(E)return E.drawImage(A,Math.floor(a),Math.floor(c),Math.floor(h),Math.floor(l),0,0,Math.floor(h),Math.floor(l)),I}drawPlaceholder(t,i,s=1){if(this._ctx){let{width:n,height:A}=this.cellSize;if(n===-1||A===-1||(this._placeholder?A>=this._placeholder.height&&this._createPlaceHolder(A+1):this._createPlaceHolder(Math.max(A+1,pe)),!this._placeholder))return;this._ctx.drawImage(this._placeholderBitmap||this._placeholder,t*n,i*A%2?0:1,n*s,A,t*n,i*A,n*s,A);}}rescaleCanvas(){this.canvas&&(this.canvas.width!==this.dimensions.css.canvas.width||this.canvas.height!==this.dimensions.css.canvas.height)&&(this.canvas.width=this.dimensions.css.canvas.width||0,this.canvas.height=this.dimensions.css.canvas.height||0);}_rescaleImage(t,i,s){if(i===t.actualCellSize.width&&s===t.actualCellSize.height)return;let{width:n,height:A}=t.origCellSize;if(i===n&&s===A){t.actual=t.orig,t.actualCellSize.width=n,t.actualCellSize.height=A;return}let o=r.createCanvas(this.document,Math.ceil(t.orig.width*i/n),Math.ceil(t.orig.height*s/A)),a=o.getContext("2d");a&&(a.drawImage(t.orig,0,0,o.width,o.height),t.actual=o,t.actualCellSize.width=i,t.actualCellSize.height=s);}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=t=>{this.removeLayerFromDom(),this._oldSetRenderer?.call(this._renderService,t);};}insertLayerToDom(){this.document&&this._terminal._core.screenElement?this.canvas||(this.canvas=r.createCanvas(this.document,this.dimensions?.css.canvas.width||0,this.dimensions?.css.canvas.height||0),this.canvas.classList.add("xterm-image-layer"),this._terminal._core.screenElement.appendChild(this.canvas),this._ctx=this.canvas.getContext("2d",{alpha:true,desynchronized:true}),this.clearAll()):console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");}removeLayerFromDom(){this.canvas&&(this._ctx=void 0,this.canvas.remove(),this.canvas=void 0);}_createPlaceHolder(t=pe){this._placeholderBitmap?.close(),this._placeholderBitmap=void 0;let i=32,s=r.createCanvas(this.document,i,t),n=s.getContext("2d",{alpha:false});if(!n)return;let A=r.createImageData(n,i,t),o=new Uint32Array(A.data.buffer),a=(0, fe.toRGBA8888)(0,0,0),c=(0, fe.toRGBA8888)(255,255,255);o.fill(a);for(let I=0;I<t;++I){let E=I%2,C=I*i;for(let _=0;_<i;_+=2)o[C+_+E]=c;}n.putImageData(A,0,0);let h=screen.width+i-1&-32||Ct;this._placeholder=r.createCanvas(this.document,h,t);let l=this._placeholder.getContext("2d",{alpha:false});if(!l){this._placeholder=void 0;return}for(let I=0;I<h;I+=i)l.drawImage(s,I,0);r.createImageBitmap(this._placeholder).then(I=>this._placeholderBitmap=I);}get document(){return this._terminal._core._coreBrowserService?.window.document}};var S={width:7,height:14},G=class r{constructor(e=0,t=0,i=-1,s=-1){this.imageId=i;this.tileId=s;this._ext=0;this._urlId=0;this._ext=e,this._urlId=t;}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e;}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048;}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863;}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384;}get urlId(){return this._urlId}set urlId(e){this._urlId=e;}clone(){return new r(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0&&this.imageId===-1}},F=new G,ie=class{constructor(e,t,i){this._terminal=e;this._renderer=t;this._opts=i;this._images=new Map;this._lastId=0;this._lowestId=0;this._fullyCleared=false;this._needsFullClear=false;this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit);}catch(s){console.error(s.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`);}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows};}dispose(){this.reset();}reset(){for(let e of this._images.values())e.marker?.dispose();this._images.clear(),this._renderer.clearAll();}getLimit(){return this._pixelLimit*4/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0);}getUsage(){return this._getStoredPixels()*4/1e6}_getStoredPixels(){let e=0;for(let t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){let t=this._images.get(e);this._images.delete(e),t&&window.ImageBitmap&&t.orig instanceof ImageBitmap&&t.orig.close();}wipeAlternate(){let e=[];for(let[t,i]of this._images.entries())i.bufferType==="alternate"&&(i.marker?.dispose(),e.push(t));for(let t of e)this._delImg(t);this._needsFullClear=true,this._fullyCleared=false;}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;(t.width===-1||t.height===-1)&&(t=S);let i=Math.ceil(e/t.height);for(let s=1;s<i;++s)this._terminal._core._inputHandler.lineFeed();}}addImage(e){this._evictOldest(e.width*e.height);let t=this._renderer.cellSize;(t.width===-1||t.height===-1)&&(t=S);let i=Math.ceil(e.width/t.width),s=Math.ceil(e.height/t.height),n=++this._lastId,A=this._terminal._core.buffer,o=this._terminal.cols,a=this._terminal.rows,c=A.x,h=A.y,l=c,I=0;this._opts.sixelScrolling||(A.x=0,A.y=0,l=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(A.y);for(let B=0;B<s;++B){let y=A.lines.get(A.y+A.ybase);for(let k=0;k<i&&!(l+k>=o);++k)this._writeToCell(y,l+k,n,B*i+k),I++;if(this._opts.sixelScrolling)B<s-1&&this._terminal._core._inputHandler.lineFeed();else if(++A.y>=a)break;A.x=l;}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(A.y),this._opts.sixelScrolling?A.x=l:(A.x=c,A.y=h);let E=[];for(let[B,y]of this._images.entries())y.tileCount<1&&(y.marker?.dispose(),E.push(B));for(let B of E)this._delImg(B);let C=this._terminal.registerMarker(0);C?.onDispose(()=>{this._images.get(n)&&this._delImg(n);}),this._terminal.buffer.active.type==="alternate"&&this._evictOnAlternate();let _={orig:e,origCellSize:t,actual:e,actualCellSize:{...t},marker:C||void 0,tileCount:I,bufferType:this._terminal.buffer.active.type};this._images.set(n,_);}render(e){if(!this._renderer.canvas&&this._images.size&&(this._renderer.insertLayerToDom(),!this._renderer.canvas))return;if(this._renderer.rescaleCanvas(),!this._images.size){this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=true,this._needsFullClear=false),this._renderer.canvas&&this._renderer.removeLayerFromDom();return}this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=true,this._needsFullClear=false);let{start:t,end:i}=e,s=this._terminal._core.buffer,n=this._terminal._core.cols;this._renderer.clearLines(t,i);for(let A=t;A<=i;++A){let o=s.lines.get(A+s.ydisp);if(!o)return;for(let a=0;a<n;++a)if(o.getBg(a)&268435456){let c=o._extendedAttrs[a]||F,h=c.imageId;if(h===void 0||h===-1)continue;let l=this._images.get(h);if(c.tileId!==-1){let I=c.tileId,E=a,C=1;for(;++a<n&&o.getBg(a)&268435456&&(c=o._extendedAttrs[a]||F)&&c.imageId===h&&c.tileId===I+C;)C++;a--,l?l.actual&&this._renderer.draw(l,I,E,A,C):this._opts.showPlaceholder&&this._renderer.drawPlaceholder(E,A,C),this._fullyCleared=false;}}}}viewportResize(e){if(!this._images.size){this._viewportMetrics=e;return}if(this._viewportMetrics.cols>=e.cols){this._viewportMetrics=e;return}let t=this._terminal._core.buffer,i=t.lines.length,s=this._viewportMetrics.cols-1;for(let n=0;n<i;++n){let A=t.lines.get(n);if(A.getBg(s)&268435456){let o=A._extendedAttrs[s]||F,a=o.imageId;if(a===void 0||a===-1)continue;let c=this._images.get(a);if(!c)continue;let h=Math.ceil((c.actual?.width||0)/c.actualCellSize.width);if(o.tileId%h+1>=h)continue;let l=false;for(let C=s+1;C>e.cols;++C)if(A._data[C*3+0]&4194303){l=true;break}if(l)continue;let I=Math.min(e.cols,h-o.tileId%h+s),E=o.tileId;for(let C=s+1;C<I;++C)this._writeToCell(A,C,a,++E),c.tileCount++;}}this._viewportMetrics=e;}getImageAtBufferCell(e,t){let s=this._terminal._core.buffer.lines.get(t);if(s&&s.getBg(e)&268435456){let n=s._extendedAttrs[e]||F;if(n.imageId&&n.imageId!==-1){let A=this._images.get(n.imageId)?.orig;if(window.ImageBitmap&&A instanceof ImageBitmap){let o=T.createCanvas(window.document,A.width,A.height);return o.getContext("2d")?.drawImage(A,0,0,A.width,A.height),o}return A}}}extractTileAtBufferCell(e,t){let s=this._terminal._core.buffer.lines.get(t);if(s&&s.getBg(e)&268435456){let n=s._extendedAttrs[e]||F;if(n.imageId&&n.imageId!==-1&&n.tileId!==-1){let A=this._images.get(n.imageId);if(A)return this._renderer.extractTile(A,n.tileId)}}}_evictOldest(e){let t=this._getStoredPixels(),i=t;for(;this._pixelLimit<i+e&&this._images.size;){let s=this._images.get(++this._lowestId);s&&s.orig&&(i-=s.orig.width*s.orig.height,s.actual&&s.orig!==s.actual&&(i-=s.actual.width*s.actual.height),s.marker?.dispose(),this._delImg(this._lowestId));}return t-i}_writeToCell(e,t,i,s){if(e._data[t*3+2]&268435456){let n=e._extendedAttrs[t];if(n){if(n.imageId!==void 0){let A=this._images.get(n.imageId);A&&A.tileCount--,n.imageId=i,n.tileId=s;return}e._extendedAttrs[t]=new G(n.ext,n.urlId,i,s);return}}e._data[t*3+2]|=268435456,e._extendedAttrs[t]=new G(0,0,i,s);}_evictOnAlternate(){for(let i of this._images.values())i.bufferType==="alternate"&&(i.tileCount=0);let e=this._terminal._core.buffer;for(let i=0;i<this._terminal.rows;++i){let s=e.lines.get(i);if(s){for(let n=0;n<this._terminal.cols;++n)if(s._data[n*3+2]&268435456){let A=s._extendedAttrs[n]?.imageId;if(A){let o=this._images.get(A);o&&o.tileCount++;}}}}let t=[];for(let[i,s]of this._images.entries())s.bufferType==="alternate"&&!s.tileCount&&(s.marker?.dispose(),t.push(i));for(let i of t)this._delImg(i);}};var qe=Y(Oe());function se(r){let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);return e}function Ee(r){let e=0;for(let t=0;t<r.length;++t){if(r[t]<48||r[t]>57)throw new Error("illegal char");e=e*10+r[t]-48;}return e}function Pe(r){let e=se(r);if(!e.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return e}function yt(r){if(typeof Buffer<"u")return Buffer.from(se(r),"base64").toString();let e=atob(se(r)),t=new Uint8Array(e.length);for(let i=0;i<t.length;++i)t[i]=e.charCodeAt(i);return new TextDecoder().decode(t)}var Ye={inline:Ee,size:Ee,name:yt,width:Pe,height:Pe,preserveAspectRatio:Ee},We=[70,105,108,101],Be=1024,ne=class{constructor(){this.state=0;this._buffer=new Uint32Array(Be);this._position=0;this._key="";this.fields={};}reset(){this._buffer.fill(0),this.state=0,this._position=0,this.fields={},this._key="";}parse(e,t,i){let s=this.state,n=this._position,A=this._buffer;if(s===1||s===4||s===0&&n>6)return -1;for(let o=t;o<i;++o){let a=e[o];switch(a){case 59:if(!this._storeValue(n))return this._a();s=2,n=0;break;case 61:if(s===0){for(let c=0;c<We.length;++c)if(A[c]!==We[c])return this._a();s=2,n=0;}else if(s===2){if(!this._storeKey(n))return this._a();s=3,n=0;}else if(s===3){if(n>=Be)return this._a();A[n++]=a;}break;case 58:return s===3&&!this._storeValue(n)?this._a():(this.state=4,o+1);default:if(n>=Be)return this._a();A[n++]=a;}}return this.state=s,this._position=n,-2}_a(){return this.state=1,-1}_storeKey(e){let t=se(this._buffer.subarray(0,e));return t?(this._key=t,this.fields[t]=null,true):false}_storeValue(e){if(this._key){try{let t=this._buffer.slice(0,e);this.fields[this._key]=Ye[this._key]?Ye[this._key](t):t;}catch{return false}return true}return false}};var J={mime:"unsupported",width:0,height:0};function ze(r){if(r.length<24)return J;let e=new Uint32Array(r.buffer,r.byteOffset,6);if(e[0]===1196314761&&e[1]===169478669&&e[3]===1380206665)return {mime:"image/png",width:r[16]<<24|r[17]<<16|r[18]<<8|r[19],height:r[20]<<24|r[21]<<16|r[22]<<8|r[23]};if(r[0]===255&&r[1]===216&&r[2]===255){let[t,i]=vt(r);return {mime:"image/jpeg",width:t,height:i}}return e[0]===944130375&&(r[4]===55||r[4]===57)&&r[5]===97?{mime:"image/gif",width:r[7]<<8|r[6],height:r[9]<<8|r[8]}:J}function vt(r){let e=r.length,t=4,i=r[t]<<8|r[t+1];for(;;){if(t+=i,t>=e)return [0,0];if(r[t]!==255)return [0,0];if(r[t+1]===192||r[t+1]===194)return t+8<e?[r[t+7]<<8|r[t+8],r[t+5]<<8|r[t+6]]:[0,0];t+=2,i=r[t]<<8|r[t+1];}}var St=4194304,Qe={name:"Unnamed file",size:0,width:"auto",height:"auto",preserveAspectRatio:1,inline:0},Ae=class{constructor(e,t,i,s){this._opts=e;this._renderer=t;this._storage=i;this._coreTerminal=s;this._aborted=false;this._hp=new ne;this._header=Qe;this._dec=new qe.default(St);this._metrics=J;}reset(){}start(){this._aborted=false,this._header=Qe,this._metrics=J,this._hp.reset();}put(e,t,i){if(!this._aborted)if(this._hp.state===4)this._dec.put(e,t,i)&&(this._dec.release(),this._aborted=true);else {let s=this._hp.parse(e,t,i);if(s===-1){this._aborted=true;return}if(s>0){if(this._header=Object.assign({},Qe,this._hp.fields),!this._header.inline||!this._header.size||this._header.size>this._opts.iipSizeLimit){this._aborted=true;return}this._dec.init(this._header.size),this._dec.put(e,s,i)&&(this._dec.release(),this._aborted=true);}}}end(e){if(this._aborted)return true;let t=0,i=0,s=true;if((s=e)&&(s=!this._dec.end())&&(this._metrics=ze(this._dec.data8),(s=this._metrics.mime!=="unsupported")&&(t=this._metrics.width,i=this._metrics.height,(s=t&&i&&t*i<this._opts.pixelLimit)&&([t,i]=this._resize(t,i).map(Math.floor),s=t&&i&&t*i<this._opts.pixelLimit))),!s)return this._dec.release(),true;let n=new Blob([this._dec.data8],{type:this._metrics.mime});if(this._dec.release(),!window.createImageBitmap){let A=URL.createObjectURL(n),o=new Image;return new Promise(a=>{o.addEventListener("load",()=>{URL.revokeObjectURL(A);let c=T.createCanvas(window.document,t,i);c.getContext("2d")?.drawImage(o,0,0,t,i),this._storage.addImage(c),a(true);}),o.src=A,setTimeout(()=>a(true),1e3);})}return createImageBitmap(n,{resizeWidth:t,resizeHeight:i}).then(A=>(this._storage.addImage(A),true))}_resize(e,t){let i=this._renderer.dimensions?.css.cell.width||S.width,s=this._renderer.dimensions?.css.cell.height||S.height,n=this._renderer.dimensions?.css.canvas.width||i*this._coreTerminal.cols,A=this._renderer.dimensions?.css.canvas.height||s*this._coreTerminal.rows,o=this._dim(this._header.width,n,i),a=this._dim(this._header.height,A,s);if(!o&&!a){let c=n/e,h=(A-s)/t,l=Math.min(c,h);return l<1?[e*l,t*l]:[e,t]}return o?this._header.preserveAspectRatio||!o||!a?[o,t*o/e]:[o,a]:[e*a/t,a]}_dim(e,t,i){return e==="auto"?0:e.endsWith("%")?parseInt(e.slice(0,-1))*t/100:e.endsWith("px")?parseInt(e.slice(0,-2)):parseInt(e)*i}};var w=Y(W());var $e=Y(Xe());var Nt=4194304,De=w.PALETTE_ANSI_256;De.set(w.PALETTE_VT340_COLOR);var ce=class{constructor(e,t,i){this._opts=e;this._storage=t;this._coreTerminal=i;this._size=0;this._aborted=false;(0, $e.DecoderAsync)({memoryLimit:this._opts.pixelLimit*4,palette:De,paletteLimit:this._opts.sixelPaletteLimit}).then(s=>this._dec=s);}reset(){this._dec&&(this._dec.release(),this._dec._palette.fill(0),this._dec.init(0,De,this._opts.sixelPaletteLimit));}hook(e){if(this._size=0,this._aborted=false,this._dec){let t=e.params[1]===1?0:Ht(this._coreTerminal._core._inputHandler._curAttrData,this._coreTerminal._core._themeService?.colors);this._dec.init(t,null,this._opts.sixelPaletteLimit);}}put(e,t,i){if(!(this._aborted||!this._dec)){if(this._size+=i-t,this._size>this._opts.sixelSizeLimit){console.warn("SIXEL: too much data, aborting"),this._aborted=true,this._dec.release();return}try{this._dec.decode(e,t,i);}catch(s){console.warn(`SIXEL: error while decoding image - ${s}`),this._aborted=true,this._dec.release();}}}unhook(e){if(this._aborted||!e||!this._dec)return true;let t=this._dec.width,i=this._dec.height;if(!t||!i)return i&&this._storage.advanceCursor(i),true;let s=T.createCanvas(void 0,t,i);return s.getContext("2d")?.putImageData(new ImageData(this._dec.data8,t,i),0,0),this._dec.memoryUsage>Nt&&this._dec.release(),this._storage.addImage(s),true}};function Ht(r,e){let t=0;if(!e)return t;if(r.isInverse())if(r.isFgDefault())t=le(e.foreground.rgba);else if(r.isFgRGB()){let i=r.constructor.toColorRGB(r.getFgColor());t=(0, w.toRGBA8888)(...i);}else t=le(e.ansi[r.getFgColor()].rgba);else if(r.isBgDefault())t=le(e.background.rgba);else if(r.isBgRGB()){let i=r.constructor.toColorRGB(r.getBgColor());t=(0, w.toRGBA8888)(...i);}else t=le(e.ansi[r.getBgColor()].rgba);return t}function le(r){return w.BIG_ENDIAN?r:(r&255)<<24|(r>>>8&255)<<16|(r>>>16&255)<<8|r>>>24&255}var et={enableSizeReports:true,pixelLimit:16777216,sixelSupport:true,sixelScrolling:true,sixelPaletteLimit:256,sixelSizeLimit:25e6,storageLimit:128,showPlaceholder:true,iipSupport:true,iipSizeLimit:2e7},tt=4096;var it=class{constructor(e){this._disposables=[];this._handlers=new Map;this._opts=Object.assign({},et,e),this._defaultOpts=Object.assign({},et,e);}dispose(){for(let e of this._disposables)e.dispose();this._disposables.length=0,this._handlers.clear();}_disposeLater(...e){for(let t of e)this._disposables.push(t);}activate(e){if(this._terminal=e,this._renderer=new T(e),this._storage=new ie(e,this._renderer,this._opts),this._opts.enableSizeReports){let t=e.options.windowOptions||{};t.getWinSizePixels=true,t.getCellSizePixels=true,t.getWinSizeChars=true,e.options.windowOptions=t;}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},t=>this._decset(t)),e.parser.registerCsiHandler({prefix:"?",final:"l"},t=>this._decrst(t)),e.parser.registerCsiHandler({final:"c"},t=>this._da1(t)),e.parser.registerCsiHandler({prefix:"?",final:"S"},t=>this._xtermGraphicsAttributes(t)),e.onRender(t=>this._storage?.render(t)),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>this._storage?.wipeAlternate()),e.onResize(t=>this._storage?.viewportResize(t))),this._opts.sixelSupport){let t=new ce(this._opts,this._storage,e);this._handlers.set("sixel",t),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},t));}if(this._opts.iipSupport){let t=new Ae(this._opts,this._renderer,this._storage,e);this._handlers.set("iip",t),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,t));}}reset(){this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,this._storage?.reset();for(let e of this._handlers.values())e.reset();return false}get storageLimit(){return this._storage?.getLimit()||-1}set storageLimit(e){this._storage?.setLimit(e),this._opts.storageLimit=e;}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){this._opts.showPlaceholder=e,this._renderer?.showPlaceholder(e);}getImageAtBufferCell(e,t){return this._storage?.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){return this._storage?.extractTileAtBufferCell(e,t)}_report(e){this._terminal?._core.coreService.triggerDataEvent(e);}_decset(e){for(let t=0;t<e.length;++t)switch(e[t]){case 80:this._opts.sixelScrolling=false;break}return false}_decrst(e){for(let t=0;t<e.length;++t)switch(e[t]){case 80:this._opts.sixelScrolling=true;break}return false}_da1(e){return e[0]?true:this._opts.sixelSupport?(this._report("\x1B[?62;4;9;22c"),true):false}_xtermGraphicsAttributes(e){if(e.length<2)return true;if(e[0]===1)switch(e[1]){case 1:return this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`),true;case 2:this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`);for(let t of this._handlers.values())t.reset();return true;case 3:return e.length>2&&!(e[2]instanceof Array)&&e[2]<=tt?(this._opts.sixelPaletteLimit=e[2],this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`\x1B[?${e[0]};2S`),true;case 4:return this._report(`\x1B[?${e[0]};0;${tt}S`),true;default:return this._report(`\x1B[?${e[0]};2S`),true}if(e[0]===2)switch(e[1]){case 1:let t=this._renderer?.dimensions?.css.canvas.width,i=this._renderer?.dimensions?.css.canvas.height;if(!t||!i){let n=S;t=(this._terminal?.cols||80)*n.width,i=(this._terminal?.rows||24)*n.height;}if(t*i<this._opts.pixelLimit)this._report(`\x1B[?${e[0]};0;${t.toFixed(0)};${i.toFixed(0)}S`);else {let n=Math.floor(Math.sqrt(this._opts.pixelLimit));this._report(`\x1B[?${e[0]};0;${n};${n}S`);}return true;case 4:let s=Math.floor(Math.sqrt(this._opts.pixelLimit));return this._report(`\x1B[?${e[0]};0;${s};${s}S`),true;default:return this._report(`\x1B[?${e[0]};2S`),true}return this._report(`\x1B[?${e[0]};1S`),true}};
216
216
 
217
- const phirepassTerminalCss = () => `.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#FFF;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1 !important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px !important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:rgba(0,0,0,0);transition:opacity 100ms linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity 800ms linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:host{display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;container-type:inline-size}:host #ccc{flex:1 1 auto;width:100%;min-width:0;min-height:0;overflow:hidden}.keys{display:none;flex:0 0 auto;align-items:center;gap:4px;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-top:1px solid rgba(255, 255, 255, 0.08);background:#16181d;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}.keys::-webkit-scrollbar{display:none}.keys .key{flex:0 0 auto;min-width:40px;height:38px;padding:0 10px;border:1px solid rgba(255, 255, 255, 0.1);border-radius:8px;background:rgba(255, 255, 255, 0.06);color:#cbd5e1;font:inherit;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:13px;line-height:1;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}.keys .key:active{background:rgba(255, 255, 255, 0.14)}.keys .key.armed{border-color:#2dd4a7;background:rgba(45, 212, 167, 0.18);color:#2dd4a7}.keys .spacer{flex:1 0 8px}@container (max-width: 640px){.keys{display:flex}}:host(.keys-on) .keys{display:flex}:host(.keys-off) .keys{display:none}`;
217
+ const phirepassTerminalCss = () => `.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#FFF;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1 !important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px !important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:rgba(0,0,0,0);transition:opacity 100ms linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity 800ms linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:host{display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;container-type:inline-size}:host #ccc{flex:1 1 auto;width:100%;min-width:0;min-height:0;overflow:hidden;background:#0b1021}.keys{display:none;flex:0 0 auto;align-items:center;gap:4px;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-top:1px solid rgba(255, 255, 255, 0.08);background:#16181d;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}.keys::-webkit-scrollbar{display:none}.keys .key{flex:0 0 auto;min-width:40px;height:38px;padding:0 10px;border:1px solid rgba(255, 255, 255, 0.1);border-radius:8px;background:rgba(255, 255, 255, 0.06);color:#cbd5e1;font:inherit;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:13px;line-height:1;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}.keys .key:active{background:rgba(255, 255, 255, 0.14)}.keys .key.armed{border-color:#2dd4a7;background:rgba(45, 212, 167, 0.18);color:#2dd4a7}.keys .spacer{flex:1 0 8px}@container (max-width: 640px){.keys{display:flex}}:host(.keys-on) .keys{display:flex}:host(.keys-off) .keys{display:none}`;
218
218
 
219
219
  /**
220
220
  * The control character a key produces when Ctrl is held.
@@ -324,6 +324,8 @@ const PhirepassTerminal = class {
324
324
  cursorWidth: 1,
325
325
  // Colors
326
326
  theme: {
327
+ // Also the `#ccc` background in phirepass-terminal.css, which
328
+ // paints the partial row the fit leaves unused; change both.
327
329
  background: "#0b1021",
328
330
  foreground: "#e2e8f0",
329
331
  cursor: "#67e8f9",
@@ -955,13 +957,13 @@ const PhirepassTerminal = class {
955
957
  return (index.h("button", { key: id, type: "button", class: { key: true, armed: !!armed }, "aria-label": hint, "aria-pressed": armed === undefined ? undefined : String(armed), onPointerDown: (event) => event.preventDefault(), onMouseDown: (event) => event.preventDefault(), onClick: onPress }, label));
956
958
  }
957
959
  render() {
958
- return (index.h(index.Host, { key: '4f00fba03285e6410d0248df32247f3231199cf8', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, index.h("div", { key: 'f43351419da2ca6ef1232afd96ea30be5feae138', id: "ccc", ref: el => (this.containerEl = el) }), index.h("div", { key: '56f7929c2045ae17053777b818f3317844ec6467', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
960
+ return (index.h(index.Host, { key: '89ceeaf06acf34bb2c3231bc65b447e022f1e7a0', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, index.h("div", { key: '6bc2b33e9064c3c94430081d567de5ca9e341bcb', id: "ccc", ref: el => (this.containerEl = el) }), index.h("div", { key: '825a633a3affb71780f78bed7ffd091461718f86', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
959
961
  this.ctrlArmed = !this.ctrlArmed;
960
962
  this.terminal?.focus();
961
963
  }, this.ctrlArmed), this.key_button('alt', 'alt', 'Alt', () => {
962
964
  this.altArmed = !this.altArmed;
963
965
  this.terminal?.focus();
964
- }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), index.h("span", { key: '6573fdb8605d4a3555589412591d921738c98abb', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
966
+ }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), index.h("span", { key: 'e5f52769c4fe42ecfa6002690db02c8e8cd3232b', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
965
967
  }
966
968
  static get watchers() { return {
967
969
  "nodeId": [{
@@ -744,7 +744,7 @@ function __wbg_get_imports() {
744
744
  const ret = arg0.call(arg1, arg2, arg3);
745
745
  return ret;
746
746
  }, arguments); },
747
- __wbg_clearInterval_26ba580547547579: function(arg0) {
747
+ __wbg_clearInterval_2ed00e80b9bdc143: function(arg0) {
748
748
  const ret = clearInterval(arg0);
749
749
  return ret;
750
750
  },
@@ -766,7 +766,7 @@ function __wbg_get_imports() {
766
766
  const ret = Reflect.get(arg0, arg1);
767
767
  return ret;
768
768
  }, arguments); },
769
- __wbg_info_2b8ee6588e4c6072: function(arg0, arg1) {
769
+ __wbg_info_78ac71b951cadff2: function(arg0, arg1) {
770
770
  console.info(getStringFromWasm0(arg0, arg1));
771
771
  },
772
772
  __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
@@ -813,7 +813,7 @@ function __wbg_get_imports() {
813
813
  __wbg_send_d83d0891cf698779: function() { return handleError(function (arg0, arg1, arg2) {
814
814
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
815
815
  }, arguments); },
816
- __wbg_setInterval_d933acbf2578adfa: function() { return handleError(function (arg0, arg1) {
816
+ __wbg_setInterval_ef738bbfe8cc0974: function() { return handleError(function (arg0, arg1) {
817
817
  const ret = setInterval(arg0, arg1);
818
818
  return ret;
819
819
  }, arguments); },
@@ -838,7 +838,7 @@ function __wbg_get_imports() {
838
838
  __wbg_set_onopen_757be120cc7b1ea6: function(arg0, arg1) {
839
839
  arg0.onopen = arg1;
840
840
  },
841
- __wbg_warn_b0df9a9e7105e74b: function(arg0, arg1) {
841
+ __wbg_warn_e7d9e5b57902730d: function(arg0, arg1) {
842
842
  console.warn(getStringFromWasm0(arg0, arg1));
843
843
  },
844
844
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
@@ -1195,7 +1195,7 @@ async function __wbg_init_once(module_or_path) {
1195
1195
  }
1196
1196
 
1197
1197
  if (module_or_path === undefined) {
1198
- module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-DCBMfc2u.js', document.baseURI).href)));
1198
+ module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-eJBbdh77.js', document.baseURI).href)));
1199
1199
  }
1200
1200
  const imports = __wbg_get_imports();
1201
1201
 
@@ -305,6 +305,13 @@
305
305
  min-width: 0;
306
306
  min-height: 0;
307
307
  overflow: hidden;
308
+
309
+ /* xterm's theme background (`theme.background` in phirepass-terminal.tsx;
310
+ keep the two in step). The fit only uses whole rows, so up to one row of
311
+ height is always left over below the last one. xterm does not paint that
312
+ strip, so without this the embedder's background shows through as a band
313
+ under the session, and the terminal looks shorter than its panel. */
314
+ background: #0b1021;
308
315
  }
309
316
 
310
317
  /*
@@ -111,6 +111,8 @@ export class PhirepassTerminal {
111
111
  cursorWidth: 1,
112
112
  // Colors
113
113
  theme: {
114
+ // Also the `#ccc` background in phirepass-terminal.css, which
115
+ // paints the partial row the fit leaves unused; change both.
114
116
  background: "#0b1021",
115
117
  foreground: "#e2e8f0",
116
118
  cursor: "#67e8f9",
@@ -742,13 +744,13 @@ export class PhirepassTerminal {
742
744
  return (h("button", { key: id, type: "button", class: { key: true, armed: !!armed }, "aria-label": hint, "aria-pressed": armed === undefined ? undefined : String(armed), onPointerDown: (event) => event.preventDefault(), onMouseDown: (event) => event.preventDefault(), onClick: onPress }, label));
743
745
  }
744
746
  render() {
745
- return (h(Host, { key: '4f00fba03285e6410d0248df32247f3231199cf8', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, h("div", { key: 'f43351419da2ca6ef1232afd96ea30be5feae138', id: "ccc", ref: el => (this.containerEl = el) }), h("div", { key: '56f7929c2045ae17053777b818f3317844ec6467', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
747
+ return (h(Host, { key: '89ceeaf06acf34bb2c3231bc65b447e022f1e7a0', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, h("div", { key: '6bc2b33e9064c3c94430081d567de5ca9e341bcb', id: "ccc", ref: el => (this.containerEl = el) }), h("div", { key: '825a633a3affb71780f78bed7ffd091461718f86', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
746
748
  this.ctrlArmed = !this.ctrlArmed;
747
749
  this.terminal?.focus();
748
750
  }, this.ctrlArmed), this.key_button('alt', 'alt', 'Alt', () => {
749
751
  this.altArmed = !this.altArmed;
750
752
  this.terminal?.focus();
751
- }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), h("span", { key: '6573fdb8605d4a3555589412591d921738c98abb', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
753
+ }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), h("span", { key: 'e5f52769c4fe42ecfa6002690db02c8e8cd3232b', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
752
754
  }
753
755
  static get is() { return "phirepass-terminal"; }
754
756
  static get encapsulation() { return "shadow"; }
@@ -780,7 +782,7 @@ export class PhirepassTerminal {
780
782
  },
781
783
  "getter": false,
782
784
  "setter": false,
783
- "defaultValue": "{\n // Terminal identification\n termName: 'xterm-256color',\n\n // Rendering\n rendererType: 'canvas', // Better performance\n allowTransparency: false,\n\n fontFamily:\n '\"Berkeley Mono\", \"Fira Code\", \"SFMono-Regular\", Menlo, monospace',\n fontSize: 12,\n // fontWeight: 'normal',\n // fontWeightBold: 'bold',\n letterSpacing: 0,\n lineHeight: 1.0,\n\n allowProposedApi: true, // needed for bracketed paste\n\n // Cursor\n cursorBlink: true,\n // cursorStyle: 'block',\n cursorWidth: 1,\n\n // Colors\n theme: {\n background: \"#0b1021\",\n foreground: \"#e2e8f0\",\n cursor: \"#67e8f9\",\n },\n\n // Scrolling\n scrollback: 10000,\n fastScrollModifier: 'shift',\n fastScrollSensitivity: 5,\n\n // Behavior\n bellStyle: 'sound', // or 'none' if you prefer\n convertEol: false, // true to treat \\n as \\r\\n\n disableStdin: false,\n\n // Selection\n rightClickSelectsWord: true,\n\n // Performance\n drawBoldTextInBrightColors: true,\n minimumContrastRatio: 1,\n\n // Advanced\n windowsMode: false, // Important for Linux\n macOptionIsMeta: false,\n altClickMovesCursor: true\n }"
785
+ "defaultValue": "{\n // Terminal identification\n termName: 'xterm-256color',\n\n // Rendering\n rendererType: 'canvas', // Better performance\n allowTransparency: false,\n\n fontFamily:\n '\"Berkeley Mono\", \"Fira Code\", \"SFMono-Regular\", Menlo, monospace',\n fontSize: 12,\n // fontWeight: 'normal',\n // fontWeightBold: 'bold',\n letterSpacing: 0,\n lineHeight: 1.0,\n\n allowProposedApi: true, // needed for bracketed paste\n\n // Cursor\n cursorBlink: true,\n // cursorStyle: 'block',\n cursorWidth: 1,\n\n // Colors\n theme: {\n // Also the `#ccc` background in phirepass-terminal.css, which\n // paints the partial row the fit leaves unused; change both.\n background: \"#0b1021\",\n foreground: \"#e2e8f0\",\n cursor: \"#67e8f9\",\n },\n\n // Scrolling\n scrollback: 10000,\n fastScrollModifier: 'shift',\n fastScrollSensitivity: 5,\n\n // Behavior\n bellStyle: 'sound', // or 'none' if you prefer\n convertEol: false, // true to treat \\n as \\r\\n\n disableStdin: false,\n\n // Selection\n rightClickSelectsWord: true,\n\n // Performance\n drawBoldTextInBrightColors: true,\n minimumContrastRatio: 1,\n\n // Advanced\n windowsMode: false, // Important for Linux\n macOptionIsMeta: false,\n altClickMovesCursor: true\n }"
784
786
  },
785
787
  "serverHost": {
786
788
  "type": "string",
@@ -1 +1 @@
1
- class t{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,s.unregister(this),t}free(){const t=this.__destroy_into_raw();T.__wbg_channel_free(t,0)}authenticate(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_authenticate(this.__wbg_ptr,c,o,i,s,r)}connect(){T.channel_connect(this.__wbg_ptr)}create_service(t,n,e,r,c,o,i,s,_){const u=+c,a=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let f,b,l,d,h,w,g,p,m,R,A,N,S,O;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(n,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),w=F,g=v(r,T.__wbindgen_export,T.__wbindgen_export2),p=F,m=y(o)?0:v(o,T.__wbindgen_export,T.__wbindgen_export2),R=F,A=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),N=F,S=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),O=F}catch(t){throw S&&T.__wbindgen_export3(S,1*O,1),A&&T.__wbindgen_export3(A,1*N,1),m&&T.__wbindgen_export3(m,1*R,1),g&&T.__wbindgen_export3(g,1*p,1),h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_create_service(this.__wbg_ptr,f,b,l,d,h,w,g,p,u,m,R,A,N,S,O,a)}delete_service(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_delete_service(this.__wbg_ptr,c,o,i,s,r)}disconnect(){T.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==T.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==T.channel_is_disconnected(this.__wbg_ptr)}constructor(t,n,e){let r,c,o,i,_,u;try{r=v(t,T.__wbindgen_export,T.__wbindgen_export2),c=F,o=v(n,T.__wbindgen_export,T.__wbindgen_export2),i=F,_=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),o&&T.__wbindgen_export3(o,1*i,1),r&&T.__wbindgen_export3(r,1*c,1),t}const a=T.channel_new(r,c,o,i,_,u);return this.__wbg_ptr=a,s.register(this,this.__wbg_ptr,this),this}on_connection_close(t){T.channel_on_connection_close(this.__wbg_ptr,y(t)?0:_(t))}on_connection_error(t){T.channel_on_connection_error(this.__wbg_ptr,y(t)?0:_(t))}on_connection_message(t){T.channel_on_connection_message(this.__wbg_ptr,y(t)?0:_(t))}on_connection_open(t){T.channel_on_connection_open(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message(t){T.channel_on_protocol_message(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message_type(t,n){const e=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_on_protocol_message_type(this.__wbg_ptr,e,F,y(n)?0:_(n))}open_rdp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_rdp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_sftp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_sftp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_ssh_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_ssh_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}send_sftp_chmod(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_chmod(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_delete(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_delete(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_download_ack(t,n,e,r){const c=+n,o=+e,i=+r,s=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_ack(this.__wbg_ptr,s,F,c,o,i)}send_sftp_download_chunk(t,n,e,r,c){const o=+n,i=+e,s=+r,_=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0),u=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_chunk(this.__wbg_ptr,u,F,o,i,s,_)}send_sftp_download_start(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_download_start(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_list_data(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_list_data(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_mkdir(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_mkdir(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_read_file(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_read_file(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_remove(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_remove(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_rename(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_rename(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_upload_chunk(t,n,e,r,c,o,i){const s=+n,_=+e,u=+r,a=+c,f=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let b,l,d,h;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=m(o,T.__wbindgen_export),h=F}catch(t){throw d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,l,s,_,u,a,d,h,f)}send_sftp_upload_start(t,n,e,r,c,o,i){const s=+n,_=+c,u=BigInt.asIntN(64,o),a=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let f,b,l,d,h,w;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(e,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=v(r,T.__wbindgen_export,T.__wbindgen_export2),w=F}catch(t){throw h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,s,l,d,h,w,_,u,a)}send_sftp_write_file(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=m(r,T.__wbindgen_export),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_write_file(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_ssh_terminal_resize(t,n,e,r,c,o){const i=+n,s=+e,_=+r,u=+c,a=+o,f=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,F,i,s,_,u,a)}send_ssh_tunnel_data(t,n,e){const r=+n;let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(e,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_send_ssh_tunnel_data(this.__wbg_ptr,c,o,r,i,s)}start_heartbeat(t){T.channel_start_heartbeat(this.__wbg_ptr,t)}stop_heartbeat(){T.channel_stop_heartbeat(this.__wbg_ptr)}update_service(t,n,e,r,c,o,i,s,_,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,l,d,h,w,g,p,m,R,A,N,S,O,P,U,j;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=v(n,T.__wbindgen_export,T.__wbindgen_export2),h=F,w=v(e,T.__wbindgen_export,T.__wbindgen_export2),g=F,p=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),m=F,R=v(c,T.__wbindgen_export,T.__wbindgen_export2),A=F,N=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),S=F,O=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),P=F,U=y(_)?0:v(_,T.__wbindgen_export,T.__wbindgen_export2),j=F}catch(t){throw U&&T.__wbindgen_export3(U,1*j,1),O&&T.__wbindgen_export3(O,1*P,1),N&&T.__wbindgen_export3(N,1*S,1),R&&T.__wbindgen_export3(R,1*A,1),p&&T.__wbindgen_export3(p,1*m,1),w&&T.__wbindgen_export3(w,1*g,1),d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_update_service(this.__wbg_ptr,b,l,d,h,w,g,p,m,R,A,a,N,S,O,P,U,j,f)}}Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);const n=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(t,n){T.__wasm_bindgen_func_elem_67(t,n)}function r(t,n,e){T.__wasm_bindgen_func_elem_63(t,n,e)}function c(t,n,e){T.__wasm_bindgen_func_elem_63_37(t,n,e)}function o(t,n,e){T.__wasm_bindgen_func_elem_63_38(t,n,e)}const i=["blob","arraybuffer"],s="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbg_channel_free(t,1)));function _(t){const n=T.__wbindgen_export5();return T.__wbindgen_externrefs.set(n,t),n}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbindgen_export6(t.a,t.b)));function a(t){switch(typeof t){case"number":case"boolean":case"undefined":return`${t}`;case"string":return JSON.stringify(t);case"bigint":return`${t}n`;case"symbol":return void 0!==t.description?`Symbol(${t.description})`:"Symbol";case"function":return"string"==typeof t.name&&""!==t.name?`Function(${t.name})`:"Function";case"object":{if(null===t)return"null";if(Array.isArray(t))return"["+Array.from(t,a).join(", ")+"]";if(t instanceof Error)return`${t.name}: ${t.message}\n${t.stack}`;const n=toString.call(t),e=/\[object ([^\]]+)\]/.exec(n)?.[1];if(void 0===e)return n;if("Object"===e)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return e}}}function f(t,n){return t>>>=0,w().subarray(t/1,t/1+n)}let b=null;function l(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==T.memory.buffer)&&(b=new DataView(T.memory.buffer)),b}function d(t,n){return t>>>=0,e=w().subarray(t,t+n),N+=e.length,N>=A&&(R=new TextDecoder("utf-8",{ignoreBOM:!0}),R.decode(),N=e.length),R.decode(e);var e}let h=null;function w(){return null!==h&&0!==h.byteLength||(h=new Uint8Array(T.memory.buffer)),h}function g(t,n){try{return t.apply(this,n)}catch(t){const n=_(t);T.__wbindgen_export4(n)}}function y(t){return null==t}function p(t,n,e){const r={a:t,b:n,cnt:1},c=(...t)=>{r.cnt++;const n=r.a;r.a=0;try{return e(n,r.b,...t)}finally{r.a=n,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{0==--r.cnt&&(T.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(c,r,r),c}function m(t,n){const e=n(1*t.length,1)>>>0;return w().set(t,e/1),F=t.length,e}function v(t,n,e){if(void 0===e){const e=S.encode(t),r=n(e.length,1)>>>0;return w().subarray(r,r+e.length).set(e),F=e.length,r}let r=t.length,c=n(r,1)>>>0;const o=w();let i=0;for(;i<r;i++){const n=t.charCodeAt(i);if(n>127)break;o[c+i]=n}if(i!==r){0!==i&&(t=t.slice(i)),c=e(c,r,r=i+3*t.length,1)>>>0;const n=w().subarray(c+i,c+r);i+=S.encodeInto(t,n).written,c=e(c,r,i,1)>>>0}return F=i,c}let R=new TextDecoder("utf-8",{ignoreBOM:!0});R.decode();const A=2146435072;let N=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(t,n){const e=S.encode(t);return n.set(e),{read:t.length,written:e.length}});let T,O,F=0;async function P(t){return void 0!==T?T:(void 0===O&&(O=async function(t){void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===t&&(t=new URL("phirepass-channel_bg.wasm",import.meta.url));const n=function(){const t={__proto__:null,__wbg_Error_208446807d0d1e30:function(t,n){return Error(d(t,n))},__wbg_String_8564e559799eccda:function(t,n){const e=v(String(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(t,n){const e=v(a(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(t,n){const e="string"==typeof n?n:void 0;var r=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),c=F;l().setInt32(4+(t>>>0),c,!0),l().setInt32(0+(t>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(t,n){throw new Error(d(t,n))},__wbg__wbg_cb_unref_09736879a3f67559:function(t){t._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return g((function(t,n){return t.call(n)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return g((function(t,n,e){return t.call(n,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return g((function(t,n,e,r){return t.call(n,e,r)}),arguments)},__wbg_clearInterval_26ba580547547579:function(t){return clearInterval(t)},__wbg_close_5ee9c5fe4e8754a4:function(){return g((function(t){t.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(t){return t.data},__wbg_from_eac91875c8a5ffa4:function(t){return Array.from(t)},__wbg_getRandomValues_5d8c030b527203a6:function(){return g((function(t,n){globalThis.crypto.getRandomValues(f(t,n))}),arguments)},__wbg_get_2080c49015e35254:function(){return g((function(t,n){return Reflect.get(t,n)}),arguments)},__wbg_info_2b8ee6588e4c6072:function(t,n){console.info(d(t,n))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(t){let n;try{n=t instanceof ArrayBuffer}catch(t){n=!1}return n},__wbg_length_186163212ffe79c3:function(t){return t.length},__wbg_new_13de428334042d26:function(t){return new Uint8Array(t)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return g((function(t,n,e){return new WebSocket(d(t,n),e)}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(t,n,e){Uint8Array.prototype.set.call(f(t,n),e)},__wbg_push_c9f4893fc209f768:function(t,n){return t.push(n)},__wbg_readyState_039bc047141a5f6d:function(t){return t.readyState},__wbg_send_d83d0891cf698779:function(){return g((function(t,n,e){t.send(f(n,e))}),arguments)},__wbg_setInterval_d933acbf2578adfa:function(){return g((function(t,n){return setInterval(t,n)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(t,n){t.binaryType=i[n]},__wbg_set_d2d33b52458e984a:function(t,n,e){t[n>>>0]=e},__wbg_set_e4b9a833d288759a:function(t,n,e){t[n]=e},__wbg_set_onclose_078935cf8d0fb024:function(t,n){t.onclose=n},__wbg_set_onerror_f7f089f7f059501c:function(t,n){t.onerror=n},__wbg_set_onmessage_26abc49cfa5f9ffc:function(t,n){t.onmessage=n},__wbg_set_onopen_757be120cc7b1ea6:function(t,n){t.onopen=n},__wbg_warn_b0df9a9e7105e74b:function(t,n){console.warn(d(t,n))},__wbindgen_generic_0000000000000001:function(t,n){return p(t,n,r)},__wbindgen_generic_0000000000000002:function(t,n){return p(t,n,c)},__wbindgen_generic_0000000000000003:function(t,n){return p(t,n,o)},__wbindgen_generic_0000000000000004:function(t,n){return p(t,n,e)},__wbindgen_generic_0000000000000005:function(t){return t},__wbindgen_generic_0000000000000006:function(t,n){return f(t,n)},__wbindgen_generic_0000000000000007:function(t,n){return d(t,n)},__wbindgen_generic_0000000000000008:function(t){return BigInt.asUintN(64,t)},__wbindgen_init_externref_table:function(){const t=T.__wbindgen_externrefs;t.set(0,void 0),t.set(1024,void 0),t.set(1025,null),t.set(1026,!0),t.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":t}}();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s}=await async function(t,n){if("function"==typeof Response&&t instanceof Response){if(!t.ok)throw new Error(`failed to fetch Wasm: ${t.status} ${t.statusText} fetching '${t.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,n)}catch(n){if(!function(t){switch(t){case"basic":case"cors":case"default":return!0}return!1}(t.type)||"application/wasm"===t.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,n)}{const e=await WebAssembly.instantiate(t,n);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,n);return function(t){return T=t.exports,b=null,h=null,T.__wbindgen_start(),T}(s)}(t),O.catch((()=>{O=void 0}))),O)}var U,j,k;!function(t){t.Error="Error",t.AuthSuccess="AuthSuccess",t.TunnelOpened="TunnelOpened",t.TunnelClosed="TunnelClosed",t.TunnelData="TunnelData",t.RDPAuthorized="RDPAuthorized",t.SFTPListItems="SFTPListItems",t.SFTPDownloadStartResponse="SFTPDownloadStartResponse",t.SFTPDownloadChunk="SFTPDownloadChunk",t.SFTPUploadStartResponse="SFTPUploadStartResponse",t.SFTPUploadChunkAck="SFTPUploadChunkAck",t.SFTPOpResult="SFTPOpResult"}(U||(U={})),function(t){t[t.Username=0]="Username",t[t.Password=1]="Password",t[t.Default=2]="Default"}(j||(j={})),function(t){t.Disconnected="disconnected",t.Connected="connected",t.Error="error"}(k||(k={}));export{t as C,n as E,j as I,U as P,P as _,k as a}
1
+ class t{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,s.unregister(this),t}free(){const t=this.__destroy_into_raw();T.__wbg_channel_free(t,0)}authenticate(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_authenticate(this.__wbg_ptr,c,o,i,s,r)}connect(){T.channel_connect(this.__wbg_ptr)}create_service(t,n,e,r,c,o,i,s,_){const u=+c,a=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let f,b,l,d,h,w,g,p,m,R,A,N,S,O;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(n,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),w=F,g=v(r,T.__wbindgen_export,T.__wbindgen_export2),p=F,m=y(o)?0:v(o,T.__wbindgen_export,T.__wbindgen_export2),R=F,A=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),N=F,S=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),O=F}catch(t){throw S&&T.__wbindgen_export3(S,1*O,1),A&&T.__wbindgen_export3(A,1*N,1),m&&T.__wbindgen_export3(m,1*R,1),g&&T.__wbindgen_export3(g,1*p,1),h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_create_service(this.__wbg_ptr,f,b,l,d,h,w,g,p,u,m,R,A,N,S,O,a)}delete_service(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_delete_service(this.__wbg_ptr,c,o,i,s,r)}disconnect(){T.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==T.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==T.channel_is_disconnected(this.__wbg_ptr)}constructor(t,n,e){let r,c,o,i,_,u;try{r=v(t,T.__wbindgen_export,T.__wbindgen_export2),c=F,o=v(n,T.__wbindgen_export,T.__wbindgen_export2),i=F,_=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),o&&T.__wbindgen_export3(o,1*i,1),r&&T.__wbindgen_export3(r,1*c,1),t}const a=T.channel_new(r,c,o,i,_,u);return this.__wbg_ptr=a,s.register(this,this.__wbg_ptr,this),this}on_connection_close(t){T.channel_on_connection_close(this.__wbg_ptr,y(t)?0:_(t))}on_connection_error(t){T.channel_on_connection_error(this.__wbg_ptr,y(t)?0:_(t))}on_connection_message(t){T.channel_on_connection_message(this.__wbg_ptr,y(t)?0:_(t))}on_connection_open(t){T.channel_on_connection_open(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message(t){T.channel_on_protocol_message(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message_type(t,n){const e=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_on_protocol_message_type(this.__wbg_ptr,e,F,y(n)?0:_(n))}open_rdp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_rdp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_sftp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_sftp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_ssh_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_ssh_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}send_sftp_chmod(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_chmod(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_delete(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_delete(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_download_ack(t,n,e,r){const c=+n,o=+e,i=+r,s=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_ack(this.__wbg_ptr,s,F,c,o,i)}send_sftp_download_chunk(t,n,e,r,c){const o=+n,i=+e,s=+r,_=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0),u=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_chunk(this.__wbg_ptr,u,F,o,i,s,_)}send_sftp_download_start(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_download_start(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_list_data(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_list_data(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_mkdir(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_mkdir(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_read_file(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_read_file(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_remove(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_remove(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_rename(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_rename(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_upload_chunk(t,n,e,r,c,o,i){const s=+n,_=+e,u=+r,a=+c,f=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let b,l,d,h;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=m(o,T.__wbindgen_export),h=F}catch(t){throw d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,l,s,_,u,a,d,h,f)}send_sftp_upload_start(t,n,e,r,c,o,i){const s=+n,_=+c,u=BigInt.asIntN(64,o),a=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let f,b,l,d,h,w;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(e,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=v(r,T.__wbindgen_export,T.__wbindgen_export2),w=F}catch(t){throw h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,s,l,d,h,w,_,u,a)}send_sftp_write_file(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=m(r,T.__wbindgen_export),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_write_file(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_ssh_terminal_resize(t,n,e,r,c,o){const i=+n,s=+e,_=+r,u=+c,a=+o,f=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,F,i,s,_,u,a)}send_ssh_tunnel_data(t,n,e){const r=+n;let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(e,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_send_ssh_tunnel_data(this.__wbg_ptr,c,o,r,i,s)}start_heartbeat(t){T.channel_start_heartbeat(this.__wbg_ptr,t)}stop_heartbeat(){T.channel_stop_heartbeat(this.__wbg_ptr)}update_service(t,n,e,r,c,o,i,s,_,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,l,d,h,w,g,p,m,R,A,N,S,O,P,U,j;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=v(n,T.__wbindgen_export,T.__wbindgen_export2),h=F,w=v(e,T.__wbindgen_export,T.__wbindgen_export2),g=F,p=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),m=F,R=v(c,T.__wbindgen_export,T.__wbindgen_export2),A=F,N=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),S=F,O=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),P=F,U=y(_)?0:v(_,T.__wbindgen_export,T.__wbindgen_export2),j=F}catch(t){throw U&&T.__wbindgen_export3(U,1*j,1),O&&T.__wbindgen_export3(O,1*P,1),N&&T.__wbindgen_export3(N,1*S,1),R&&T.__wbindgen_export3(R,1*A,1),p&&T.__wbindgen_export3(p,1*m,1),w&&T.__wbindgen_export3(w,1*g,1),d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_update_service(this.__wbg_ptr,b,l,d,h,w,g,p,m,R,A,a,N,S,O,P,U,j,f)}}Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);const n=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(t,n){T.__wasm_bindgen_func_elem_67(t,n)}function r(t,n,e){T.__wasm_bindgen_func_elem_63(t,n,e)}function c(t,n,e){T.__wasm_bindgen_func_elem_63_37(t,n,e)}function o(t,n,e){T.__wasm_bindgen_func_elem_63_38(t,n,e)}const i=["blob","arraybuffer"],s="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbg_channel_free(t,1)));function _(t){const n=T.__wbindgen_export5();return T.__wbindgen_externrefs.set(n,t),n}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbindgen_export6(t.a,t.b)));function a(t){switch(typeof t){case"number":case"boolean":case"undefined":return`${t}`;case"string":return JSON.stringify(t);case"bigint":return`${t}n`;case"symbol":return void 0!==t.description?`Symbol(${t.description})`:"Symbol";case"function":return"string"==typeof t.name&&""!==t.name?`Function(${t.name})`:"Function";case"object":{if(null===t)return"null";if(Array.isArray(t))return"["+Array.from(t,a).join(", ")+"]";if(t instanceof Error)return`${t.name}: ${t.message}\n${t.stack}`;const n=toString.call(t),e=/\[object ([^\]]+)\]/.exec(n)?.[1];if(void 0===e)return n;if("Object"===e)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return e}}}function f(t,n){return t>>>=0,w().subarray(t/1,t/1+n)}let b=null;function l(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==T.memory.buffer)&&(b=new DataView(T.memory.buffer)),b}function d(t,n){return t>>>=0,e=w().subarray(t,t+n),N+=e.length,N>=A&&(R=new TextDecoder("utf-8",{ignoreBOM:!0}),R.decode(),N=e.length),R.decode(e);var e}let h=null;function w(){return null!==h&&0!==h.byteLength||(h=new Uint8Array(T.memory.buffer)),h}function g(t,n){try{return t.apply(this,n)}catch(t){const n=_(t);T.__wbindgen_export4(n)}}function y(t){return null==t}function p(t,n,e){const r={a:t,b:n,cnt:1},c=(...t)=>{r.cnt++;const n=r.a;r.a=0;try{return e(n,r.b,...t)}finally{r.a=n,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{0==--r.cnt&&(T.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(c,r,r),c}function m(t,n){const e=n(1*t.length,1)>>>0;return w().set(t,e/1),F=t.length,e}function v(t,n,e){if(void 0===e){const e=S.encode(t),r=n(e.length,1)>>>0;return w().subarray(r,r+e.length).set(e),F=e.length,r}let r=t.length,c=n(r,1)>>>0;const o=w();let i=0;for(;i<r;i++){const n=t.charCodeAt(i);if(n>127)break;o[c+i]=n}if(i!==r){0!==i&&(t=t.slice(i)),c=e(c,r,r=i+3*t.length,1)>>>0;const n=w().subarray(c+i,c+r);i+=S.encodeInto(t,n).written,c=e(c,r,i,1)>>>0}return F=i,c}let R=new TextDecoder("utf-8",{ignoreBOM:!0});R.decode();const A=2146435072;let N=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(t,n){const e=S.encode(t);return n.set(e),{read:t.length,written:e.length}});let T,O,F=0;async function P(t){return void 0!==T?T:(void 0===O&&(O=async function(t){void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===t&&(t=new URL("phirepass-channel_bg.wasm",import.meta.url));const n=function(){const t={__proto__:null,__wbg_Error_208446807d0d1e30:function(t,n){return Error(d(t,n))},__wbg_String_8564e559799eccda:function(t,n){const e=v(String(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(t,n){const e=v(a(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(t,n){const e="string"==typeof n?n:void 0;var r=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),c=F;l().setInt32(4+(t>>>0),c,!0),l().setInt32(0+(t>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(t,n){throw new Error(d(t,n))},__wbg__wbg_cb_unref_09736879a3f67559:function(t){t._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return g((function(t,n){return t.call(n)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return g((function(t,n,e){return t.call(n,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return g((function(t,n,e,r){return t.call(n,e,r)}),arguments)},__wbg_clearInterval_2ed00e80b9bdc143:function(t){return clearInterval(t)},__wbg_close_5ee9c5fe4e8754a4:function(){return g((function(t){t.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(t){return t.data},__wbg_from_eac91875c8a5ffa4:function(t){return Array.from(t)},__wbg_getRandomValues_5d8c030b527203a6:function(){return g((function(t,n){globalThis.crypto.getRandomValues(f(t,n))}),arguments)},__wbg_get_2080c49015e35254:function(){return g((function(t,n){return Reflect.get(t,n)}),arguments)},__wbg_info_78ac71b951cadff2:function(t,n){console.info(d(t,n))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(t){let n;try{n=t instanceof ArrayBuffer}catch(t){n=!1}return n},__wbg_length_186163212ffe79c3:function(t){return t.length},__wbg_new_13de428334042d26:function(t){return new Uint8Array(t)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return g((function(t,n,e){return new WebSocket(d(t,n),e)}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(t,n,e){Uint8Array.prototype.set.call(f(t,n),e)},__wbg_push_c9f4893fc209f768:function(t,n){return t.push(n)},__wbg_readyState_039bc047141a5f6d:function(t){return t.readyState},__wbg_send_d83d0891cf698779:function(){return g((function(t,n,e){t.send(f(n,e))}),arguments)},__wbg_setInterval_ef738bbfe8cc0974:function(){return g((function(t,n){return setInterval(t,n)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(t,n){t.binaryType=i[n]},__wbg_set_d2d33b52458e984a:function(t,n,e){t[n>>>0]=e},__wbg_set_e4b9a833d288759a:function(t,n,e){t[n]=e},__wbg_set_onclose_078935cf8d0fb024:function(t,n){t.onclose=n},__wbg_set_onerror_f7f089f7f059501c:function(t,n){t.onerror=n},__wbg_set_onmessage_26abc49cfa5f9ffc:function(t,n){t.onmessage=n},__wbg_set_onopen_757be120cc7b1ea6:function(t,n){t.onopen=n},__wbg_warn_e7d9e5b57902730d:function(t,n){console.warn(d(t,n))},__wbindgen_generic_0000000000000001:function(t,n){return p(t,n,r)},__wbindgen_generic_0000000000000002:function(t,n){return p(t,n,c)},__wbindgen_generic_0000000000000003:function(t,n){return p(t,n,o)},__wbindgen_generic_0000000000000004:function(t,n){return p(t,n,e)},__wbindgen_generic_0000000000000005:function(t){return t},__wbindgen_generic_0000000000000006:function(t,n){return f(t,n)},__wbindgen_generic_0000000000000007:function(t,n){return d(t,n)},__wbindgen_generic_0000000000000008:function(t){return BigInt.asUintN(64,t)},__wbindgen_init_externref_table:function(){const t=T.__wbindgen_externrefs;t.set(0,void 0),t.set(1024,void 0),t.set(1025,null),t.set(1026,!0),t.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":t}}();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s}=await async function(t,n){if("function"==typeof Response&&t instanceof Response){if(!t.ok)throw new Error(`failed to fetch Wasm: ${t.status} ${t.statusText} fetching '${t.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,n)}catch(n){if(!function(t){switch(t){case"basic":case"cors":case"default":return!0}return!1}(t.type)||"application/wasm"===t.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,n)}{const e=await WebAssembly.instantiate(t,n);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,n);return function(t){return T=t.exports,b=null,h=null,T.__wbindgen_start(),T}(s)}(t),O.catch((()=>{O=void 0}))),O)}var U,j,k;!function(t){t.Error="Error",t.AuthSuccess="AuthSuccess",t.TunnelOpened="TunnelOpened",t.TunnelClosed="TunnelClosed",t.TunnelData="TunnelData",t.RDPAuthorized="RDPAuthorized",t.SFTPListItems="SFTPListItems",t.SFTPDownloadStartResponse="SFTPDownloadStartResponse",t.SFTPDownloadChunk="SFTPDownloadChunk",t.SFTPUploadStartResponse="SFTPUploadStartResponse",t.SFTPUploadChunkAck="SFTPUploadChunkAck",t.SFTPOpResult="SFTPOpResult"}(U||(U={})),function(t){t[t.Username=0]="Username",t[t.Password=1]="Password",t[t.Default=2]="Default"}(j||(j={})),function(t){t.Disconnected="disconnected",t.Connected="connected",t.Error="error"}(k||(k={}));export{t as C,n as E,j as I,U as P,P as _,k as a}
@@ -1 +1 @@
1
- import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-CsYQJXY2.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class m{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function b(){return"function"==typeof f()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function g(){if(b())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const v=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new m((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):g()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),g(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"56354df7bd0d3f01fcd5ff65ca5618ceb6af1b91"},o("div",{key:"446dc83e41a29c3bc2c341a26092ed3581565967",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"2beafc92d81662dfac5c7b41356f6c6c802643b9"})),this.credentialsPrompt&&o("form",{key:"dcc29b21fba03bb97526ec3d1cf5a1fb51b483e9",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"b5a3e302089b2282aedbdbefd4fb5eaca7c34455",htmlFor:"rdp-username"},"Username"),o("input",{key:"3bd1c902a6bc41bc7e69c16258cac78035a949bd",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"2defe12d73b609cbad27c06447c3c3221ff3e5aa",htmlFor:"rdp-password"},"Password"),o("input",{key:"55935891f24f0c1db71a14c42b2fc7a96c0c0ba6",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"83439c0e8756001c7042fc3b6754889d62a8eada",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"294262625f44a3f45d54bcd492875a9b6fd03219",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}'}},[769,"phirepass-rdp",{serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],serviceId:[1,"service-id"],token:[1],username:[1],password:[1],destination:[1],scale:[1],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],clipboard:[4],serverId:[1,"server-id"],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64],sendCtrlAltDel:[64],sendMetaKey:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),v))}))}k();const _=v,I=k;export{_ as PhirepassRdp,I as defineCustomElement}
1
+ import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-B5gxndLM.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class m{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function b(){return"function"==typeof f()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function g(){if(b())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const v=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new m((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):g()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),g(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"56354df7bd0d3f01fcd5ff65ca5618ceb6af1b91"},o("div",{key:"446dc83e41a29c3bc2c341a26092ed3581565967",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"2beafc92d81662dfac5c7b41356f6c6c802643b9"})),this.credentialsPrompt&&o("form",{key:"dcc29b21fba03bb97526ec3d1cf5a1fb51b483e9",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"b5a3e302089b2282aedbdbefd4fb5eaca7c34455",htmlFor:"rdp-username"},"Username"),o("input",{key:"3bd1c902a6bc41bc7e69c16258cac78035a949bd",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"2defe12d73b609cbad27c06447c3c3221ff3e5aa",htmlFor:"rdp-password"},"Password"),o("input",{key:"55935891f24f0c1db71a14c42b2fc7a96c0c0ba6",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"83439c0e8756001c7042fc3b6754889d62a8eada",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"294262625f44a3f45d54bcd492875a9b6fd03219",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}'}},[769,"phirepass-rdp",{serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],serviceId:[1,"service-id"],token:[1],username:[1],password:[1],destination:[1],scale:[1],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],clipboard:[4],serverId:[1,"server-id"],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64],sendCtrlAltDel:[64],sendMetaKey:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),v))}))}k();const _=v,I=k;export{_ as PhirepassRdp,I as defineCustomElement}