phirepass-widgets 0.0.109 → 0.0.110

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 (29) hide show
  1. package/dist/cjs/{index-Bp3srVzl.js → index-B8w6l0VL.js} +3 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/phirepass-rdp.cjs.entry.js +2 -2
  4. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  6. package/dist/cjs/phirepass-widgets.cjs.js +2 -2
  7. package/dist/cjs/{protocol-Bubcy-lZ.js → protocol-CCD7cbHu.js} +35 -35
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  10. package/dist/components/index.js +1 -1
  11. package/dist/{phirepass-widgets/p-C-YMMXFH.js → components/p-D4JeTIHt.js} +1 -1
  12. package/dist/components/phirepass-rdp.js +1 -1
  13. package/dist/components/phirepass-sftp-client.js +1 -1
  14. package/dist/components/phirepass-terminal.js +1 -1
  15. package/dist/esm/{index-CdCGB_oz.js → index-DGq2b7rM.js} +3 -2
  16. package/dist/esm/loader.js +2 -2
  17. package/dist/esm/phirepass-rdp.entry.js +2 -2
  18. package/dist/esm/phirepass-sftp-client.entry.js +2 -2
  19. package/dist/esm/phirepass-terminal.entry.js +2 -2
  20. package/dist/esm/phirepass-widgets.js +3 -3
  21. package/dist/esm/{protocol-C-YMMXFH.js → protocol-D4JeTIHt.js} +34 -34
  22. package/dist/phirepass-widgets/{p-db0c7f24.entry.js → p-1472a609.entry.js} +1 -1
  23. package/dist/phirepass-widgets/{p-8bc0b2c4.entry.js → p-401631af.entry.js} +1 -1
  24. package/dist/{components/p-C-YMMXFH.js → phirepass-widgets/p-D4JeTIHt.js} +1 -1
  25. package/dist/phirepass-widgets/{p-CdCGB_oz.js → p-DGq2b7rM.js} +1 -1
  26. package/dist/phirepass-widgets/{p-96ff3516.entry.js → p-ff3ec00c.entry.js} +1 -1
  27. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  28. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  29. package/package.json +3 -3
@@ -4,7 +4,7 @@ const NAMESPACE = 'phirepass-widgets';
4
4
  const BUILD = /* phirepass-widgets */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.45.0 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.45.1 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
 
10
10
 
@@ -1338,8 +1338,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1338
1338
  if (isBooleanTarget) {
1339
1339
  newValue = newValue === null || newValue === "false" ? false : true;
1340
1340
  }
1341
+ const currentValue = propMemberFlags & 4096 /* Setter */ ? hostRef.$instanceValues$.get(propName) : this[propName];
1341
1342
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1342
- if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
1343
+ if (!isSpuriousBooleanRemoval && newValue != currentValue && (!propDesc.get || !!propDesc.set)) {
1343
1344
  this[propName] = newValue;
1344
1345
  }
