phirepass-widgets 0.0.114 → 0.0.115

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 (37) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +133 -38
  3. package/dist/cjs/phirepass-rdp.cjs.entry.js +1 -1
  4. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-widgets.cjs.js +1 -1
  6. package/dist/collection/components/phirepass-downloader/jobs.js +22 -2
  7. package/dist/collection/components/phirepass-downloader/views/icons.js +1 -0
  8. package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +9 -0
  9. package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +79 -3
  10. package/dist/collection/components/phirepass-media-player/player.js +24 -0
  11. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +1 -1
  12. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +33 -33
  13. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
  14. package/dist/components/p-DIf-Ru26.js +1 -0
  15. package/dist/components/p-DqT-qhTU.js +1 -0
  16. package/dist/components/phirepass-downloader.js +1 -1
  17. package/dist/components/phirepass-media-player.js +1 -1
  18. package/dist/components/phirepass-rdp.js +1 -1
  19. package/dist/components/phirepass-sftp-client.js +1 -1
  20. package/dist/components/phirepass-terminal.js +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/phirepass-downloader_3.entry.js +133 -38
  23. package/dist/esm/phirepass-rdp.entry.js +1 -1
  24. package/dist/esm/phirepass-terminal.entry.js +2 -2
  25. package/dist/esm/phirepass-widgets.js +1 -1
  26. package/dist/phirepass-widgets/{p-a4a5e5f5.entry.js → p-2fd32ec5.entry.js} +1 -1
  27. package/dist/phirepass-widgets/{p-a5ce104d.entry.js → p-705501d4.entry.js} +1 -1
  28. package/dist/phirepass-widgets/p-b8caf9e1.entry.js +1 -0
  29. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  30. package/dist/types/components/phirepass-downloader/jobs.d.ts +7 -0
  31. package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +16 -1
  32. package/dist/types/components/phirepass-media-player/player.d.ts +10 -0
  33. package/dist/types/components.d.ts +10 -2
  34. package/package.json +4 -4
  35. package/dist/components/p-C4cmk3bS.js +0 -1
  36. package/dist/components/p-CKnb-oeB.js +0 -1
  37. package/dist/phirepass-widgets/p-97d84225.entry.js +0 -1
@@ -375,10 +375,22 @@ function applyProgress(prev, job) {
375
375
  return { jobs, completed, first: !before };
376
376
  }
377
377
  const ACTIVE_STATES = new Set(['Queued', 'Scheduled', 'Resolving', 'FetchingMetadata', 'Downloading', 'Verifying', 'Paused', 'Stopped', 'Unknown']);
