phirepass-widgets 0.0.113 → 0.0.114

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 (39) hide show
  1. package/dist/cjs/{index-CurErEK7.js → index-BCgmMoIq.js} +3 -3
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +24 -3
  4. package/dist/cjs/phirepass-rdp.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  6. package/dist/cjs/phirepass-widgets.cjs.js +2 -2
  7. package/dist/cjs/{protocol-DCBMfc2u.js → protocol-CYh109n2.js} +252 -21
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/common/fetch.js +4 -0
  10. package/dist/collection/components/phirepass-downloader/jobs.js +4 -1
  11. package/dist/collection/components/phirepass-downloader/source.js +14 -0
  12. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  13. package/dist/components/p-BtMWUitf.js +1 -0
  14. package/dist/components/p-CKnb-oeB.js +1 -0
  15. package/dist/components/phirepass-downloader.js +1 -1
  16. package/dist/components/phirepass-rdp.js +1 -1
  17. package/dist/components/phirepass-sftp-client.js +1 -1
  18. package/dist/components/phirepass-terminal.js +1 -1
  19. package/dist/esm/{index-B9qUl6FW.js → index-Dd9o0CbU.js} +3 -3
  20. package/dist/esm/loader.js +2 -2
  21. package/dist/esm/phirepass-downloader_3.entry.js +24 -3
  22. package/dist/esm/phirepass-rdp.entry.js +2 -2
  23. package/dist/esm/phirepass-terminal.entry.js +2 -2
  24. package/dist/esm/phirepass-widgets.js +3 -3
  25. package/dist/esm/{protocol-CsYQJXY2.js → protocol-BtMWUitf.js} +251 -20
  26. package/dist/phirepass-widgets/p-97d84225.entry.js +1 -0
  27. package/dist/phirepass-widgets/p-BtMWUitf.js +1 -0
  28. package/dist/phirepass-widgets/{p-B9qUl6FW.js → p-Dd9o0CbU.js} +2 -2
  29. package/dist/phirepass-widgets/{p-1b84c526.entry.js → p-a4a5e5f5.entry.js} +1 -1
  30. package/dist/phirepass-widgets/{p-41dd1ac9.entry.js → p-a5ce104d.entry.js} +1 -1
  31. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  32. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  33. package/dist/types/common/fetch.d.ts +6 -0
  34. package/dist/types/components/phirepass-downloader/jobs.d.ts +3 -2
  35. package/package.json +3 -3
  36. package/dist/components/p-CsYQJXY2.js +0 -1
  37. package/dist/components/p-D6Geq8Rn.js +0 -1
  38. package/dist/phirepass-widgets/p-614ab3de.entry.js +0 -1
  39. package/dist/phirepass-widgets/p-CsYQJXY2.js +0 -1
@@ -4,7 +4,7 @@ const NAMESPACE = 'phirepass-widgets';
4
4
  const BUILD = /* phirepass-widgets */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.45.3 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.45.4 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
 
10
10
 