1345
1346
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bp3srVzl.js');
3
+ var index = require('./index-B8w6l0VL.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bp3srVzl.js');
4
- var protocol = require('./protocol-Bubcy-lZ.js');
3
+ var index = require('./index-B8w6l0VL.js');
4
+ var protocol = require('./protocol-CCD7cbHu.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
- var index = require('./index-Bp3srVzl.js');
4
- var protocol = require('./protocol-Bubcy-lZ.js');
3
+ var index = require('./index-B8w6l0VL.js');
4
+ var protocol = require('./protocol-CCD7cbHu.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
- var index = require('./index-Bp3srVzl.js');
4
- var protocol = require('./protocol-Bubcy-lZ.js');
3
+ var index = require('./index-B8w6l0VL.js');
4
+ var protocol = require('./protocol-CCD7cbHu.js');
5
5
 
6
6
  /**
7
7
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bp3srVzl.js');
3
+ var index = require('./index-B8w6l0VL.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.45.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.45.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -486,7 +486,7 @@ const ErrorType = Object.freeze({
486
486
  function __wbg_get_imports() {
487
487
  const import0 = {
488
488
  __proto__: null,
489
- __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
489
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
490
490
  const ret = Error(getStringFromWasm0(arg0, arg1));
491
491
  return addHeapObject(ret);
492
492
  },
@@ -497,14 +497,14 @@ function __wbg_get_imports() {
497
497
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
498
498
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
499
499
  },
500
- __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
500
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
501
501
  const ret = debugString(getObject(arg1));
502
502
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
503
503
  const len1 = WASM_VECTOR_LEN;
504
504
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
505
505
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
506
506
  },
507
- __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
507
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
508
508
  const obj = getObject(arg1);
509
509
  const ret = typeof(obj) === 'string' ? obj : undefined;
510
510
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -512,50 +512,50 @@ function __wbg_get_imports() {
512
512
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
513
513
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
514
514
  },
515
- __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
515
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
516
516
  throw new Error(getStringFromWasm0(arg0, arg1));
517
517
  },
518
- __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
518
+ __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
519
519
  getObject(arg0)._wbg_cb_unref();
520
520
  },
521
- __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
522
- const ret = getObject(arg0).call(getObject(arg1));
521
+ __wbg_call_1875a20c43a36133: function() { return handleError(function (arg0, arg1, arg2, arg3) {
522
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
523
523
  return addHeapObject(ret);
524
524
  }, arguments); },
525
- __wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
525
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
526
526
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
527
527
  return addHeapObject(ret);
528
528
  }, arguments); },
529
- __wbg_call_7bbd9cceba9949ad: function() { return handleError(function (arg0, arg1, arg2, arg3) {
530
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
529
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
530
+ const ret = getObject(arg0).call(getObject(arg1));
531
531
  return addHeapObject(ret);
532
532
  }, arguments); },
533
533
  __wbg_clearInterval_26ba580547547579: function(arg0) {
534
534
  const ret = clearInterval(takeObject(arg0));
535
535
  return addHeapObject(ret);
536
536
  },
537
- __wbg_close_a009f540ff811039: function() { return handleError(function (arg0) {
537
+ __wbg_close_d3ed56b5763be5ae: function() { return handleError(function (arg0) {
538
538
  getObject(arg0).close();
539
539
  }, arguments); },
540
- __wbg_data_aa7ba49b34c0d883: function(arg0) {
540
+ __wbg_data_522f7abc70721269: function(arg0) {
541
541
  const ret = getObject(arg0).data;
542
542
  return addHeapObject(ret);
543
543
  },
544
- __wbg_from_a39669ce566077da: function(arg0) {
544
+ __wbg_from_296ca31f8d0f1c52: function(arg0) {
545
545
  const ret = Array.from(getObject(arg0));
546
546
  return addHeapObject(ret);
547
547
  },
548
548
  __wbg_getRandomValues_a608c4436c19407a: function() { return handleError(function (arg0, arg1) {
549
549
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
550
550
  }, arguments); },
551
- __wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
551
+ __wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
552
552
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
553
553
  return addHeapObject(ret);
554
554
  }, arguments); },
555
- __wbg_info_2eae925674557566: function(arg0, arg1) {
555
+ __wbg_info_c2e816d395f9b883: function(arg0, arg1) {
556
556
  console.info(getStringFromWasm0(arg0, arg1));
557
557
  },
558
- __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
558
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
559
559
  let result;
560
560
  try {
561
561
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -565,66 +565,66 @@ function __wbg_get_imports() {
565
565
  const ret = result;
566
566
  return ret;
567
567
  },
568
- __wbg_length_31bdaf014f5fbde2: function(arg0) {
568
+ __wbg_length_7f3c00c40364105e: function(arg0) {
569
569
  const ret = getObject(arg0).length;
570
570
  return ret;
571
571
  },
572
- __wbg_new_1da3429bc3c4541c: function(arg0) {
572
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
573
573
  const ret = new Uint8Array(getObject(arg0));
574
574
  return addHeapObject(ret);
575
575
  },
576
- __wbg_new_bebc3f4757acf305: function() {
576
+ __wbg_new_617a8cdb8bb1130e: function() {
577
577
  const ret = new Object();
578
578
  return addHeapObject(ret);
579
579
  },
580
- __wbg_new_ffa92086ea89f79c: function() {
580
+ __wbg_new_ee2291f50781bf1d: function() {
581
581
  const ret = new Array();
582
582
  return addHeapObject(ret);
583
583
  },
584
- __wbg_new_with_str_sequence_9ab4875494df9d99: function() { return handleError(function (arg0, arg1, arg2) {
584
+ __wbg_new_with_str_sequence_f79e461d58fdeacc: function() { return handleError(function (arg0, arg1, arg2) {
585
585
  const ret = new WebSocket(getStringFromWasm0(arg0, arg1), getObject(arg2));
586
586
  return addHeapObject(ret);
587
587
  }, arguments); },
588
- __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
588
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
589
589
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
590
590
  },
591
- __wbg_push_bfdf956ba476f65b: function(arg0, arg1) {
591
+ __wbg_push_2baf45db356cf468: function(arg0, arg1) {
592
592
  const ret = getObject(arg0).push(getObject(arg1));
593
593
  return ret;
594
594
  },
595
- __wbg_readyState_83df235b27cf257f: function(arg0) {
595
+ __wbg_readyState_d8514376867e415b: function(arg0) {
596
596
  const ret = getObject(arg0).readyState;
597
597
  return ret;
598
598
  },
599
- __wbg_send_af811d92e7aea5c4: function() { return handleError(function (arg0, arg1, arg2) {
599
+ __wbg_send_c1dad0ec2e52defb: function() { return handleError(function (arg0, arg1, arg2) {
600
600
  getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
601
601
  }, arguments); },
602
602
  __wbg_setInterval_cbf1c35c6a692d37: function() { return handleError(function (arg0, arg1) {
603
603
  const ret = setInterval(getObject(arg0), arg1);
604
604
  return addHeapObject(ret);
605
605
  }, arguments); },
606
- __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
607
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
608
- },
609
606
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
610
607
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
611
608
  },
612
- __wbg_set_binaryType_f88804219cea0f9e: function(arg0, arg1) {
609
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
610
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
611
+ },
612
+ __wbg_set_binaryType_21835bf0df8f70aa: function(arg0, arg1) {
613
613
  getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1];
614
614
  },
615
- __wbg_set_onclose_97aab74a1c2662f7: function(arg0, arg1) {
615
+ __wbg_set_onclose_a84370531f3d2948: function(arg0, arg1) {
616
616
  getObject(arg0).onclose = getObject(arg1);
617
617
  },
618
- __wbg_set_onerror_88cb2134dca3aba2: function(arg0, arg1) {
618
+ __wbg_set_onerror_94ee307653399172: function(arg0, arg1) {
619
619
  getObject(arg0).onerror = getObject(arg1);
620
620
  },
621
- __wbg_set_onmessage_0f0d391465909a45: function(arg0, arg1) {
621
+ __wbg_set_onmessage_cb6f77d2d8e0402a: function(arg0, arg1) {
622
622
  getObject(arg0).onmessage = getObject(arg1);
623
623
  },
624
- __wbg_set_onopen_e91e64af99b7966d: function(arg0, arg1) {
624
+ __wbg_set_onopen_c914147e8a2db4b0: function(arg0, arg1) {
625
625
  getObject(arg0).onopen = getObject(arg1);
626
626
  },
627
- __wbg_warn_86f4bd95357114e8: function(arg0, arg1) {
627
+ __wbg_warn_ce1d5c8a41cfe303: function(arg0, arg1) {
628
628
  console.warn(getStringFromWasm0(arg0, arg1));
629
629
  },
630
630
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
@@ -998,7 +998,7 @@ async function __wbg_init(module_or_path) {
998
998
  }
999
999
 
1000
1000
  if (module_or_path === undefined) {
1001
- 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-Bubcy-lZ.js', document.baseURI).href)));
1001
+ 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-CCD7cbHu.js', document.baseURI).href)));
1002
1002
  }
1003
1003
  const imports = __wbg_get_imports();
1004
1004
 
@@ -7,7 +7,7 @@
7
7
  "mixins": [],
8
8
  "compiler": {
9
9
  "name": "@stencil/core",
10
- "version": "4.45.0",
10
+ "version": "4.45.1",
11
11
  "typescriptVersion": "5.8.3"
12
12
  },
13
13
  "collections": [],
@@ -1 +1 @@
1
- function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,p=[],h=[],m=()=>{var t;return(null==(t=r.document)?void 0:t.hidden)?$(v):f.raf(v)},b=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.i?$(v):m())},y=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},v=()=>{y(p),y(h),(d=p.length>0)&&m()},$=t=>Promise.resolve(void 0).then(t),g=b(h,!0),w=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},j=t=>f.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,k=new WeakMap,M=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let l=null,o=null,i=!1,r=!1;const c=[],f=e=>{for(let n=0;n<e.length;n++)if(l=e[n],Array.isArray(l))f(l);else if(null!=l&&"boolean"!=typeof l){if(i="function"!=typeof t&&!E(l))l+="";else if("function"!=typeof t&&void 0===l.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=l:c.push(i?C(null,l):l),r=i}};if(f(n),e){e.key&&(o=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,c.length>0&&(u.v=c),u.$=o,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},N=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},L=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,_=(t,e)=>{const n=t;return{emit:t=>D(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},D=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},H=(t,e,n,s,i,c)=>{if(n===s)return;let u=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,l=W(n);let o=W(s);e.remove(...l.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&tt(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=E(s);if((u||l&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==s||!1===s?(!1!==s||""===t.getAttribute(e)||4&c&&!R(e))&&t.removeAttribute(e):(!u||4&c||i)&&!l&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const l=e.endsWith(F);e=e.replace(T,""),n&&f.rel(t,e,n,l),s&&f.ael(t,e,s,l)}},P=new Set(["draggable","contenteditable","spellcheck"]),R=t=>P.has(t)||t.startsWith("aria-"),U=/\s/,W=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(U):[]),F="Capture",T=RegExp(F+"$"),V=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of q(Object.keys(o)))t in s||H(l,t,o[t],void 0,n,e.i);for(const t of q(Object.keys(s)))H(l,t,o[t],s[t],n,e.i)};function q(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var z=!1,I=!1,Y=[],Z=[],B=(t,e,n)=>{const l=e.v[n];let o,s,i=0;if(null!=l.h)o=l.O=r.document.createTextNode(l.h);else{if(I||(I="svg"===l.j),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=r.document.createElementNS(I?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.j),I&&"foreignObject"===l.j&&(I=!1),V(null,l,I),l.v){const e="template"===l.j?o.content:o;for(i=0;i<l.v.length;++i)s=B(t,l,i),s&&e.appendChild(s)}"svg"===l.j?I=!1:"foreignObject"===o.tagName&&(I=!0)}return o["s-hn"]=S,o},G=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=B(null,n,o),i&&(l[o].O=i,et(r,i,e)))},J=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;X(e),t&&t.remove()}}},K=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),Q=(t,e,n=!1)=>{const l=e.O=t.O,o=t.v,s=e.v,i=e.j,r=e.h;null==r?(I="svg"===i||"foreignObject"!==i&&I,"slot"!==i||z||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(et(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),V(t,e,I),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,d=e[0],p=e[a],h=l.length-1,m=l[0],b=l[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(K(d,m,o))Q(d,m,o),d=e[++r],m=l[++c];else if(K(p,b,o))Q(p,b,o),p=e[--a],b=l[--h];else if(K(d,b,o))Q(d,b,o),et(y,d.O,p.O.nextSibling),d=e[++r],b=l[--h];else if(K(p,m,o))Q(p,m,o),et(y,p.O,d.O),p=e[--a],m=l[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].$&&e[u].$===m.$){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=B(e&&e[c],n,c):(Q(i,m,o),e[f]=void 0,s=i.O),m=l[++c]):(s=B(e&&e[c],n,c),m=l[++c]),s&&et(d.O.parentNode,s,d.O)}r>a?G(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&J(e,r,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),G(l,null,e,s,0,s.length-1)):!n&&null!==o&&J(o,0,o.length-1),I&&"svg"===i&&(I=!1)):t.h!==r&&(l.data=r)},X=t=>{t.m&&t.m.ref&&Y.push((()=>t.m.ref(null))),t.v&&t.v.map(X)},tt=(t,e)=>{Z.push((()=>t(e)))},et=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),nt=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.k||C(null,null),i=(t=>t&&t.j===x)(e)?e:A(null,null,e);if(S=l.tagName,n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=l.shadowRoot||l,z=!(!(1&o.i)||128&o.i),Q(s,i,n),Y.forEach((t=>t())),Y.length=0,Z.forEach((t=>t())),Z.length=0},lt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.M=()=>{e["s-p"].splice(n-1,1),l()})))}},ot=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);lt(t,t.A);const n=()=>st(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},st=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=dt(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=it(o,(()=>dt(l,"componentWillRender",void 0,n))),it(o,(()=>ct(t,l,e)))},it=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ct=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=M(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let o,i=k.get(t=t.head||t);if(i||k.set(t,i=new Set),!i.has(s)){o=r.document.createElement("style"),o.textContent=c;const d=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)l.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);ft(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>ut(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},ft=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,nt(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},ut=t=>{const e=t.$hostElement$,n=e,l=t.A;dt(n,"componentDidRender",void 0,e),64&t.i?dt(n,"componentDidUpdate",void 0,e):(t.i|=64,pt(e),dt(n,"componentDidLoad",void 0,e),t.N(e),l||at()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>ot(t,!1))),t.i&=-517},at=()=>{$((()=>D(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},dt=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},pt=t=>t.classList.add("hydrated"),ht=(t,e,n,o)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),f=i.i,u=r;if(!((n=L(n,o.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),o.L){const t=o.L[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&f||1&o)&&(u?u[l](n,c,e):i._.push((()=>{i.D[l](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||ot(i,!1)}}},mt=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.L&&(n.L=N(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,L(t,o)),void ht(this,e,t=32&o?this[e]:s.$hostElement$[e],n);ht(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var c;const f=t.get(e),u=l(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.L)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===f)),d=4&(a?a[1][0]:0),p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},bt=async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=M(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.A,s=()=>ot(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),!e.N||1024&e.i||e.N(t)}},yt=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o.L=N(t.L),o.H=t.H,o.P=t.P;const s=t.prototype.connectedCallback,i=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,R:new Map};l.U=new Promise((t=>l.N=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)(null==e?void 0:e.D)||(1024&e.i?setTimeout((()=>bt(t,e,n)),1e3):(null==e?void 0:e.U)&&e.U.then((()=>{})));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){lt(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),bt(t,e,n)}o()}})(this),s&&s.call(this)},disconnectedCallback(){(async t=>{k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),mt(t,o)}catch(e){return s(e),t}},vt=t=>f.C=t,$t=t=>Object.assign(f,t),gt=new WeakMap;function wt(t,e){let n=gt.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},gt.set(e,n)),nt(n,t)}function jt(t){return t}export{c as H,x as a,_ as c,w as getAssetPath,A as h,yt as p,wt as render,j as setAssetPath,vt as setNonce,$t as setPlatformOptions,jt as t}
1
+ function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,p=[],h=[],m=()=>{var t;return(null==(t=r.document)?void 0:t.hidden)?$(v):f.raf(v)},b=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.i?$(v):m())},y=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},v=()=>{y(p),y(h),(d=p.length>0)&&m()},$=t=>Promise.resolve(void 0).then(t),g=b(h,!0),w=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},j=t=>f.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,k=new WeakMap,M=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let l=null,o=null,i=!1,r=!1;const c=[],f=e=>{for(let n=0;n<e.length;n++)if(l=e[n],Array.isArray(l))f(l);else if(null!=l&&"boolean"!=typeof l){if(i="function"!=typeof t&&!E(l))l+="";else if("function"!=typeof t&&void 0===l.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=l:c.push(i?C(null,l):l),r=i}};if(f(n),e){e.key&&(o=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,c.length>0&&(u.v=c),u.$=o,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},N=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},L=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,_=(t,e)=>{const n=t;return{emit:t=>D(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},D=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},H=(t,e,n,s,i,c)=>{if(n===s)return;let u=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,l=W(n);let o=W(s);e.remove(...l.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&tt(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=E(s);if((u||l&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==s||!1===s?(!1!==s||""===t.getAttribute(e)||4&c&&!R(e))&&t.removeAttribute(e):(!u||4&c||i)&&!l&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const l=e.endsWith(F);e=e.replace(T,""),n&&f.rel(t,e,n,l),s&&f.ael(t,e,s,l)}},P=new Set(["draggable","contenteditable","spellcheck"]),R=t=>P.has(t)||t.startsWith("aria-"),U=/\s/,W=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(U):[]),F="Capture",T=RegExp(F+"$"),V=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of q(Object.keys(o)))t in s||H(l,t,o[t],void 0,n,e.i);for(const t of q(Object.keys(s)))H(l,t,o[t],s[t],n,e.i)};function q(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var z=!1,I=!1,Y=[],Z=[],B=(t,e,n)=>{const l=e.v[n];let o,s,i=0;if(null!=l.h)o=l.O=r.document.createTextNode(l.h);else{if(I||(I="svg"===l.j),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=r.document.createElementNS(I?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.j),I&&"foreignObject"===l.j&&(I=!1),V(null,l,I),l.v){const e="template"===l.j?o.content:o;for(i=0;i<l.v.length;++i)s=B(t,l,i),s&&e.appendChild(s)}"svg"===l.j?I=!1:"foreignObject"===o.tagName&&(I=!0)}return o["s-hn"]=S,o},G=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=B(null,n,o),i&&(l[o].O=i,et(r,i,e)))},J=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;X(e),t&&t.remove()}}},K=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),Q=(t,e,n=!1)=>{const l=e.O=t.O,o=t.v,s=e.v,i=e.j,r=e.h;null==r?(I="svg"===i||"foreignObject"!==i&&I,"slot"!==i||z||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(et(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),V(t,e,I),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,d=e[0],p=e[a],h=l.length-1,m=l[0],b=l[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(K(d,m,o))Q(d,m,o),d=e[++r],m=l[++c];else if(K(p,b,o))Q(p,b,o),p=e[--a],b=l[--h];else if(K(d,b,o))Q(d,b,o),et(y,d.O,p.O.nextSibling),d=e[++r],b=l[--h];else if(K(p,m,o))Q(p,m,o),et(y,p.O,d.O),p=e[--a],m=l[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].$&&e[u].$===m.$){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=B(e&&e[c],n,c):(Q(i,m,o),e[f]=void 0,s=i.O),m=l[++c]):(s=B(e&&e[c],n,c),m=l[++c]),s&&et(d.O.parentNode,s,d.O)}r>a?G(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&J(e,r,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),G(l,null,e,s,0,s.length-1)):!n&&null!==o&&J(o,0,o.length-1),I&&"svg"===i&&(I=!1)):t.h!==r&&(l.data=r)},X=t=>{t.m&&t.m.ref&&Y.push((()=>t.m.ref(null))),t.v&&t.v.map(X)},tt=(t,e)=>{Z.push((()=>t(e)))},et=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),nt=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.k||C(null,null),i=(t=>t&&t.j===x)(e)?e:A(null,null,e);if(S=l.tagName,n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=l.shadowRoot||l,z=!(!(1&o.i)||128&o.i),Q(s,i,n),Y.forEach((t=>t())),Y.length=0,Z.forEach((t=>t())),Z.length=0},lt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.M=()=>{e["s-p"].splice(n-1,1),l()})))}},ot=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);lt(t,t.A);const n=()=>st(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},st=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=dt(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=it(o,(()=>dt(l,"componentWillRender",void 0,n))),it(o,(()=>ct(t,l,e)))},it=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ct=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=M(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let o,i=k.get(t=t.head||t);if(i||k.set(t,i=new Set),!i.has(s)){o=r.document.createElement("style"),o.textContent=c;const d=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)l.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);ft(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>ut(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},ft=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,nt(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},ut=t=>{const e=t.$hostElement$,n=e,l=t.A;dt(n,"componentDidRender",void 0,e),64&t.i?dt(n,"componentDidUpdate",void 0,e):(t.i|=64,pt(e),dt(n,"componentDidLoad",void 0,e),t.N(e),l||at()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>ot(t,!1))),t.i&=-517},at=()=>{$((()=>D(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},dt=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},pt=t=>t.classList.add("hydrated"),ht=(t,e,n,o)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),f=i.i,u=r;if(!((n=L(n,o.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),o.L){const t=o.L[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&f||1&o)&&(u?u[l](n,c,e):i._.push((()=>{i.D[l](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||ot(i,!1)}}},mt=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.L&&(n.L=N(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,L(t,o)),void ht(this,e,t=32&o?this[e]:s.$hostElement$[e],n);ht(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var c;const f=t.get(e),u=l(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.L)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===f)),d=4&(a?a[1][0]:0),p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=this[f],m=Object.getOwnPropertyDescriptor(i,f);p||s==h||m.get&&!m.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},bt=async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=M(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.A,s=()=>ot(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),!e.N||1024&e.i||e.N(t)}},yt=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o.L=N(t.L),o.H=t.H,o.P=t.P;const s=t.prototype.connectedCallback,i=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,R:new Map};l.U=new Promise((t=>l.N=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)(null==e?void 0:e.D)||(1024&e.i?setTimeout((()=>bt(t,e,n)),1e3):(null==e?void 0:e.U)&&e.U.then((()=>{})));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){lt(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),bt(t,e,n)}o()}})(this),s&&s.call(this)},disconnectedCallback(){(async t=>{k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),mt(t,o)}catch(e){return s(e),t}},vt=t=>f.C=t,$t=t=>Object.assign(f,t),gt=new WeakMap;function wt(t,e){let n=gt.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},gt.set(e,n)),nt(n,t)}function jt(t){return t}export{c as H,x as a,_ as c,w as getAssetPath,A as h,yt as p,wt as render,j as setAssetPath,vt as setNonce,$t as setPlatformOptions,jt as t}
@@ -1 +1 @@
1
- class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();j.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2);j.channel_authenticate(this.__wbg_ptr,r,o,i,k,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}connect(){j.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,o,i,s,c,_){const u=N(n,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=N(t,j.__wbindgen_export,j.__wbindgen_export2),b=k;var l=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),d=k;const w=N(r,j.__wbindgen_export,j.__wbindgen_export2),g=k;var h=R(i)?0:N(i,j.__wbindgen_export,j.__wbindgen_export2),p=k,m=R(s)?0:N(s,j.__wbindgen_export,j.__wbindgen_export2),y=k,v=R(c)?0:N(c,j.__wbindgen_export,j.__wbindgen_export2);j.channel_create_service(this.__wbg_ptr,u,a,f,b,l,d,w,g,o,h,p,m,y,v,k,R(_)?Number.MAX_SAFE_INTEGER:_>>>0)}delete_service(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2);j.channel_delete_service(this.__wbg_ptr,r,o,i,k,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}disconnect(){j.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==j.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==j.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2),s=k;var c=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2);const u=j.channel_new(r,o,i,s,c,k);return this.__wbg_ptr=u,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){j.channel_on_connection_close(this.__wbg_ptr,R(n)?0:u(n))}on_connection_error(n){j.channel_on_connection_error(this.__wbg_ptr,R(n)?0:u(n))}on_connection_message(n){j.channel_on_connection_message(this.__wbg_ptr,R(n)?0:u(n))}on_connection_open(n){j.channel_on_connection_open(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message(n){j.channel_on_protocol_message(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message_type(n,t){const e=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_on_protocol_message_type(this.__wbg_ptr,e,k,R(t)?0:u(t))}open_rdp_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_rdp_tunnel(this.__wbg_ptr,i,s,c,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_sftp_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_sftp_tunnel(this.__wbg_ptr,i,s,c,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_ssh_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_ssh_tunnel(this.__wbg_ptr,i,s,c,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_chmod(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_chmod(this.__wbg_ptr,i,s,t,c,k,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_delete(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_delete(this.__wbg_ptr,i,s,t,c,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_ack(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_ack(this.__wbg_ptr,o,k,t,e,r)}send_sftp_download_chunk(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_chunk(this.__wbg_ptr,i,k,t,e,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_start(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_start(this.__wbg_ptr,i,s,t,c,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_list_data(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_list_data(this.__wbg_ptr,o,i,t,s,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_mkdir(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_mkdir(this.__wbg_ptr,o,i,t,s,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_read_file(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_read_file(this.__wbg_ptr,o,i,t,s,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_remove(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_remove(this.__wbg_ptr,i,s,t,c,k,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_rename(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_rename(this.__wbg_ptr,i,s,t,c,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_upload_chunk(n,t,e,r,o,i,s){const c=N(n,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=S(i,j.__wbindgen_export);j.channel_send_sftp_upload_chunk(this.__wbg_ptr,c,_,t,e,r,o,u,k,R(s)?Number.MAX_SAFE_INTEGER:s>>>0)}send_sftp_upload_start(n,t,e,r,o,i,s){const c=N(n,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_upload_start(this.__wbg_ptr,c,_,t,u,a,f,k,o,i,R(s)?Number.MAX_SAFE_INTEGER:s>>>0)}send_sftp_write_file(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),s=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=S(r,j.__wbindgen_export);j.channel_send_sftp_write_file(this.__wbg_ptr,i,s,t,c,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_ssh_terminal_resize(n,t,e,r,o,i){const s=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_terminal_resize(this.__wbg_ptr,s,k,t,e,r,o,i)}send_ssh_tunnel_data(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,i,k)}start_heartbeat(n){j.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){j.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,o,i,s,c,_,u){const a=N(n,j.__wbindgen_export,j.__wbindgen_export2),f=k,b=N(t,j.__wbindgen_export,j.__wbindgen_export2),l=k,d=N(e,j.__wbindgen_export,j.__wbindgen_export2),w=k;var g=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2),h=k;const p=N(o,j.__wbindgen_export,j.__wbindgen_export2),m=k;var y=R(s)?0:N(s,j.__wbindgen_export,j.__wbindgen_export2),v=k,A=R(c)?0:N(c,j.__wbindgen_export,j.__wbindgen_export2),S=k,T=R(_)?0:N(_,j.__wbindgen_export,j.__wbindgen_export2);j.channel_update_service(this.__wbg_ptr,a,f,b,l,d,w,g,h,p,m,i,y,v,A,S,T,k,R(u)?Number.MAX_SAFE_INTEGER:u>>>0)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_67e7344beaa85059:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=N(String(p(t)),j.__wbindgen_export,j.__wbindgen_export2),r=k;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0:function(n,t){const e=N(f(p(t)),j.__wbindgen_export,j.__wbindgen_export2),r=k;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_92ab86bb19cbc12f:function(n,t){const e=p(t),r="string"==typeof e?e:void 0;var o=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2),i=k;d().setInt32(n+4,i,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_5d9e815e6fdf150f:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_997e73d32238e655:function(n){p(n)._wbg_cb_unref()},__wbg_call_269c5566fbede3eb:function(){return m((function(n,t){return u(p(n).call(p(t)))}),arguments)},__wbg_call_6bcf8d3e20937e46:function(){return m((function(n,t,e){return u(p(n).call(p(t),p(e)))}),arguments)},__wbg_call_7bbd9cceba9949ad:function(){return m((function(n,t,e,r){return u(p(n).call(p(t),p(e),p(r)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(T(n)))},__wbg_close_a009f540ff811039:function(){return m((function(n){p(n).close()}),arguments)},__wbg_data_aa7ba49b34c0d883:function(n){return u(p(n).data)},__wbg_from_a39669ce566077da:function(n){return u(Array.from(p(n)))},__wbg_getRandomValues_a608c4436c19407a:function(){return m((function(n,t){globalThis.crypto.getRandomValues(b(n,t))}),arguments)},__wbg_get_989d0a1309644f2b:function(){return m((function(n,t){return u(Reflect.get(p(n),p(t)))}),arguments)},__wbg_info_2eae925674557566:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_d4ff01f8247925ae:function(n){let t;try{t=p(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_31bdaf014f5fbde2:function(n){return p(n).length},__wbg_new_1da3429bc3c4541c:function(n){return u(new Uint8Array(p(n)))},__wbg_new_bebc3f4757acf305:function(){return u(new Object)},__wbg_new_ffa92086ea89f79c:function(){return u(new Array)},__wbg_new_with_str_sequence_9ab4875494df9d99:function(){return m((function(n,t,e){return u(new WebSocket(w(n,t),p(e)))}),arguments)},__wbg_prototypesetcall_ae9f5e7459250748:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),p(e))},__wbg_push_bfdf956ba476f65b:function(n,t){return p(n).push(p(t))},__wbg_readyState_83df235b27cf257f:function(n){return p(n).readyState},__wbg_send_af811d92e7aea5c4:function(){return m((function(n,t,e){p(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return m((function(n,t){return u(setInterval(p(n),t))}),arguments)},__wbg_set_13d25b81ab403f5e:function(n,t,e){p(n)[t>>>0]=T(e)},__wbg_set_6be42768c690e380:function(n,t,e){p(n)[T(t)]=T(e)},__wbg_set_binaryType_f88804219cea0f9e:function(n,t){p(n).binaryType=c[t]},__wbg_set_onclose_97aab74a1c2662f7:function(n,t){p(n).onclose=p(t)},__wbg_set_onerror_88cb2134dca3aba2:function(n,t){p(n).onerror=p(t)},__wbg_set_onmessage_0f0d391465909a45:function(n,t){p(n).onmessage=p(t)},__wbg_set_onopen_e91e64af99b7966d:function(n,t){p(n).onopen=p(t)},__wbg_warn_86f4bd95357114e8:function(n,t){console.warn(w(n,t))},__wbindgen_generic_0000000000000001:function(n,t){return u(A(n,t,o))},__wbindgen_generic_0000000000000002:function(n,t){return u(A(n,t,i))},__wbindgen_generic_0000000000000003:function(n,t){return u(A(n,t,s))},__wbindgen_generic_0000000000000004:function(n,t){return u(A(n,t,r))},__wbindgen_generic_0000000000000005:function(n){return u(n)},__wbindgen_generic_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_generic_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_generic_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(p(n))},__wbindgen_object_drop_ref:function(n){T(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){j.__wasm_bindgen_func_elem_64(n,t)}function o(n,t,e){j.__wasm_bindgen_func_elem_60(n,t,u(e))}function i(n,t,e){j.__wasm_bindgen_func_elem_60_37(n,t,u(e))}function s(n,t,e){j.__wasm_bindgen_func_elem_60_38(n,t,u(e))}const c=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbg_channel_free(n,1)));function u(n){v===y.length&&y.push(y.length+1);const t=v;return v=y[t],y[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==j.memory.buffer)&&(l=new DataView(j.memory.buffer)),l}function w(n,t){return function(n,t){return P+=t,P>=O&&(F=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),F.decode(),P=t),F.decode(h().subarray(n,n+t))}(n>>>0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(j.memory.buffer)),g}function p(n){return y[n]}function m(n,t){try{return n.apply(this,t)}catch(n){j.__wbindgen_export3(u(n))}}let y=new Array(1024).fill(void 0);y.push(void 0,null,!0,!1);let v=y.length;function R(n){return null==n}function A(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(j.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t){const e=t(1*n.length,1)>>>0;return h().set(n,e/1),k=n.length,e}function N(n,t,e){if(void 0===e){const e=U.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),k=e.length,r}let r=n.length,o=t(r,1)>>>0;const i=h();let s=0;for(;s<r;s++){const t=n.charCodeAt(s);if(t>127)break;i[o+s]=t}if(s!==r){0!==s&&(n=n.slice(s)),o=e(o,r,r=s+3*n.length,1)>>>0;const t=h().subarray(o+s,o+r);s+=U.encodeInto(n,t).written,o=e(o,r,s,1)>>>0}return k=s,o}function T(n){const t=p(n);return function(n){n<1028||(y[n]=v,v=n)}(n),t}let F=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});F.decode();const O=2146435072;let P=0;const U=new TextEncoder;"encodeInto"in U||(U.encodeInto=function(n,t){const e=U.encode(n);return t.set(e),{read:n.length,written:e.length}});let j,k=0;async function W(n){if(void 0!==j)return j;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;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",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return j=n.exports,l=null,g=null,j}(r)}var $,q,E;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck",n.SFTPOpResult="SFTPOpResult"}($||($={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(q||(q={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(E||(E={}));export{n as C,t as E,q as I,$ as P,W as _,E as a}
1
+ class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();j.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2);j.channel_authenticate(this.__wbg_ptr,r,o,i,k,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}connect(){j.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,o,i,c,s,_){const u=N(n,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=N(t,j.__wbindgen_export,j.__wbindgen_export2),b=k;var d=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),l=k;const w=N(r,j.__wbindgen_export,j.__wbindgen_export2),g=k;var h=R(i)?0:N(i,j.__wbindgen_export,j.__wbindgen_export2),p=k,m=R(c)?0:N(c,j.__wbindgen_export,j.__wbindgen_export2),y=k,v=R(s)?0:N(s,j.__wbindgen_export,j.__wbindgen_export2);j.channel_create_service(this.__wbg_ptr,u,a,f,b,d,l,w,g,o,h,p,m,y,v,k,R(_)?Number.MAX_SAFE_INTEGER:_>>>0)}delete_service(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2);j.channel_delete_service(this.__wbg_ptr,r,o,i,k,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}disconnect(){j.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==j.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==j.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(t,j.__wbindgen_export,j.__wbindgen_export2),c=k;var s=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2);const u=j.channel_new(r,o,i,c,s,k);return this.__wbg_ptr=u,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){j.channel_on_connection_close(this.__wbg_ptr,R(n)?0:u(n))}on_connection_error(n){j.channel_on_connection_error(this.__wbg_ptr,R(n)?0:u(n))}on_connection_message(n){j.channel_on_connection_message(this.__wbg_ptr,R(n)?0:u(n))}on_connection_open(n){j.channel_on_connection_open(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message(n){j.channel_on_protocol_message(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message_type(n,t){const e=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_on_protocol_message_type(this.__wbg_ptr,e,k,R(t)?0:u(t))}open_rdp_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_rdp_tunnel(this.__wbg_ptr,i,c,s,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_sftp_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_sftp_tunnel(this.__wbg_ptr,i,c,s,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_ssh_tunnel(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(t,j.__wbindgen_export,j.__wbindgen_export2),_=k;var u=R(e)?0:N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_open_ssh_tunnel(this.__wbg_ptr,i,c,s,_,u,a,f,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_chmod(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_chmod(this.__wbg_ptr,i,c,t,s,k,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_delete(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_delete(this.__wbg_ptr,i,c,t,s,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_ack(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_ack(this.__wbg_ptr,o,k,t,e,r)}send_sftp_download_chunk(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_chunk(this.__wbg_ptr,i,k,t,e,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_start(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_download_start(this.__wbg_ptr,i,c,t,s,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_list_data(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_list_data(this.__wbg_ptr,o,i,t,c,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_mkdir(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_mkdir(this.__wbg_ptr,o,i,t,c,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_read_file(n,t,e,r){const o=N(n,j.__wbindgen_export,j.__wbindgen_export2),i=k,c=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_read_file(this.__wbg_ptr,o,i,t,c,k,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_remove(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_remove(this.__wbg_ptr,i,c,t,s,k,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_rename(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_rename(this.__wbg_ptr,i,c,t,s,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_upload_chunk(n,t,e,r,o,i,c){const s=N(n,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=S(i,j.__wbindgen_export);j.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,k,R(c)?Number.MAX_SAFE_INTEGER:c>>>0)}send_sftp_upload_start(n,t,e,r,o,i,c){const s=N(n,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=N(e,j.__wbindgen_export,j.__wbindgen_export2),a=k,f=N(r,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,k,o,i,R(c)?Number.MAX_SAFE_INTEGER:c>>>0)}send_sftp_write_file(n,t,e,r,o){const i=N(n,j.__wbindgen_export,j.__wbindgen_export2),c=k,s=N(e,j.__wbindgen_export,j.__wbindgen_export2),_=k,u=S(r,j.__wbindgen_export);j.channel_send_sftp_write_file(this.__wbg_ptr,i,c,t,s,_,u,k,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_ssh_terminal_resize(n,t,e,r,o,i){const c=N(n,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_terminal_resize(this.__wbg_ptr,c,k,t,e,r,o,i)}send_ssh_tunnel_data(n,t,e){const r=N(n,j.__wbindgen_export,j.__wbindgen_export2),o=k,i=N(e,j.__wbindgen_export,j.__wbindgen_export2);j.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,i,k)}start_heartbeat(n){j.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){j.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,o,i,c,s,_,u){const a=N(n,j.__wbindgen_export,j.__wbindgen_export2),f=k,b=N(t,j.__wbindgen_export,j.__wbindgen_export2),d=k,l=N(e,j.__wbindgen_export,j.__wbindgen_export2),w=k;var g=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2),h=k;const p=N(o,j.__wbindgen_export,j.__wbindgen_export2),m=k;var y=R(c)?0:N(c,j.__wbindgen_export,j.__wbindgen_export2),v=k,A=R(s)?0:N(s,j.__wbindgen_export,j.__wbindgen_export2),S=k,T=R(_)?0:N(_,j.__wbindgen_export,j.__wbindgen_export2);j.channel_update_service(this.__wbg_ptr,a,f,b,d,l,w,g,h,p,m,i,y,v,A,S,T,k,R(u)?Number.MAX_SAFE_INTEGER:u>>>0)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_30c8987f7c2ed4e2:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=N(String(p(t)),j.__wbindgen_export,j.__wbindgen_export2),r=k;l().setInt32(n+4,r,!0),l().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_4687d8d8c2017d52:function(n,t){const e=N(f(p(t)),j.__wbindgen_export,j.__wbindgen_export2),r=k;l().setInt32(n+4,r,!0),l().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_0380ccaa2f57f0d9:function(n,t){const e=p(t),r="string"==typeof e?e:void 0;var o=R(r)?0:N(r,j.__wbindgen_export,j.__wbindgen_export2),i=k;l().setInt32(n+4,i,!0),l().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_41e9ee4f547fc59a:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_dcc1a90847f04c41:function(n){p(n)._wbg_cb_unref()},__wbg_call_1875a20c43a36133:function(){return m((function(n,t,e,r){return u(p(n).call(p(t),p(e),p(r)))}),arguments)},__wbg_call_187d372bd5fdd4aa:function(){return m((function(n,t,e){return u(p(n).call(p(t),p(e)))}),arguments)},__wbg_call_6137034ef55c9d0f:function(){return m((function(n,t){return u(p(n).call(p(t)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(T(n)))},__wbg_close_d3ed56b5763be5ae:function(){return m((function(n){p(n).close()}),arguments)},__wbg_data_522f7abc70721269:function(n){return u(p(n).data)},__wbg_from_296ca31f8d0f1c52:function(n){return u(Array.from(p(n)))},__wbg_getRandomValues_a608c4436c19407a:function(){return m((function(n,t){globalThis.crypto.getRandomValues(b(n,t))}),arguments)},__wbg_get_31af05bd4842a84f:function(){return m((function(n,t){return u(Reflect.get(p(n),p(t)))}),arguments)},__wbg_info_c2e816d395f9b883:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_a99f175873e5d9b8:function(n){let t;try{t=p(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_7f3c00c40364105e:function(n){return p(n).length},__wbg_new_1dbf7428bba60a42:function(n){return u(new Uint8Array(p(n)))},__wbg_new_617a8cdb8bb1130e:function(){return u(new Object)},__wbg_new_ee2291f50781bf1d:function(){return u(new Array)},__wbg_new_with_str_sequence_f79e461d58fdeacc:function(){return m((function(n,t,e){return u(new WebSocket(w(n,t),p(e)))}),arguments)},__wbg_prototypesetcall_bc27214492979395:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),p(e))},__wbg_push_2baf45db356cf468:function(n,t){return p(n).push(p(t))},__wbg_readyState_d8514376867e415b:function(n){return p(n).readyState},__wbg_send_c1dad0ec2e52defb:function(){return m((function(n,t,e){p(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return m((function(n,t){return u(setInterval(p(n),t))}),arguments)},__wbg_set_6be42768c690e380:function(n,t,e){p(n)[T(t)]=T(e)},__wbg_set_bea140a88be9b277:function(n,t,e){p(n)[t>>>0]=T(e)},__wbg_set_binaryType_21835bf0df8f70aa:function(n,t){p(n).binaryType=s[t]},__wbg_set_onclose_a84370531f3d2948:function(n,t){p(n).onclose=p(t)},__wbg_set_onerror_94ee307653399172:function(n,t){p(n).onerror=p(t)},__wbg_set_onmessage_cb6f77d2d8e0402a:function(n,t){p(n).onmessage=p(t)},__wbg_set_onopen_c914147e8a2db4b0:function(n,t){p(n).onopen=p(t)},__wbg_warn_ce1d5c8a41cfe303:function(n,t){console.warn(w(n,t))},__wbindgen_generic_0000000000000001:function(n,t){return u(A(n,t,o))},__wbindgen_generic_0000000000000002:function(n,t){return u(A(n,t,i))},__wbindgen_generic_0000000000000003:function(n,t){return u(A(n,t,c))},__wbindgen_generic_0000000000000004:function(n,t){return u(A(n,t,r))},__wbindgen_generic_0000000000000005:function(n){return u(n)},__wbindgen_generic_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_generic_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_generic_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(p(n))},__wbindgen_object_drop_ref:function(n){T(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){j.__wasm_bindgen_func_elem_64(n,t)}function o(n,t,e){j.__wasm_bindgen_func_elem_60(n,t,u(e))}function i(n,t,e){j.__wasm_bindgen_func_elem_60_37(n,t,u(e))}function c(n,t,e){j.__wasm_bindgen_func_elem_60_38(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbg_channel_free(n,1)));function u(n){v===y.length&&y.push(y.length+1);const t=v;return v=y[t],y[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>j.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let d=null;function l(){return(null===d||!0===d.buffer.detached||void 0===d.buffer.detached&&d.buffer!==j.memory.buffer)&&(d=new DataView(j.memory.buffer)),d}function w(n,t){return function(n,t){return P+=t,P>=O&&(F=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),F.decode(),P=t),F.decode(h().subarray(n,n+t))}(n>>>0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(j.memory.buffer)),g}function p(n){return y[n]}function m(n,t){try{return n.apply(this,t)}catch(n){j.__wbindgen_export3(u(n))}}let y=new Array(1024).fill(void 0);y.push(void 0,null,!0,!1);let v=y.length;function R(n){return null==n}function A(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(j.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t){const e=t(1*n.length,1)>>>0;return h().set(n,e/1),k=n.length,e}function N(n,t,e){if(void 0===e){const e=U.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),k=e.length,r}let r=n.length,o=t(r,1)>>>0;const i=h();let c=0;for(;c<r;c++){const t=n.charCodeAt(c);if(t>127)break;i[o+c]=t}if(c!==r){0!==c&&(n=n.slice(c)),o=e(o,r,r=c+3*n.length,1)>>>0;const t=h().subarray(o+c,o+r);c+=U.encodeInto(n,t).written,o=e(o,r,c,1)>>>0}return k=c,o}function T(n){const t=p(n);return function(n){n<1028||(y[n]=v,v=n)}(n),t}let F=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});F.decode();const O=2146435072;let P=0;const U=new TextEncoder;"encodeInto"in U||(U.encodeInto=function(n,t){const e=U.encode(n);return t.set(e),{read:n.length,written:e.length}});let j,k=0;async function W(n){if(void 0!==j)return j;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;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",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return j=n.exports,d=null,g=null,j}(r)}var $,q,E;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck",n.SFTPOpResult="SFTPOpResult"}($||($={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(q||(q={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(E||(E={}));export{n as C,t as E,q as I,$ as P,W as _,E 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-C-YMMXFH.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-D4JeTIHt.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}