378
+ /**
379
+ * A finished torrent whose seeding was stopped. Its files are whole and
380
+ * Resume seeds again, so it stays with the finished rows. The agent keeps
381
+ * `seeding_since` through a Stop, which is what tells it apart from a
382
+ * download stopped half-way.
383
+ */
384
+ function isPausedSeeding(row) {
385
+ return row.state === 'Stopped' && row.kind === 'Torrent' && !!row.seeding_since;
386
+ }
378
387
  function tabOf(row) {
379
388
  if (row.state === 'Retrying') {
380
389
  return 'retrying';
381
390
  }
391
+ if (isPausedSeeding(row)) {
392
+ return 'finished';
393
+ }
382
394
  if (ACTIVE_STATES.has(row.state)) {
383
395
  return 'active';
384
396
  }
@@ -460,7 +472,9 @@ function playCheck(row) {
460
472
  if (row.in_order) {
461
473
  return { play: true, file, switchToInOrder: false };
462
474
  }
463
- return { play: false, file: null, switchToInOrder: row.kind === 'Torrent' };
475
+ // Paused seeding has nothing left to download, so switching the order
476
+ // would change nothing.
477
+ return { play: false, file: null, switchToInOrder: row.kind === 'Torrent' && !isPausedSeeding(row) };
464
478
  }
465
479
  function streamUrl(base, nodeId, downloadId, fileIndex) {
466
480
  return `${base.replace(/\/+$/, '')}/api/web/stream/${encodeURIComponent(nodeId)}/${encodeURIComponent(downloadId)}/${fileIndex}`;
@@ -509,7 +523,7 @@ function statePill(row) {
509
523
  case 'Completed':
510
524
  return { text: 'Completed', tone: 'ok' };
511
525
  case 'Stopped':
512
- return { text: 'Stopped', tone: 'ps' };
526
+ return { text: isPausedSeeding(row) ? 'Seeding paused' : 'Stopped', tone: 'ps' };
513
527
  case 'Cancelled':
514
528
  return { text: 'Cancelled', tone: 'err' };
515
529
  default:
@@ -623,6 +637,12 @@ function statsLine(row, ctx = {}) {
623
637
  break;
624
638
  }
625
639
  case 'Stopped':
640
+ if (isPausedSeeding(row)) {
641
+ push(`${formatBytes(row.up_total)} uploaded`);
642
+ push(row.reason ?? 'Seeding paused by you');
643
+ push('Resume shares it again');
644
+ break;
645
+ }
626
646
  push(pct, { strong: true });
627
647
  push(row.reason ?? 'Stopped by you');
628
648
  push('Resume continues from here');
@@ -730,6 +750,7 @@ const paths = {
730
750
  lock: () => [h("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2" }), h("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })],
731
751
  signal: () => [h("path", { d: "M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 4v16" })],
732
752
  plus: () => [h("path", { d: "M12 5v14M5 12h14" })],
753
+ link: () => [h("path", { d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7" }), h("path", { d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7" })],
733
754
  };
734
755
  const filled = {
735
756
  pause: () => [h("rect", { x: "6", y: "5", width: "4", height: "14", rx: "1" }), h("rect", { x: "14", y: "5", width: "4", height: "14", rx: "1" })],
@@ -1796,6 +1817,30 @@ function castBlocker(name, mime) {
1796
1817
  }
1797
1818
  return null;
1798
1819
  }
1820
+ /** `src` with its ticket, absolute, since it leaves this page. */
1821
+ function ticketUrl(src, ticket, base = globalThis.location?.href) {
1822
+ // An invalid base throws even for an absolute src, so it is used only
1823
+ // when src needs one.
1824
+ const url = /^[a-z][a-z0-9+.-]*:/i.test(src) ? new URL(src) : new URL(src, base);
1825
+ url.searchParams.set('ticket', ticket);
1826
+ return url.href;
1827
+ }
1828
+ /** POSTs the stream URL with the session cookie; the server answers `{ ticket }`. */
1829
+ function fetchLinkMinter(fetcher = (input, init) => fetch(input, init)) {
1830
+ return async (src) => {
1831
+ try {
1832
+ const res = await fetcher(src, { method: 'POST', credentials: 'include' });
1833
+ if (!res.ok) {
1834
+ return null;
1835
+ }
1836
+ const body = (await res.json());
1837
+ return typeof body.ticket === 'string' && body.ticket ? ticketUrl(src, body.ticket) : null;
1838
+ }
1839
+ catch {
1840
+ return null;
1841
+ }
1842
+ };
1843
+ }
1799
1844
  /** Nothing is saved in the first 30 seconds. */
1800
1845
  const SAVE_AFTER_SECS = 30;
1801
1846
  const SAVE_EVERY_MS = 10_000;
@@ -1849,7 +1894,7 @@ const localPositionStore = {
1849
1894
  },
1850
1895
  };
1851
1896
 
1852
- const phirepassMediaPlayerCss = () => `:host{--card:220 18% 10%;--bg:216 18% 7%;--border:220 15% 18%;--primary:160 60% 45%;--primary-foreground:220 20% 7%;--muted:220 15% 13%;--muted-foreground:215 10% 52%;--foreground:210 20% 90%;--amber:38 75% 55%;display:flex;flex-direction:column;background:hsl(var(--card));color:hsl(var(--foreground));border:1px solid hsl(var(--border));border-radius:8px;overflow:hidden;font-family:ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;font-size:13px;line-height:1.45;box-shadow:0 20px 50px -10px rgba(0, 0, 0, 0.7)}*{box-sizing:border-box}button,a.btn{font:inherit;color:inherit;cursor:pointer}:focus-visible{outline:2px solid hsl(var(--primary));outline-offset:2px}.bar{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid hsl(var(--border));min-width:0}.nm{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.pill{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;padding:2px 7px;border-radius:3px;white-space:nowrap;background:hsl(var(--primary) / 0.18);color:hsl(var(--primary));flex:none}.sp{flex:1}.ib{width:28px;height:28px;display:inline-grid;place-items:center;border-radius:4px;border:1px solid transparent;background:transparent;color:hsl(var(--muted-foreground));padding:0;flex:none}.ib:hover:not(:disabled){background:hsl(var(--muted));color:hsl(var(--foreground))}.ib:disabled{opacity:0.4;cursor:not-allowed}.btn{border-radius:4px;padding:7px 14px;font-size:12px;font-weight:600;border:1px solid hsl(var(--border));background:hsl(var(--muted));text-decoration:none;display:inline-flex;align-items:center}.btn.pri{background:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground))}.stage{position:relative;background:#000;min-height:220px;display:grid}.stage.audio{min-height:0;background:hsl(var(--bg));padding:14px}.stage>video,.stage>audio{grid-area:1 / 1;width:100%;max-height:70vh;display:block}.stage>audio{align-self:center}.stage>.hidden{visibility:hidden}.stage-msg{grid-area:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:22px;z-index:1}.stage.audio .stage-msg{padding:8px}.overlay-msg{background:rgba(0, 0, 0, 0.55);pointer-events:none}.stage-msg>svg{color:hsl(var(--amber))}.stage-msg[data-phase='casting']>svg{color:hsl(var(--primary))}.stage-msg b{font-size:14px;font-weight:600}.stage-msg span{color:hsl(var(--muted-foreground));font-size:12px;max-width:44ch}.stage-msg .clock{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-variant-numeric:tabular-nums}.stage-msg .row{display:flex;gap:8px;margin-top:4px}.spin{width:26px;height:26px;border-radius:50%;border:3px solid hsl(var(--border));border-top-color:hsl(var(--primary));animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spin{animation:none}}`;
1897
+ const phirepassMediaPlayerCss = () => `:host{--card:220 18% 10%;--bg:216 18% 7%;--border:220 15% 18%;--primary:160 60% 45%;--primary-foreground:220 20% 7%;--muted:220 15% 13%;--muted-foreground:215 10% 52%;--foreground:210 20% 90%;--amber:38 75% 55%;display:flex;flex-direction:column;background:hsl(var(--card));color:hsl(var(--foreground));border:1px solid hsl(var(--border));border-radius:8px;overflow:hidden;font-family:ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;font-size:13px;line-height:1.45;box-shadow:0 20px 50px -10px rgba(0, 0, 0, 0.7)}*{box-sizing:border-box}button,a.btn{font:inherit;color:inherit;cursor:pointer}:focus-visible{outline:2px solid hsl(var(--primary));outline-offset:2px}.bar{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid hsl(var(--border));min-width:0}.nm{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.pill{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;padding:2px 7px;border-radius:3px;white-space:nowrap;background:hsl(var(--primary) / 0.18);color:hsl(var(--primary));flex:none}.sp{flex:1}.ib{width:28px;height:28px;display:inline-grid;place-items:center;border-radius:4px;border:1px solid transparent;background:transparent;color:hsl(var(--muted-foreground));padding:0;flex:none}.ib:hover:not(:disabled){background:hsl(var(--muted));color:hsl(var(--foreground))}.ib:disabled{opacity:0.4;cursor:not-allowed}.btn{border-radius:4px;padding:7px 14px;font-size:12px;font-weight:600;border:1px solid hsl(var(--border));background:hsl(var(--muted));text-decoration:none;display:inline-flex;align-items:center}.btn.pri{background:hsl(var(--primary));border-color:hsl(var(--primary));color:hsl(var(--primary-foreground))}.stage{position:relative;background:#000;min-height:220px;display:grid}.stage.audio{min-height:0;background:hsl(var(--bg));padding:14px}.stage>video,.stage>audio{grid-area:1 / 1;width:100%;max-height:70vh;display:block}.stage>audio{align-self:center}.stage>.hidden{visibility:hidden}.stage-msg{grid-area:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:22px;z-index:1}.stage.audio .stage-msg{padding:8px}.overlay-msg{background:rgba(0, 0, 0, 0.55);pointer-events:none}.stage-msg>svg{color:hsl(var(--amber))}.stage-msg[data-phase='casting']>svg{color:hsl(var(--primary))}.stage-msg b{font-size:14px;font-weight:600}.stage-msg span{color:hsl(var(--muted-foreground));font-size:12px;max-width:44ch}.stage-msg .clock{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-variant-numeric:tabular-nums}.stage-msg .row{display:flex;gap:8px;margin-top:4px}.spin{width:26px;height:26px;border-radius:50%;border:3px solid hsl(var(--border));border-top-color:hsl(var(--primary));animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spin{animation:none}}.link-note{margin:0;padding:6px 10px;font-size:12px;color:var(--w-dim, #737f8c);overflow-wrap:anywhere;border-top:1px solid var(--w-border, #262c35)}`;
1853
1898
 
1854
1899
  const PhirepassMediaPlayer = class {
1855
1900
  constructor(hostRef) {
@@ -1886,12 +1931,17 @@ const PhirepassMediaPlayer = class {
1886
1931
  positionKey;
1887
1932
  /** Stands in for `video.remote`, for demos and tests (like `channelFactory`). */
1888
1933
  remotePlayback;
1934
+ /** Makes the link a TV or VLC opens (T2.9). Defaults to POSTing `src`. */
1935
+ linkMinter;
1889
1936
  /** Shown while casting, when the host knows the device's name. */
1890
1937
  castDevice;
1891
1938
  playerClose;
1892
1939
  phase = 'buffering';
1893
1940
  stored = null;
1894
1941
  castAvailable = false;
1942
+ /** The ticket URL the element plays from once casting was asked for. */
1943
+ castSrc = null;
1944
+ linkNote = null;
1895
1945
  currentTime = 0;
1896
1946
  duration = 0;
1897
1947
  get store() {
@@ -1925,6 +1975,7 @@ const PhirepassMediaPlayer = class {
1925
1975
  }
1926
1976
  }
1927
1977
  onSrc() {
1978
+ this.castSrc = null;
1928
1979
  this.everPlayed = false;
1929
1980
  this.phase = 'buffering';
1930
1981
  }
@@ -1934,6 +1985,50 @@ const PhirepassMediaPlayer = class {
1934
1985
  this.media?.pause?.();
1935
1986
  this.playerClose.emit();
1936
1987
  }
1988
+ get minter() {
1989
+ return this.linkMinter ?? fetchLinkMinter();
1990
+ }
1991
+ /**
1992
+ * The TV fetches the file itself and has no cookie, so the element first
1993
+ * moves to a ticket URL (same bytes, same position), then the device picker
1994
+ * opens. A ticket that cannot be had still opens the picker: on a
1995
+ * development stack the plain URL plays.
1996
+ */
1997
+ async cast() {
1998
+ if (!this.castSrc) {
1999
+ const url = await this.minter(this.src);
2000
+ const media = this.media;
2001
+ if (url && media) {
2002
+ const at = media.currentTime;
2003
+ const playing = !media.paused;
2004
+ this.castSrc = url;
2005
+ media.src = url;
2006
+ this.resumeAt = at;
2007
+ if (at > 0) {
2008
+ media.currentTime = at;
2009
+ }
2010
+ if (playing) {
2011
+ void media.play?.()?.catch?.(() => undefined);
2012
+ }
2013
+ }
2014
+ }
2015
+ await this.remote()?.prompt().catch(() => undefined);
2016
+ }
2017
+ /** “Copy link for VLC”: the same ticket, on the clipboard. */
2018
+ async copyLink() {
2019
+ const url = this.castSrc ?? (await this.minter(this.src));
2020
+ if (!url) {
2021
+ this.linkNote = 'Could not make a link.';
2022
+ return;
2023
+ }
2024
+ try {
2025
+ await navigator.clipboard.writeText(url);
2026
+ this.linkNote = 'Link copied. It works in VLC until it expires.';
2027
+ }
2028
+ catch {
2029
+ this.linkNote = url;
2030
+ }
2031
+ }
1937
2032
  remote() {
1938
2033
  return this.remotePlayback ?? this.media?.remote;
1939
2034
  }
@@ -2030,7 +2125,7 @@ const PhirepassMediaPlayer = class {
2030
2125
  const hideMedia = this.phase === 'prompt' || this.phase === 'unsupported' || this.phase === 'stopped' || this.phase === 'casting';
2031
2126
  const common = {
2032
2127
  ref: (el) => this.bindMedia(el),
2033
- src: this.src,
2128
+ src: this.castSrc ?? this.src,
2034
2129
  controls: true,
2035
2130
  // Play was pressed to get here; a stored position asks first (G6).
2036
2131
  preload: this.phase === 'prompt' ? 'metadata' : 'auto',
@@ -2062,7 +2157,7 @@ const PhirepassMediaPlayer = class {
2062
2157
  onPause: () => void this.savePosition(true),
2063
2158
  onError: () => this.onError(),
2064
2159
  };
2065
- return (h(Host, { key: '941b4e81590e1144fc0bd424f4a5156ca047624d', class: { audio } }, h("header", { key: 'c1866c6dce284c49a17918c6d0e86d132ea9824a', class: "bar" }, h("span", { key: '645cf1ec23df722e4b479e2d0b9f78aad9c339f1', class: "nm", title: this.name }, this.name), this.status && h("span", { key: 'db77564456be6b4b52b78c709041924b97b930fc', class: "pill" }, this.status), h("span", { key: '4f3203babb8f002bf3b783947a01ff6b06cfdb13', class: "sp" }), !audio && (this.castAvailable || blocked) && (h("button", { key: '3174885867db39af25d328d1bf69879e2e9e5ea5', type: "button", class: "ib", disabled: !!blocked, title: blocked ?? 'Cast', "aria-label": blocked ? `Cast unavailable: ${blocked}` : 'Cast', onClick: () => void this.remote()?.prompt().catch(() => undefined) }, h(Icon, { key: 'c36b4847aa20e6b37da23b8b124bc5a679fcfdf1', name: "cast", size: 15 }))), !audio && airplay && (h("button", { key: '7f1932ac452b57518c608e4723329dac0b9c5698', type: "button", class: "ib", title: "AirPlay", "aria-label": "AirPlay", onClick: () => this.media.webkitShowPlaybackTargetPicker() }, h(Icon, { key: '6814c32ae5b0276260164131f7d017ce24c5063d', name: "cast", size: 15 }))), h("button", { key: 'dfcf1c345b01bd30f8274e637e03a0a7e97a0bb8', type: "button", class: "ib", "aria-label": "Close player", title: "Close", onClick: () => void this.close() }, h(Icon, { key: '2d056a662ae56d4e70ff90cd08ab05cb6c2cf386', name: "x", size: 14 }))), h("div", { key: 'bd610362589f488b395081ae4d12b06da92e8372', class: { stage: true, audio }, "data-phase": this.phase }, audio ? h("audio", { ...common }) : h("video", { ...common }), this.renderStage())));
2160
+ return (h(Host, { key: '2a0961d6bb91d0d28c516e42b11c8988a7721c99', class: { audio } }, h("header", { key: 'c2339f0ca216eb347a09c9be77df877a54cf8b47', class: "bar" }, h("span", { key: 'ae5b874219ff03c803febb079027549ee68751b6', class: "nm", title: this.name }, this.name), this.status && h("span", { key: '09ccaae203ecb0c205bd2e4b1ac9fc2f5d9b22a1', class: "pill" }, this.status), h("span", { key: '7304adbb0b50a3bcf8c4783f3444029f97e84fa9', class: "sp" }), !audio && (this.castAvailable || blocked) && (h("button", { key: '5c2b9d5d36ae0fd723d81da54e8e4acbf79a39d0', type: "button", class: "ib", disabled: !!blocked, title: blocked ?? 'Cast', "aria-label": blocked ? `Cast unavailable: ${blocked}` : 'Cast', onClick: () => void this.cast() }, h(Icon, { key: 'f45d71a1a5b1144376b6360812185dcbc7e5e57f', name: "cast", size: 15 }))), h("button", { key: '71964d197aee9de089f895fd0c017e1e4e04297a', type: "button", class: "ib", title: "Copy link for VLC", "aria-label": "Copy link for VLC", onClick: () => void this.copyLink() }, h(Icon, { key: '643d026d4dd85cad24e1e6b01dcba1bfda956825', name: "link", size: 15 })), !audio && airplay && (h("button", { key: 'a42d75246d807366e427b660062b47cc03890fac', type: "button", class: "ib", title: "AirPlay", "aria-label": "AirPlay", onClick: () => this.media.webkitShowPlaybackTargetPicker() }, h(Icon, { key: '21c9dc4e3ea560f72d230b017f2f73314ae17ef4', name: "cast", size: 15 }))), h("button", { key: 'f1413cec5dceb9f1dfe9b0470d3784ccaf20d08a', type: "button", class: "ib", "aria-label": "Close player", title: "Close", onClick: () => void this.close() }, h(Icon, { key: '707e719e7608edbad68185c8071ab90e2da614d4', name: "x", size: 14 }))), h("div", { key: '51673733f9cd732cfe5f1b9406ddec3787ba0e6c', class: { stage: true, audio }, "data-phase": this.phase }, audio ? h("audio", { ...common }) : h("video", { ...common }), this.renderStage()), this.linkNote && (h("p", { key: 'bd2db764da4183f67d1589a8be5aa4e8e7df76f3', class: "link-note", role: "status" }, this.linkNote))));
2066
2161
  }
2067
2162
  static get watchers() { return {
2068
2163
  "src": [{
@@ -3584,11 +3679,11 @@ const PhirepassSftpClient = class {
3584
3679
  return `${typeChar}${chars.join('')}`;
3585
3680
  }
3586
3681
  render() {
3587
- return (h(Host, { key: '1add0943926c6c6a88bc981f8a1518d65236683c', class: {
3682
+ return (h(Host, { key: 'c8a576625404b5653c066c2844160c40cff71603', class: {
3588
3683
  'default': !this.max,
3589
3684
  'max': this.max,
3590
- } }, h("section", { key: '28626f9858866d915616b2ebc085a1ce859b03f0', class: "listing" }, !this.hideHeader &&
3591
- h("header", { key: 'f8f10d47f0b16ed1bf1967f5cf600b4c70495d70' }, h("section", { key: '4ab613e910bbfed7cacb119db7edf547fbda39fa', class: "title" }, h("img", { key: '2642eacb535e5aafac0e6425bc7cd0526957001d', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: '6f34a92afe6d4000c6f583289a8f6217b2368900', class: "text" }, h("div", { key: '456e5506271447a8d2ae276672b3a34f016417e6', class: "name" }, this.name), h("div", { key: 'ecb14900f1abb5d306f8fc385bf8c17f85a58d11', class: "description" }, this.description))), h("section", { key: 'bb30a18acda6ae3eefff0b56b393d379d0c21c06', class: "actions" }, h("div", { key: '07bafaa8f7b854a997e8a90f84b757e4b78c30a7', class: "action", onClick: () => this.toggle_max() }, h("img", { key: 'd302666026a736aa471b4f6c156114566d56f35c', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: '0233f33b0205f6b4d6e7847e3a606d2564a61f65' }, this.show_navigation && h("nav", { key: '36c75ce35cd00479b436b7928cd121f36cfb275a', class: "navigation" }, h("div", { key: '3b34fd062152edeb9e1d4de19151b209a5994211', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h("span", { key: index, class: "breadcrumb-container" }, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '6c424e6318c729acbeed5d9c1b6bef8e24dc931a', class: "actions", "aria-label": "SFTP actions" }, h("input", { key: '5642bb923cfae63906cef97b927dd8851cc05ebd', class: "filter", type: "search", autocorrect: "off", autocapitalize: "none", autoComplete: "off", placeholder: "Filter", "aria-label": "Filter this directory", value: this.filter, onInput: (event) => this.filter = event.target.value }), h("button", { key: '782f09887a6e13c13a2de97eb1f6d12b12848965', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: 'a13174c473a0dc9ed9bd9473e37246f891e9cae0', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: '07dc546a7954bd9410d817b429dc245bb54fe50d', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: 'de81815c636c37a6509b04e629c433d2b8c5e55b', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: '11deba37930ab320b8c20da92b5b1abd5de407ee', type: "button", class: "action", onClick: () => this.open_mkdir(), title: "New folder", "aria-label": "New folder" }, h("svg", { key: '5354cbb7a1a391c89616d4a0d257c4466ef3b860', xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: '9547220371703834e0ed2a90ac391183c6c13a48', d: "M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }), h("line", { key: 'ee583af7f725b2dc7d8a35b051dd602f8ddd4105', x1: "12", x2: "12", y1: "10", y2: "16" }), h("line", { key: 'f9aa4e2038d64a58e9a2ff5ccf3bfc03b6d048f3', x1: "9", x2: "15", y1: "13", y2: "13" }))), this.fetch_enabled() && h(FetchButton, { key: '093626170ba4326e0ae5f4b16e043a18534fd110', count: this.fetch_count, onClick: () => void this.downloaderEl?.openFetch(this.current_dir) }), h("button", { key: '40dca240acdfa6c4c3e6afc3813440a5ef098c70', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: '35ff0f2a46f15850e3e5fdd4cae2b6a539711cc3', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '4d4d80c880618cb4af35cdab7afd6372f69c6d55', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: 'cfcf588e1f5ae8b1bf860bfcb661e3dc2b8a26c7', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: '55d94cb9a1b0e602294935f7fa09e981b8dbd6dd', class: "content", tabindex: 0, onKeyDown: (event) => this.on_listing_keydown(event) }, h("table", { key: '4bfc73c7db0c0eb2da44365fc911a9d03b1b5819' }, h("thead", { key: 'df798e9fc8156b5bde598150d51c097085c3bd81' }, h("tr", { key: '932c08d84c66323158f03e7b17b59b8ea0d9a7d0' }, h("th", { key: 'c6ff81a180383fd784b33616cbe52ce3124e446a', class: "sortable", onClick: () => this.toggle_sort('name'), title: "Sort by name" }, "Name", this.sort_indicator('name')), h("th", { key: '652645c923b13094b5149b975140f664d8a2f39c', class: "sortable", onClick: () => this.toggle_sort('size'), title: "Sort by size" }, "Size", this.sort_indicator('size')), h("th", { key: '452672f41f731bca3f0ecc2f15d730d8bb9ae408' }, "Permissions"), h("th", { key: '8792a16415236c42d1d85ee71d45eb2b8bdfe71a' }, "Owner"), h("th", { key: '697619d7691aebff7f58c3845d07bb14adec66ab', class: "sortable", onClick: () => this.toggle_sort('modified'), title: "Sort by modified date" }, "Modified", this.sort_indicator('modified')), h("th", { key: '332072e87b227e6b274ec728db080c2a44fe7b82', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '5bfa829bf47f0696b3aac2c67cc445a77deb31fc' }, this.visible_listing().map((item, index) => (h("tr", { key: index, class: {
3685
+ } }, h("section", { key: '87cc1357c8cba09dc857ac0035d701ee46f72ad3', class: "listing" }, !this.hideHeader &&
3686
+ h("header", { key: 'f034a4a4d6498c8f813174566ce7ff258f6d98fb' }, h("section", { key: 'ce24941dbd0beffe42d5fa6bad89542d25e57ff8', class: "title" }, h("img", { key: '808e0b3f448e15ceb5a7daccce98f9314eb5b758', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: '4b4e8244a97167010abc5ba2a518f9c7fd465b39', class: "text" }, h("div", { key: 'dc32511596fb480ef7fb280941b9de8099b5ff05', class: "name" }, this.name), h("div", { key: 'fc477ea5670b74c40f4af20022dac4f02bc8b96c', class: "description" }, this.description))), h("section", { key: '35beb6cd84dea257e428cca3338db239eed37cdb', class: "actions" }, h("div", { key: '7adecc9ecb0a24721fcf6e82f73b58d38946801e', class: "action", onClick: () => this.toggle_max() }, h("img", { key: 'e63674064553d3809a1d563bbe6fc83ad0aceb80', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: '4bef9055a683d18e391c2620ba2351282a1165ca' }, this.show_navigation && h("nav", { key: 'e08ac22ec258e081195785661907d170b86bd83d', class: "navigation" }, h("div", { key: '026e32148d4062a7e6be2b58192676dc0102e2dd', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h("span", { key: index, class: "breadcrumb-container" }, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '04f0111d530f2cb9a64bb0557b72820bd13832bf', class: "actions", "aria-label": "SFTP actions" }, h("input", { key: 'fb28f1861a4dd9c83aaa4a20a5d25dde3e6337c7', class: "filter", type: "search", autocorrect: "off", autocapitalize: "none", autoComplete: "off", placeholder: "Filter", "aria-label": "Filter this directory", value: this.filter, onInput: (event) => this.filter = event.target.value }), h("button", { key: '5e173f8426eee17b08b05547e9ba033746a5a84a', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '64ed13f7093abc57f9b73638b902b160d11c1fd3', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: 'e6a7d97bc089f3b023d06213852aec8e5cd83d18', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '66590858743453d7fc0fbb578e98da2a8bc762d5', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: '8eca55beb0377394da8fae85546b25ee74c0f6f9', type: "button", class: "action", onClick: () => this.open_mkdir(), title: "New folder", "aria-label": "New folder" }, h("svg", { key: '12d1fc50a9e325a1214462f2a06d734ab38ff1c1', xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { key: '7148c12cc461d1778ccfb3e3129786655f780dc2', d: "M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }), h("line", { key: 'a5701765411cff983baa1c4248a383c3a3a9dca6', x1: "12", x2: "12", y1: "10", y2: "16" }), h("line", { key: '9c22835c4279619e8c8cd130007d07ed19795366', x1: "9", x2: "15", y1: "13", y2: "13" }))), this.fetch_enabled() && h(FetchButton, { key: '259d3c2e7bdadac5d1ed77724628459e6c440e09', count: this.fetch_count, onClick: () => void this.downloaderEl?.openFetch(this.current_dir) }), h("button", { key: 'f744681697e23f2f2892a01b625490fc66999592', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: 'bcb2e3f7c283f4213b0a27cb97afd3e61f8d954e', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '5348bc25576e559e7b2f05ec6378fe72fc8483f5', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '7daf75741416f3aeb759ddc6c94106167291d641', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'e384c122d7454b16d13066a7cc6f7f3aa1414feb', class: "content", tabindex: 0, onKeyDown: (event) => this.on_listing_keydown(event) }, h("table", { key: 'bd1b14b317290eb59cb867a2bfbf23fb63b2fa94' }, h("thead", { key: 'c414438b0e8f2a776643bdaaf6441b01ed7c3be3' }, h("tr", { key: 'fd7d0947644aa0e0eb93d56dfacb8fe545c805f3' }, h("th", { key: '8e62f0daaaad938db61b85586aeb138844877ebe', class: "sortable", onClick: () => this.toggle_sort('name'), title: "Sort by name" }, "Name", this.sort_indicator('name')), h("th", { key: 'f2d3e287c8f0f97e23c173c10393d0eec4e4a752', class: "sortable", onClick: () => this.toggle_sort('size'), title: "Sort by size" }, "Size", this.sort_indicator('size')), h("th", { key: 'd62906a8dd76c22cfcf2c7a82d37ffe8ac3582ba' }, "Permissions"), h("th", { key: 'd5ce78f188629f956704a70a8d2280a1db945666' }, "Owner"), h("th", { key: '42d52536f0c5daa29af06c892c5ca3f79b888216', class: "sortable", onClick: () => this.toggle_sort('modified'), title: "Sort by modified date" }, "Modified", this.sort_indicator('modified')), h("th", { key: '4b80527286d771950be9219387fb938e92f07b63', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '1959c3f04257c8c1a2e93b4717a6eef9a7999437' }, this.visible_listing().map((item, index) => (h("tr", { key: index, class: {
3592
3687
  'selected': this.is_selected(item),
3593
3688
  'part': item.kind === 'File' && isPartFile(item.name),
3594
3689
  'fresh': item.kind === 'File' && this.fresh_names.includes(item.name),
@@ -3596,12 +3691,12 @@ const PhirepassSftpClient = class {
3596
3691
  h("button", { type: "button", class: "file-action", onClick: (event) => void this.play_listing_file(item, event), title: "Play", "aria-label": `Play ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, h("path", { d: "M7 5v14l12-7z" }))), item.kind === 'File' &&
3597
3692
  h("button", { type: "button", class: "file-action", onClick: (event) => this.on_edit_action(item, event), title: "Edit", "aria-label": `Edit ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), h("path", { d: "M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z" }))), item.kind === 'File' &&
3598
3693
  h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": `Download ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action", onClick: (event) => this.on_rename_action(item, event), title: "Rename", "aria-label": `Rename ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M12 20h9" }), h("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" }))), h("button", { type: "button", class: "file-action", onClick: (event) => this.on_chmod_action(item, event), title: "Permissions", "aria-label": `Change permissions on ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }), h("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": `Delete ${item.name}` }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" })))))))), this.visible_listing().length === 0 &&
3599
- h("tr", { key: '4482356f0cea6d59c08b94aa907118c0cd246d7a', class: "empty" }, h("td", { key: 'c5caefb25d955bc7978a743d395bcf825518e6f2', colSpan: 6 }, this.filter ? `Nothing here matches "${this.filter}".` : 'This directory is empty.'))))), this.show_loader && h("div", { key: 'fbee827272c265491cda4cf0ee551d050c28eb26', class: "loader" }, "Loading..."), this.show_error && h("div", { key: 'c48be0f9bf98efae82848863ba67aab7cbe94cfa', class: "error" }, this.error_message)), this.fetch_enabled() &&
3600
- h("phirepass-downloader", { key: '299ca33e978ac5267a78fd554fa4cc368416ab72', ref: (el) => this.downloaderEl = el, compact: true, channel: this.channel, connected: this.channel_ready, nodeId: this.nodeId, browsingService: this.serviceId, browsingPath: this.current_dir, streamBase: this.stream_base(), onPhirepassActiveCount: (event) => this.fetch_count = event.detail.n, onPhirepassFetchCompleted: (event) => this.on_fetch_completed(event.detail), onPhirepassShowInFolder: (event) => this.on_show_in_folder(event.detail) }), h("footer", { key: '51483dfe57fe920139a94bac637a21d9387f93bd' }, h("section", { key: '4800e113635d349fb7223ba5d84c10036106471e', class: "status" }, this.status, this.selected_item && h("span", { key: 'c8a2189794096852b1bf59903fcb9e4225420af3', class: "selected-item" }, this.selected_item.name)), h("section", { key: '0003dd6457a61bb70f1f2beb1fe09902a9a7d9a6', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
3601
- h("section", { key: 'cd32e7b1357f1edfefa6f6cdef6bb1b8d3293ffd', class: {
3694
+ h("tr", { key: '94619eb9cf5506a57c6d085ac6b91d41b7770553', class: "empty" }, h("td", { key: '87161e6091cf501364eda0d0b1072a937f8c9946', colSpan: 6 }, this.filter ? `Nothing here matches "${this.filter}".` : 'This directory is empty.'))))), this.show_loader && h("div", { key: 'db0f871976de1f36a72fa947441e0fb1f6051438', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '8870f437cfe246be74479d98f0a0d5a2bc72f781', class: "error" }, this.error_message)), this.fetch_enabled() &&
3695
+ h("phirepass-downloader", { key: '917af582cad03523807ef641710f85bd74bb317e', ref: (el) => this.downloaderEl = el, compact: true, channel: this.channel, connected: this.channel_ready, nodeId: this.nodeId, browsingService: this.serviceId, browsingPath: this.current_dir, streamBase: this.stream_base(), onPhirepassActiveCount: (event) => this.fetch_count = event.detail.n, onPhirepassFetchCompleted: (event) => this.on_fetch_completed(event.detail), onPhirepassShowInFolder: (event) => this.on_show_in_folder(event.detail) }), h("footer", { key: 'ff3c726b1762ca1789b1f3cd795613d9e64ec445' }, h("section", { key: '47e1cbc5a79ee62355136341add2b67456d1a462', class: "status" }, this.status, this.selected_item && h("span", { key: 'c828889045b7d0cca91ce0703a577f9a35a708e0', class: "selected-item" }, this.selected_item.name)), h("section", { key: '9e16fe486979999adadd80483542709570a5992d', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
3696
+ h("section", { key: '4da9c7934d550538c3bd488c7ad455af30ff4e00', class: {
3602
3697
  'creds': true,
3603
3698
  'blurred': this.show_login_screen,
3604
- } }, h("form", { key: 'cde44856f2fb11347aadd9eedf2774383ac88818', class: "auth", onSubmit: (event) => {
3699
+ } }, h("form", { key: '576cc82e5cd90978039e1e644af04194485b86d6', class: "auth", onSubmit: (event) => {
3605
3700
  const formData = new FormData(event.target);
3606
3701
  let username = undefined;
3607
3702
  if (this.show_login_screen_username) {
@@ -3618,58 +3713,58 @@ const PhirepassSftpClient = class {
3618
3713
  this.show_loader = true;
3619
3714
  event.stopPropagation();
3620
3715
  event.preventDefault();
3621
- } }, h("div", { key: 'a030e1ff396252b7aa5b9a1384ecfbb035018d81', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
3622
- h("div", { key: '6cec65370e2254527939d83c4214f57747eb4437' }, h("label", { key: '21e7fd85d58893e44ec025896f1a4da007b33869', htmlFor: "username" }, "Username"), h("input", { key: '5e3e039e5d543b1507095f1020f713c8174d73ca', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
3623
- h("div", { key: '6ea710ff7ac77e4ac015083ee44eaa5bd9f18fb2' }, h("label", { key: '096fa5ca5f41ecf6de193016011f159ca3e742be', htmlFor: "password" }, "Password"), h("input", { key: 'b6edc254626bcdf8266c2870436d2f14f3d2dd08', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: '5c0cb7f8e6e4d5277c6b026f0e47c43ec01d2739' }, h("button", { key: '8b9e95c1bfda24bcdf40e9b27c80b037d30d9f94', type: "submit" }, "Connect")))), this.show_upload_modal &&
3624
- h("section", { key: '268de116ac02bf628d5d04b8ce0d8a844ff9c77f', class: {
3716
+ } }, h("div", { key: '27098f0a63b4ceddd4e0bf0d84b3b3f321a3f512', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
3717
+ h("div", { key: '2714b5b014572d4f58523ddb79bde232bf9b65f1' }, h("label", { key: '8f0c73f148cc08fc8db445cd99fbab060807fe12', htmlFor: "username" }, "Username"), h("input", { key: 'c64fd60eb284e8a77d0943380cb3fcbacbc333fa', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
3718
+ h("div", { key: '2d84bbacefcb3b4ba84a9b8ce74bd662fa62c8b3' }, h("label", { key: '0ce1b8309229d45ab0f54d5e2de1e40b3fab57f0', htmlFor: "password" }, "Password"), h("input", { key: '5752cbe6e72c332be94c0b9a813a66526ab06f3c', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: 'e272596a07a758d008a90a2c2290e589feeb8b3f' }, h("button", { key: '5ddb365a8b700a8d5051539bed3c9aafef20a099', type: "submit" }, "Connect")))), this.show_upload_modal &&
3719
+ h("section", { key: 'b4314fc5bb3ace26757d690ff4113954144362f6', class: {
3625
3720
  'upload-modal': true,
3626
3721
  'visible': this.show_upload_modal,
3627
- } }, h("div", { key: '53e6ff8ba3a404f3575efda6fe228a11272f3799', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: 'a543b63fbd0ffb0e3e2cca0e3feca09c6be19214', class: "title" }, "Uploading File"), h("div", { key: '465d349e6cc1b59cb4d63222354beb83ee9b5242', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: 'e809cdb7c3d0a94d49b410508582b5db0767665b', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: '5a5bc88e8287b02b937969add54daf117d8d96a4', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: '251e8fef171cba5912d15cbbbf93f4297527fc44', class: "progress-meta" }, h("div", { key: 'd8fc5f31ca6012500b413c8f8c769b2f9235cf03', class: "progress-speed" }, this.upload_speed), h("div", { key: 'c2c6da0c0435eb2391980c3c15029ae80e0cf09c', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: '3040b677c47f5d042744d9e42c3d906ea01aa28b', type: "button", class: {
3722
+ } }, h("div", { key: '8d152c11c9c27528b667199e6cd66e7129506be6', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '703aa9f78b0248f026ae168d95db2aaaea65a6ce', class: "title" }, "Uploading File"), h("div", { key: '8e9bceaea052b871b2b6700684384515260c864c', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: '0c3f7be58a562e339dea87904297d0407bddb289', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: 'e003866966bdae3af7e9321b288dd23424491a16', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: 'ac5e45111e0d694b09c4af709378e827288ad418', class: "progress-meta" }, h("div", { key: '63e5c77d6af531e49fe9817167d945fc6e80e1be', class: "progress-speed" }, this.upload_speed), h("div", { key: '369628aa1ba577c4a4a9fa13930985716830b993', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: 'da4984bb0fc81d65a8f2876aa1aaba5dc8ea9da8', type: "button", class: {
3628
3723
  'cancel': true,
3629
3724
  'finished': this.upload_finished,
3630
3725
  }, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
3631
- h("section", { key: '9be248d46c503fca474d410beb3b5f0224fa8f01', class: {
3726
+ h("section", { key: '88a14959b710af2dcced2fc37b7c404272571084', class: {
3632
3727
  'download-modal': true,
3633
3728
  'visible': this.show_download_modal,
3634
- } }, h("div", { key: '494342f0e61d6ecf3bdf59613234337fa03b1060', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '70bf1682654a6f8992fad36efc6f674e9b0aa652', class: "title" }, "Downloading File"), h("div", { key: '2d595a897f62fb305f235394a272c4e79c2cbc5a', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '4876918db59b29347b53fa95598e0600e4a608e4', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '19b49f11524f024a38c56a541d87683fbd381f2a', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: 'b14e6df3c52fe9a39d3d41bc50414eea10898ec6', class: "progress-meta" }, h("div", { key: 'b1510407a47fc2546074b8bda19165b8ab869616', class: "progress-speed" }, this.download_speed), h("div", { key: 'aecf960be679c4943d3089cc1f0d3545f4cc8ce2', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: '67b9c16ec6dbbcfabd7dd9601bef2e99a8e79387', type: "button", class: {
3729
+ } }, h("div", { key: '86bbc1dd32612e7b63c4af35b366fe0a74597ed9', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '8c3edb4fc04ffaecb3fbd5b6d1aeab4211d7876c', class: "title" }, "Downloading File"), h("div", { key: '4815f43687f525c0b6f598e98f9df237a4253dd9', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '095ac5ffbcb3f4a1bfe5742232752baffb93308e', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '6a1f3d4ddbbda2c8a4069b59c7882ddcddee5b4d', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: 'db52703f7105f26aa4234eb6b623524362ced064', class: "progress-meta" }, h("div", { key: 'a12b2578badf08fc272f3533db2fd93fa946a4b2', class: "progress-speed" }, this.download_speed), h("div", { key: '3b2b1d92c4534d6f7adf01d64a1593af504f98d0', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: 'f9a668ef58d9566ebaf66ad9219d619005294a6f', type: "button", class: {
3635
3730
  'cancel': true,
3636
3731
  'finished': this.download_finished,
3637
3732
  }, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
3638
- h("section", { key: 'd59cef90ed1172a230e6d7698dec6426f99d9884', class: {
3733
+ h("section", { key: 'cbcf699a17d748a8a7fa3daf1d96f42e47847bd6', class: {
3639
3734
  'delete-modal': true,
3640
3735
  'visible': this.show_delete_modal,
3641
- } }, h("div", { key: '660767440e69e1f26e62ae425cf447fcb323e01c', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation", tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.cancel_delete()) }, h("div", { key: '93d4a9afbe2c792244d83d5d44c12daa81da29a5', class: "title" }, this.delete_is_dir ? 'Delete Folder' : 'Delete File'), h("div", { key: '04a74d9f586d6c12c71295412caf76ca9001f964', class: "message" }, this.delete_loading
3736
+ } }, h("div", { key: '3ac99ddba7dc86a7712a4cbb1516254a62f88ef4', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation", tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.cancel_delete()) }, h("div", { key: '5075e7e7fda69e6941980d3bb257b30bd61d1b03', class: "title" }, this.delete_is_dir ? 'Delete Folder' : 'Delete File'), h("div", { key: 'a9bc63a90afc0f56caccdda8c782abf761b06fa9', class: "message" }, this.delete_loading
3642
3737
  ? (this.delete_recursive ? 'Deleting the folder and everything in it...' : 'Deleting...')
3643
- : `Are you sure you want to delete this ${this.delete_is_dir ? 'folder' : 'file'}?`), h("div", { key: 'e210a51de468e7e86ef78948f110042aff124014', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_is_dir &&
3644
- h("label", { key: 'ebe09093a817c7cee09bafc5a390eedbb6894a7d', class: "checkline" }, h("input", { key: '57941f4851616517593934289a6289c28140c464', type: "checkbox", checked: this.delete_recursive, disabled: this.delete_loading, onChange: (event) => this.delete_recursive = event.target.checked }), h("span", { key: '7ffce1f1c5c9b10808e571664f327a7f02d14dee' }, "Delete everything inside it too")), !this.delete_is_dir || this.delete_recursive ? null :
3645
- h("div", { class: "hint" }, "Without this, the remote refuses a folder that is not empty."), this.delete_error && h("div", { key: '885f914bc1bd1a5a878d77501106ac33c67be1ab', class: "dialog-error" }, this.delete_error), this.delete_loading &&
3646
- h("div", { key: '64aa48b84fabf80d19a394c632e2f7fadf803080', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: 'a38b4b5e4825c18208872a74092905d716049c9a', class: "spinner" })), h("div", { key: '30edaa0fbdcf408de35e456ee23c50acf221120d', class: "modal-actions" }, h("button", { key: '47e03980bc5189b3a08ded71cbd994241119b415', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '613d80e7607f365ac74bb878cadd2beb54161aec', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete')))), this.prompt_kind &&
3647
- h("section", { key: '301de6586f5ef4df8690c589a175c27c5583c3c5', class: "prompt-modal visible" }, h("div", { key: 'b9b8d962d727a7634e9191ebb5c63d796a216c53', class: "prompt-dialog", role: "dialog", "aria-modal": "true", "aria-label": this.prompt_kind === 'mkdir' ? 'New folder' : 'Rename', tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.close_prompt()) }, h("div", { key: '10cb310b35b4dead8d6550fb34ccb832a65fd1b2', class: "title" }, this.prompt_kind === 'mkdir' ? 'New Folder' : 'Rename'), h("div", { key: 'e05a7a4a0a35b5be2845834eb55870842c0d17ef', class: "message" }, this.prompt_kind === 'mkdir'
3738
+ : `Are you sure you want to delete this ${this.delete_is_dir ? 'folder' : 'file'}?`), h("div", { key: '50a72830064fc1352787d6ac761a13e8c6d2d5ce', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_is_dir &&
3739
+ h("label", { key: '528ba9b17f186d54e98fa5abe26d649721880eab', class: "checkline" }, h("input", { key: '33dc78531ac4833e95460b93de7d211979a7973b', type: "checkbox", checked: this.delete_recursive, disabled: this.delete_loading, onChange: (event) => this.delete_recursive = event.target.checked }), h("span", { key: '68517a96007ba248bbcac1fffaae2b048c4aafaf' }, "Delete everything inside it too")), !this.delete_is_dir || this.delete_recursive ? null :
3740
+ h("div", { class: "hint" }, "Without this, the remote refuses a folder that is not empty."), this.delete_error && h("div", { key: 'fb0df28a4daa756166deec9dd18c0acae8874202', class: "dialog-error" }, this.delete_error), this.delete_loading &&
3741
+ h("div", { key: '114fcfea0367efd1f2df2d06beeba2013058ff73', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: '2b07a71d733ba7606fa45f0d24548b2b63dcc798', class: "spinner" })), h("div", { key: '44cfc262272484fdbd41257c39457d42de6e1f29', class: "modal-actions" }, h("button", { key: '5035eb462279fb4e89036a34b5b5b64eee052706', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: 'f16d9f97ce99691c0cfbbad16679bb1dc3affbc9', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete')))), this.prompt_kind &&
3742
+ h("section", { key: '8ee05b491fbc60b2fa9115fa7a88b60960e3326a', class: "prompt-modal visible" }, h("div", { key: '46622ceafa285047e2df9082251d7a02e38cb49f', class: "prompt-dialog", role: "dialog", "aria-modal": "true", "aria-label": this.prompt_kind === 'mkdir' ? 'New folder' : 'Rename', tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.close_prompt()) }, h("div", { key: '1dce2a864f58590017238fc76810297190dc223f', class: "title" }, this.prompt_kind === 'mkdir' ? 'New Folder' : 'Rename'), h("div", { key: '556e931df541d9ca07a58882cf658572c23276fe', class: "message" }, this.prompt_kind === 'mkdir'
3648
3743
  ? `Create a folder in ${this.current_dir}`
3649
- : 'Give it a new name. Existing names are not overwritten.'), h("form", { key: '79a3d81f678b8ccd52580e0eb972f539cbe9f30f', onSubmit: (event) => { event.preventDefault(); event.stopPropagation(); void this.submit_prompt(); } }, h("input", { key: '9d250a5956fc6e7698490d522648fd20cf4414c7', class: "dialog-input", type: "text", autocorrect: "off", autocapitalize: "none", autoComplete: "off", spellcheck: false, "aria-label": "Name", disabled: this.prompt_busy, value: this.prompt_value, onInput: (event) => this.prompt_value = event.target.value, ref: (el) => this.focus_once(el, this.promptInputEl, (kept) => this.promptInputEl = kept) }), this.prompt_error && h("div", { key: 'b17730b911abb499a63a993d0c3639f118590c0c', class: "dialog-error" }, this.prompt_error), h("div", { key: 'bbb9cede972be9ec6ec24ec2d346559a7f3351ab', class: "modal-actions" }, h("button", { key: 'e5e9f0b04d8cfaa0a1b4403594b50050e09fb303', type: "button", class: "btn secondary", onClick: () => this.close_prompt(), disabled: this.prompt_busy }, "Cancel"), h("button", { key: '5e5bedb0ff6b13fbf83149915863069a2d546fa8', type: "submit", class: "btn primary", disabled: this.prompt_busy }, this.prompt_busy ? 'Working...' : (this.prompt_kind === 'mkdir' ? 'Create' : 'Rename')))))), this.chmod_target &&
3650
- h("section", { key: '5d99487be165e07de0e8b1ad614eeae7bcbc7872', class: "prompt-modal visible" }, h("div", { key: '695afa14bb481bfa2577b30e6152f586360d833e', class: "prompt-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Change permissions", tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.close_chmod()) }, h("div", { key: '8738d7ba896ecb2a752965cc9b1d698165598299', class: "title" }, "Permissions"), h("div", { key: '649ec7e7db8046156b43e1b0d6e8d50e07e02e4f', class: "file-name", title: this.chmod_target.name }, this.chmod_target.name), h("table", { key: '3f97d70594c54e602e297ab71b6d399598696498', class: "perm-grid" }, h("thead", { key: '0fe7ef70c02cbac2d4ee5e746e8066245071b24d' }, h("tr", { key: 'af2285e351eb0228180be0bd5d7131f8e5b66cd1' }, h("th", { key: 'abe22f0637551c96ebf4e0a9482c50e788510b6b', "aria-label": "Class" }), h("th", { key: '35a0a3f0ad80dae8028da7696d19d8d930a05e1c' }, "Read"), h("th", { key: 'f67ac96284ee4fd3b275cdbcee361cc6cd46ab07' }, "Write"), h("th", { key: 'ecab3e2a37deb94ea2fb3b922d39d46220fef1e0' }, "Execute"))), h("tbody", { key: 'c24e7f92cc2a95dd633858510aca3b2cdd56861b' }, [
3744
+ : 'Give it a new name. Existing names are not overwritten.'), h("form", { key: 'b6a5807b0208576e15468912c48bcdc314cf2d41', onSubmit: (event) => { event.preventDefault(); event.stopPropagation(); void this.submit_prompt(); } }, h("input", { key: 'd7ad180a2b431046905f37ee8ba21e6933f8eb09', class: "dialog-input", type: "text", autocorrect: "off", autocapitalize: "none", autoComplete: "off", spellcheck: false, "aria-label": "Name", disabled: this.prompt_busy, value: this.prompt_value, onInput: (event) => this.prompt_value = event.target.value, ref: (el) => this.focus_once(el, this.promptInputEl, (kept) => this.promptInputEl = kept) }), this.prompt_error && h("div", { key: 'c0afc0bc34860b1c8bcfea5087d8afca425edf6a', class: "dialog-error" }, this.prompt_error), h("div", { key: '91899e1d57a82434cc859e7d90636bd9f1df2545', class: "modal-actions" }, h("button", { key: '24f1d359789dbd40e8d98ddf220acf2e5cdbb1e1', type: "button", class: "btn secondary", onClick: () => this.close_prompt(), disabled: this.prompt_busy }, "Cancel"), h("button", { key: '3a5ae8f5edbbe70c226d9ec01d204b0f276607cd', type: "submit", class: "btn primary", disabled: this.prompt_busy }, this.prompt_busy ? 'Working...' : (this.prompt_kind === 'mkdir' ? 'Create' : 'Rename')))))), this.chmod_target &&
3745
+ h("section", { key: '3f5daa368a81ae49fd074c33979fad6d9dc1e79f', class: "prompt-modal visible" }, h("div", { key: 'a2cfc7cbecbead9ccd977e74213c48ba47d5e0f7', class: "prompt-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Change permissions", tabindex: -1, onKeyDown: (event) => this.on_modal_keydown(event, () => this.close_chmod()) }, h("div", { key: '6db7c2771db3bf9dc4c16c506c95fbadc01b24d5', class: "title" }, "Permissions"), h("div", { key: 'c6fba2cffb84fd01ac51171ddedc140978652756', class: "file-name", title: this.chmod_target.name }, this.chmod_target.name), h("table", { key: 'fc871c448ad4ad75754256f0b4d9ce9e5188ea90', class: "perm-grid" }, h("thead", { key: 'b2de44bba7219257af5e16687f1f9e44b64429b8' }, h("tr", { key: 'b4e964c7281f8088385d1707df0c638b99c0e1e7' }, h("th", { key: 'a0bebfa92a96c6276a8c57bbd56555c1c8cacbd2', "aria-label": "Class" }), h("th", { key: 'c7618c92048861c4ee94d0fb8078c6dd719d9603' }, "Read"), h("th", { key: '23d0d6cbf7de82f337d4230e0286174a5fc6bd97' }, "Write"), h("th", { key: 'fbbe7fafe3aa03ed29db6038157167362c736f9c' }, "Execute"))), h("tbody", { key: '5468214c98eb5e6278cade8d46bcae62394d0205' }, [
3651
3746
  { label: 'Owner', read: 0o400, write: 0o200, exec: 0o100 },
3652
3747
  { label: 'Group', read: 0o040, write: 0o020, exec: 0o010 },
3653
3748
  { label: 'Other', read: 0o004, write: 0o002, exec: 0o001 },
3654
- ].map((row) => (h("tr", { key: row.label }, h("th", { scope: "row" }, row.label), [row.read, row.write, row.exec].map((bit) => (h("td", { key: bit }, h("input", { type: "checkbox", "aria-label": `${row.label} ${bit}`, disabled: this.chmod_busy, checked: (this.chmod_mode & bit) !== 0, onChange: () => this.toggle_chmod_bit(bit) }))))))))), h("div", { key: '8b6520714e3f16a484e798f3e8e435a4a2cdf623', class: "perm-special" }, [
3749
+ ].map((row) => (h("tr", { key: row.label }, h("th", { scope: "row" }, row.label), [row.read, row.write, row.exec].map((bit) => (h("td", { key: bit }, h("input", { type: "checkbox", "aria-label": `${row.label} ${bit}`, disabled: this.chmod_busy, checked: (this.chmod_mode & bit) !== 0, onChange: () => this.toggle_chmod_bit(bit) }))))))))), h("div", { key: '61a09c4521472a61f3f7e71fe651cb42f125ed81', class: "perm-special" }, [
3655
3750
  { label: 'setuid', bit: 0o4000 },
3656
3751
  { label: 'setgid', bit: 0o2000 },
3657
3752
  { label: 'sticky', bit: 0o1000 },
3658
- ].map((special) => (h("label", { key: special.label, class: "checkline" }, h("input", { type: "checkbox", disabled: this.chmod_busy, checked: (this.chmod_mode & special.bit) !== 0, onChange: () => this.toggle_chmod_bit(special.bit) }), h("span", null, special.label))))), h("div", { key: '205f0ece8a0d8ea7668e367bdc9db898fb5246bc', class: "perm-octal" }, h("label", { key: '98fb6673ef8d84b3be12bf88996ff8365a20de2e', htmlFor: "chmod-octal" }, "Octal"), h("input", { key: '608666086fdac97e33b6f58b8eed6ebf173b44d7', id: "chmod-octal", class: "dialog-input", type: "text", autocorrect: "off", autocapitalize: "none", autoComplete: "off", spellcheck: false, maxlength: 4, disabled: this.chmod_busy, value: this.chmod_mode.toString(8).padStart(4, '0'), onInput: (event) => this.on_chmod_octal_input(event.target.value) }), h("span", { key: '84a6afb198c0a3078ff16fe0c1fc3c3546cc2f20', class: "perm-preview" }, this.format_permissions(this.chmod_mode, this.chmod_target.kind))), this.chmod_error && h("div", { key: '079368ae29a0acc2690b9b5648d035001fbb6a9f', class: "dialog-error" }, this.chmod_error), h("div", { key: 'cda31e7896518dfcaad7697e2e72e476d3821605', class: "modal-actions" }, h("button", { key: 'b904a28a3dad29ee03ea6c24036a2ff91d04da6a', type: "button", class: "btn secondary", onClick: () => this.close_chmod(), disabled: this.chmod_busy }, "Cancel"), h("button", { key: 'bd7bd7c11a73d7cc1cec1405c0693f898a7b493a', type: "button", class: "btn primary", onClick: () => void this.submit_chmod(), disabled: this.chmod_busy }, this.chmod_busy ? 'Applying...' : 'Apply')))), this.show_editor &&
3659
- h("section", { key: '7a195dda87e6b87ce2dfb52f87c8627e9ea6e5a7', class: "editor-modal visible" }, h("div", { key: 'caabc3db3d6311f34ff42be97e469ffa64e55ed5', class: "editor-dialog", role: "dialog", "aria-modal": "true", "aria-label": `Editing ${this.editor_name}`, tabindex: -1, onKeyDown: (event) => {
3753
+ ].map((special) => (h("label", { key: special.label, class: "checkline" }, h("input", { type: "checkbox", disabled: this.chmod_busy, checked: (this.chmod_mode & special.bit) !== 0, onChange: () => this.toggle_chmod_bit(special.bit) }), h("span", null, special.label))))), h("div", { key: '49370f167cbe30ee221f6373d4261571b25be38b', class: "perm-octal" }, h("label", { key: 'f0b17a2ed4c59cbbaf02cd34cc847c773118faef', htmlFor: "chmod-octal" }, "Octal"), h("input", { key: '020ec6003d98553c663cceb92502f6391c60691b', id: "chmod-octal", class: "dialog-input", type: "text", autocorrect: "off", autocapitalize: "none", autoComplete: "off", spellcheck: false, maxlength: 4, disabled: this.chmod_busy, value: this.chmod_mode.toString(8).padStart(4, '0'), onInput: (event) => this.on_chmod_octal_input(event.target.value) }), h("span", { key: '4cc7a1cbe4ddfb565f44b5ef3fd116feb879b6c0', class: "perm-preview" }, this.format_permissions(this.chmod_mode, this.chmod_target.kind))), this.chmod_error && h("div", { key: '99cc2d982aef130ea75fa61765d17921186cc2fb', class: "dialog-error" }, this.chmod_error), h("div", { key: 'd5796750cfa9eb9304340bb9fd091eea7781f3cc', class: "modal-actions" }, h("button", { key: 'dffe3756b1b4e593ff71663e931df57d53c4a842', type: "button", class: "btn secondary", onClick: () => this.close_chmod(), disabled: this.chmod_busy }, "Cancel"), h("button", { key: 'cb30401112b8f500b49e6974dc67ae9065319539', type: "button", class: "btn primary", onClick: () => void this.submit_chmod(), disabled: this.chmod_busy }, this.chmod_busy ? 'Applying...' : 'Apply')))), this.show_editor &&
3754
+ h("section", { key: 'c9be5edfe1feea95ca51495503dc0c1c3b213d70', class: "editor-modal visible" }, h("div", { key: 'bf7c2aec8559b42017dc7142bc8a12f0fb4f1c39', class: "editor-dialog", role: "dialog", "aria-modal": "true", "aria-label": `Editing ${this.editor_name}`, tabindex: -1, onKeyDown: (event) => {
3660
3755
  if ((event.ctrlKey || event.metaKey) && event.key === 's') {
3661
3756
  event.preventDefault();
3662
3757
  void this.save_editor();
3663
3758
  return;
3664
3759
  }
3665
3760
  this.on_modal_keydown(event, () => this.close_editor());
3666
- } }, h("div", { key: 'b5b5cffca1d0c586a9d99aa1abd95930403970cb', class: "editor-head" }, h("div", { key: '3c957b920459ff3e7593ce1ac3a33096e6792063', class: "title" }, this.editor_name, this.editor_is_dirty() ? ' *' : ''), h("button", { key: 'd397267be9355ac675bd4503628992396e83785c', type: "button", class: "editor-close", onClick: () => this.close_editor(), "aria-label": "Close editor", disabled: this.editor_busy === 'saving' }, "x")), this.editor_busy === 'loading'
3761
+ } }, h("div", { key: 'fb6c305fc54a7c5f419a133c9477a69b489b77f0', class: "editor-head" }, h("div", { key: '9b22c14a92be28cc42ea900b4907d4411f5e3c7d', class: "title" }, this.editor_name, this.editor_is_dirty() ? ' *' : ''), h("button", { key: '2c800c08e12448ddf3c0f92f34257960ea0ea713', type: "button", class: "editor-close", onClick: () => this.close_editor(), "aria-label": "Close editor", disabled: this.editor_busy === 'saving' }, "x")), this.editor_busy === 'loading'
3667
3762
  ? h("div", { class: "editor-loading" }, "Loading...")
3668
- : h("textarea", { class: "editor-text", spellcheck: false, autocorrect: "off", autocapitalize: "none", autoComplete: "off", "aria-label": "File contents", disabled: this.editor_busy === 'saving' || !this.editor_loaded, value: this.editor_text, onInput: (event) => this.editor_text = event.target.value, ref: (el) => this.focus_once(el, this.editorTextEl, (kept) => this.editorTextEl = kept) }), this.editor_error && h("div", { key: '9725a5c01bed575c4e6e047709239f629b753ee6', class: "dialog-error" }, this.editor_error), this.editor_confirm_discard &&
3669
- h("div", { key: '8f57947f27b8d98a4976f72308da77ad0bc0dd81', class: "dialog-error" }, "Unsaved changes. Close anyway?"), h("div", { key: '699edc1344ea9f3eb8da85062f9b790bcb137a17', class: "modal-actions" }, this.editor_confirm_discard
3763
+ : h("textarea", { class: "editor-text", spellcheck: false, autocorrect: "off", autocapitalize: "none", autoComplete: "off", "aria-label": "File contents", disabled: this.editor_busy === 'saving' || !this.editor_loaded, value: this.editor_text, onInput: (event) => this.editor_text = event.target.value, ref: (el) => this.focus_once(el, this.editorTextEl, (kept) => this.editorTextEl = kept) }), this.editor_error && h("div", { key: '7918d367cbe8c9a3c179a20f8083b9c4e067ad79', class: "dialog-error" }, this.editor_error), this.editor_confirm_discard &&
3764
+ h("div", { key: '6b2ba93692a575bd2c6253dcd7c9abb65807a900', class: "dialog-error" }, "Unsaved changes. Close anyway?"), h("div", { key: '879a150fdb6501ad95847a09f984f5acd9301830', class: "modal-actions" }, this.editor_confirm_discard
3670
3765
  ? h("button", { type: "button", class: "btn destructive", onClick: () => this.close_editor(true) }, "Discard")
3671
- : h("button", { type: "button", class: "btn secondary", onClick: () => this.close_editor(), disabled: this.editor_busy === 'saving' }, "Close"), h("button", { key: '98b5856690b7cfc00a8ea992ffd87ee2229a7384', type: "button", class: "btn primary", onClick: () => void this.save_editor(), disabled: !!this.editor_busy || !this.editor_is_dirty() }, this.editor_busy === 'saving' ? 'Saving...' : 'Save')))), this.part_delete &&
3672
- h(PartDeleteDialog, { key: 'b6d85a1c323044094236f9d353c0967e37ba8a2b', name: this.part_delete.name, busy: this.part_delete.busy, onCancel: () => this.part_delete = null, onConfirm: () => {
3766
+ : h("button", { type: "button", class: "btn secondary", onClick: () => this.close_editor(), disabled: this.editor_busy === 'saving' }, "Close"), h("button", { key: 'e034f852259bcf75f6ba28159706862cfefbe5fa', type: "button", class: "btn primary", onClick: () => void this.save_editor(), disabled: !!this.editor_busy || !this.editor_is_dirty() }, this.editor_busy === 'saving' ? 'Saving...' : 'Save')))), this.part_delete &&
3767
+ h(PartDeleteDialog, { key: 'e7789b9ddf6e9d7f9e479aa390e7391e61c208f7', name: this.part_delete.name, busy: this.part_delete.busy, onCancel: () => this.part_delete = null, onConfirm: () => {
3673
3768
  const target = this.part_delete;
3674
3769
  this.part_delete = { ...target, busy: true };
3675
3770
  void this.downloaderEl?.deleteDownload(target.download_id).finally(() => {
@@ -3677,7 +3772,7 @@ const PhirepassSftpClient = class {
3677
3772
  this.refresh_directory();
3678
3773
  });
3679
3774
  } }), this.torrent_menu &&
3680
- h(TorrentContextMenu, { key: 'ecffff22fef17b34aaaa86279a6a117ad56ff091', menu: this.torrent_menu, onClose: () => this.torrent_menu = null, onFetch: () => {
3775
+ h(TorrentContextMenu, { key: '094cd2ab17cf975825db6afefcf205855221a03b', menu: this.torrent_menu, onClose: () => this.torrent_menu = null, onFetch: () => {
3681
3776
  const path = this.torrent_menu.path;
3682
3777
  this.torrent_menu = null;
3683
3778
  void this.downloaderEl?.startTorrentPath(path);
@@ -3697,7 +3792,7 @@ const PhirepassSftpClient = class {
3697
3792
  if (item)
3698
3793
  this.on_file_delete_action(item, new window.Event('click'));
3699
3794
  } }), this.listing_player &&
3700
- h("section", { key: '2a14b61054682ce21422d953c3997912331079ae', class: "player-modal visible" }, h("phirepass-media-player", { key: 'aa5dc1638310f59ec127dc915faa12e66784a7f5', src: this.listing_player.src, name: this.listing_player.name, status: "On the node", positionKey: this.listing_player.key, onPhirepassPlayerClose: () => this.listing_player = null }))));
3795
+ h("section", { key: 'f5b06ff083b4af19a7c4cc336d8be172c0e646e1', class: "player-modal visible" }, h("phirepass-media-player", { key: 'b2770268f3fb6af053a6a52da1e346d8ae3cdda9', src: this.listing_player.src, name: this.listing_player.name, status: "On the node", positionKey: this.listing_player.key, onPhirepassPlayerClose: () => this.listing_player = null }))));
3701
3796
  }
3702
3797
  static get watchers() { return {
3703
3798
  "nodeId": [{
@@ -762,7 +762,7 @@ const PhirepassRdp = class {
762
762
  this.request_tunnel();
763
763
  }
764
764
  render() {
765
- return (h(Host, { key: '04896084a5e914a9e2a184ee7b560f4978da9bfd' }, h("div", { key: 'db5d3d0d4351aeb868ffe6956b86f22b62775e4b', class: "screen", ref: (el) => (this.containerEl = el) }, h("slot", { key: 'efafd5d8b1437687713aff0425c050413593d162' })), this.credentialsPrompt && (h("form", { key: 'ad6079b6db1d71e8eb60bef71cd808be22b7387c', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: 'b976c7a3c01e4983fac39e1ef027e4307a6654c7', htmlFor: "rdp-username" }, "Username"), h("input", { key: '3a90a73a446015d708eaebec6a7d9bc1703ae5d0', id: "rdp-username", type: "text", autocomplete: "off", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: 'eaf13aa5fe39e4576de052b15c85e6b60be466cb', htmlFor: "rdp-password" }, "Password"), h("input", { key: 'd53ec8c48b7826b011a07bcb57b7ae1fbe30160f', id: "rdp-password", type: "password", autocomplete: "off", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'd1616e75c1f37a853ec793a25ffc8919544c16d2', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '8e6deb9e32f0c416bf85666847f10e095f40e210', class: "status" }, this.statusMessage))));
765
+ return (h(Host, { key: '9db127da5dbe168ef5f7a021767e5cedeb8305e6' }, h("div", { key: '06d2de6763ec479198389032ab65033eefab21d6', class: "screen", ref: (el) => (this.containerEl = el) }, h("slot", { key: '7842ca9fd64795794e1b90e15319ddaa599f85b8' })), this.credentialsPrompt && (h("form", { key: 'ce53830ced182740f139a318f099918c31013d9f', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: '2b55341b9cfc2e08a847e26985000f5e1bc86eca', htmlFor: "rdp-username" }, "Username"), h("input", { key: '243500ff59de6f16cc67acc5ddf9e15e3c0de0f6', id: "rdp-username", type: "text", autocomplete: "off", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: '5a346aa6a730c4cb0dd550eab9a65db9f2e74bc6', htmlFor: "rdp-password" }, "Password"), h("input", { key: '0f1081b05f94e15a7f04df4de390a33a021ffe53', id: "rdp-password", type: "password", autocomplete: "off", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'e9657c9df124176210508f5125fc526e3c78c5f1', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '3c59dbae63b7c5c5ef80344abad4b1a2b4c0b79d', class: "status" }, this.statusMessage))));
766
766
  }
767
767
  static get watchers() { return {
768
768
  "nodeId": [{
@@ -953,13 +953,13 @@ const PhirepassTerminal = class {
953
953
  return (h$1("button", { key: id, type: "button", class: { key: true, armed: !!armed }, "aria-label": hint, "aria-pressed": armed === undefined ? undefined : String(armed), onPointerDown: (event) => event.preventDefault(), onMouseDown: (event) => event.preventDefault(), onClick: onPress }, label));
954
954
  }
955
955
  render() {
956
- return (h$1(Host, { key: '7916b1ec27e8557c5327364992658bbd9456a050', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, h$1("div", { key: '7b1716371a6df4d3330b94e8a23195069628ccc0', id: "ccc", ref: el => (this.containerEl = el) }), h$1("div", { key: 'fb43cc80fbf8d0d6374ed03d980f04cfaec1bd5a', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
956
+ return (h$1(Host, { key: '0cd75107af5640ebcd5fe0b829b0f7910a01f2c6', class: { 'keys-on': this.keyBar === 'on', 'keys-off': this.keyBar === 'off' } }, h$1("div", { key: 'c405840c6ae231c5ef2d0f39d139eaf4eb54f5de', id: "ccc", ref: el => (this.containerEl = el) }), h$1("div", { key: 'a4acfc2ee6b2bc4cdcd159a5c4b794c3ccf1c504', class: "keys", role: "toolbar", "aria-label": "Terminal keys" }, this.key_button('ctrl', 'ctrl', 'Control', () => {
957
957
  this.ctrlArmed = !this.ctrlArmed;
958
958
  this.terminal?.focus();
959
959
  }, this.ctrlArmed), this.key_button('alt', 'alt', 'Alt', () => {
960
960
  this.altArmed = !this.altArmed;
961
961
  this.terminal?.focus();
962
- }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), h$1("span", { key: '0bbada06a098775bfdab27fde2580abe6fdd969d', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
962
+ }, this.altArmed), KEY_BAR_KEYS.map(entry => this.key_button(entry.id, entry.label, entry.hint, () => this.press(entry.data))), h$1("span", { key: '0d4b62865ccc92b9e82fff8375912f839c3ec32c', class: "spacer" }), this.key_button('left', '←', 'Left arrow', () => this.press(this.arrow('D'))), this.key_button('down', '↓', 'Down arrow', () => this.press(this.arrow('B'))), this.key_button('up', '↑', 'Up arrow', () => this.press(this.arrow('A'))), this.key_button('right', '→', 'Right arrow', () => this.press(this.arrow('C'))))));
963
963
  }
964
964
  static get watchers() { return {
965
965
  "nodeId": [{
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["phirepass-rdp",[[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"],"channelFactory":[16],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64],"sendCtrlAltDel":[64],"sendMetaKey":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"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],"keyBar":[1,"key-bar"],"serverId":[1,"server-id"],"channelFactory":[16],"ctrlArmed":[32],"altArmed":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-downloader_3",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"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],"serverId":[1,"server-id"],"channelFactory":[16],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"delete_is_dir":[32],"delete_recursive":[32],"delete_error":[32],"prompt_kind":[32],"prompt_value":[32],"prompt_error":[32],"prompt_busy":[32],"chmod_target":[32],"chmod_mode":[32],"chmod_error":[32],"chmod_busy":[32],"show_editor":[32],"editor_name":[32],"editor_text":[32],"editor_saved_text":[32],"editor_busy":[32],"editor_error":[32],"editor_confirm_discard":[32],"editor_loaded":[32],"filter":[32],"sort_key":[32],"sort_asc":[32],"channel_ready":[32],"fetch_count":[32],"fresh_names":[32],"part_delete":[32],"torrent_menu":[32],"listing_player":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}],[513,"phirepass-downloader",{"nodeId":[1,"node-id"],"nodeLabel":[1,"node-label"],"token":[1],"channel":[16],"connected":[4],"channelFactory":[16],"browsingService":[1,"browsing-service"],"browsingPath":[1025,"browsing-path"],"compact":[516],"streamBase":[1,"stream-base"],"canConfigure":[4,"can-configure"],"inlinePlayer":[4,"inline-player"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"serverId":[1,"server-id"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"connection":[32],"caps":[32],"jobs":[32],"tab":[32],"drawerOpen":[32],"dialogOpen":[32],"unread":[32],"form":[32],"where":[32],"starting":[32],"refusal":[32],"confirm":[32],"notices":[32],"subDir":[32],"picker":[32],"player":[32],"receive":[64],"openFetch":[64],"toggleDrawer":[64],"jobForPath":[64],"deleteDownload":[64],"torrentPathFor":[64],"startTorrentPath":[64]},null,{"channel":[{"onChannel":0}],"connected":[{"onConnected":0}],"browsingPath":[{"onBrowsing":0}],"browsingService":[{"onBrowsing":0}],"nodeId":[{"onNode":0}]}],[513,"phirepass-media-player",{"src":[1],"name":[1],"mime":[1],"status":[1],"ready":[2],"positionStore":[16],"positionKey":[1,"position-key"],"remotePlayback":[16],"castDevice":[1,"cast-device"],"phase":[32],"stored":[32],"castAvailable":[32],"currentTime":[32],"duration":[32],"close":[64]},null,{"src":[{"onSrc":0}]}]]]], options);
20
+ return bootstrapLazy([["phirepass-rdp",[[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"],"channelFactory":[16],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64],"sendCtrlAltDel":[64],"sendMetaKey":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"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],"keyBar":[1,"key-bar"],"serverId":[1,"server-id"],"channelFactory":[16],"ctrlArmed":[32],"altArmed":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-downloader_3",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"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],"serverId":[1,"server-id"],"channelFactory":[16],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"delete_is_dir":[32],"delete_recursive":[32],"delete_error":[32],"prompt_kind":[32],"prompt_value":[32],"prompt_error":[32],"prompt_busy":[32],"chmod_target":[32],"chmod_mode":[32],"chmod_error":[32],"chmod_busy":[32],"show_editor":[32],"editor_name":[32],"editor_text":[32],"editor_saved_text":[32],"editor_busy":[32],"editor_error":[32],"editor_confirm_discard":[32],"editor_loaded":[32],"filter":[32],"sort_key":[32],"sort_asc":[32],"channel_ready":[32],"fetch_count":[32],"fresh_names":[32],"part_delete":[32],"torrent_menu":[32],"listing_player":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}],[513,"phirepass-downloader",{"nodeId":[1,"node-id"],"nodeLabel":[1,"node-label"],"token":[1],"channel":[16],"connected":[4],"channelFactory":[16],"browsingService":[1,"browsing-service"],"browsingPath":[1025,"browsing-path"],"compact":[516],"streamBase":[1,"stream-base"],"canConfigure":[4,"can-configure"],"inlinePlayer":[4,"inline-player"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"serverId":[1,"server-id"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"connection":[32],"caps":[32],"jobs":[32],"tab":[32],"drawerOpen":[32],"dialogOpen":[32],"unread":[32],"form":[32],"where":[32],"starting":[32],"refusal":[32],"confirm":[32],"notices":[32],"subDir":[32],"picker":[32],"player":[32],"receive":[64],"openFetch":[64],"toggleDrawer":[64],"jobForPath":[64],"deleteDownload":[64],"torrentPathFor":[64],"startTorrentPath":[64]},null,{"channel":[{"onChannel":0}],"connected":[{"onConnected":0}],"browsingPath":[{"onBrowsing":0}],"browsingService":[{"onBrowsing":0}],"nodeId":[{"onNode":0}]}],[513,"phirepass-media-player",{"src":[1],"name":[1],"mime":[1],"status":[1],"ready":[2],"positionStore":[16],"positionKey":[1,"position-key"],"remotePlayback":[16],"linkMinter":[16],"castDevice":[1,"cast-device"],"phase":[32],"stored":[32],"castAvailable":[32],"castSrc":[32],"linkNote":[32],"currentTime":[32],"duration":[32],"close":[64]},null,{"src":[{"onSrc":0}]}]]]], options);
21
21
  });
@@ -1 +1 @@
1
- import{r as t,c as e,g as s,h as i,H as o}from"./p-Dd9o0CbU.js";import{_ as n,C as h,a as r,P as a}from"./p-BtMWUitf.js";const c=200;function d(t){return!Number.isFinite(t)||t<=0?c:Math.min(8192,Math.max(c,Math.floor(t)))}function l(t){return t-t%2}function u(t){const e=t.getBoundingClientRect();return s=e.height,{width:l(d(e.width)),height:l(d(s))};var s}class p{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(u(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(u(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){var e,s;s=this.reported,(e=t)&&s&&e.width===s.width&&e.height===s.height||(this.reported=t,this.onResize(t))}}function m(){return navigator.keyboard}function f(){return"function"==typeof m()?.lock}function b(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function y(){if(f())try{m().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=class{constructor(s){new.target===g&&t(this,s),this.connectionStateChanged=e(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 s(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;channelFactory;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,this.channelFactory||await n(),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 b(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),b(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return f()}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.channelFactory?this.channelFactory(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId||void 0):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([r.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([r.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([r.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case a.Error:this.handle_error(e);break;case a.AuthSuccess:this.handle_auth_success(e);break;case a.RDPAuthorized:this.handle_rdp_authorized(e);break;case a.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<c||e.height<c))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([r.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new p((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(){var t;t=this.ironEl,t?.focus({preventScroll:!0})}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(f()&&w(t))try{await m().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):y()}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([r.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(),y(),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 i(o,{key:"04896084a5e914a9e2a184ee7b560f4978da9bfd"},i("div",{key:"db5d3d0d4351aeb868ffe6956b86f22b62775e4b",class:"screen",ref:t=>this.containerEl=t},i("slot",{key:"efafd5d8b1437687713aff0425c050413593d162"})),this.credentialsPrompt&&i("form",{key:"ad6079b6db1d71e8eb60bef71cd808be22b7387c",class:"prompt",onSubmit:t=>this.submit_credentials(t)},i("label",{key:"b976c7a3c01e4983fac39e1ef027e4307a6654c7",htmlFor:"rdp-username"},"Username"),i("input",{key:"3a90a73a446015d708eaebec6a7d9bc1703ae5d0",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),i("label",{key:"eaf13aa5fe39e4576de052b15c85e6b60be466cb",htmlFor:"rdp-password"},"Password"),i("input",{key:"d53ec8c48b7826b011a07bcb57b7ae1fbe30160f",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),i("button",{key:"d1616e75c1f37a853ec793a25ffc8919544c16d2",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&i("div",{key:"8e6deb9e32f0c416bf85666847f10e095f40e210",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};g.style=':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))}}';export{g as phirepass_rdp}
1
+ import{r as t,c as e,g as s,h as i,H as o}from"./p-Dd9o0CbU.js";import{_ as n,C as h,a as r,P as a}from"./p-BtMWUitf.js";const c=200;function d(t){return!Number.isFinite(t)||t<=0?c:Math.min(8192,Math.max(c,Math.floor(t)))}function l(t){return t-t%2}function u(t){const e=t.getBoundingClientRect();return s=e.height,{width:l(d(e.width)),height:l(d(s))};var s}class p{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(u(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(u(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){var e,s;s=this.reported,(e=t)&&s&&e.width===s.width&&e.height===s.height||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function m(){return"function"==typeof f()?.lock}function b(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function y(){if(m())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=class{constructor(s){new.target===g&&t(this,s),this.connectionStateChanged=e(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 s(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;channelFactory;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,this.channelFactory||await n(),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 b(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),b(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return m()}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.channelFactory?this.channelFactory(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId||void 0):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([r.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([r.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([r.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case a.Error:this.handle_error(e);break;case a.AuthSuccess:this.handle_auth_success(e);break;case a.RDPAuthorized:this.handle_rdp_authorized(e);break;case a.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<c||e.height<c))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([r.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new p((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(){var t;t=this.ironEl,t?.focus({preventScroll:!0})}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(m()&&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()):y()}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([r.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(),y(),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 i(o,{key:"9db127da5dbe168ef5f7a021767e5cedeb8305e6"},i("div",{key:"06d2de6763ec479198389032ab65033eefab21d6",class:"screen",ref:t=>this.containerEl=t},i("slot",{key:"7842ca9fd64795794e1b90e15319ddaa599f85b8"})),this.credentialsPrompt&&i("form",{key:"ce53830ced182740f139a318f099918c31013d9f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},i("label",{key:"2b55341b9cfc2e08a847e26985000f5e1bc86eca",htmlFor:"rdp-username"},"Username"),i("input",{key:"243500ff59de6f16cc67acc5ddf9e15e3c0de0f6",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),i("label",{key:"5a346aa6a730c4cb0dd550eab9a65db9f2e74bc6",htmlFor:"rdp-password"},"Password"),i("input",{key:"0f1081b05f94e15a7f04df4de390a33a021ffe53",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),i("button",{key:"e9657c9df124176210508f5125fc526e3c78c5f1",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&i("div",{key:"3c59dbae63b7c5c5ef80344abad4b1a2b4c0b79d",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};g.style=':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))}}';export{g as phirepass_rdp}