@@ -1674,7 +1674,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1674
1674
  disconnectedCallback() {
1675
1675
  plt.jmp(() => disconnectedCallback(this));
1676
1676
  nextTick(() => {
1677
- var _a3;
1677
+ var _a3, _b2;
1678
1678
  const hostRef = getHostRef(this);
1679
1679
  if (!hostRef) {
1680
1680
  return;
@@ -1683,7 +1683,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1683
1683
  if (i2 > -1) {
1684
1684
  deferredConnectedCallbacks.splice(i2, 1);
1685
1685
  }
1686
- if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1686
+ if (((_b2 = (_a3 = hostRef.$vnode$) == null ? void 0 : _a3.$elm$) == null ? void 0 : _b2.isConnected) === false) {
1687
1687
  delete hostRef.$vnode$.$elm$;
1688
1688
  }
1689
1689
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CurErEK7.js');
3
+ var index = require('./index-BCgmMoIq.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CurErEK7.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
3
+ var index = require('./index-BCgmMoIq.js');
4
+ var protocol = require('./protocol-CYh109n2.js');
5
5
 
6
6
  const DOWNLOAD_METHODS = [
7
7
  'send_download_start',
@@ -33,6 +33,10 @@ function supportsDownloads(channel) {
33
33
  * enums by name, data-carrying enums externally tagged (`{ Http: { … } }`).
34
34
  * Unit enums that may grow end in `Unknown`, as on the Rust side, so a newer
35
35
  * server never breaks an older widget.
36
+ *
37
+ * A Rust `None` reaches JS as `undefined` (the field is absent), not `null`,
38
+ * even where a type below says `| null`. Read optional fields with `??` or a
39
+ * truthiness check, never `=== null`. Checked against the real channel build.
36
40
  */
37
41
  /**
38
42
  * `msg_id`s `<phirepass-downloader>` mints start here, so a host sharing its
@@ -234,6 +238,8 @@ const EMPTY_AUTH = { mode: 'none', username: '', password: '', token: '', header
234
238
  * what is missing. `null` with no error means no login.
235
239
  */
236
240
  function buildSourceAuth(form) {
241
+ // The node refuses these too (`SourceAuth::problem`); this answers sooner.
242
+ const breaks = (...values) => values.some(v => /[\r\n\0]/.test(v));
237
243
  switch (form.mode) {
238
244
  case 'none':
239
245
  return { auth: null };
@@ -241,11 +247,20 @@ function buildSourceAuth(form) {
241
247
  if (!form.username) {
242
248
  return { auth: null, error: 'Enter a username.' };
243
249
  }
250
+ if (form.username.includes(':')) {
251
+ return { auth: null, error: 'A username cannot contain a colon.' };
252
+ }
253
+ if (breaks(form.username, form.password)) {
254
+ return { auth: null, error: 'A login cannot contain line breaks.' };
255
+ }
244
256
  return { auth: { Basic: { username: form.username, password: form.password } } };
245
257
  case 'bearer':
246
258
  if (!form.token.trim()) {
247
259
  return { auth: null, error: 'Enter a token.' };
248
260
  }
261
+ if (breaks(form.token)) {
262
+ return { auth: null, error: 'A login cannot contain line breaks.' };
263
+ }
249
264
  return { auth: { Bearer: { token: form.token.trim() } } };
250
265
  case 'header': {
251
266
  const name = form.headerName.trim();
@@ -255,6 +270,9 @@ function buildSourceAuth(form) {
255
270
  if (DENIED_AUTH_HEADERS.has(name.toLowerCase())) {
256
271
  return { auth: null, error: `${name} cannot be set here.` };
257
272
  }
273
+ if (breaks(form.headerValue)) {
274
+ return { auth: null, error: 'A login cannot contain line breaks.' };
275
+ }
258
276
  return { auth: { Header: { name, value: form.headerValue } } };
259
277
  }
260
278
  }
@@ -351,7 +369,10 @@ function applyProgress(prev, job) {
351
369
  const { [job.download_id]: _gone, ...rest } = prev;
352
370
  return { jobs: rest, first: false };
353
371
  }
354
- const jobs = { ...prev, [job.download_id]: { ...job, deleting: before?.deleting } };
372
+ // Once deleting, a row stays so until the node says Deleted: its own
373
+ // progress in between does not carry the flag.
374
+ const deleting = job.deleting || before?.deleting || undefined;
375
+ const jobs = { ...prev, [job.download_id]: { ...job, deleting } };
355
376
  const completed = before && !isFinished(before.state) && isFinished(job.state) ? job : undefined;
356
377
  return { jobs, completed, first: !before };
357
378
  }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CurErEK7.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
3
+ var index = require('./index-BCgmMoIq.js');
4
+ var protocol = require('./protocol-CYh109n2.js');
5
5
 
6
6
  /**
7
7
  * RDP's display-control PDU describes a monitor in whole, even pixels within
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CurErEK7.js');
4
- var protocol = require('./protocol-DCBMfc2u.js');
3
+ var index = require('./index-BCgmMoIq.js');
4
+ var protocol = require('./protocol-CYh109n2.js');
5
5
 
6
6
  /**
7
7
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CurErEK7.js');
3
+ var index = require('./index-BCgmMoIq.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.45.3 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.45.4 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -273,6 +273,117 @@ class Channel {
273
273
  }
274
274
  wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
275
275
  }
276
+ /**
277
+ * @param {string} download_id
278
+ * @param {boolean} delete_file
279
+ * @param {number | null} [msg_id]
280
+ */
281
+ send_download_delete(download_id, delete_file, msg_id) {
282
+ const val2 = +delete_file;
283
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
284
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
285
+ const len0 = WASM_VECTOR_LEN;
286
+ wasm.channel_send_download_delete(this.__wbg_ptr, ptr0, len0, val2, val3);
287
+ }
288
+ /**
289
+ * @param {string} download_id
290
+ * @param {boolean} ignore_window
291
+ * @param {number | null} [msg_id]
292
+ */
293
+ send_download_resume(download_id, ignore_window, msg_id) {
294
+ const val2 = +ignore_window;
295
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
296
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
297
+ const len0 = WASM_VECTOR_LEN;
298
+ wasm.channel_send_download_resume(this.__wbg_ptr, ptr0, len0, val2, val3);
299
+ }
300
+ /**
301
+ * @param {string} download_id
302
+ * @param {boolean} in_order
303
+ * @param {number | null} [msg_id]
304
+ */
305
+ send_download_set_order(download_id, in_order, msg_id) {
306
+ const val2 = +in_order;
307
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
308
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
309
+ const len0 = WASM_VECTOR_LEN;
310
+ wasm.channel_send_download_set_order(this.__wbg_ptr, ptr0, len0, val2, val3);
311
+ }
312
+ /**
313
+ * @param {string} node_id
314
+ * @param {number | null} [msg_id]
315
+ */
316
+ send_download_settings_get(node_id, msg_id) {
317
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
318
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
319
+ const len0 = WASM_VECTOR_LEN;
320
+ wasm.channel_send_download_settings_get(this.__wbg_ptr, ptr0, len0, val2);
321
+ }
322
+ /**
323
+ * @param {string} node_id
324
+ * @param {any} settings
325
+ * @param {number | null} [msg_id]
326
+ */
327
+ send_download_settings_save(node_id, settings, msg_id) {
328
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
329
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ wasm.channel_send_download_settings_save(this.__wbg_ptr, ptr0, len0, settings, val2);
332
+ }
333
+ /**
334
+ * @param {string} node_id
335
+ * @param {any} source
336
+ * @param {string | null | undefined} sub_dir
337
+ * @param {any} browsing
338
+ * @param {boolean | null | undefined} in_order
339
+ * @param {any} options
340
+ * @param {number | null} [msg_id]
341
+ */
342
+ send_download_start(node_id, source, sub_dir, browsing, in_order, options, msg_id) {
343
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
344
+ let ptr0, len0, ptr1, len1;
345
+ try {
346
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
347
+ len0 = WASM_VECTOR_LEN;
348
+ ptr1 = isLikeNone(sub_dir) ? 0 : passStringToWasm0(sub_dir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
349
+ len1 = WASM_VECTOR_LEN;
350
+ } catch (e) {
351
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
352
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
353
+ throw e;
354
+ }
355
+ wasm.channel_send_download_start(this.__wbg_ptr, ptr0, len0, source, ptr1, len1, browsing, isLikeNone(in_order) ? 0xFFFFFF : in_order ? 1 : 0, options, val3);
356
+ }
357
+ /**
358
+ * @param {string} download_id
359
+ * @param {boolean} discard
360
+ * @param {number | null} [msg_id]
361
+ */
362
+ send_download_stop(download_id, discard, msg_id) {
363
+ const val2 = +discard;
364
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
365
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
366
+ const len0 = WASM_VECTOR_LEN;
367
+ wasm.channel_send_download_stop(this.__wbg_ptr, ptr0, len0, val2, val3);
368
+ }
369
+ /**
370
+ * `{ Node: "<uuid>" }` or `"All"`.
371
+ * @param {any} scope
372
+ */
373
+ send_download_subscribe(scope) {
374
+ wasm.channel_send_download_subscribe(this.__wbg_ptr, scope);
375
+ }
376
+ /**
377
+ * @param {string} node_id
378
+ * @param {any} browsing
379
+ * @param {number | null} [msg_id]
380
+ */
381
+ send_download_where(node_id, browsing, msg_id) {
382
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
383
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
384
+ const len0 = WASM_VECTOR_LEN;
385
+ wasm.channel_send_download_where(this.__wbg_ptr, ptr0, len0, browsing, val2);
386
+ }
276
387
  /**
277
388
  * Set permission bits. The agent masks these to `0o7777`.
278
389
  * @param {string} node_id
@@ -704,6 +815,10 @@ function __wbg_get_imports() {
704
815
  const ret = Error(getStringFromWasm0(arg0, arg1));
705
816
  return ret;
706
817
  },
818
+ __wbg_Number_ff192a72a0dcdf6d: function(arg0) {
819
+ const ret = Number(arg0);
820
+ return ret;
821
+ },
707
822
  __wbg_String_8564e559799eccda: function(arg0, arg1) {
708
823
  const ret = String(arg1);
709
824
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -711,6 +826,17 @@ function __wbg_get_imports() {
711
826
  getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
712
827
  getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
713
828
  },
829
+ __wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
830
+ const v = arg1;
831
+ const ret = typeof(v) === 'bigint' ? v : undefined;
832
+ getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
833
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
834
+ },
835
+ __wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
836
+ const v = arg0;
837
+ const ret = typeof(v) === 'boolean' ? v : undefined;
838
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
839
+ },
714
840
  __wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
715
841
  const ret = debugString(arg1);
716
842
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -718,6 +844,49 @@ function __wbg_get_imports() {
718
844
  getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
719
845
  getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
720
846
  },
847
+ __wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
848
+ const ret = arg0 in arg1;
849
+ return ret;
850
+ },
851
+ __wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
852
+ const ret = typeof(arg0) === 'bigint';
853
+ return ret;
854
+ },
855
+ __wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
856
+ const ret = typeof(arg0) === 'function';
857
+ return ret;
858
+ },
859
+ __wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
860
+ const ret = arg0 === null;
861
+ return ret;
862
+ },
863
+ __wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
864
+ const val = arg0;
865
+ const ret = typeof(val) === 'object' && val !== null;
866
+ return ret;
867
+ },
868
+ __wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
869
+ const ret = typeof(arg0) === 'string';
870
+ return ret;
871
+ },
872
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
873
+ const ret = arg0 === undefined;
874
+ return ret;
875
+ },
876
+ __wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
877
+ const ret = arg0 === arg1;
878
+ return ret;
879
+ },
880
+ __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
881
+ const ret = arg0 == arg1;
882
+ return ret;
883
+ },
884
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
885
+ const obj = arg1;
886
+ const ret = typeof(obj) === 'number' ? obj : undefined;
887
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
888
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
889
+ },
721
890
  __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
722
891
  const obj = arg1;
723
892
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -744,7 +913,7 @@ function __wbg_get_imports() {
744
913
  const ret = arg0.call(arg1, arg2, arg3);
745
914
  return ret;
746
915
  }, arguments); },
747
- __wbg_clearInterval_26ba580547547579: function(arg0) {
916
+ __wbg_clearInterval_2ed00e80b9bdc143: function(arg0) {
748
917
  const ret = clearInterval(arg0);
749
918
  return ret;
750
919
  },
@@ -755,6 +924,14 @@ function __wbg_get_imports() {
755
924
  const ret = arg0.data;
756
925
  return ret;
757
926
  },
927
+ __wbg_done_57e08d0be6e30c02: function(arg0) {
928
+ const ret = arg0.done;
929
+ return ret;
930
+ },
931
+ __wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
932
+ const ret = Object.entries(arg0);
933
+ return ret;
934
+ },
758
935
  __wbg_from_eac91875c8a5ffa4: function(arg0) {
759
936
  const ret = Array.from(arg0);
760
937
  return ret;
@@ -766,7 +943,23 @@ function __wbg_get_imports() {
766
943
  const ret = Reflect.get(arg0, arg1);
767
944
  return ret;
768
945
  }, arguments); },
769
- __wbg_info_2b8ee6588e4c6072: function(arg0, arg1) {
946
+ __wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
947
+ const ret = Reflect.get(arg0, arg1);
948
+ return ret;
949
+ }, arguments); },
950
+ __wbg_get_d7176cfb76d71114: function(arg0, arg1) {
951
+ const ret = arg0[arg1 >>> 0];
952
+ return ret;
953
+ },
954
+ __wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
955
+ const ret = arg0[arg1 >>> 0];
956
+ return ret;
957
+ },
958
+ __wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
959
+ const ret = arg0[arg1];
960
+ return ret;
961
+ },
962
+ __wbg_info_b0bac022aae81d46: function(arg0, arg1) {
770
963
  console.info(getStringFromWasm0(arg0, arg1));
771
964
  },
772
965
  __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
@@ -779,10 +972,36 @@ function __wbg_get_imports() {
779
972
  const ret = result;
780
973
  return ret;
781
974
  },
975
+ __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
976
+ let result;
977
+ try {
978
+ result = arg0 instanceof Uint8Array;
979
+ } catch (_) {
980
+ result = false;
981
+ }
982
+ const ret = result;
983
+ return ret;
984
+ },
985
+ __wbg_isArray_bcf1376d0d732d08: function(arg0) {
986
+ const ret = Array.isArray(arg0);
987
+ return ret;
988
+ },
989
+ __wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
990
+ const ret = Number.isSafeInteger(arg0);
991
+ return ret;
992
+ },
993
+ __wbg_iterator_e4c5e8f68ada7b58: function() {
994
+ const ret = Symbol.iterator;
995
+ return ret;
996
+ },
782
997
  __wbg_length_186163212ffe79c3: function(arg0) {
783
998
  const ret = arg0.length;
784
999
  return ret;
785
1000
  },
1001
+ __wbg_length_b03a0fabb109b1e9: function(arg0) {
1002
+ const ret = arg0.length;
1003
+ return ret;
1004
+ },
786
1005
  __wbg_new_13de428334042d26: function(arg0) {
787
1006
  const ret = new Uint8Array(arg0);
788
1007
  return ret;
@@ -799,6 +1018,14 @@ function __wbg_get_imports() {
799
1018
  const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
800
1019
  return ret;
801
1020
  }, arguments); },
1021
+ __wbg_next_178c1651c11432b3: function(arg0) {
1022
+ const ret = arg0.next;
1023
+ return ret;
1024
+ },
1025
+ __wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
1026
+ const ret = arg0.next();
1027
+ return ret;
1028
+ }, arguments); },
802
1029
  __wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
803
1030
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
804
1031
  },
@@ -813,7 +1040,7 @@ function __wbg_get_imports() {
813
1040
  __wbg_send_d83d0891cf698779: function() { return handleError(function (arg0, arg1, arg2) {
814
1041
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
815
1042
  }, arguments); },
816
- __wbg_setInterval_d933acbf2578adfa: function() { return handleError(function (arg0, arg1) {
1043
+ __wbg_setInterval_ef738bbfe8cc0974: function() { return handleError(function (arg0, arg1) {
817
1044
  const ret = setInterval(arg0, arg1);
818
1045
  return ret;
819
1046
  }, arguments); },
@@ -838,27 +1065,31 @@ function __wbg_get_imports() {
838
1065
  __wbg_set_onopen_757be120cc7b1ea6: function(arg0, arg1) {
839
1066
  arg0.onopen = arg1;
840
1067
  },
841
- __wbg_warn_b0df9a9e7105e74b: function(arg0, arg1) {
1068
+ __wbg_value_e0f328965e184931: function(arg0) {
1069
+ const ret = arg0.value;
1070
+ return ret;
1071
+ },
1072
+ __wbg_warn_95c497419b251cd5: function(arg0, arg1) {
842
1073
  console.warn(getStringFromWasm0(arg0, arg1));
843
1074
  },
844
1075
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
845
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
846
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_63);
1076
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1077
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96);
847
1078
  return ret;
848
1079
  },
849
1080
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
850
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
851
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_63_37);
1081
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1082
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_46);
852
1083
  return ret;
853
1084
  },
854
1085
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
855
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
856
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_63_38);
1086
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1087
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_47);
857
1088
  return ret;
858
1089
  },
859
1090
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
860
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 5, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
861
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_67);
1091
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 7, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1092
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_100);
862
1093
  return ret;
863
1094
  },
864
1095
  __wbindgen_generic_0000000000000005: function(arg0) {
@@ -896,20 +1127,20 @@ function __wbg_get_imports() {
896
1127
  };
897
1128
  }
898
1129
 
899
- function __wasm_bindgen_func_elem_67(arg0, arg1) {
900
- wasm.__wasm_bindgen_func_elem_67(arg0, arg1);
1130
+ function __wasm_bindgen_func_elem_100(arg0, arg1) {
1131
+ wasm.__wasm_bindgen_func_elem_100(arg0, arg1);
901
1132
  }
902
1133
 
903
- function __wasm_bindgen_func_elem_63(arg0, arg1, arg2) {
904
- wasm.__wasm_bindgen_func_elem_63(arg0, arg1, arg2);
1134
+ function __wasm_bindgen_func_elem_96(arg0, arg1, arg2) {
1135
+ wasm.__wasm_bindgen_func_elem_96(arg0, arg1, arg2);
905
1136
  }
906
1137
 
907
- function __wasm_bindgen_func_elem_63_37(arg0, arg1, arg2) {
908
- wasm.__wasm_bindgen_func_elem_63_37(arg0, arg1, arg2);
1138
+ function __wasm_bindgen_func_elem_96_46(arg0, arg1, arg2) {
1139
+ wasm.__wasm_bindgen_func_elem_96_46(arg0, arg1, arg2);
909
1140
  }
910
1141
 
911
- function __wasm_bindgen_func_elem_63_38(arg0, arg1, arg2) {
912
- wasm.__wasm_bindgen_func_elem_63_38(arg0, arg1, arg2);
1142
+ function __wasm_bindgen_func_elem_96_47(arg0, arg1, arg2) {
1143
+ wasm.__wasm_bindgen_func_elem_96_47(arg0, arg1, arg2);
913
1144
  }
914
1145
 
915
1146
 
@@ -1195,7 +1426,7 @@ async function __wbg_init_once(module_or_path) {
1195
1426
  }
1196
1427
 
1197
1428
  if (module_or_path === undefined) {
1198
- module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-DCBMfc2u.js', document.baseURI).href)));
1429
+ module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-CYh109n2.js', document.baseURI).href)));
1199
1430
  }
1200
1431
  const imports = __wbg_get_imports();
1201
1432
 
@@ -9,7 +9,7 @@
9
9
  "mixins": [],
10
10
  "compiler": {
11
11
  "name": "@stencil/core",
12
- "version": "4.45.3",
12
+ "version": "4.45.4",
13
13
  "typescriptVersion": "5.8.3"
14
14
  },
15
15
  "collections": [],
@@ -6,6 +6,10 @@
6
6
  * enums by name, data-carrying enums externally tagged (`{ Http: { … } }`).
7
7
  * Unit enums that may grow end in `Unknown`, as on the Rust side, so a newer
8
8
  * server never breaks an older widget.
9
+ *
10
+ * A Rust `None` reaches JS as `undefined` (the field is absent), not `null`,
11
+ * even where a type below says `| null`. Read optional fields with `??` or a
12
+ * truthiness check, never `=== null`. Checked against the real channel build.
9
13
  */
10
14
  /**
11
15
  * `msg_id`s `<phirepass-downloader>` mints start here, so a host sharing its
@@ -21,7 +21,10 @@ export function applyProgress(prev, job) {
21
21
  const { [job.download_id]: _gone, ...rest } = prev;
22
22
  return { jobs: rest, first: false };
23
23
  }
24
- const jobs = { ...prev, [job.download_id]: { ...job, deleting: before?.deleting } };
24
+ // Once deleting, a row stays so until the node says Deleted: its own
25
+ // progress in between does not carry the flag.
26
+ const deleting = job.deleting || before?.deleting || undefined;
27
+ const jobs = { ...prev, [job.download_id]: { ...job, deleting } };
25
28
  const completed = before && !isFinished(before.state) && isFinished(job.state) ? job : undefined;
26
29
  return { jobs, completed, first: !before };
27
30
  }
@@ -79,6 +79,8 @@ export const EMPTY_AUTH = { mode: 'none', username: '', password: '', token: '',
79
79
  * what is missing. `null` with no error means no login.
80
80
  */
81
81
  export function buildSourceAuth(form) {
82
+ // The node refuses these too (`SourceAuth::problem`); this answers sooner.
83
+ const breaks = (...values) => values.some(v => /[\r\n\0]/.test(v));
82
84
  switch (form.mode) {
83
85
  case 'none':
84
86
  return { auth: null };
@@ -86,11 +88,20 @@ export function buildSourceAuth(form) {
86
88
  if (!form.username) {
87
89
  return { auth: null, error: 'Enter a username.' };
88
90
  }
91
+ if (form.username.includes(':')) {
92
+ return { auth: null, error: 'A username cannot contain a colon.' };
93
+ }
94
+ if (breaks(form.username, form.password)) {
95
+ return { auth: null, error: 'A login cannot contain line breaks.' };
96
+ }
89
97
  return { auth: { Basic: { username: form.username, password: form.password } } };
90
98
  case 'bearer':
91
99
  if (!form.token.trim()) {
92
100
  return { auth: null, error: 'Enter a token.' };
93
101
  }
102
+ if (breaks(form.token)) {
103
+ return { auth: null, error: 'A login cannot contain line breaks.' };
104
+ }
94
105
  return { auth: { Bearer: { token: form.token.trim() } } };
95
106
  case 'header': {
96
107
  const name = form.headerName.trim();
@@ -100,6 +111,9 @@ export function buildSourceAuth(form) {
100
111
  if (DENIED_AUTH_HEADERS.has(name.toLowerCase())) {
101
112
  return { auth: null, error: `${name} cannot be set here.` };
102
113
  }
114
+ if (breaks(form.headerValue)) {
115
+ return { auth: null, error: 'A login cannot contain line breaks.' };
116
+ }
103
117
  return { auth: { Header: { name, value: form.headerValue } } };
104
118
  }
105
119
  }