@bitwarden/sdk-internal 0.2.0-main.18 → 0.2.0-main.180

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.
@@ -1,58 +1,26 @@
1
1
  let imports = {};
2
2
  imports["__wbindgen_placeholder__"] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
5
-
6
- let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
9
-
10
- let cachedUint8ArrayMemory0 = null;
11
-
12
- function getUint8ArrayMemory0() {
13
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
14
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
15
- }
16
- return cachedUint8ArrayMemory0;
17
- }
18
-
19
- function getStringFromWasm0(ptr, len) {
20
- ptr = ptr >>> 0;
21
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
22
- }
4
+ const { TextEncoder, TextDecoder } = require(`util`);
23
5
 
24
6
  const heap = new Array(128).fill(undefined);
25
7
 
26
8
  heap.push(undefined, null, true, false);
27
9
 
28
- let heap_next = heap.length;
29
-
30
- function addHeapObject(obj) {
31
- if (heap_next === heap.length) heap.push(heap.length + 1);
32
- const idx = heap_next;
33
- heap_next = heap[idx];
34
-
35
- heap[idx] = obj;
36
- return idx;
37
- }
38
-
39
10
  function getObject(idx) {
40
11
  return heap[idx];
41
12
  }
42
13
 
43
- function dropObject(idx) {
44
- if (idx < 132) return;
45
- heap[idx] = heap_next;
46
- heap_next = idx;
47
- }
14
+ let WASM_VECTOR_LEN = 0;
48
15
 
49
- function takeObject(idx) {
50
- const ret = getObject(idx);
51
- dropObject(idx);
52
- return ret;
53
- }
16
+ let cachedUint8ArrayMemory0 = null;
54
17
 
55
- let WASM_VECTOR_LEN = 0;
18
+ function getUint8ArrayMemory0() {
19
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
20
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
21
+ }
22
+ return cachedUint8ArrayMemory0;
23
+ }
56
24
 
57
25
  let cachedTextEncoder = new TextEncoder("utf-8");
58
26
 
@@ -110,10 +78,6 @@ function passStringToWasm0(arg, malloc, realloc) {
110
78
  return ptr;
111
79
  }
112
80
 
113
- function isLikeNone(x) {
114
- return x === undefined || x === null;
115
- }
116
-
117
81
  let cachedDataViewMemory0 = null;
118
82
 
119
83
  function getDataViewMemory0() {
@@ -128,6 +92,87 @@ function getDataViewMemory0() {
128
92
  return cachedDataViewMemory0;
129
93
  }
130
94
 
95
+ let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
96
+
97
+ cachedTextDecoder.decode();
98
+
99
+ function getStringFromWasm0(ptr, len) {
100
+ ptr = ptr >>> 0;
101
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
102
+ }
103
+
104
+ let heap_next = heap.length;
105
+
106
+ function addHeapObject(obj) {
107
+ if (heap_next === heap.length) heap.push(heap.length + 1);
108
+ const idx = heap_next;
109
+ heap_next = heap[idx];
110
+
111
+ heap[idx] = obj;
112
+ return idx;
113
+ }
114
+
115
+ function handleError(f, args) {
116
+ try {
117
+ return f.apply(this, args);
118
+ } catch (e) {
119
+ wasm.__wbindgen_exn_store(addHeapObject(e));
120
+ }
121
+ }
122
+
123
+ function dropObject(idx) {
124
+ if (idx < 132) return;
125
+ heap[idx] = heap_next;
126
+ heap_next = idx;
127
+ }
128
+
129
+ function takeObject(idx) {
130
+ const ret = getObject(idx);
131
+ dropObject(idx);
132
+ return ret;
133
+ }
134
+
135
+ function getArrayU8FromWasm0(ptr, len) {
136
+ ptr = ptr >>> 0;
137
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
138
+ }
139
+
140
+ function isLikeNone(x) {
141
+ return x === undefined || x === null;
142
+ }
143
+
144
+ const CLOSURE_DTORS =
145
+ typeof FinalizationRegistry === "undefined"
146
+ ? { register: () => {}, unregister: () => {} }
147
+ : new FinalizationRegistry((state) => {
148
+ wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
149
+ });
150
+
151
+ function makeMutClosure(arg0, arg1, dtor, f) {
152
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
153
+ const real = (...args) => {
154
+ // First up with a closure we increment the internal reference
155
+ // count. This ensures that the Rust closure environment won't
156
+ // be deallocated while we're invoking it.
157
+ state.cnt++;
158
+ const a = state.a;
159
+ state.a = 0;
160
+ try {
161
+ return f(a, state.b, ...args);
162
+ } finally {
163
+ if (--state.cnt === 0) {
164
+ wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
165
+ CLOSURE_DTORS.unregister(state);
166
+ } else {
167
+ state.a = a;
168
+ }
169
+ }
170
+ };
171
+ real.original = state;
172
+ CLOSURE_DTORS.register(real, state, state);
173
+ return real;
174
+ }
175
+
131
176
  function debugString(val) {
132
177
  // primitive types
133
178
  const type = typeof val;
@@ -169,7 +214,7 @@ function debugString(val) {
169
214
  // Test for built-in
170
215
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
171
216
  let className;
172
- if (builtInMatches.length > 1) {
217
+ if (builtInMatches && builtInMatches.length > 1) {
173
218
  className = builtInMatches[1];
174
219
  } else {
175
220
  // Failed to match the standard '[object ClassName]'
@@ -193,45 +238,6 @@ function debugString(val) {
193
238
  return className;
194
239
  }
195
240
 
196
- const CLOSURE_DTORS =
197
- typeof FinalizationRegistry === "undefined"
198
- ? { register: () => {}, unregister: () => {} }
199
- : new FinalizationRegistry((state) => {
200
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
201
- });
202
-
203
- function makeMutClosure(arg0, arg1, dtor, f) {
204
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
205
- const real = (...args) => {
206
- // First up with a closure we increment the internal reference
207
- // count. This ensures that the Rust closure environment won't
208
- // be deallocated while we're invoking it.
209
- state.cnt++;
210
- const a = state.a;
211
- state.a = 0;
212
- try {
213
- return f(a, state.b, ...args);
214
- } finally {
215
- if (--state.cnt === 0) {
216
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
217
- CLOSURE_DTORS.unregister(state);
218
- } else {
219
- state.a = a;
220
- }
221
- }
222
- };
223
- real.original = state;
224
- CLOSURE_DTORS.register(real, state, state);
225
- return real;
226
- }
227
- function __wbg_adapter_38(arg0, arg1, arg2) {
228
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcab43b83560065d8(
229
- arg0,
230
- arg1,
231
- addHeapObject(arg2),
232
- );
233
- }
234
-
235
241
  let stack_pointer = 128;
236
242
 
237
243
  function addBorrowedObject(obj) {
@@ -243,9 +249,9 @@ function addBorrowedObject(obj) {
243
249
  * @param {any} error
244
250
  * @returns {boolean}
245
251
  */
246
- module.exports.isCoreError = function (error) {
252
+ module.exports.isEncryptionSettingsError = function (error) {
247
253
  try {
248
- const ret = wasm.isCoreError(addBorrowedObject(error));
254
+ const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
249
255
  return ret !== 0;
250
256
  } finally {
251
257
  heap[stack_pointer++] = undefined;
@@ -256,22 +262,41 @@ module.exports.isCoreError = function (error) {
256
262
  * @param {any} error
257
263
  * @returns {boolean}
258
264
  */
259
- module.exports.isEncryptionSettingsError = function (error) {
265
+ module.exports.isCryptoError = function (error) {
260
266
  try {
261
- const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
267
+ const ret = wasm.isCryptoError(addBorrowedObject(error));
262
268
  return ret !== 0;
263
269
  } finally {
264
270
  heap[stack_pointer++] = undefined;
265
271
  }
266
272
  };
267
273
 
274
+ function passArrayJsValueToWasm0(array, malloc) {
275
+ const ptr = malloc(array.length * 4, 4) >>> 0;
276
+ const mem = getDataViewMemory0();
277
+ for (let i = 0; i < array.length; i++) {
278
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
279
+ }
280
+ WASM_VECTOR_LEN = array.length;
281
+ return ptr;
282
+ }
283
+
284
+ function getArrayJsValueFromWasm0(ptr, len) {
285
+ ptr = ptr >>> 0;
286
+ const mem = getDataViewMemory0();
287
+ const result = [];
288
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
289
+ result.push(takeObject(mem.getUint32(i, true)));
290
+ }
291
+ return result;
292
+ }
268
293
  /**
269
294
  * @param {any} error
270
295
  * @returns {boolean}
271
296
  */
272
- module.exports.isKeyGenerationError = function (error) {
297
+ module.exports.isExportError = function (error) {
273
298
  try {
274
- const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
299
+ const ret = wasm.isExportError(addBorrowedObject(error));
275
300
  return ret !== 0;
276
301
  } finally {
277
302
  heap[stack_pointer++] = undefined;
@@ -282,9 +307,9 @@ module.exports.isKeyGenerationError = function (error) {
282
307
  * @param {any} error
283
308
  * @returns {boolean}
284
309
  */
285
- module.exports.isTestError = function (error) {
310
+ module.exports.isUsernameError = function (error) {
286
311
  try {
287
- const ret = wasm.isTestError(addBorrowedObject(error));
312
+ const ret = wasm.isUsernameError(addBorrowedObject(error));
288
313
  return ret !== 0;
289
314
  } finally {
290
315
  heap[stack_pointer++] = undefined;
@@ -292,250 +317,2580 @@ module.exports.isTestError = function (error) {
292
317
  };
293
318
 
294
319
  /**
295
- * @param {KeyAlgorithm} key_algorithm
296
- * @returns {GenerateSshKeyResult}
320
+ * @param {any} error
321
+ * @returns {boolean}
297
322
  */
298
- module.exports.generate_ssh_key = function (key_algorithm) {
323
+ module.exports.isPasswordError = function (error) {
299
324
  try {
300
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
301
- wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
302
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
303
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
304
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
305
- if (r2) {
306
- throw takeObject(r1);
307
- }
308
- return takeObject(r0);
325
+ const ret = wasm.isPasswordError(addBorrowedObject(error));
326
+ return ret !== 0;
309
327
  } finally {
310
- wasm.__wbindgen_add_to_stack_pointer(16);
328
+ heap[stack_pointer++] = undefined;
311
329
  }
312
330
  };
313
331
 
314
- function handleError(f, args) {
332
+ /**
333
+ * @param {any} error
334
+ * @returns {boolean}
335
+ */
336
+ module.exports.isPassphraseError = function (error) {
315
337
  try {
316
- return f.apply(this, args);
317
- } catch (e) {
318
- wasm.__wbindgen_exn_store(addHeapObject(e));
338
+ const ret = wasm.isPassphraseError(addBorrowedObject(error));
339
+ return ret !== 0;
340
+ } finally {
341
+ heap[stack_pointer++] = undefined;
319
342
  }
320
- }
321
- function __wbg_adapter_125(arg0, arg1, arg2, arg3) {
322
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h7363c1bfa226a55d(
323
- arg0,
324
- arg1,
325
- addHeapObject(arg2),
326
- addHeapObject(arg3),
327
- );
328
- }
329
-
330
- module.exports.LogLevel = Object.freeze({
331
- Trace: 0,
332
- 0: "Trace",
333
- Debug: 1,
334
- 1: "Debug",
335
- Info: 2,
336
- 2: "Info",
337
- Warn: 3,
338
- 3: "Warn",
339
- Error: 4,
340
- 4: "Error",
341
- });
342
-
343
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
344
-
345
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
343
+ };
346
344
 
347
- const BitwardenClientFinalization =
348
- typeof FinalizationRegistry === "undefined"
349
- ? { register: () => {}, unregister: () => {} }
350
- : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
345
+ function passArray8ToWasm0(arg, malloc) {
346
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
347
+ getUint8ArrayMemory0().set(arg, ptr / 1);
348
+ WASM_VECTOR_LEN = arg.length;
349
+ return ptr;
350
+ }
351
351
 
352
- class BitwardenClient {
353
- __destroy_into_raw() {
354
- const ptr = this.__wbg_ptr;
355
- this.__wbg_ptr = 0;
356
- BitwardenClientFinalization.unregister(this);
357
- return ptr;
352
+ function _assertClass(instance, klass) {
353
+ if (!(instance instanceof klass)) {
354
+ throw new Error(`expected instance of ${klass.name}`);
358
355
  }
359
-
360
- free() {
361
- const ptr = this.__destroy_into_raw();
362
- wasm.__wbg_bitwardenclient_free(ptr, 0);
356
+ }
357
+ /**
358
+ * @param {any} error
359
+ * @returns {boolean}
360
+ */
361
+ module.exports.isChannelError = function (error) {
362
+ try {
363
+ const ret = wasm.isChannelError(addBorrowedObject(error));
364
+ return ret !== 0;
365
+ } finally {
366
+ heap[stack_pointer++] = undefined;
367
+ }
368
+ };
369
+
370
+ /**
371
+ * @param {any} error
372
+ * @returns {boolean}
373
+ */
374
+ module.exports.isDeserializeError = function (error) {
375
+ try {
376
+ const ret = wasm.isDeserializeError(addBorrowedObject(error));
377
+ return ret !== 0;
378
+ } finally {
379
+ heap[stack_pointer++] = undefined;
380
+ }
381
+ };
382
+
383
+ /**
384
+ * @param {any} error
385
+ * @returns {boolean}
386
+ */
387
+ module.exports.isSshKeyExportError = function (error) {
388
+ try {
389
+ const ret = wasm.isSshKeyExportError(addBorrowedObject(error));
390
+ return ret !== 0;
391
+ } finally {
392
+ heap[stack_pointer++] = undefined;
393
+ }
394
+ };
395
+
396
+ /**
397
+ * @param {any} error
398
+ * @returns {boolean}
399
+ */
400
+ module.exports.isSshKeyImportError = function (error) {
401
+ try {
402
+ const ret = wasm.isSshKeyImportError(addBorrowedObject(error));
403
+ return ret !== 0;
404
+ } finally {
405
+ heap[stack_pointer++] = undefined;
406
+ }
407
+ };
408
+
409
+ /**
410
+ * @param {any} error
411
+ * @returns {boolean}
412
+ */
413
+ module.exports.isKeyGenerationError = function (error) {
414
+ try {
415
+ const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
416
+ return ret !== 0;
417
+ } finally {
418
+ heap[stack_pointer++] = undefined;
419
+ }
420
+ };
421
+
422
+ /**
423
+ * @param {any} error
424
+ * @returns {boolean}
425
+ */
426
+ module.exports.isDecryptError = function (error) {
427
+ try {
428
+ const ret = wasm.isDecryptError(addBorrowedObject(error));
429
+ return ret !== 0;
430
+ } finally {
431
+ heap[stack_pointer++] = undefined;
432
+ }
433
+ };
434
+
435
+ /**
436
+ * @param {any} error
437
+ * @returns {boolean}
438
+ */
439
+ module.exports.isEncryptError = function (error) {
440
+ try {
441
+ const ret = wasm.isEncryptError(addBorrowedObject(error));
442
+ return ret !== 0;
443
+ } finally {
444
+ heap[stack_pointer++] = undefined;
445
+ }
446
+ };
447
+
448
+ /**
449
+ * @param {any} error
450
+ * @returns {boolean}
451
+ */
452
+ module.exports.isTotpError = function (error) {
453
+ try {
454
+ const ret = wasm.isTotpError(addBorrowedObject(error));
455
+ return ret !== 0;
456
+ } finally {
457
+ heap[stack_pointer++] = undefined;
458
+ }
459
+ };
460
+
461
+ /**
462
+ * @param {any} error
463
+ * @returns {boolean}
464
+ */
465
+ module.exports.isCipherError = function (error) {
466
+ try {
467
+ const ret = wasm.isCipherError(addBorrowedObject(error));
468
+ return ret !== 0;
469
+ } finally {
470
+ heap[stack_pointer++] = undefined;
471
+ }
472
+ };
473
+
474
+ /**
475
+ * @param {any} error
476
+ * @returns {boolean}
477
+ */
478
+ module.exports.isDecryptFileError = function (error) {
479
+ try {
480
+ const ret = wasm.isDecryptFileError(addBorrowedObject(error));
481
+ return ret !== 0;
482
+ } finally {
483
+ heap[stack_pointer++] = undefined;
484
+ }
485
+ };
486
+
487
+ /**
488
+ * @param {any} error
489
+ * @returns {boolean}
490
+ */
491
+ module.exports.isEncryptFileError = function (error) {
492
+ try {
493
+ const ret = wasm.isEncryptFileError(addBorrowedObject(error));
494
+ return ret !== 0;
495
+ } finally {
496
+ heap[stack_pointer++] = undefined;
497
+ }
498
+ };
499
+
500
+ /**
501
+ * @param {LogLevel} level
502
+ */
503
+ module.exports.set_log_level = function (level) {
504
+ wasm.set_log_level(level);
505
+ };
506
+
507
+ /**
508
+ * @param {LogLevel | null} [log_level]
509
+ */
510
+ module.exports.init_sdk = function (log_level) {
511
+ wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
512
+ };
513
+
514
+ /**
515
+ * Generate a new SSH key pair
516
+ *
517
+ * # Arguments
518
+ * - `key_algorithm` - The algorithm to use for the key pair
519
+ *
520
+ * # Returns
521
+ * - `Ok(SshKey)` if the key was successfully generated
522
+ * - `Err(KeyGenerationError)` if the key could not be generated
523
+ * @param {KeyAlgorithm} key_algorithm
524
+ * @returns {SshKeyView}
525
+ */
526
+ module.exports.generate_ssh_key = function (key_algorithm) {
527
+ try {
528
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
529
+ wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
532
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
533
+ if (r2) {
534
+ throw takeObject(r1);
535
+ }
536
+ return takeObject(r0);
537
+ } finally {
538
+ wasm.__wbindgen_add_to_stack_pointer(16);
539
+ }
540
+ };
541
+
542
+ /**
543
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
544
+ * to an OpenSSH private key with public key and fingerprint
545
+ *
546
+ * # Arguments
547
+ * - `imported_key` - The private key to convert
548
+ * - `password` - The password to use for decrypting the key
549
+ *
550
+ * # Returns
551
+ * - `Ok(SshKey)` if the key was successfully coneverted
552
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
553
+ * - `Err(WrongPassword)` if the password provided is incorrect
554
+ * - `Err(ParsingError)` if the key could not be parsed
555
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
556
+ * @param {string} imported_key
557
+ * @param {string | null} [password]
558
+ * @returns {SshKeyView}
559
+ */
560
+ module.exports.import_ssh_key = function (imported_key, password) {
561
+ try {
562
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
563
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
564
+ const len0 = WASM_VECTOR_LEN;
565
+ var ptr1 = isLikeNone(password)
566
+ ? 0
567
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
568
+ var len1 = WASM_VECTOR_LEN;
569
+ wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1);
570
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
571
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
572
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
573
+ if (r2) {
574
+ throw takeObject(r1);
575
+ }
576
+ return takeObject(r0);
577
+ } finally {
578
+ wasm.__wbindgen_add_to_stack_pointer(16);
579
+ }
580
+ };
581
+
582
+ /**
583
+ * @param {any} error
584
+ * @returns {boolean}
585
+ */
586
+ module.exports.isTestError = function (error) {
587
+ try {
588
+ const ret = wasm.isTestError(addBorrowedObject(error));
589
+ return ret !== 0;
590
+ } finally {
591
+ heap[stack_pointer++] = undefined;
592
+ }
593
+ };
594
+
595
+ function __wbg_adapter_50(arg0, arg1) {
596
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha35b9bda8efb3006(
597
+ arg0,
598
+ arg1,
599
+ );
600
+ }
601
+
602
+ function __wbg_adapter_53(arg0, arg1, arg2) {
603
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9af0b195ec309e58(
604
+ arg0,
605
+ arg1,
606
+ addHeapObject(arg2),
607
+ );
608
+ }
609
+
610
+ function __wbg_adapter_256(arg0, arg1, arg2, arg3) {
611
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h08b1d375eb2ae73e(
612
+ arg0,
613
+ arg1,
614
+ addHeapObject(arg2),
615
+ addHeapObject(arg3),
616
+ );
617
+ }
618
+
619
+ /**
620
+ * @enum {300 | 301 | 302 | 303 | 304 | 305}
621
+ */
622
+ module.exports.CardLinkedIdType = Object.freeze({
623
+ CardholderName: 300,
624
+ 300: "CardholderName",
625
+ ExpMonth: 301,
626
+ 301: "ExpMonth",
627
+ ExpYear: 302,
628
+ 302: "ExpYear",
629
+ Code: 303,
630
+ 303: "Code",
631
+ Brand: 304,
632
+ 304: "Brand",
633
+ Number: 305,
634
+ 305: "Number",
635
+ });
636
+ /**
637
+ * @enum {0 | 1}
638
+ */
639
+ module.exports.CipherRepromptType = Object.freeze({
640
+ None: 0,
641
+ 0: "None",
642
+ Password: 1,
643
+ 1: "Password",
644
+ });
645
+ /**
646
+ * @enum {1 | 2 | 3 | 4 | 5}
647
+ */
648
+ module.exports.CipherType = Object.freeze({
649
+ Login: 1,
650
+ 1: "Login",
651
+ SecureNote: 2,
652
+ 2: "SecureNote",
653
+ Card: 3,
654
+ 3: "Card",
655
+ Identity: 4,
656
+ 4: "Identity",
657
+ SshKey: 5,
658
+ 5: "SshKey",
659
+ });
660
+ /**
661
+ * @enum {0 | 1 | 2 | 3}
662
+ */
663
+ module.exports.FieldType = Object.freeze({
664
+ Text: 0,
665
+ 0: "Text",
666
+ Hidden: 1,
667
+ 1: "Hidden",
668
+ Boolean: 2,
669
+ 2: "Boolean",
670
+ Linked: 3,
671
+ 3: "Linked",
672
+ });
673
+ /**
674
+ * @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
675
+ */
676
+ module.exports.IdentityLinkedIdType = Object.freeze({
677
+ Title: 400,
678
+ 400: "Title",
679
+ MiddleName: 401,
680
+ 401: "MiddleName",
681
+ Address1: 402,
682
+ 402: "Address1",
683
+ Address2: 403,
684
+ 403: "Address2",
685
+ Address3: 404,
686
+ 404: "Address3",
687
+ City: 405,
688
+ 405: "City",
689
+ State: 406,
690
+ 406: "State",
691
+ PostalCode: 407,
692
+ 407: "PostalCode",
693
+ Country: 408,
694
+ 408: "Country",
695
+ Company: 409,
696
+ 409: "Company",
697
+ Email: 410,
698
+ 410: "Email",
699
+ Phone: 411,
700
+ 411: "Phone",
701
+ Ssn: 412,
702
+ 412: "Ssn",
703
+ Username: 413,
704
+ 413: "Username",
705
+ PassportNumber: 414,
706
+ 414: "PassportNumber",
707
+ LicenseNumber: 415,
708
+ 415: "LicenseNumber",
709
+ FirstName: 416,
710
+ 416: "FirstName",
711
+ LastName: 417,
712
+ 417: "LastName",
713
+ FullName: 418,
714
+ 418: "FullName",
715
+ });
716
+ /**
717
+ * @enum {0 | 1 | 2 | 3 | 4}
718
+ */
719
+ module.exports.LogLevel = Object.freeze({
720
+ Trace: 0,
721
+ 0: "Trace",
722
+ Debug: 1,
723
+ 1: "Debug",
724
+ Info: 2,
725
+ 2: "Info",
726
+ Warn: 3,
727
+ 3: "Warn",
728
+ Error: 4,
729
+ 4: "Error",
730
+ });
731
+ /**
732
+ * @enum {100 | 101}
733
+ */
734
+ module.exports.LoginLinkedIdType = Object.freeze({
735
+ Username: 100,
736
+ 100: "Username",
737
+ Password: 101,
738
+ 101: "Password",
739
+ });
740
+ /**
741
+ * @enum {0}
742
+ */
743
+ module.exports.SecureNoteType = Object.freeze({
744
+ Generic: 0,
745
+ 0: "Generic",
746
+ });
747
+ /**
748
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
749
+ */
750
+ module.exports.UriMatchType = Object.freeze({
751
+ Domain: 0,
752
+ 0: "Domain",
753
+ Host: 1,
754
+ 1: "Host",
755
+ StartsWith: 2,
756
+ 2: "StartsWith",
757
+ Exact: 3,
758
+ 3: "Exact",
759
+ RegularExpression: 4,
760
+ 4: "RegularExpression",
761
+ Never: 5,
762
+ 5: "Never",
763
+ });
764
+
765
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
766
+
767
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
768
+
769
+ const AttachmentsClientFinalization =
770
+ typeof FinalizationRegistry === "undefined"
771
+ ? { register: () => {}, unregister: () => {} }
772
+ : new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
773
+
774
+ class AttachmentsClient {
775
+ static __wrap(ptr) {
776
+ ptr = ptr >>> 0;
777
+ const obj = Object.create(AttachmentsClient.prototype);
778
+ obj.__wbg_ptr = ptr;
779
+ AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
780
+ return obj;
781
+ }
782
+
783
+ __destroy_into_raw() {
784
+ const ptr = this.__wbg_ptr;
785
+ this.__wbg_ptr = 0;
786
+ AttachmentsClientFinalization.unregister(this);
787
+ return ptr;
788
+ }
789
+
790
+ free() {
791
+ const ptr = this.__destroy_into_raw();
792
+ wasm.__wbg_attachmentsclient_free(ptr, 0);
793
+ }
794
+ /**
795
+ * Decrypts an attachment's encrypted content
796
+ * @param {Cipher} cipher
797
+ * @param {AttachmentView} attachment
798
+ * @param {Uint8Array} encrypted_buffer
799
+ * @returns {Uint8Array}
800
+ */
801
+ decrypt_buffer(cipher, attachment, encrypted_buffer) {
802
+ try {
803
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
804
+ const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
805
+ const len0 = WASM_VECTOR_LEN;
806
+ wasm.attachmentsclient_decrypt_buffer(
807
+ retptr,
808
+ this.__wbg_ptr,
809
+ addHeapObject(cipher),
810
+ addHeapObject(attachment),
811
+ ptr0,
812
+ len0,
813
+ );
814
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
815
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
816
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
817
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
818
+ if (r3) {
819
+ throw takeObject(r2);
820
+ }
821
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
822
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
823
+ return v2;
824
+ } finally {
825
+ wasm.__wbindgen_add_to_stack_pointer(16);
826
+ }
827
+ }
828
+ }
829
+ module.exports.AttachmentsClient = AttachmentsClient;
830
+
831
+ const BitwardenClientFinalization =
832
+ typeof FinalizationRegistry === "undefined"
833
+ ? { register: () => {}, unregister: () => {} }
834
+ : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
835
+
836
+ class BitwardenClient {
837
+ __destroy_into_raw() {
838
+ const ptr = this.__wbg_ptr;
839
+ this.__wbg_ptr = 0;
840
+ BitwardenClientFinalization.unregister(this);
841
+ return ptr;
842
+ }
843
+
844
+ free() {
845
+ const ptr = this.__destroy_into_raw();
846
+ wasm.__wbg_bitwardenclient_free(ptr, 0);
847
+ }
848
+ /**
849
+ * @param {ClientSettings | null} [settings]
850
+ */
851
+ constructor(settings) {
852
+ const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addHeapObject(settings));
853
+ this.__wbg_ptr = ret >>> 0;
854
+ BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
855
+ return this;
856
+ }
857
+ /**
858
+ * Test method, echoes back the input
859
+ * @param {string} msg
860
+ * @returns {string}
861
+ */
862
+ echo(msg) {
863
+ let deferred2_0;
864
+ let deferred2_1;
865
+ try {
866
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
867
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
868
+ const len0 = WASM_VECTOR_LEN;
869
+ wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
870
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
871
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
872
+ deferred2_0 = r0;
873
+ deferred2_1 = r1;
874
+ return getStringFromWasm0(r0, r1);
875
+ } finally {
876
+ wasm.__wbindgen_add_to_stack_pointer(16);
877
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
878
+ }
879
+ }
880
+ /**
881
+ * @returns {string}
882
+ */
883
+ version() {
884
+ let deferred1_0;
885
+ let deferred1_1;
886
+ try {
887
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
888
+ wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
889
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
890
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
891
+ deferred1_0 = r0;
892
+ deferred1_1 = r1;
893
+ return getStringFromWasm0(r0, r1);
894
+ } finally {
895
+ wasm.__wbindgen_add_to_stack_pointer(16);
896
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
897
+ }
898
+ }
899
+ /**
900
+ * @param {string} msg
901
+ */
902
+ throw(msg) {
903
+ try {
904
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
905
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
906
+ const len0 = WASM_VECTOR_LEN;
907
+ wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
908
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
909
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
910
+ if (r1) {
911
+ throw takeObject(r0);
912
+ }
913
+ } finally {
914
+ wasm.__wbindgen_add_to_stack_pointer(16);
915
+ }
916
+ }
917
+ /**
918
+ * Test method, calls http endpoint
919
+ * @param {string} url
920
+ * @returns {Promise<string>}
921
+ */
922
+ http_get(url) {
923
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
924
+ const len0 = WASM_VECTOR_LEN;
925
+ const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
926
+ return takeObject(ret);
927
+ }
928
+ /**
929
+ * @returns {CryptoClient}
930
+ */
931
+ crypto() {
932
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
933
+ return CryptoClient.__wrap(ret);
934
+ }
935
+ /**
936
+ * @returns {VaultClient}
937
+ */
938
+ vault() {
939
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
940
+ return VaultClient.__wrap(ret);
941
+ }
942
+ /**
943
+ * Constructs a specific client for generating passwords and passphrases
944
+ * @returns {GeneratorClient}
945
+ */
946
+ generator() {
947
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
948
+ return GeneratorClient.__wrap(ret);
949
+ }
950
+ /**
951
+ * @returns {ExporterClient}
952
+ */
953
+ exporters() {
954
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
955
+ return ExporterClient.__wrap(ret);
956
+ }
957
+ }
958
+ module.exports.BitwardenClient = BitwardenClient;
959
+
960
+ const CiphersClientFinalization =
961
+ typeof FinalizationRegistry === "undefined"
962
+ ? { register: () => {}, unregister: () => {} }
963
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
964
+
965
+ class CiphersClient {
966
+ static __wrap(ptr) {
967
+ ptr = ptr >>> 0;
968
+ const obj = Object.create(CiphersClient.prototype);
969
+ obj.__wbg_ptr = ptr;
970
+ CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
971
+ return obj;
972
+ }
973
+
974
+ __destroy_into_raw() {
975
+ const ptr = this.__wbg_ptr;
976
+ this.__wbg_ptr = 0;
977
+ CiphersClientFinalization.unregister(this);
978
+ return ptr;
979
+ }
980
+
981
+ free() {
982
+ const ptr = this.__destroy_into_raw();
983
+ wasm.__wbg_ciphersclient_free(ptr, 0);
984
+ }
985
+ /**
986
+ * @param {CipherView} cipher_view
987
+ * @returns {EncryptionContext}
988
+ */
989
+ encrypt(cipher_view) {
990
+ try {
991
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
992
+ wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
993
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
994
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
995
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
996
+ if (r2) {
997
+ throw takeObject(r1);
998
+ }
999
+ return takeObject(r0);
1000
+ } finally {
1001
+ wasm.__wbindgen_add_to_stack_pointer(16);
1002
+ }
1003
+ }
1004
+ /**
1005
+ * @param {Cipher} cipher
1006
+ * @returns {CipherView}
1007
+ */
1008
+ decrypt(cipher) {
1009
+ try {
1010
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1011
+ wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
1012
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1013
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1014
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1015
+ if (r2) {
1016
+ throw takeObject(r1);
1017
+ }
1018
+ return takeObject(r0);
1019
+ } finally {
1020
+ wasm.__wbindgen_add_to_stack_pointer(16);
1021
+ }
1022
+ }
1023
+ /**
1024
+ * @param {Cipher[]} ciphers
1025
+ * @returns {CipherListView[]}
1026
+ */
1027
+ decrypt_list(ciphers) {
1028
+ try {
1029
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1030
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1031
+ const len0 = WASM_VECTOR_LEN;
1032
+ wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1033
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1034
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1035
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1036
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1037
+ if (r3) {
1038
+ throw takeObject(r2);
1039
+ }
1040
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1041
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1042
+ return v2;
1043
+ } finally {
1044
+ wasm.__wbindgen_add_to_stack_pointer(16);
1045
+ }
1046
+ }
1047
+ /**
1048
+ * @param {CipherView} cipher_view
1049
+ * @returns {Fido2CredentialView[]}
1050
+ */
1051
+ decrypt_fido2_credentials(cipher_view) {
1052
+ try {
1053
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1054
+ wasm.ciphersclient_decrypt_fido2_credentials(
1055
+ retptr,
1056
+ this.__wbg_ptr,
1057
+ addHeapObject(cipher_view),
1058
+ );
1059
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1060
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1061
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1062
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1063
+ if (r3) {
1064
+ throw takeObject(r2);
1065
+ }
1066
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1067
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1068
+ return v1;
1069
+ } finally {
1070
+ wasm.__wbindgen_add_to_stack_pointer(16);
1071
+ }
1072
+ }
1073
+ /**
1074
+ * @param {CipherView} cipher_view
1075
+ * @param {OrganizationId} organization_id
1076
+ * @returns {CipherView}
1077
+ */
1078
+ move_to_organization(cipher_view, organization_id) {
1079
+ try {
1080
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1081
+ wasm.ciphersclient_move_to_organization(
1082
+ retptr,
1083
+ this.__wbg_ptr,
1084
+ addHeapObject(cipher_view),
1085
+ addHeapObject(organization_id),
1086
+ );
1087
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1088
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1089
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1090
+ if (r2) {
1091
+ throw takeObject(r1);
1092
+ }
1093
+ return takeObject(r0);
1094
+ } finally {
1095
+ wasm.__wbindgen_add_to_stack_pointer(16);
1096
+ }
1097
+ }
1098
+ /**
1099
+ * @param {CipherView} cipher_view
1100
+ * @returns {string}
1101
+ */
1102
+ decrypt_fido2_private_key(cipher_view) {
1103
+ let deferred2_0;
1104
+ let deferred2_1;
1105
+ try {
1106
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1107
+ wasm.ciphersclient_decrypt_fido2_private_key(
1108
+ retptr,
1109
+ this.__wbg_ptr,
1110
+ addHeapObject(cipher_view),
1111
+ );
1112
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1113
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1114
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1115
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1116
+ var ptr1 = r0;
1117
+ var len1 = r1;
1118
+ if (r3) {
1119
+ ptr1 = 0;
1120
+ len1 = 0;
1121
+ throw takeObject(r2);
1122
+ }
1123
+ deferred2_0 = ptr1;
1124
+ deferred2_1 = len1;
1125
+ return getStringFromWasm0(ptr1, len1);
1126
+ } finally {
1127
+ wasm.__wbindgen_add_to_stack_pointer(16);
1128
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1129
+ }
1130
+ }
1131
+ }
1132
+ module.exports.CiphersClient = CiphersClient;
1133
+
1134
+ const CryptoClientFinalization =
1135
+ typeof FinalizationRegistry === "undefined"
1136
+ ? { register: () => {}, unregister: () => {} }
1137
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
1138
+
1139
+ class CryptoClient {
1140
+ static __wrap(ptr) {
1141
+ ptr = ptr >>> 0;
1142
+ const obj = Object.create(CryptoClient.prototype);
1143
+ obj.__wbg_ptr = ptr;
1144
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
1145
+ return obj;
1146
+ }
1147
+
1148
+ __destroy_into_raw() {
1149
+ const ptr = this.__wbg_ptr;
1150
+ this.__wbg_ptr = 0;
1151
+ CryptoClientFinalization.unregister(this);
1152
+ return ptr;
1153
+ }
1154
+
1155
+ free() {
1156
+ const ptr = this.__destroy_into_raw();
1157
+ wasm.__wbg_cryptoclient_free(ptr, 0);
1158
+ }
1159
+ /**
1160
+ * Initialization method for the user crypto. Needs to be called before any other crypto
1161
+ * operations.
1162
+ * @param {InitUserCryptoRequest} req
1163
+ * @returns {Promise<void>}
1164
+ */
1165
+ initialize_user_crypto(req) {
1166
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
1167
+ return takeObject(ret);
1168
+ }
1169
+ /**
1170
+ * Initialization method for the organization crypto. Needs to be called after
1171
+ * `initialize_user_crypto` but before any other crypto operations.
1172
+ * @param {InitOrgCryptoRequest} req
1173
+ * @returns {Promise<void>}
1174
+ */
1175
+ initialize_org_crypto(req) {
1176
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
1177
+ return takeObject(ret);
1178
+ }
1179
+ /**
1180
+ * Generates a new key pair and encrypts the private key with the provided user key.
1181
+ * Crypto initialization not required.
1182
+ * @param {string} user_key
1183
+ * @returns {MakeKeyPairResponse}
1184
+ */
1185
+ make_key_pair(user_key) {
1186
+ try {
1187
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1188
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
+ const len0 = WASM_VECTOR_LEN;
1190
+ wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
1191
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1192
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1193
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1194
+ if (r2) {
1195
+ throw takeObject(r1);
1196
+ }
1197
+ return takeObject(r0);
1198
+ } finally {
1199
+ wasm.__wbindgen_add_to_stack_pointer(16);
1200
+ }
1201
+ }
1202
+ /**
1203
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
1204
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
1205
+ * Crypto initialization not required.
1206
+ * @param {VerifyAsymmetricKeysRequest} request
1207
+ * @returns {VerifyAsymmetricKeysResponse}
1208
+ */
1209
+ verify_asymmetric_keys(request) {
1210
+ try {
1211
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1212
+ wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
1213
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1214
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1215
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1216
+ if (r2) {
1217
+ throw takeObject(r1);
1218
+ }
1219
+ return takeObject(r0);
1220
+ } finally {
1221
+ wasm.__wbindgen_add_to_stack_pointer(16);
1222
+ }
1223
+ }
1224
+ }
1225
+ module.exports.CryptoClient = CryptoClient;
1226
+
1227
+ const ExporterClientFinalization =
1228
+ typeof FinalizationRegistry === "undefined"
1229
+ ? { register: () => {}, unregister: () => {} }
1230
+ : new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
1231
+
1232
+ class ExporterClient {
1233
+ static __wrap(ptr) {
1234
+ ptr = ptr >>> 0;
1235
+ const obj = Object.create(ExporterClient.prototype);
1236
+ obj.__wbg_ptr = ptr;
1237
+ ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
1238
+ return obj;
1239
+ }
1240
+
1241
+ __destroy_into_raw() {
1242
+ const ptr = this.__wbg_ptr;
1243
+ this.__wbg_ptr = 0;
1244
+ ExporterClientFinalization.unregister(this);
1245
+ return ptr;
1246
+ }
1247
+
1248
+ free() {
1249
+ const ptr = this.__destroy_into_raw();
1250
+ wasm.__wbg_exporterclient_free(ptr, 0);
1251
+ }
1252
+ /**
1253
+ * @param {Folder[]} folders
1254
+ * @param {Cipher[]} ciphers
1255
+ * @param {ExportFormat} format
1256
+ * @returns {string}
1257
+ */
1258
+ export_vault(folders, ciphers, format) {
1259
+ let deferred4_0;
1260
+ let deferred4_1;
1261
+ try {
1262
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1263
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1264
+ const len0 = WASM_VECTOR_LEN;
1265
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1266
+ const len1 = WASM_VECTOR_LEN;
1267
+ wasm.exporterclient_export_vault(
1268
+ retptr,
1269
+ this.__wbg_ptr,
1270
+ ptr0,
1271
+ len0,
1272
+ ptr1,
1273
+ len1,
1274
+ addHeapObject(format),
1275
+ );
1276
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1277
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1278
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1279
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1280
+ var ptr3 = r0;
1281
+ var len3 = r1;
1282
+ if (r3) {
1283
+ ptr3 = 0;
1284
+ len3 = 0;
1285
+ throw takeObject(r2);
1286
+ }
1287
+ deferred4_0 = ptr3;
1288
+ deferred4_1 = len3;
1289
+ return getStringFromWasm0(ptr3, len3);
1290
+ } finally {
1291
+ wasm.__wbindgen_add_to_stack_pointer(16);
1292
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1293
+ }
1294
+ }
1295
+ /**
1296
+ * @param {Collection[]} collections
1297
+ * @param {Cipher[]} ciphers
1298
+ * @param {ExportFormat} format
1299
+ * @returns {string}
1300
+ */
1301
+ export_organization_vault(collections, ciphers, format) {
1302
+ let deferred4_0;
1303
+ let deferred4_1;
1304
+ try {
1305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1306
+ const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
1307
+ const len0 = WASM_VECTOR_LEN;
1308
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1309
+ const len1 = WASM_VECTOR_LEN;
1310
+ wasm.exporterclient_export_organization_vault(
1311
+ retptr,
1312
+ this.__wbg_ptr,
1313
+ ptr0,
1314
+ len0,
1315
+ ptr1,
1316
+ len1,
1317
+ addHeapObject(format),
1318
+ );
1319
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1320
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1321
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1322
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1323
+ var ptr3 = r0;
1324
+ var len3 = r1;
1325
+ if (r3) {
1326
+ ptr3 = 0;
1327
+ len3 = 0;
1328
+ throw takeObject(r2);
1329
+ }
1330
+ deferred4_0 = ptr3;
1331
+ deferred4_1 = len3;
1332
+ return getStringFromWasm0(ptr3, len3);
1333
+ } finally {
1334
+ wasm.__wbindgen_add_to_stack_pointer(16);
1335
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1336
+ }
1337
+ }
1338
+ /**
1339
+ * Credential Exchange Format (CXF)
1340
+ *
1341
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1342
+ *
1343
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1344
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1345
+ * @param {Account} account
1346
+ * @param {Cipher[]} ciphers
1347
+ * @returns {string}
1348
+ */
1349
+ export_cxf(account, ciphers) {
1350
+ let deferred3_0;
1351
+ let deferred3_1;
1352
+ try {
1353
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1354
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1355
+ const len0 = WASM_VECTOR_LEN;
1356
+ wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
1357
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1358
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1359
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1360
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1361
+ var ptr2 = r0;
1362
+ var len2 = r1;
1363
+ if (r3) {
1364
+ ptr2 = 0;
1365
+ len2 = 0;
1366
+ throw takeObject(r2);
1367
+ }
1368
+ deferred3_0 = ptr2;
1369
+ deferred3_1 = len2;
1370
+ return getStringFromWasm0(ptr2, len2);
1371
+ } finally {
1372
+ wasm.__wbindgen_add_to_stack_pointer(16);
1373
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1374
+ }
1375
+ }
1376
+ /**
1377
+ * Credential Exchange Format (CXF)
1378
+ *
1379
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1380
+ *
1381
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1382
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1383
+ * @param {string} payload
1384
+ * @returns {Cipher[]}
1385
+ */
1386
+ import_cxf(payload) {
1387
+ try {
1388
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1389
+ const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1390
+ const len0 = WASM_VECTOR_LEN;
1391
+ wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
1392
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1393
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1394
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1395
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1396
+ if (r3) {
1397
+ throw takeObject(r2);
1398
+ }
1399
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1400
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1401
+ return v2;
1402
+ } finally {
1403
+ wasm.__wbindgen_add_to_stack_pointer(16);
1404
+ }
1405
+ }
1406
+ }
1407
+ module.exports.ExporterClient = ExporterClient;
1408
+
1409
+ const FoldersClientFinalization =
1410
+ typeof FinalizationRegistry === "undefined"
1411
+ ? { register: () => {}, unregister: () => {} }
1412
+ : new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
1413
+
1414
+ class FoldersClient {
1415
+ static __wrap(ptr) {
1416
+ ptr = ptr >>> 0;
1417
+ const obj = Object.create(FoldersClient.prototype);
1418
+ obj.__wbg_ptr = ptr;
1419
+ FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1420
+ return obj;
1421
+ }
1422
+
1423
+ __destroy_into_raw() {
1424
+ const ptr = this.__wbg_ptr;
1425
+ this.__wbg_ptr = 0;
1426
+ FoldersClientFinalization.unregister(this);
1427
+ return ptr;
1428
+ }
1429
+
1430
+ free() {
1431
+ const ptr = this.__destroy_into_raw();
1432
+ wasm.__wbg_foldersclient_free(ptr, 0);
1433
+ }
1434
+ /**
1435
+ * @param {FolderView} folder_view
1436
+ * @returns {Folder}
1437
+ */
1438
+ encrypt(folder_view) {
1439
+ try {
1440
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1441
+ wasm.foldersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(folder_view));
1442
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1443
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1444
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1445
+ if (r2) {
1446
+ throw takeObject(r1);
1447
+ }
1448
+ return takeObject(r0);
1449
+ } finally {
1450
+ wasm.__wbindgen_add_to_stack_pointer(16);
1451
+ }
1452
+ }
1453
+ /**
1454
+ * @param {Folder} folder
1455
+ * @returns {FolderView}
1456
+ */
1457
+ decrypt(folder) {
1458
+ try {
1459
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1460
+ wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1461
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1462
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1463
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1464
+ if (r2) {
1465
+ throw takeObject(r1);
1466
+ }
1467
+ return takeObject(r0);
1468
+ } finally {
1469
+ wasm.__wbindgen_add_to_stack_pointer(16);
1470
+ }
1471
+ }
1472
+ /**
1473
+ * @param {Folder[]} folders
1474
+ * @returns {FolderView[]}
1475
+ */
1476
+ decrypt_list(folders) {
1477
+ try {
1478
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1479
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1480
+ const len0 = WASM_VECTOR_LEN;
1481
+ wasm.foldersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1482
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1483
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1484
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1485
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1486
+ if (r3) {
1487
+ throw takeObject(r2);
1488
+ }
1489
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1490
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1491
+ return v2;
1492
+ } finally {
1493
+ wasm.__wbindgen_add_to_stack_pointer(16);
1494
+ }
1495
+ }
1496
+ }
1497
+ module.exports.FoldersClient = FoldersClient;
1498
+
1499
+ const GeneratorClientFinalization =
1500
+ typeof FinalizationRegistry === "undefined"
1501
+ ? { register: () => {}, unregister: () => {} }
1502
+ : new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
1503
+
1504
+ class GeneratorClient {
1505
+ static __wrap(ptr) {
1506
+ ptr = ptr >>> 0;
1507
+ const obj = Object.create(GeneratorClient.prototype);
1508
+ obj.__wbg_ptr = ptr;
1509
+ GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
1510
+ return obj;
1511
+ }
1512
+
1513
+ __destroy_into_raw() {
1514
+ const ptr = this.__wbg_ptr;
1515
+ this.__wbg_ptr = 0;
1516
+ GeneratorClientFinalization.unregister(this);
1517
+ return ptr;
1518
+ }
1519
+
1520
+ free() {
1521
+ const ptr = this.__destroy_into_raw();
1522
+ wasm.__wbg_generatorclient_free(ptr, 0);
1523
+ }
1524
+ /**
1525
+ * Generates a random password.
1526
+ *
1527
+ * The character sets and password length can be customized using the `input` parameter.
1528
+ *
1529
+ * # Examples
1530
+ *
1531
+ * ```
1532
+ * use bitwarden_core::Client;
1533
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PasswordGeneratorRequest};
1534
+ *
1535
+ * async fn test() -> Result<(), PassphraseError> {
1536
+ * let input = PasswordGeneratorRequest {
1537
+ * lowercase: true,
1538
+ * uppercase: true,
1539
+ * numbers: true,
1540
+ * length: 20,
1541
+ * ..Default::default()
1542
+ * };
1543
+ * let password = Client::new(None).generator().password(input).unwrap();
1544
+ * println!("{}", password);
1545
+ * Ok(())
1546
+ * }
1547
+ * ```
1548
+ * @param {PasswordGeneratorRequest} input
1549
+ * @returns {string}
1550
+ */
1551
+ password(input) {
1552
+ let deferred2_0;
1553
+ let deferred2_1;
1554
+ try {
1555
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1556
+ wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(input));
1557
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1558
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1559
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1560
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1561
+ var ptr1 = r0;
1562
+ var len1 = r1;
1563
+ if (r3) {
1564
+ ptr1 = 0;
1565
+ len1 = 0;
1566
+ throw takeObject(r2);
1567
+ }
1568
+ deferred2_0 = ptr1;
1569
+ deferred2_1 = len1;
1570
+ return getStringFromWasm0(ptr1, len1);
1571
+ } finally {
1572
+ wasm.__wbindgen_add_to_stack_pointer(16);
1573
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1574
+ }
1575
+ }
1576
+ /**
1577
+ * Generates a random passphrase.
1578
+ * A passphrase is a combination of random words separated by a character.
1579
+ * An example of passphrase is `correct horse battery staple`.
1580
+ *
1581
+ * The number of words and their case, the word separator, and the inclusion of
1582
+ * a number in the passphrase can be customized using the `input` parameter.
1583
+ *
1584
+ * # Examples
1585
+ *
1586
+ * ```
1587
+ * use bitwarden_core::Client;
1588
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PassphraseGeneratorRequest};
1589
+ *
1590
+ * async fn test() -> Result<(), PassphraseError> {
1591
+ * let input = PassphraseGeneratorRequest {
1592
+ * num_words: 4,
1593
+ * ..Default::default()
1594
+ * };
1595
+ * let passphrase = Client::new(None).generator().passphrase(input).unwrap();
1596
+ * println!("{}", passphrase);
1597
+ * Ok(())
1598
+ * }
1599
+ * ```
1600
+ * @param {PassphraseGeneratorRequest} input
1601
+ * @returns {string}
1602
+ */
1603
+ passphrase(input) {
1604
+ let deferred2_0;
1605
+ let deferred2_1;
1606
+ try {
1607
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1608
+ wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(input));
1609
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1610
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1611
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1612
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1613
+ var ptr1 = r0;
1614
+ var len1 = r1;
1615
+ if (r3) {
1616
+ ptr1 = 0;
1617
+ len1 = 0;
1618
+ throw takeObject(r2);
1619
+ }
1620
+ deferred2_0 = ptr1;
1621
+ deferred2_1 = len1;
1622
+ return getStringFromWasm0(ptr1, len1);
1623
+ } finally {
1624
+ wasm.__wbindgen_add_to_stack_pointer(16);
1625
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1626
+ }
1627
+ }
1628
+ }
1629
+ module.exports.GeneratorClient = GeneratorClient;
1630
+
1631
+ const IncomingMessageFinalization =
1632
+ typeof FinalizationRegistry === "undefined"
1633
+ ? { register: () => {}, unregister: () => {} }
1634
+ : new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
1635
+
1636
+ class IncomingMessage {
1637
+ static __wrap(ptr) {
1638
+ ptr = ptr >>> 0;
1639
+ const obj = Object.create(IncomingMessage.prototype);
1640
+ obj.__wbg_ptr = ptr;
1641
+ IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1642
+ return obj;
1643
+ }
1644
+
1645
+ __destroy_into_raw() {
1646
+ const ptr = this.__wbg_ptr;
1647
+ this.__wbg_ptr = 0;
1648
+ IncomingMessageFinalization.unregister(this);
1649
+ return ptr;
1650
+ }
1651
+
1652
+ free() {
1653
+ const ptr = this.__destroy_into_raw();
1654
+ wasm.__wbg_incomingmessage_free(ptr, 0);
1655
+ }
1656
+ /**
1657
+ * @returns {Uint8Array}
1658
+ */
1659
+ get payload() {
1660
+ try {
1661
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1662
+ wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
1663
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1664
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1665
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1666
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1667
+ return v1;
1668
+ } finally {
1669
+ wasm.__wbindgen_add_to_stack_pointer(16);
1670
+ }
1671
+ }
1672
+ /**
1673
+ * @param {Uint8Array} arg0
1674
+ */
1675
+ set payload(arg0) {
1676
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1677
+ const len0 = WASM_VECTOR_LEN;
1678
+ wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
1679
+ }
1680
+ /**
1681
+ * @returns {Endpoint}
1682
+ */
1683
+ get destination() {
1684
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1685
+ return takeObject(ret);
1686
+ }
1687
+ /**
1688
+ * @param {Endpoint} arg0
1689
+ */
1690
+ set destination(arg0) {
1691
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1692
+ }
1693
+ /**
1694
+ * @returns {Endpoint}
1695
+ */
1696
+ get source() {
1697
+ const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
1698
+ return takeObject(ret);
1699
+ }
1700
+ /**
1701
+ * @param {Endpoint} arg0
1702
+ */
1703
+ set source(arg0) {
1704
+ wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
1705
+ }
1706
+ /**
1707
+ * @returns {string | undefined}
1708
+ */
1709
+ get topic() {
1710
+ try {
1711
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1712
+ wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
1713
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1714
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1715
+ let v1;
1716
+ if (r0 !== 0) {
1717
+ v1 = getStringFromWasm0(r0, r1).slice();
1718
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1719
+ }
1720
+ return v1;
1721
+ } finally {
1722
+ wasm.__wbindgen_add_to_stack_pointer(16);
1723
+ }
1724
+ }
1725
+ /**
1726
+ * @param {string | null} [arg0]
1727
+ */
1728
+ set topic(arg0) {
1729
+ var ptr0 = isLikeNone(arg0)
1730
+ ? 0
1731
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1732
+ var len0 = WASM_VECTOR_LEN;
1733
+ wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
1734
+ }
1735
+ /**
1736
+ * @param {Uint8Array} payload
1737
+ * @param {Endpoint} destination
1738
+ * @param {Endpoint} source
1739
+ * @param {string | null} [topic]
1740
+ */
1741
+ constructor(payload, destination, source, topic) {
1742
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1743
+ const len0 = WASM_VECTOR_LEN;
1744
+ var ptr1 = isLikeNone(topic)
1745
+ ? 0
1746
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1747
+ var len1 = WASM_VECTOR_LEN;
1748
+ const ret = wasm.incomingmessage_new(
1749
+ ptr0,
1750
+ len0,
1751
+ addHeapObject(destination),
1752
+ addHeapObject(source),
1753
+ ptr1,
1754
+ len1,
1755
+ );
1756
+ this.__wbg_ptr = ret >>> 0;
1757
+ IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
1758
+ return this;
1759
+ }
1760
+ /**
1761
+ * Try to parse the payload as JSON.
1762
+ * @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
1763
+ */
1764
+ parse_payload_as_json() {
1765
+ const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
1766
+ return takeObject(ret);
1767
+ }
1768
+ }
1769
+ module.exports.IncomingMessage = IncomingMessage;
1770
+
1771
+ const IpcClientFinalization =
1772
+ typeof FinalizationRegistry === "undefined"
1773
+ ? { register: () => {}, unregister: () => {} }
1774
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
1775
+
1776
+ class IpcClient {
1777
+ __destroy_into_raw() {
1778
+ const ptr = this.__wbg_ptr;
1779
+ this.__wbg_ptr = 0;
1780
+ IpcClientFinalization.unregister(this);
1781
+ return ptr;
1782
+ }
1783
+
1784
+ free() {
1785
+ const ptr = this.__destroy_into_raw();
1786
+ wasm.__wbg_ipcclient_free(ptr, 0);
1787
+ }
1788
+ /**
1789
+ * @param {IpcCommunicationBackend} communication_provider
1790
+ */
1791
+ constructor(communication_provider) {
1792
+ _assertClass(communication_provider, IpcCommunicationBackend);
1793
+ var ptr0 = communication_provider.__destroy_into_raw();
1794
+ const ret = wasm.ipcclient_new(ptr0);
1795
+ this.__wbg_ptr = ret >>> 0;
1796
+ IpcClientFinalization.register(this, this.__wbg_ptr, this);
1797
+ return this;
1798
+ }
1799
+ /**
1800
+ * @param {OutgoingMessage} message
1801
+ * @returns {Promise<void>}
1802
+ */
1803
+ send(message) {
1804
+ _assertClass(message, OutgoingMessage);
1805
+ var ptr0 = message.__destroy_into_raw();
1806
+ const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
1807
+ return takeObject(ret);
1808
+ }
1809
+ /**
1810
+ * @returns {Promise<IpcClientSubscription>}
1811
+ */
1812
+ subscribe() {
1813
+ const ret = wasm.ipcclient_subscribe(this.__wbg_ptr);
1814
+ return takeObject(ret);
1815
+ }
1816
+ }
1817
+ module.exports.IpcClient = IpcClient;
1818
+
1819
+ const IpcClientSubscriptionFinalization =
1820
+ typeof FinalizationRegistry === "undefined"
1821
+ ? { register: () => {}, unregister: () => {} }
1822
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclientsubscription_free(ptr >>> 0, 1));
1823
+
1824
+ class IpcClientSubscription {
1825
+ static __wrap(ptr) {
1826
+ ptr = ptr >>> 0;
1827
+ const obj = Object.create(IpcClientSubscription.prototype);
1828
+ obj.__wbg_ptr = ptr;
1829
+ IpcClientSubscriptionFinalization.register(obj, obj.__wbg_ptr, obj);
1830
+ return obj;
1831
+ }
1832
+
1833
+ __destroy_into_raw() {
1834
+ const ptr = this.__wbg_ptr;
1835
+ this.__wbg_ptr = 0;
1836
+ IpcClientSubscriptionFinalization.unregister(this);
1837
+ return ptr;
1838
+ }
1839
+
1840
+ free() {
1841
+ const ptr = this.__destroy_into_raw();
1842
+ wasm.__wbg_ipcclientsubscription_free(ptr, 0);
1843
+ }
1844
+ /**
1845
+ * @returns {Promise<IncomingMessage>}
1846
+ */
1847
+ receive() {
1848
+ const ret = wasm.ipcclientsubscription_receive(this.__wbg_ptr);
1849
+ return takeObject(ret);
1850
+ }
1851
+ }
1852
+ module.exports.IpcClientSubscription = IpcClientSubscription;
1853
+
1854
+ const IpcCommunicationBackendFinalization =
1855
+ typeof FinalizationRegistry === "undefined"
1856
+ ? { register: () => {}, unregister: () => {} }
1857
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipccommunicationbackend_free(ptr >>> 0, 1));
1858
+
1859
+ class IpcCommunicationBackend {
1860
+ __destroy_into_raw() {
1861
+ const ptr = this.__wbg_ptr;
1862
+ this.__wbg_ptr = 0;
1863
+ IpcCommunicationBackendFinalization.unregister(this);
1864
+ return ptr;
1865
+ }
1866
+
1867
+ free() {
1868
+ const ptr = this.__destroy_into_raw();
1869
+ wasm.__wbg_ipccommunicationbackend_free(ptr, 0);
1870
+ }
1871
+ /**
1872
+ * @param {IpcCommunicationBackendSender} sender
1873
+ */
1874
+ constructor(sender) {
1875
+ const ret = wasm.ipccommunicationbackend_new(addHeapObject(sender));
1876
+ this.__wbg_ptr = ret >>> 0;
1877
+ IpcCommunicationBackendFinalization.register(this, this.__wbg_ptr, this);
1878
+ return this;
1879
+ }
1880
+ /**
1881
+ * JavaScript function to provide a received message to the backend/IPC framework.
1882
+ * @param {IncomingMessage} message
1883
+ */
1884
+ deliver_message(message) {
1885
+ try {
1886
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1887
+ _assertClass(message, IncomingMessage);
1888
+ var ptr0 = message.__destroy_into_raw();
1889
+ wasm.ipccommunicationbackend_deliver_message(retptr, this.__wbg_ptr, ptr0);
1890
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1891
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1892
+ if (r1) {
1893
+ throw takeObject(r0);
1894
+ }
1895
+ } finally {
1896
+ wasm.__wbindgen_add_to_stack_pointer(16);
1897
+ }
1898
+ }
1899
+ }
1900
+ module.exports.IpcCommunicationBackend = IpcCommunicationBackend;
1901
+
1902
+ const OutgoingMessageFinalization =
1903
+ typeof FinalizationRegistry === "undefined"
1904
+ ? { register: () => {}, unregister: () => {} }
1905
+ : new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
1906
+
1907
+ class OutgoingMessage {
1908
+ static __wrap(ptr) {
1909
+ ptr = ptr >>> 0;
1910
+ const obj = Object.create(OutgoingMessage.prototype);
1911
+ obj.__wbg_ptr = ptr;
1912
+ OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1913
+ return obj;
1914
+ }
1915
+
1916
+ __destroy_into_raw() {
1917
+ const ptr = this.__wbg_ptr;
1918
+ this.__wbg_ptr = 0;
1919
+ OutgoingMessageFinalization.unregister(this);
1920
+ return ptr;
1921
+ }
1922
+
1923
+ free() {
1924
+ const ptr = this.__destroy_into_raw();
1925
+ wasm.__wbg_outgoingmessage_free(ptr, 0);
1926
+ }
1927
+ /**
1928
+ * @returns {Uint8Array}
1929
+ */
1930
+ get payload() {
1931
+ try {
1932
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1933
+ wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
1934
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1935
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1936
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1937
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1938
+ return v1;
1939
+ } finally {
1940
+ wasm.__wbindgen_add_to_stack_pointer(16);
1941
+ }
1942
+ }
1943
+ /**
1944
+ * @param {Uint8Array} arg0
1945
+ */
1946
+ set payload(arg0) {
1947
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1948
+ const len0 = WASM_VECTOR_LEN;
1949
+ wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
1950
+ }
1951
+ /**
1952
+ * @returns {Endpoint}
1953
+ */
1954
+ get destination() {
1955
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1956
+ return takeObject(ret);
1957
+ }
1958
+ /**
1959
+ * @param {Endpoint} arg0
1960
+ */
1961
+ set destination(arg0) {
1962
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1963
+ }
1964
+ /**
1965
+ * @returns {string | undefined}
1966
+ */
1967
+ get topic() {
1968
+ try {
1969
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1970
+ wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
1971
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1972
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1973
+ let v1;
1974
+ if (r0 !== 0) {
1975
+ v1 = getStringFromWasm0(r0, r1).slice();
1976
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1977
+ }
1978
+ return v1;
1979
+ } finally {
1980
+ wasm.__wbindgen_add_to_stack_pointer(16);
1981
+ }
1982
+ }
1983
+ /**
1984
+ * @param {string | null} [arg0]
1985
+ */
1986
+ set topic(arg0) {
1987
+ var ptr0 = isLikeNone(arg0)
1988
+ ? 0
1989
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1990
+ var len0 = WASM_VECTOR_LEN;
1991
+ wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
1992
+ }
1993
+ /**
1994
+ * @param {Uint8Array} payload
1995
+ * @param {Endpoint} destination
1996
+ * @param {string | null} [topic]
1997
+ */
1998
+ constructor(payload, destination, topic) {
1999
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
2000
+ const len0 = WASM_VECTOR_LEN;
2001
+ var ptr1 = isLikeNone(topic)
2002
+ ? 0
2003
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2004
+ var len1 = WASM_VECTOR_LEN;
2005
+ const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
2006
+ this.__wbg_ptr = ret >>> 0;
2007
+ OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
2008
+ return this;
2009
+ }
2010
+ /**
2011
+ * Create a new message and encode the payload as JSON.
2012
+ * @param {any} payload
2013
+ * @param {Endpoint} destination
2014
+ * @param {string | null} [topic]
2015
+ * @returns {OutgoingMessage}
2016
+ */
2017
+ static new_json_payload(payload, destination, topic) {
2018
+ try {
2019
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2020
+ var ptr0 = isLikeNone(topic)
2021
+ ? 0
2022
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2023
+ var len0 = WASM_VECTOR_LEN;
2024
+ wasm.outgoingmessage_new_json_payload(
2025
+ retptr,
2026
+ addHeapObject(payload),
2027
+ addHeapObject(destination),
2028
+ ptr0,
2029
+ len0,
2030
+ );
2031
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2032
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2033
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2034
+ if (r2) {
2035
+ throw takeObject(r1);
2036
+ }
2037
+ return OutgoingMessage.__wrap(r0);
2038
+ } finally {
2039
+ wasm.__wbindgen_add_to_stack_pointer(16);
2040
+ }
2041
+ }
2042
+ }
2043
+ module.exports.OutgoingMessage = OutgoingMessage;
2044
+
2045
+ const PureCryptoFinalization =
2046
+ typeof FinalizationRegistry === "undefined"
2047
+ ? { register: () => {}, unregister: () => {} }
2048
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
2049
+ /**
2050
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
2051
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
2052
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
2053
+ * responsible for state and keys.
2054
+ */
2055
+ class PureCrypto {
2056
+ __destroy_into_raw() {
2057
+ const ptr = this.__wbg_ptr;
2058
+ this.__wbg_ptr = 0;
2059
+ PureCryptoFinalization.unregister(this);
2060
+ return ptr;
2061
+ }
2062
+
2063
+ free() {
2064
+ const ptr = this.__destroy_into_raw();
2065
+ wasm.__wbg_purecrypto_free(ptr, 0);
2066
+ }
2067
+ /**
2068
+ * DEPRECATED: Use `symmetric_decrypt_string` instead.
2069
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2070
+ * @param {string} enc_string
2071
+ * @param {Uint8Array} key
2072
+ * @returns {string}
2073
+ */
2074
+ static symmetric_decrypt(enc_string, key) {
2075
+ let deferred4_0;
2076
+ let deferred4_1;
2077
+ try {
2078
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2079
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2080
+ const len0 = WASM_VECTOR_LEN;
2081
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2082
+ const len1 = WASM_VECTOR_LEN;
2083
+ wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
2084
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2085
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2086
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2087
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2088
+ var ptr3 = r0;
2089
+ var len3 = r1;
2090
+ if (r3) {
2091
+ ptr3 = 0;
2092
+ len3 = 0;
2093
+ throw takeObject(r2);
2094
+ }
2095
+ deferred4_0 = ptr3;
2096
+ deferred4_1 = len3;
2097
+ return getStringFromWasm0(ptr3, len3);
2098
+ } finally {
2099
+ wasm.__wbindgen_add_to_stack_pointer(16);
2100
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2101
+ }
2102
+ }
2103
+ /**
2104
+ * @param {string} enc_string
2105
+ * @param {Uint8Array} key
2106
+ * @returns {string}
2107
+ */
2108
+ static symmetric_decrypt_string(enc_string, key) {
2109
+ let deferred4_0;
2110
+ let deferred4_1;
2111
+ try {
2112
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2113
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2114
+ const len0 = WASM_VECTOR_LEN;
2115
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2116
+ const len1 = WASM_VECTOR_LEN;
2117
+ wasm.purecrypto_symmetric_decrypt_string(retptr, ptr0, len0, ptr1, len1);
2118
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2119
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2120
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2121
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2122
+ var ptr3 = r0;
2123
+ var len3 = r1;
2124
+ if (r3) {
2125
+ ptr3 = 0;
2126
+ len3 = 0;
2127
+ throw takeObject(r2);
2128
+ }
2129
+ deferred4_0 = ptr3;
2130
+ deferred4_1 = len3;
2131
+ return getStringFromWasm0(ptr3, len3);
2132
+ } finally {
2133
+ wasm.__wbindgen_add_to_stack_pointer(16);
2134
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2135
+ }
2136
+ }
2137
+ /**
2138
+ * @param {string} enc_string
2139
+ * @param {Uint8Array} key
2140
+ * @returns {Uint8Array}
2141
+ */
2142
+ static symmetric_decrypt_bytes(enc_string, key) {
2143
+ try {
2144
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2145
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2146
+ const len0 = WASM_VECTOR_LEN;
2147
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2148
+ const len1 = WASM_VECTOR_LEN;
2149
+ wasm.purecrypto_symmetric_decrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2150
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2151
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2152
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2153
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2154
+ if (r3) {
2155
+ throw takeObject(r2);
2156
+ }
2157
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2158
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2159
+ return v3;
2160
+ } finally {
2161
+ wasm.__wbindgen_add_to_stack_pointer(16);
2162
+ }
2163
+ }
2164
+ /**
2165
+ * DEPRECATED: Use `symmetric_decrypt_filedata` instead.
2166
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2167
+ * @param {Uint8Array} enc_bytes
2168
+ * @param {Uint8Array} key
2169
+ * @returns {Uint8Array}
2170
+ */
2171
+ static symmetric_decrypt_array_buffer(enc_bytes, key) {
2172
+ try {
2173
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2174
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2175
+ const len0 = WASM_VECTOR_LEN;
2176
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2177
+ const len1 = WASM_VECTOR_LEN;
2178
+ wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
2179
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2180
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2181
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2182
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2183
+ if (r3) {
2184
+ throw takeObject(r2);
2185
+ }
2186
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2187
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2188
+ return v3;
2189
+ } finally {
2190
+ wasm.__wbindgen_add_to_stack_pointer(16);
2191
+ }
2192
+ }
2193
+ /**
2194
+ * @param {Uint8Array} enc_bytes
2195
+ * @param {Uint8Array} key
2196
+ * @returns {Uint8Array}
2197
+ */
2198
+ static symmetric_decrypt_filedata(enc_bytes, key) {
2199
+ try {
2200
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2201
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2202
+ const len0 = WASM_VECTOR_LEN;
2203
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2204
+ const len1 = WASM_VECTOR_LEN;
2205
+ wasm.purecrypto_symmetric_decrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2206
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2207
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2208
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2209
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2210
+ if (r3) {
2211
+ throw takeObject(r2);
2212
+ }
2213
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2214
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2215
+ return v3;
2216
+ } finally {
2217
+ wasm.__wbindgen_add_to_stack_pointer(16);
2218
+ }
2219
+ }
2220
+ /**
2221
+ * @param {string} plain
2222
+ * @param {Uint8Array} key
2223
+ * @returns {string}
2224
+ */
2225
+ static symmetric_encrypt_string(plain, key) {
2226
+ let deferred4_0;
2227
+ let deferred4_1;
2228
+ try {
2229
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2230
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2231
+ const len0 = WASM_VECTOR_LEN;
2232
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2233
+ const len1 = WASM_VECTOR_LEN;
2234
+ wasm.purecrypto_symmetric_encrypt_string(retptr, ptr0, len0, ptr1, len1);
2235
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2236
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2237
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2238
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2239
+ var ptr3 = r0;
2240
+ var len3 = r1;
2241
+ if (r3) {
2242
+ ptr3 = 0;
2243
+ len3 = 0;
2244
+ throw takeObject(r2);
2245
+ }
2246
+ deferred4_0 = ptr3;
2247
+ deferred4_1 = len3;
2248
+ return getStringFromWasm0(ptr3, len3);
2249
+ } finally {
2250
+ wasm.__wbindgen_add_to_stack_pointer(16);
2251
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2252
+ }
2253
+ }
2254
+ /**
2255
+ * @param {Uint8Array} plain
2256
+ * @param {Uint8Array} key
2257
+ * @returns {string}
2258
+ */
2259
+ static symmetric_encrypt_bytes(plain, key) {
2260
+ let deferred4_0;
2261
+ let deferred4_1;
2262
+ try {
2263
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2264
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2265
+ const len0 = WASM_VECTOR_LEN;
2266
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2267
+ const len1 = WASM_VECTOR_LEN;
2268
+ wasm.purecrypto_symmetric_encrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2269
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2270
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2271
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2272
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2273
+ var ptr3 = r0;
2274
+ var len3 = r1;
2275
+ if (r3) {
2276
+ ptr3 = 0;
2277
+ len3 = 0;
2278
+ throw takeObject(r2);
2279
+ }
2280
+ deferred4_0 = ptr3;
2281
+ deferred4_1 = len3;
2282
+ return getStringFromWasm0(ptr3, len3);
2283
+ } finally {
2284
+ wasm.__wbindgen_add_to_stack_pointer(16);
2285
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2286
+ }
2287
+ }
2288
+ /**
2289
+ * @param {Uint8Array} plain
2290
+ * @param {Uint8Array} key
2291
+ * @returns {Uint8Array}
2292
+ */
2293
+ static symmetric_encrypt_filedata(plain, key) {
2294
+ try {
2295
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2296
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2297
+ const len0 = WASM_VECTOR_LEN;
2298
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2299
+ const len1 = WASM_VECTOR_LEN;
2300
+ wasm.purecrypto_symmetric_encrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2301
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2302
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2303
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2304
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2305
+ if (r3) {
2306
+ throw takeObject(r2);
2307
+ }
2308
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2309
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2310
+ return v3;
2311
+ } finally {
2312
+ wasm.__wbindgen_add_to_stack_pointer(16);
2313
+ }
2314
+ }
2315
+ /**
2316
+ * @param {string} encrypted_user_key
2317
+ * @param {string} master_password
2318
+ * @param {string} email
2319
+ * @param {Kdf} kdf
2320
+ * @returns {Uint8Array}
2321
+ */
2322
+ static decrypt_user_key_with_master_password(encrypted_user_key, master_password, email, kdf) {
2323
+ try {
2324
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2325
+ const ptr0 = passStringToWasm0(
2326
+ encrypted_user_key,
2327
+ wasm.__wbindgen_malloc,
2328
+ wasm.__wbindgen_realloc,
2329
+ );
2330
+ const len0 = WASM_VECTOR_LEN;
2331
+ const ptr1 = passStringToWasm0(
2332
+ master_password,
2333
+ wasm.__wbindgen_malloc,
2334
+ wasm.__wbindgen_realloc,
2335
+ );
2336
+ const len1 = WASM_VECTOR_LEN;
2337
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2338
+ const len2 = WASM_VECTOR_LEN;
2339
+ wasm.purecrypto_decrypt_user_key_with_master_password(
2340
+ retptr,
2341
+ ptr0,
2342
+ len0,
2343
+ ptr1,
2344
+ len1,
2345
+ ptr2,
2346
+ len2,
2347
+ addHeapObject(kdf),
2348
+ );
2349
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2350
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2351
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2352
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2353
+ if (r3) {
2354
+ throw takeObject(r2);
2355
+ }
2356
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
2357
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2358
+ return v4;
2359
+ } finally {
2360
+ wasm.__wbindgen_add_to_stack_pointer(16);
2361
+ }
2362
+ }
2363
+ /**
2364
+ * @param {Uint8Array} user_key
2365
+ * @param {string} master_password
2366
+ * @param {string} email
2367
+ * @param {Kdf} kdf
2368
+ * @returns {string}
2369
+ */
2370
+ static encrypt_user_key_with_master_password(user_key, master_password, email, kdf) {
2371
+ let deferred5_0;
2372
+ let deferred5_1;
2373
+ try {
2374
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2375
+ const ptr0 = passArray8ToWasm0(user_key, wasm.__wbindgen_malloc);
2376
+ const len0 = WASM_VECTOR_LEN;
2377
+ const ptr1 = passStringToWasm0(
2378
+ master_password,
2379
+ wasm.__wbindgen_malloc,
2380
+ wasm.__wbindgen_realloc,
2381
+ );
2382
+ const len1 = WASM_VECTOR_LEN;
2383
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2384
+ const len2 = WASM_VECTOR_LEN;
2385
+ wasm.purecrypto_encrypt_user_key_with_master_password(
2386
+ retptr,
2387
+ ptr0,
2388
+ len0,
2389
+ ptr1,
2390
+ len1,
2391
+ ptr2,
2392
+ len2,
2393
+ addHeapObject(kdf),
2394
+ );
2395
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2396
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2397
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2398
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2399
+ var ptr4 = r0;
2400
+ var len4 = r1;
2401
+ if (r3) {
2402
+ ptr4 = 0;
2403
+ len4 = 0;
2404
+ throw takeObject(r2);
2405
+ }
2406
+ deferred5_0 = ptr4;
2407
+ deferred5_1 = len4;
2408
+ return getStringFromWasm0(ptr4, len4);
2409
+ } finally {
2410
+ wasm.__wbindgen_add_to_stack_pointer(16);
2411
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
2412
+ }
2413
+ }
2414
+ /**
2415
+ * @returns {Uint8Array}
2416
+ */
2417
+ static make_user_key_aes256_cbc_hmac() {
2418
+ try {
2419
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2420
+ wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
2421
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2422
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2423
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2424
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2425
+ return v1;
2426
+ } finally {
2427
+ wasm.__wbindgen_add_to_stack_pointer(16);
2428
+ }
2429
+ }
2430
+ /**
2431
+ * @returns {Uint8Array}
2432
+ */
2433
+ static make_user_key_xchacha20_poly1305() {
2434
+ try {
2435
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2436
+ wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
2437
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2438
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2439
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2440
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2441
+ return v1;
2442
+ } finally {
2443
+ wasm.__wbindgen_add_to_stack_pointer(16);
2444
+ }
363
2445
  }
364
2446
  /**
365
- * @param {ClientSettings | undefined} [settings]
366
- * @param {LogLevel | undefined} [log_level]
2447
+ * Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
2448
+ * as an EncString.
2449
+ * @param {Uint8Array} key_to_be_wrapped
2450
+ * @param {Uint8Array} wrapping_key
2451
+ * @returns {string}
367
2452
  */
368
- constructor(settings, log_level) {
369
- const ret = wasm.bitwardenclient_new(
370
- isLikeNone(settings) ? 0 : addHeapObject(settings),
371
- isLikeNone(log_level) ? 5 : log_level,
372
- );
373
- this.__wbg_ptr = ret >>> 0;
374
- BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
375
- return this;
2453
+ static wrap_symmetric_key(key_to_be_wrapped, wrapping_key) {
2454
+ let deferred4_0;
2455
+ let deferred4_1;
2456
+ try {
2457
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2458
+ const ptr0 = passArray8ToWasm0(key_to_be_wrapped, wasm.__wbindgen_malloc);
2459
+ const len0 = WASM_VECTOR_LEN;
2460
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2461
+ const len1 = WASM_VECTOR_LEN;
2462
+ wasm.purecrypto_wrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2463
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2464
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2465
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2466
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2467
+ var ptr3 = r0;
2468
+ var len3 = r1;
2469
+ if (r3) {
2470
+ ptr3 = 0;
2471
+ len3 = 0;
2472
+ throw takeObject(r2);
2473
+ }
2474
+ deferred4_0 = ptr3;
2475
+ deferred4_1 = len3;
2476
+ return getStringFromWasm0(ptr3, len3);
2477
+ } finally {
2478
+ wasm.__wbindgen_add_to_stack_pointer(16);
2479
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2480
+ }
376
2481
  }
377
2482
  /**
378
- * Test method, echoes back the input
379
- * @param {string} msg
2483
+ * Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
2484
+ * unwrapped key as a serialized byte array.
2485
+ * @param {string} wrapped_key
2486
+ * @param {Uint8Array} wrapping_key
2487
+ * @returns {Uint8Array}
2488
+ */
2489
+ static unwrap_symmetric_key(wrapped_key, wrapping_key) {
2490
+ try {
2491
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2492
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2493
+ const len0 = WASM_VECTOR_LEN;
2494
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2495
+ const len1 = WASM_VECTOR_LEN;
2496
+ wasm.purecrypto_unwrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2497
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2498
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2499
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2500
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2501
+ if (r3) {
2502
+ throw takeObject(r2);
2503
+ }
2504
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2505
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2506
+ return v3;
2507
+ } finally {
2508
+ wasm.__wbindgen_add_to_stack_pointer(16);
2509
+ }
2510
+ }
2511
+ /**
2512
+ * Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
2513
+ * key. Note: Usually, a public key is - by definition - public, so this should not be
2514
+ * used. The specific use-case for this function is to enable rotateable key sets, where
2515
+ * the "public key" is not public, with the intent of preventing the server from being able
2516
+ * to overwrite the user key unlocked by the rotateable keyset.
2517
+ * @param {Uint8Array} encapsulation_key
2518
+ * @param {Uint8Array} wrapping_key
380
2519
  * @returns {string}
381
2520
  */
382
- echo(msg) {
383
- let deferred2_0;
384
- let deferred2_1;
2521
+ static wrap_encapsulation_key(encapsulation_key, wrapping_key) {
2522
+ let deferred4_0;
2523
+ let deferred4_1;
385
2524
  try {
386
2525
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
387
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2526
+ const ptr0 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
388
2527
  const len0 = WASM_VECTOR_LEN;
389
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
2528
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2529
+ const len1 = WASM_VECTOR_LEN;
2530
+ wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
390
2531
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
2532
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
- deferred2_0 = r0;
393
- deferred2_1 = r1;
394
- return getStringFromWasm0(r0, r1);
2533
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2534
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2535
+ var ptr3 = r0;
2536
+ var len3 = r1;
2537
+ if (r3) {
2538
+ ptr3 = 0;
2539
+ len3 = 0;
2540
+ throw takeObject(r2);
2541
+ }
2542
+ deferred4_0 = ptr3;
2543
+ deferred4_1 = len3;
2544
+ return getStringFromWasm0(ptr3, len3);
2545
+ } finally {
2546
+ wasm.__wbindgen_add_to_stack_pointer(16);
2547
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2548
+ }
2549
+ }
2550
+ /**
2551
+ * Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
2552
+ * wrapping key.
2553
+ * @param {string} wrapped_key
2554
+ * @param {Uint8Array} wrapping_key
2555
+ * @returns {Uint8Array}
2556
+ */
2557
+ static unwrap_encapsulation_key(wrapped_key, wrapping_key) {
2558
+ try {
2559
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2560
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2561
+ const len0 = WASM_VECTOR_LEN;
2562
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2563
+ const len1 = WASM_VECTOR_LEN;
2564
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2565
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2566
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2567
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2568
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2569
+ if (r3) {
2570
+ throw takeObject(r2);
2571
+ }
2572
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2573
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2574
+ return v3;
395
2575
  } finally {
396
2576
  wasm.__wbindgen_add_to_stack_pointer(16);
397
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
398
2577
  }
399
2578
  }
400
2579
  /**
2580
+ * Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
2581
+ * key,
2582
+ * @param {Uint8Array} decapsulation_key
2583
+ * @param {Uint8Array} wrapping_key
401
2584
  * @returns {string}
402
2585
  */
403
- version() {
404
- let deferred1_0;
405
- let deferred1_1;
2586
+ static wrap_decapsulation_key(decapsulation_key, wrapping_key) {
2587
+ let deferred4_0;
2588
+ let deferred4_1;
406
2589
  try {
407
2590
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
2591
+ const ptr0 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2592
+ const len0 = WASM_VECTOR_LEN;
2593
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2594
+ const len1 = WASM_VECTOR_LEN;
2595
+ wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
409
2596
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
410
2597
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
411
- deferred1_0 = r0;
412
- deferred1_1 = r1;
413
- return getStringFromWasm0(r0, r1);
2598
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2599
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2600
+ var ptr3 = r0;
2601
+ var len3 = r1;
2602
+ if (r3) {
2603
+ ptr3 = 0;
2604
+ len3 = 0;
2605
+ throw takeObject(r2);
2606
+ }
2607
+ deferred4_0 = ptr3;
2608
+ deferred4_1 = len3;
2609
+ return getStringFromWasm0(ptr3, len3);
414
2610
  } finally {
415
2611
  wasm.__wbindgen_add_to_stack_pointer(16);
416
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2612
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
417
2613
  }
418
2614
  }
419
2615
  /**
420
- * @param {string} msg
421
- * @returns {Promise<void>}
2616
+ * Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
2617
+ * wrapping key.
2618
+ * @param {string} wrapped_key
2619
+ * @param {Uint8Array} wrapping_key
2620
+ * @returns {Uint8Array}
422
2621
  */
423
- throw(msg) {
424
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
425
- const len0 = WASM_VECTOR_LEN;
426
- const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
427
- return takeObject(ret);
2622
+ static unwrap_decapsulation_key(wrapped_key, wrapping_key) {
2623
+ try {
2624
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2625
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2626
+ const len0 = WASM_VECTOR_LEN;
2627
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2628
+ const len1 = WASM_VECTOR_LEN;
2629
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2630
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2631
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2632
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2633
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2634
+ if (r3) {
2635
+ throw takeObject(r2);
2636
+ }
2637
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2638
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2639
+ return v3;
2640
+ } finally {
2641
+ wasm.__wbindgen_add_to_stack_pointer(16);
2642
+ }
428
2643
  }
429
2644
  /**
430
- * Test method, calls http endpoint
431
- * @param {string} url
432
- * @returns {Promise<string>}
2645
+ * Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
2646
+ * in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
2647
+ * the sender's authenticity cannot be verified by the recipient.
2648
+ * @param {Uint8Array} shared_key
2649
+ * @param {Uint8Array} encapsulation_key
2650
+ * @returns {string}
433
2651
  */
434
- http_get(url) {
435
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
436
- const len0 = WASM_VECTOR_LEN;
437
- const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
2652
+ static encapsulate_key_unsigned(shared_key, encapsulation_key) {
2653
+ let deferred4_0;
2654
+ let deferred4_1;
2655
+ try {
2656
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2657
+ const ptr0 = passArray8ToWasm0(shared_key, wasm.__wbindgen_malloc);
2658
+ const len0 = WASM_VECTOR_LEN;
2659
+ const ptr1 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
2660
+ const len1 = WASM_VECTOR_LEN;
2661
+ wasm.purecrypto_encapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
2662
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2663
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2664
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2665
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2666
+ var ptr3 = r0;
2667
+ var len3 = r1;
2668
+ if (r3) {
2669
+ ptr3 = 0;
2670
+ len3 = 0;
2671
+ throw takeObject(r2);
2672
+ }
2673
+ deferred4_0 = ptr3;
2674
+ deferred4_1 = len3;
2675
+ return getStringFromWasm0(ptr3, len3);
2676
+ } finally {
2677
+ wasm.__wbindgen_add_to_stack_pointer(16);
2678
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2679
+ }
2680
+ }
2681
+ /**
2682
+ * Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
2683
+ * DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
2684
+ * recipient.
2685
+ * @param {string} encapsulated_key
2686
+ * @param {Uint8Array} decapsulation_key
2687
+ * @returns {Uint8Array}
2688
+ */
2689
+ static decapsulate_key_unsigned(encapsulated_key, decapsulation_key) {
2690
+ try {
2691
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2692
+ const ptr0 = passStringToWasm0(
2693
+ encapsulated_key,
2694
+ wasm.__wbindgen_malloc,
2695
+ wasm.__wbindgen_realloc,
2696
+ );
2697
+ const len0 = WASM_VECTOR_LEN;
2698
+ const ptr1 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2699
+ const len1 = WASM_VECTOR_LEN;
2700
+ wasm.purecrypto_decapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
2701
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2702
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2703
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2704
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2705
+ if (r3) {
2706
+ throw takeObject(r2);
2707
+ }
2708
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2709
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2710
+ return v3;
2711
+ } finally {
2712
+ wasm.__wbindgen_add_to_stack_pointer(16);
2713
+ }
2714
+ }
2715
+ }
2716
+ module.exports.PureCrypto = PureCrypto;
2717
+
2718
+ const ReceiveErrorFinalization =
2719
+ typeof FinalizationRegistry === "undefined"
2720
+ ? { register: () => {}, unregister: () => {} }
2721
+ : new FinalizationRegistry((ptr) => wasm.__wbg_receiveerror_free(ptr >>> 0, 1));
2722
+
2723
+ class ReceiveError {
2724
+ static __wrap(ptr) {
2725
+ ptr = ptr >>> 0;
2726
+ const obj = Object.create(ReceiveError.prototype);
2727
+ obj.__wbg_ptr = ptr;
2728
+ ReceiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2729
+ return obj;
2730
+ }
2731
+
2732
+ __destroy_into_raw() {
2733
+ const ptr = this.__wbg_ptr;
2734
+ this.__wbg_ptr = 0;
2735
+ ReceiveErrorFinalization.unregister(this);
2736
+ return ptr;
2737
+ }
2738
+
2739
+ free() {
2740
+ const ptr = this.__destroy_into_raw();
2741
+ wasm.__wbg_receiveerror_free(ptr, 0);
2742
+ }
2743
+ /**
2744
+ * @returns {boolean}
2745
+ */
2746
+ get timeout() {
2747
+ const ret = wasm.__wbg_get_receiveerror_timeout(this.__wbg_ptr);
2748
+ return ret !== 0;
2749
+ }
2750
+ /**
2751
+ * @param {boolean} arg0
2752
+ */
2753
+ set timeout(arg0) {
2754
+ wasm.__wbg_set_receiveerror_timeout(this.__wbg_ptr, arg0);
2755
+ }
2756
+ /**
2757
+ * @returns {any}
2758
+ */
2759
+ get crypto() {
2760
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
438
2761
  return takeObject(ret);
439
2762
  }
440
2763
  /**
441
- * @returns {ClientCrypto}
2764
+ * @param {any} arg0
442
2765
  */
443
- crypto() {
444
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
445
- return ClientCrypto.__wrap(ret);
2766
+ set crypto(arg0) {
2767
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
446
2768
  }
447
2769
  /**
448
- * @returns {ClientVault}
2770
+ * @returns {any}
449
2771
  */
450
- vault() {
451
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
452
- return ClientVault.__wrap(ret);
2772
+ get communication() {
2773
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
2774
+ return takeObject(ret);
2775
+ }
2776
+ /**
2777
+ * @param {any} arg0
2778
+ */
2779
+ set communication(arg0) {
2780
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
453
2781
  }
454
2782
  }
455
- module.exports.BitwardenClient = BitwardenClient;
2783
+ module.exports.ReceiveError = ReceiveError;
456
2784
 
457
- const ClientCryptoFinalization =
2785
+ const SendErrorFinalization =
458
2786
  typeof FinalizationRegistry === "undefined"
459
2787
  ? { register: () => {}, unregister: () => {} }
460
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
2788
+ : new FinalizationRegistry((ptr) => wasm.__wbg_senderror_free(ptr >>> 0, 1));
461
2789
 
462
- class ClientCrypto {
2790
+ class SendError {
463
2791
  static __wrap(ptr) {
464
2792
  ptr = ptr >>> 0;
465
- const obj = Object.create(ClientCrypto.prototype);
2793
+ const obj = Object.create(SendError.prototype);
466
2794
  obj.__wbg_ptr = ptr;
467
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
2795
+ SendErrorFinalization.register(obj, obj.__wbg_ptr, obj);
468
2796
  return obj;
469
2797
  }
470
2798
 
471
2799
  __destroy_into_raw() {
472
2800
  const ptr = this.__wbg_ptr;
473
2801
  this.__wbg_ptr = 0;
474
- ClientCryptoFinalization.unregister(this);
2802
+ SendErrorFinalization.unregister(this);
475
2803
  return ptr;
476
2804
  }
477
2805
 
478
2806
  free() {
479
2807
  const ptr = this.__destroy_into_raw();
480
- wasm.__wbg_clientcrypto_free(ptr, 0);
2808
+ wasm.__wbg_senderror_free(ptr, 0);
481
2809
  }
482
2810
  /**
483
- * Initialization method for the user crypto. Needs to be called before any other crypto
484
- * operations.
485
- * @param {InitUserCryptoRequest} req
486
- * @returns {Promise<void>}
2811
+ * @returns {any}
487
2812
  */
488
- initialize_user_crypto(req) {
489
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
2813
+ get crypto() {
2814
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
490
2815
  return takeObject(ret);
491
2816
  }
492
2817
  /**
493
- * Initialization method for the organization crypto. Needs to be called after
494
- * `initialize_user_crypto` but before any other crypto operations.
495
- * @param {InitOrgCryptoRequest} req
496
- * @returns {Promise<void>}
2818
+ * @param {any} arg0
497
2819
  */
498
- initialize_org_crypto(req) {
499
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
2820
+ set crypto(arg0) {
2821
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
2822
+ }
2823
+ /**
2824
+ * @returns {any}
2825
+ */
2826
+ get communication() {
2827
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
500
2828
  return takeObject(ret);
501
2829
  }
2830
+ /**
2831
+ * @param {any} arg0
2832
+ */
2833
+ set communication(arg0) {
2834
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
2835
+ }
502
2836
  }
503
- module.exports.ClientCrypto = ClientCrypto;
2837
+ module.exports.SendError = SendError;
504
2838
 
505
- const ClientFoldersFinalization =
2839
+ const TotpClientFinalization =
506
2840
  typeof FinalizationRegistry === "undefined"
507
2841
  ? { register: () => {}, unregister: () => {} }
508
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
2842
+ : new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
509
2843
 
510
- class ClientFolders {
2844
+ class TotpClient {
511
2845
  static __wrap(ptr) {
512
2846
  ptr = ptr >>> 0;
513
- const obj = Object.create(ClientFolders.prototype);
2847
+ const obj = Object.create(TotpClient.prototype);
514
2848
  obj.__wbg_ptr = ptr;
515
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
2849
+ TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
516
2850
  return obj;
517
2851
  }
518
2852
 
519
2853
  __destroy_into_raw() {
520
2854
  const ptr = this.__wbg_ptr;
521
2855
  this.__wbg_ptr = 0;
522
- ClientFoldersFinalization.unregister(this);
2856
+ TotpClientFinalization.unregister(this);
523
2857
  return ptr;
524
2858
  }
525
2859
 
526
2860
  free() {
527
2861
  const ptr = this.__destroy_into_raw();
528
- wasm.__wbg_clientfolders_free(ptr, 0);
2862
+ wasm.__wbg_totpclient_free(ptr, 0);
529
2863
  }
530
2864
  /**
531
- * Decrypt folder
532
- * @param {Folder} folder
533
- * @returns {FolderView}
2865
+ * Generates a TOTP code from a provided key
2866
+ *
2867
+ * # Arguments
2868
+ * - `key` - Can be:
2869
+ * - A base32 encoded string
2870
+ * - OTP Auth URI
2871
+ * - Steam URI
2872
+ * - `time_ms` - Optional timestamp in milliseconds
2873
+ *
2874
+ * # Returns
2875
+ * - `Ok(TotpResponse)` containing the generated code and period
2876
+ * - `Err(TotpError)` if code generation fails
2877
+ * @param {string} key
2878
+ * @param {number | null} [time_ms]
2879
+ * @returns {TotpResponse}
534
2880
  */
535
- decrypt(folder) {
2881
+ generate_totp(key, time_ms) {
536
2882
  try {
537
2883
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
2884
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2885
+ const len0 = WASM_VECTOR_LEN;
2886
+ wasm.totpclient_generate_totp(
2887
+ retptr,
2888
+ this.__wbg_ptr,
2889
+ ptr0,
2890
+ len0,
2891
+ !isLikeNone(time_ms),
2892
+ isLikeNone(time_ms) ? 0 : time_ms,
2893
+ );
539
2894
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
540
2895
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
541
2896
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -548,214 +2903,247 @@ class ClientFolders {
548
2903
  }
549
2904
  }
550
2905
  }
551
- module.exports.ClientFolders = ClientFolders;
2906
+ module.exports.TotpClient = TotpClient;
552
2907
 
553
- const ClientVaultFinalization =
2908
+ const VaultClientFinalization =
554
2909
  typeof FinalizationRegistry === "undefined"
555
2910
  ? { register: () => {}, unregister: () => {} }
556
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
2911
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
557
2912
 
558
- class ClientVault {
2913
+ class VaultClient {
559
2914
  static __wrap(ptr) {
560
2915
  ptr = ptr >>> 0;
561
- const obj = Object.create(ClientVault.prototype);
2916
+ const obj = Object.create(VaultClient.prototype);
562
2917
  obj.__wbg_ptr = ptr;
563
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
2918
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
564
2919
  return obj;
565
2920
  }
566
2921
 
567
2922
  __destroy_into_raw() {
568
2923
  const ptr = this.__wbg_ptr;
569
2924
  this.__wbg_ptr = 0;
570
- ClientVaultFinalization.unregister(this);
2925
+ VaultClientFinalization.unregister(this);
571
2926
  return ptr;
572
2927
  }
573
2928
 
574
2929
  free() {
575
2930
  const ptr = this.__destroy_into_raw();
576
- wasm.__wbg_clientvault_free(ptr, 0);
2931
+ wasm.__wbg_vaultclient_free(ptr, 0);
2932
+ }
2933
+ /**
2934
+ * @returns {AttachmentsClient}
2935
+ */
2936
+ attachments() {
2937
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2938
+ return AttachmentsClient.__wrap(ret);
2939
+ }
2940
+ /**
2941
+ * @returns {CiphersClient}
2942
+ */
2943
+ ciphers() {
2944
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2945
+ return CiphersClient.__wrap(ret);
577
2946
  }
578
2947
  /**
579
- * @returns {ClientFolders}
2948
+ * @returns {FoldersClient}
580
2949
  */
581
2950
  folders() {
582
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
583
- return ClientFolders.__wrap(ret);
2951
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2952
+ return FoldersClient.__wrap(ret);
2953
+ }
2954
+ /**
2955
+ * @returns {TotpClient}
2956
+ */
2957
+ totp() {
2958
+ const ret = wasm.vaultclient_totp(this.__wbg_ptr);
2959
+ return TotpClient.__wrap(ret);
584
2960
  }
585
2961
  }
586
- module.exports.ClientVault = ClientVault;
587
-
588
- module.exports.__wbindgen_string_new = function (arg0, arg1) {
589
- const ret = getStringFromWasm0(arg0, arg1);
590
- return addHeapObject(ret);
591
- };
2962
+ module.exports.VaultClient = VaultClient;
592
2963
 
593
- module.exports.__wbg_get_ef828680c64da212 = function () {
594
- return handleError(function (arg0, arg1) {
595
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
596
- return addHeapObject(ret);
597
- }, arguments);
2964
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
2965
+ const ret = String(getObject(arg1));
2966
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2967
+ const len1 = WASM_VECTOR_LEN;
2968
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2969
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
598
2970
  };
599
2971
 
600
- module.exports.__wbindgen_object_drop_ref = function (arg0) {
601
- takeObject(arg0);
2972
+ module.exports.__wbg_abort_410ec47a64ac6117 = function (arg0, arg1) {
2973
+ getObject(arg0).abort(getObject(arg1));
602
2974
  };
603
2975
 
604
- module.exports.__wbindgen_string_get = function (arg0, arg1) {
605
- const obj = getObject(arg1);
606
- const ret = typeof obj === "string" ? obj : undefined;
607
- var ptr1 = isLikeNone(ret)
608
- ? 0
609
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
610
- var len1 = WASM_VECTOR_LEN;
611
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
612
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2976
+ module.exports.__wbg_abort_775ef1d17fc65868 = function (arg0) {
2977
+ getObject(arg0).abort();
613
2978
  };
614
2979
 
615
- module.exports.__wbg_new_fe19e4f3db5c3999 = function (arg0, arg1) {
616
- let deferred0_0;
617
- let deferred0_1;
618
- try {
619
- deferred0_0 = arg0;
620
- deferred0_1 = arg1;
621
- const ret = new Error(getStringFromWasm0(arg0, arg1));
622
- return addHeapObject(ret);
623
- } finally {
624
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
625
- }
2980
+ module.exports.__wbg_append_299d5d48292c0495 = function () {
2981
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2982
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2983
+ }, arguments);
626
2984
  };
627
2985
 
628
- module.exports.__wbg_setname_46d623c31ae39910 = function (arg0, arg1, arg2) {
629
- let deferred0_0;
630
- let deferred0_1;
631
- try {
632
- deferred0_0 = arg1;
633
- deferred0_1 = arg2;
634
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
635
- } finally {
636
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
637
- }
2986
+ module.exports.__wbg_append_8c7dd8d641a5f01b = function () {
2987
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2988
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2989
+ }, arguments);
638
2990
  };
639
2991
 
640
- module.exports.__wbg_setvariant_262a12673324f71b = function (arg0, arg1, arg2) {
641
- let deferred0_0;
642
- let deferred0_1;
643
- try {
644
- deferred0_0 = arg1;
645
- deferred0_1 = arg2;
646
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
647
- } finally {
648
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
649
- }
2992
+ module.exports.__wbg_append_b2d1fc16de2a0e81 = function () {
2993
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
2994
+ getObject(arg0).append(
2995
+ getStringFromWasm0(arg1, arg2),
2996
+ getObject(arg3),
2997
+ getStringFromWasm0(arg4, arg5),
2998
+ );
2999
+ }, arguments);
650
3000
  };
651
3001
 
652
- module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
653
- const ret = getObject(arg0) == getObject(arg1);
654
- return ret;
3002
+ module.exports.__wbg_append_b44785ebeb668479 = function () {
3003
+ return handleError(function (arg0, arg1, arg2, arg3) {
3004
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
3005
+ }, arguments);
655
3006
  };
656
3007
 
657
- module.exports.__wbindgen_is_object = function (arg0) {
658
- const val = getObject(arg0);
659
- const ret = typeof val === "object" && val !== null;
660
- return ret;
3008
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
3009
+ const ret = getObject(arg0).buffer;
3010
+ return addHeapObject(ret);
661
3011
  };
662
3012
 
663
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
664
- const ret = getObject(arg0)[getObject(arg1)];
665
- return addHeapObject(ret);
3013
+ module.exports.__wbg_call_672a4d21634d4a24 = function () {
3014
+ return handleError(function (arg0, arg1) {
3015
+ const ret = getObject(arg0).call(getObject(arg1));
3016
+ return addHeapObject(ret);
3017
+ }, arguments);
666
3018
  };
667
3019
 
668
- module.exports.__wbindgen_is_undefined = function (arg0) {
669
- const ret = getObject(arg0) === undefined;
670
- return ret;
3020
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
3021
+ return handleError(function (arg0, arg1, arg2) {
3022
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
3023
+ return addHeapObject(ret);
3024
+ }, arguments);
671
3025
  };
672
3026
 
673
- module.exports.__wbindgen_in = function (arg0, arg1) {
674
- const ret = getObject(arg0) in getObject(arg1);
675
- return ret;
3027
+ module.exports.__wbg_clearTimeout_86721db0036bea98 = function (arg0) {
3028
+ const ret = clearTimeout(takeObject(arg0));
3029
+ return addHeapObject(ret);
676
3030
  };
677
3031
 
678
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function (arg0) {
679
- const ret = Number.isSafeInteger(getObject(arg0));
680
- return ret;
3032
+ module.exports.__wbg_crypto_574e78ad8b13b65f = function (arg0) {
3033
+ const ret = getObject(arg0).crypto;
3034
+ return addHeapObject(ret);
681
3035
  };
682
3036
 
683
- module.exports.__wbindgen_as_number = function (arg0) {
684
- const ret = +getObject(arg0);
685
- return ret;
3037
+ module.exports.__wbg_debug_e17b51583ca6a632 = function (arg0, arg1, arg2, arg3) {
3038
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
686
3039
  };
687
3040
 
688
- module.exports.__wbindgen_is_string = function (arg0) {
689
- const ret = typeof getObject(arg0) === "string";
3041
+ module.exports.__wbg_done_769e5ede4b31c67b = function (arg0) {
3042
+ const ret = getObject(arg0).done;
690
3043
  return ret;
691
3044
  };
692
3045
 
693
- module.exports.__wbg_entries_c02034de337d3ee2 = function (arg0) {
3046
+ module.exports.__wbg_entries_3265d4158b33e5dc = function (arg0) {
694
3047
  const ret = Object.entries(getObject(arg0));
695
3048
  return addHeapObject(ret);
696
3049
  };
697
3050
 
698
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function (arg0) {
699
- const ret = getObject(arg0).length;
700
- return ret;
3051
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
3052
+ let deferred0_0;
3053
+ let deferred0_1;
3054
+ try {
3055
+ deferred0_0 = arg0;
3056
+ deferred0_1 = arg1;
3057
+ console.error(getStringFromWasm0(arg0, arg1));
3058
+ } finally {
3059
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3060
+ }
701
3061
  };
702
3062
 
703
- module.exports.__wbg_get_5419cf6b954aa11d = function (arg0, arg1) {
704
- const ret = getObject(arg0)[arg1 >>> 0];
3063
+ module.exports.__wbg_error_80de38b3f7cc3c3c = function (arg0, arg1, arg2, arg3) {
3064
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3065
+ };
3066
+
3067
+ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
3068
+ const ret = getObject(arg0).fetch(getObject(arg1));
705
3069
  return addHeapObject(ret);
706
3070
  };
707
3071
 
708
- module.exports.__wbg_new_e69b5f66fda8f13c = function () {
709
- const ret = new Object();
3072
+ module.exports.__wbg_fetch_d36a73832f0a45e8 = function (arg0) {
3073
+ const ret = fetch(getObject(arg0));
710
3074
  return addHeapObject(ret);
711
3075
  };
712
3076
 
713
- module.exports.__wbg_setmethod_ce2da76000b02f6a = function (arg0, arg1, arg2) {
714
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
3077
+ module.exports.__wbg_getRandomValues_3d90134a348e46b3 = function () {
3078
+ return handleError(function (arg0, arg1) {
3079
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
3080
+ }, arguments);
715
3081
  };
716
3082
 
717
- module.exports.__wbg_new_a9ae04a5200606a5 = function () {
718
- return handleError(function () {
719
- const ret = new Headers();
3083
+ module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function () {
3084
+ return handleError(function (arg0, arg1) {
3085
+ getObject(arg0).getRandomValues(getObject(arg1));
3086
+ }, arguments);
3087
+ };
3088
+
3089
+ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
3090
+ const ret = getObject(arg0).getTime();
3091
+ return ret;
3092
+ };
3093
+
3094
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
3095
+ return handleError(function (arg0, arg1) {
3096
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
720
3097
  return addHeapObject(ret);
721
3098
  }, arguments);
722
3099
  };
723
3100
 
724
- module.exports.__wbg_setheaders_f5205d36e423a544 = function (arg0, arg1) {
725
- getObject(arg0).headers = getObject(arg1);
3101
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
3102
+ const ret = getObject(arg0)[arg1 >>> 0];
3103
+ return addHeapObject(ret);
726
3104
  };
727
3105
 
728
- module.exports.__wbg_setmode_4919fd636102c586 = function (arg0, arg1) {
729
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
3106
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
3107
+ const ret = getObject(arg0)[getObject(arg1)];
3108
+ return addHeapObject(ret);
730
3109
  };
731
3110
 
732
- module.exports.__wbg_setcredentials_a4e661320cdb9738 = function (arg0, arg1) {
733
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
3111
+ module.exports.__wbg_has_a5ea9117f258a0ec = function () {
3112
+ return handleError(function (arg0, arg1) {
3113
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
3114
+ return ret;
3115
+ }, arguments);
734
3116
  };
735
3117
 
736
- module.exports.__wbg_setbody_aa8b691bec428bf4 = function (arg0, arg1) {
737
- getObject(arg0).body = getObject(arg1);
3118
+ module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
3119
+ const ret = getObject(arg0).headers;
3120
+ return addHeapObject(ret);
738
3121
  };
739
3122
 
740
- module.exports.__wbg_signal_9acfcec9e7dffc22 = function (arg0) {
741
- const ret = getObject(arg0).signal;
3123
+ module.exports.__wbg_incomingmessage_new = function (arg0) {
3124
+ const ret = IncomingMessage.__wrap(arg0);
742
3125
  return addHeapObject(ret);
743
3126
  };
744
3127
 
745
- module.exports.__wbg_setsignal_812ccb8269a7fd90 = function (arg0, arg1) {
746
- getObject(arg0).signal = getObject(arg1);
3128
+ module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
3129
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
747
3130
  };
748
3131
 
749
- module.exports.__wbg_append_8b3e7f74a47ea7d5 = function () {
750
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
751
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
752
- }, arguments);
3132
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
3133
+ let result;
3134
+ try {
3135
+ result = getObject(arg0) instanceof ArrayBuffer;
3136
+ } catch (_) {
3137
+ result = false;
3138
+ }
3139
+ const ret = result;
3140
+ return ret;
753
3141
  };
754
3142
 
755
- module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
3143
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function (arg0) {
756
3144
  let result;
757
3145
  try {
758
- result = getObject(arg0) instanceof Response;
3146
+ result = getObject(arg0) instanceof Map;
759
3147
  } catch (_) {
760
3148
  result = false;
761
3149
  }
@@ -763,94 +3151,87 @@ module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
763
3151
  return ret;
764
3152
  };
765
3153
 
766
- module.exports.__wbg_status_5f4e900d22140a18 = function (arg0) {
767
- const ret = getObject(arg0).status;
3154
+ module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
3155
+ let result;
3156
+ try {
3157
+ result = getObject(arg0) instanceof Response;
3158
+ } catch (_) {
3159
+ result = false;
3160
+ }
3161
+ const ret = result;
768
3162
  return ret;
769
3163
  };
770
3164
 
771
- module.exports.__wbg_url_58af972663531d16 = function (arg0, arg1) {
772
- const ret = getObject(arg1).url;
773
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
- const len1 = WASM_VECTOR_LEN;
775
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
776
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3165
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
3166
+ let result;
3167
+ try {
3168
+ result = getObject(arg0) instanceof Uint8Array;
3169
+ } catch (_) {
3170
+ result = false;
3171
+ }
3172
+ const ret = result;
3173
+ return ret;
777
3174
  };
778
3175
 
779
- module.exports.__wbg_headers_1b9bf90c73fae600 = function (arg0) {
780
- const ret = getObject(arg0).headers;
3176
+ module.exports.__wbg_ipcclientsubscription_new = function (arg0) {
3177
+ const ret = IpcClientSubscription.__wrap(arg0);
781
3178
  return addHeapObject(ret);
782
3179
  };
783
3180
 
784
- module.exports.__wbg_next_b06e115d1b01e10b = function () {
785
- return handleError(function (arg0) {
786
- const ret = getObject(arg0).next();
787
- return addHeapObject(ret);
788
- }, arguments);
3181
+ module.exports.__wbg_isArray_a1eab7e0d067391b = function (arg0) {
3182
+ const ret = Array.isArray(getObject(arg0));
3183
+ return ret;
789
3184
  };
790
3185
 
791
- module.exports.__wbg_done_983b5ffcaec8c583 = function (arg0) {
792
- const ret = getObject(arg0).done;
3186
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
3187
+ const ret = Number.isSafeInteger(getObject(arg0));
793
3188
  return ret;
794
3189
  };
795
3190
 
796
- module.exports.__wbg_value_2ab8a198c834c26a = function (arg0) {
797
- const ret = getObject(arg0).value;
3191
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function () {
3192
+ const ret = Symbol.iterator;
798
3193
  return addHeapObject(ret);
799
3194
  };
800
3195
 
801
- module.exports.__wbg_stringify_eead5648c09faaf8 = function () {
802
- return handleError(function (arg0) {
803
- const ret = JSON.stringify(getObject(arg0));
804
- return addHeapObject(ret);
805
- }, arguments);
806
- };
807
-
808
- module.exports.__wbg_abort_c57daab47a6c1215 = function (arg0) {
809
- getObject(arg0).abort();
3196
+ module.exports.__wbg_length_a446193dc22c12f8 = function (arg0) {
3197
+ const ret = getObject(arg0).length;
3198
+ return ret;
810
3199
  };
811
3200
 
812
- module.exports.__wbg_text_ebeee8b31af4c919 = function () {
813
- return handleError(function (arg0) {
814
- const ret = getObject(arg0).text();
815
- return addHeapObject(ret);
816
- }, arguments);
3201
+ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
3202
+ const ret = getObject(arg0).length;
3203
+ return ret;
817
3204
  };
818
3205
 
819
- module.exports.__wbg_call_3bfa248576352471 = function () {
820
- return handleError(function (arg0, arg1, arg2) {
821
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
822
- return addHeapObject(ret);
823
- }, arguments);
3206
+ module.exports.__wbg_log_cad59bb680daec67 = function (arg0, arg1, arg2, arg3) {
3207
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
824
3208
  };
825
3209
 
826
- module.exports.__wbindgen_object_clone_ref = function (arg0) {
827
- const ret = getObject(arg0);
3210
+ module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function (arg0) {
3211
+ const ret = getObject(arg0).msCrypto;
828
3212
  return addHeapObject(ret);
829
3213
  };
830
3214
 
831
- module.exports.__wbindgen_cb_drop = function (arg0) {
832
- const obj = takeObject(arg0).original;
833
- if (obj.cnt-- == 1) {
834
- obj.a = 0;
835
- return true;
836
- }
837
- const ret = false;
838
- return ret;
3215
+ module.exports.__wbg_new0_f788a2397c7ca929 = function () {
3216
+ const ret = new Date();
3217
+ return addHeapObject(ret);
839
3218
  };
840
3219
 
841
- module.exports.__wbindgen_error_new = function (arg0, arg1) {
842
- const ret = new Error(getStringFromWasm0(arg0, arg1));
843
- return addHeapObject(ret);
3220
+ module.exports.__wbg_new_018dcc2d6c8c2f6a = function () {
3221
+ return handleError(function () {
3222
+ const ret = new Headers();
3223
+ return addHeapObject(ret);
3224
+ }, arguments);
844
3225
  };
845
3226
 
846
- module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
3227
+ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
847
3228
  try {
848
3229
  var state0 = { a: arg0, b: arg1 };
849
3230
  var cb0 = (arg0, arg1) => {
850
3231
  const a = state0.a;
851
3232
  state0.a = 0;
852
3233
  try {
853
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
3234
+ return __wbg_adapter_256(a, state0.b, arg0, arg1);
854
3235
  } finally {
855
3236
  state0.a = a;
856
3237
  }
@@ -862,287 +3243,343 @@ module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
862
3243
  }
863
3244
  };
864
3245
 
865
- module.exports.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
866
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3246
+ module.exports.__wbg_new_405e22f390576ce2 = function () {
3247
+ const ret = new Object();
3248
+ return addHeapObject(ret);
3249
+ };
3250
+
3251
+ module.exports.__wbg_new_78feb108b6472713 = function () {
3252
+ const ret = new Array();
3253
+ return addHeapObject(ret);
867
3254
  };
868
3255
 
869
- module.exports.__wbg_new_abda76e883ba8a5f = function () {
3256
+ module.exports.__wbg_new_8a6f238a6ece86ea = function () {
870
3257
  const ret = new Error();
871
3258
  return addHeapObject(ret);
872
3259
  };
873
3260
 
874
- module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
875
- const ret = getObject(arg1).stack;
876
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
877
- const len1 = WASM_VECTOR_LEN;
878
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
879
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3261
+ module.exports.__wbg_new_9fd39a253424609a = function () {
3262
+ return handleError(function () {
3263
+ const ret = new FormData();
3264
+ return addHeapObject(ret);
3265
+ }, arguments);
3266
+ };
3267
+
3268
+ module.exports.__wbg_new_a12002a7f91c75be = function (arg0) {
3269
+ const ret = new Uint8Array(getObject(arg0));
3270
+ return addHeapObject(ret);
3271
+ };
3272
+
3273
+ module.exports.__wbg_new_c68d7209be747379 = function (arg0, arg1) {
3274
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3275
+ return addHeapObject(ret);
880
3276
  };
881
3277
 
882
- module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
3278
+ module.exports.__wbg_new_e25e5aab09ff45db = function () {
3279
+ return handleError(function () {
3280
+ const ret = new AbortController();
3281
+ return addHeapObject(ret);
3282
+ }, arguments);
3283
+ };
3284
+
3285
+ module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
883
3286
  let deferred0_0;
884
3287
  let deferred0_1;
885
3288
  try {
886
3289
  deferred0_0 = arg0;
887
3290
  deferred0_1 = arg1;
888
- console.error(getStringFromWasm0(arg0, arg1));
3291
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3292
+ return addHeapObject(ret);
889
3293
  } finally {
890
3294
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
891
3295
  }
892
3296
  };
893
3297
 
894
- module.exports.__wbg_crypto_1d1f22824a6a080c = function (arg0) {
895
- const ret = getObject(arg0).crypto;
3298
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) {
3299
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
896
3300
  return addHeapObject(ret);
897
3301
  };
898
3302
 
899
- module.exports.__wbg_process_4a72847cc503995b = function (arg0) {
900
- const ret = getObject(arg0).process;
3303
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
3304
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
901
3305
  return addHeapObject(ret);
902
3306
  };
903
3307
 
904
- module.exports.__wbg_versions_f686565e586dd935 = function (arg0) {
905
- const ret = getObject(arg0).versions;
3308
+ module.exports.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
3309
+ const ret = new Uint8Array(arg0 >>> 0);
3310
+ return addHeapObject(ret);
3311
+ };
3312
+
3313
+ module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function () {
3314
+ return handleError(function (arg0, arg1, arg2) {
3315
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
3316
+ return addHeapObject(ret);
3317
+ }, arguments);
3318
+ };
3319
+
3320
+ module.exports.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function () {
3321
+ return handleError(function (arg0, arg1) {
3322
+ const ret = new Blob(getObject(arg0), getObject(arg1));
3323
+ return addHeapObject(ret);
3324
+ }, arguments);
3325
+ };
3326
+
3327
+ module.exports.__wbg_next_25feadfc0913fea9 = function (arg0) {
3328
+ const ret = getObject(arg0).next;
906
3329
  return addHeapObject(ret);
907
3330
  };
908
3331
 
909
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function (arg0) {
3332
+ module.exports.__wbg_next_6574e1a8a62d1055 = function () {
3333
+ return handleError(function (arg0) {
3334
+ const ret = getObject(arg0).next();
3335
+ return addHeapObject(ret);
3336
+ }, arguments);
3337
+ };
3338
+
3339
+ module.exports.__wbg_node_905d3e251edff8a2 = function (arg0) {
910
3340
  const ret = getObject(arg0).node;
911
3341
  return addHeapObject(ret);
912
3342
  };
913
3343
 
914
- module.exports.__wbg_require_cca90b1a94a0255b = function () {
915
- return handleError(function () {
916
- const ret = module.require;
3344
+ module.exports.__wbg_parse_def2e24ef1252aff = function () {
3345
+ return handleError(function (arg0, arg1) {
3346
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
917
3347
  return addHeapObject(ret);
918
3348
  }, arguments);
919
3349
  };
920
3350
 
921
- module.exports.__wbindgen_is_function = function (arg0) {
922
- const ret = typeof getObject(arg0) === "function";
3351
+ module.exports.__wbg_process_dc0fbacc7c1c06f7 = function (arg0) {
3352
+ const ret = getObject(arg0).process;
3353
+ return addHeapObject(ret);
3354
+ };
3355
+
3356
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function (arg0, arg1) {
3357
+ const ret = getObject(arg0).push(getObject(arg1));
923
3358
  return ret;
924
3359
  };
925
3360
 
926
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function (arg0) {
927
- const ret = getObject(arg0).msCrypto;
928
- return addHeapObject(ret);
3361
+ module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function (arg0) {
3362
+ queueMicrotask(getObject(arg0));
929
3363
  };
930
3364
 
931
- module.exports.__wbg_newwithlength_76462a666eca145f = function (arg0) {
932
- const ret = new Uint8Array(arg0 >>> 0);
3365
+ module.exports.__wbg_queueMicrotask_d3219def82552485 = function (arg0) {
3366
+ const ret = getObject(arg0).queueMicrotask;
933
3367
  return addHeapObject(ret);
934
3368
  };
935
3369
 
936
- module.exports.__wbindgen_memory = function () {
937
- const ret = wasm.memory;
938
- return addHeapObject(ret);
3370
+ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
3371
+ return handleError(function (arg0, arg1) {
3372
+ getObject(arg0).randomFillSync(takeObject(arg1));
3373
+ }, arguments);
939
3374
  };
940
3375
 
941
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
942
- const ret = getObject(arg0).buffer;
3376
+ module.exports.__wbg_receiveerror_new = function (arg0) {
3377
+ const ret = ReceiveError.__wrap(arg0);
943
3378
  return addHeapObject(ret);
944
3379
  };
945
3380
 
946
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (arg0, arg1, arg2) {
947
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
3381
+ module.exports.__wbg_require_60cc747a6bc5215a = function () {
3382
+ return handleError(function () {
3383
+ const ret = module.require;
3384
+ return addHeapObject(ret);
3385
+ }, arguments);
3386
+ };
3387
+
3388
+ module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
3389
+ const ret = Promise.resolve(getObject(arg0));
948
3390
  return addHeapObject(ret);
949
3391
  };
950
3392
 
951
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function () {
3393
+ module.exports.__wbg_send_9b8fc6bb517867dd = function () {
952
3394
  return handleError(function (arg0, arg1) {
953
- getObject(arg0).randomFillSync(takeObject(arg1));
3395
+ const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
3396
+ return addHeapObject(ret);
954
3397
  }, arguments);
955
3398
  };
956
3399
 
957
- module.exports.__wbg_subarray_975a06f9dbd16995 = function (arg0, arg1, arg2) {
958
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3400
+ module.exports.__wbg_senderror_new = function (arg0) {
3401
+ const ret = SendError.__wrap(arg0);
959
3402
  return addHeapObject(ret);
960
3403
  };
961
3404
 
962
- module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function () {
963
- return handleError(function (arg0, arg1) {
964
- getObject(arg0).getRandomValues(getObject(arg1));
965
- }, arguments);
966
- };
967
-
968
- module.exports.__wbg_new_fec2611eb9180f95 = function (arg0) {
969
- const ret = new Uint8Array(getObject(arg0));
3405
+ module.exports.__wbg_setTimeout_2e707715f8cc9497 = function (arg0, arg1) {
3406
+ const ret = setTimeout(getObject(arg0), arg1);
970
3407
  return addHeapObject(ret);
971
3408
  };
972
3409
 
973
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function (arg0, arg1, arg2) {
974
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3410
+ module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
3411
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
975
3412
  };
976
3413
 
977
- module.exports.__wbg_self_bf91bf94d9e04084 = function () {
978
- return handleError(function () {
979
- const ret = self.self;
980
- return addHeapObject(ret);
981
- }, arguments);
3414
+ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
3415
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
982
3416
  };
983
3417
 
984
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function () {
985
- return handleError(function () {
986
- const ret = window.window;
987
- return addHeapObject(ret);
988
- }, arguments);
3418
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
3419
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
989
3420
  };
990
3421
 
991
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function () {
992
- return handleError(function () {
993
- const ret = globalThis.globalThis;
994
- return addHeapObject(ret);
995
- }, arguments);
3422
+ module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
3423
+ getObject(arg0).body = getObject(arg1);
996
3424
  };
997
3425
 
998
- module.exports.__wbg_global_3eca19bb09e9c484 = function () {
999
- return handleError(function () {
1000
- const ret = global.global;
1001
- return addHeapObject(ret);
1002
- }, arguments);
3426
+ module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function (arg0, arg1) {
3427
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1003
3428
  };
1004
3429
 
1005
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function (arg0, arg1) {
1006
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1007
- return addHeapObject(ret);
3430
+ module.exports.__wbg_setheaders_834c0bdb6a8949ad = function (arg0, arg1) {
3431
+ getObject(arg0).headers = getObject(arg1);
1008
3432
  };
1009
3433
 
1010
- module.exports.__wbg_call_a9ef466721e824f2 = function () {
1011
- return handleError(function (arg0, arg1) {
1012
- const ret = getObject(arg0).call(getObject(arg1));
1013
- return addHeapObject(ret);
1014
- }, arguments);
3434
+ module.exports.__wbg_setmethod_3c5280fe5d890842 = function (arg0, arg1, arg2) {
3435
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1015
3436
  };
1016
3437
 
1017
- module.exports.__wbg_iterator_695d699a44d6234c = function () {
1018
- const ret = Symbol.iterator;
1019
- return addHeapObject(ret);
3438
+ module.exports.__wbg_setmode_5dc300b865044b65 = function (arg0, arg1) {
3439
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1020
3440
  };
1021
3441
 
1022
- module.exports.__wbg_next_13b477da1eaa3897 = function (arg0) {
1023
- const ret = getObject(arg0).next;
1024
- return addHeapObject(ret);
3442
+ module.exports.__wbg_setname_c0e2d6f348c746f4 = function (arg0, arg1, arg2) {
3443
+ let deferred0_0;
3444
+ let deferred0_1;
3445
+ try {
3446
+ deferred0_0 = arg1;
3447
+ deferred0_1 = arg2;
3448
+ getObject(arg0).name = getStringFromWasm0(arg1, arg2);
3449
+ } finally {
3450
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3451
+ }
1025
3452
  };
1026
3453
 
1027
- module.exports.__wbg_new_034f913e7636e987 = function () {
1028
- const ret = new Array();
1029
- return addHeapObject(ret);
3454
+ module.exports.__wbg_setsignal_75b21ef3a81de905 = function (arg0, arg1) {
3455
+ getObject(arg0).signal = getObject(arg1);
1030
3456
  };
1031
3457
 
1032
- module.exports.__wbg_push_36cf4d81d7da33d1 = function (arg0, arg1) {
1033
- const ret = getObject(arg0).push(getObject(arg1));
1034
- return ret;
3458
+ module.exports.__wbg_settype_39ed370d3edd403c = function (arg0, arg1, arg2) {
3459
+ getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1035
3460
  };
1036
3461
 
1037
- module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function (arg0) {
1038
- let result;
3462
+ module.exports.__wbg_setvariant_d1d41b778dfe9c17 = function (arg0, arg1, arg2) {
3463
+ let deferred0_0;
3464
+ let deferred0_1;
1039
3465
  try {
1040
- result = getObject(arg0) instanceof ArrayBuffer;
1041
- } catch (_) {
1042
- result = false;
3466
+ deferred0_0 = arg1;
3467
+ deferred0_1 = arg2;
3468
+ getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
3469
+ } finally {
3470
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1043
3471
  }
1044
- const ret = result;
1045
- return ret;
1046
3472
  };
1047
3473
 
1048
- module.exports.__wbg_new_70a2f23d1565c04c = function (arg0, arg1) {
1049
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3474
+ module.exports.__wbg_signal_aaf9ad74119f20a4 = function (arg0) {
3475
+ const ret = getObject(arg0).signal;
1050
3476
  return addHeapObject(ret);
1051
3477
  };
1052
3478
 
1053
- module.exports.__wbg_has_bd717f25f195f23d = function () {
1054
- return handleError(function (arg0, arg1) {
1055
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
1056
- return ret;
1057
- }, arguments);
3479
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
3480
+ const ret = getObject(arg1).stack;
3481
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3482
+ const len1 = WASM_VECTOR_LEN;
3483
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3484
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1058
3485
  };
1059
3486
 
1060
- module.exports.__wbg_resolve_0aad7c1484731c99 = function (arg0) {
1061
- const ret = Promise.resolve(getObject(arg0));
1062
- return addHeapObject(ret);
3487
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () {
3488
+ const ret = typeof global === "undefined" ? null : global;
3489
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1063
3490
  };
1064
3491
 
1065
- module.exports.__wbg_then_748f75edfb032440 = function (arg0, arg1) {
1066
- const ret = getObject(arg0).then(getObject(arg1));
1067
- return addHeapObject(ret);
3492
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () {
3493
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
3494
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1068
3495
  };
1069
3496
 
1070
- module.exports.__wbg_then_4866a7d9f55d8f3e = function (arg0, arg1, arg2) {
1071
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1072
- return addHeapObject(ret);
3497
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () {
3498
+ const ret = typeof self === "undefined" ? null : self;
3499
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1073
3500
  };
1074
3501
 
1075
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function (arg0) {
1076
- const ret = getObject(arg0).length;
1077
- return ret;
3502
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () {
3503
+ const ret = typeof window === "undefined" ? null : window;
3504
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1078
3505
  };
1079
3506
 
1080
- module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function (arg0) {
1081
- let result;
1082
- try {
1083
- result = getObject(arg0) instanceof Uint8Array;
1084
- } catch (_) {
1085
- result = false;
1086
- }
1087
- const ret = result;
3507
+ module.exports.__wbg_status_f6360336ca686bf0 = function (arg0) {
3508
+ const ret = getObject(arg0).status;
1088
3509
  return ret;
1089
3510
  };
1090
3511
 
1091
- module.exports.__wbg_new_4e7308fbedde3997 = function () {
1092
- return handleError(function () {
1093
- const ret = new FormData();
3512
+ module.exports.__wbg_stringify_f7ed6987935b4a24 = function () {
3513
+ return handleError(function (arg0) {
3514
+ const ret = JSON.stringify(getObject(arg0));
1094
3515
  return addHeapObject(ret);
1095
3516
  }, arguments);
1096
3517
  };
1097
3518
 
1098
- module.exports.__wbg_append_43a4b1c9d5df4168 = function () {
1099
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1100
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
3519
+ module.exports.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) {
3520
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3521
+ return addHeapObject(ret);
3522
+ };
3523
+
3524
+ module.exports.__wbg_text_7805bea50de2af49 = function () {
3525
+ return handleError(function (arg0) {
3526
+ const ret = getObject(arg0).text();
3527
+ return addHeapObject(ret);
1101
3528
  }, arguments);
1102
3529
  };
1103
3530
 
1104
- module.exports.__wbg_settype_623d2ee701e6310a = function (arg0, arg1, arg2) {
1105
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
3531
+ module.exports.__wbg_then_44b73946d2fb3e7d = function (arg0, arg1) {
3532
+ const ret = getObject(arg0).then(getObject(arg1));
3533
+ return addHeapObject(ret);
1106
3534
  };
1107
3535
 
1108
- module.exports.__wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206 = function () {
1109
- return handleError(function (arg0, arg1) {
1110
- const ret = new Blob(getObject(arg0), getObject(arg1));
1111
- return addHeapObject(ret);
1112
- }, arguments);
3536
+ module.exports.__wbg_then_48b406749878a531 = function (arg0, arg1, arg2) {
3537
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
3538
+ return addHeapObject(ret);
1113
3539
  };
1114
3540
 
1115
- module.exports.__wbg_append_7ee78799a92a9731 = function () {
1116
- return handleError(function (arg0, arg1, arg2, arg3) {
1117
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
1118
- }, arguments);
3541
+ module.exports.__wbg_url_ae10c34ca209681d = function (arg0, arg1) {
3542
+ const ret = getObject(arg1).url;
3543
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3544
+ const len1 = WASM_VECTOR_LEN;
3545
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3546
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1119
3547
  };
1120
3548
 
1121
- module.exports.__wbg_append_8135c71037096394 = function () {
1122
- return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1123
- getObject(arg0).append(
1124
- getStringFromWasm0(arg1, arg2),
1125
- getObject(arg3),
1126
- getStringFromWasm0(arg4, arg5),
1127
- );
1128
- }, arguments);
3549
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
3550
+ const ret = getObject(arg0).value;
3551
+ return addHeapObject(ret);
1129
3552
  };
1130
3553
 
1131
- module.exports.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) {
1132
- const ret = fetch(getObject(arg0));
3554
+ module.exports.__wbg_versions_c01dfd4722a88165 = function (arg0) {
3555
+ const ret = getObject(arg0).versions;
1133
3556
  return addHeapObject(ret);
1134
3557
  };
1135
3558
 
1136
- module.exports.__wbg_fetch_1fdc4448ed9eec00 = function (arg0, arg1) {
1137
- const ret = getObject(arg0).fetch(getObject(arg1));
3559
+ module.exports.__wbg_warn_aaf1f4664a035bd6 = function (arg0, arg1, arg2, arg3) {
3560
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3561
+ };
3562
+
3563
+ module.exports.__wbindgen_as_number = function (arg0) {
3564
+ const ret = +getObject(arg0);
3565
+ return ret;
3566
+ };
3567
+
3568
+ module.exports.__wbindgen_bigint_from_i64 = function (arg0) {
3569
+ const ret = arg0;
1138
3570
  return addHeapObject(ret);
1139
3571
  };
1140
3572
 
1141
- module.exports.__wbg_new_75169ae5a9683c55 = function () {
1142
- return handleError(function () {
1143
- const ret = new AbortController();
1144
- return addHeapObject(ret);
1145
- }, arguments);
3573
+ module.exports.__wbindgen_bigint_from_u64 = function (arg0) {
3574
+ const ret = BigInt.asUintN(64, arg0);
3575
+ return addHeapObject(ret);
3576
+ };
3577
+
3578
+ module.exports.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
3579
+ const v = getObject(arg1);
3580
+ const ret = typeof v === "bigint" ? v : undefined;
3581
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3582
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1146
3583
  };
1147
3584
 
1148
3585
  module.exports.__wbindgen_boolean_get = function (arg0) {
@@ -1151,19 +3588,24 @@ module.exports.__wbindgen_boolean_get = function (arg0) {
1151
3588
  return ret;
1152
3589
  };
1153
3590
 
1154
- module.exports.__wbindgen_number_get = function (arg0, arg1) {
1155
- const obj = getObject(arg1);
1156
- const ret = typeof obj === "number" ? obj : undefined;
1157
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1158
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3591
+ module.exports.__wbindgen_cb_drop = function (arg0) {
3592
+ const obj = takeObject(arg0).original;
3593
+ if (obj.cnt-- == 1) {
3594
+ obj.a = 0;
3595
+ return true;
3596
+ }
3597
+ const ret = false;
3598
+ return ret;
1159
3599
  };
1160
3600
 
1161
- module.exports.__wbg_String_b9412f8799faab3e = function (arg0, arg1) {
1162
- const ret = String(getObject(arg1));
1163
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1164
- const len1 = WASM_VECTOR_LEN;
1165
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1166
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3601
+ module.exports.__wbindgen_closure_wrapper3197 = function (arg0, arg1, arg2) {
3602
+ const ret = makeMutClosure(arg0, arg1, 747, __wbg_adapter_50);
3603
+ return addHeapObject(ret);
3604
+ };
3605
+
3606
+ module.exports.__wbindgen_closure_wrapper3592 = function (arg0, arg1, arg2) {
3607
+ const ret = makeMutClosure(arg0, arg1, 869, __wbg_adapter_53);
3608
+ return addHeapObject(ret);
1167
3609
  };
1168
3610
 
1169
3611
  module.exports.__wbindgen_debug_string = function (arg0, arg1) {
@@ -1174,51 +3616,98 @@ module.exports.__wbindgen_debug_string = function (arg0, arg1) {
1174
3616
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1175
3617
  };
1176
3618
 
1177
- module.exports.__wbindgen_throw = function (arg0, arg1) {
1178
- throw new Error(getStringFromWasm0(arg0, arg1));
3619
+ module.exports.__wbindgen_error_new = function (arg0, arg1) {
3620
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3621
+ return addHeapObject(ret);
1179
3622
  };
1180
3623
 
1181
- module.exports.__wbg_queueMicrotask_848aa4969108a57e = function (arg0) {
1182
- const ret = getObject(arg0).queueMicrotask;
1183
- return addHeapObject(ret);
3624
+ module.exports.__wbindgen_in = function (arg0, arg1) {
3625
+ const ret = getObject(arg0) in getObject(arg1);
3626
+ return ret;
1184
3627
  };
1185
3628
 
1186
- module.exports.__wbg_queueMicrotask_c5419c06eab41e73 = function (arg0) {
1187
- queueMicrotask(getObject(arg0));
3629
+ module.exports.__wbindgen_is_bigint = function (arg0) {
3630
+ const ret = typeof getObject(arg0) === "bigint";
3631
+ return ret;
1188
3632
  };
1189
3633
 
1190
- module.exports.__wbg_newwithstrandinit_4b92c89af0a8e383 = function () {
1191
- return handleError(function (arg0, arg1, arg2) {
1192
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1193
- return addHeapObject(ret);
1194
- }, arguments);
3634
+ module.exports.__wbindgen_is_function = function (arg0) {
3635
+ const ret = typeof getObject(arg0) === "function";
3636
+ return ret;
1195
3637
  };
1196
3638
 
1197
- module.exports.__wbg_debug_a0b6c2c5ac9a4bfd = function (arg0, arg1, arg2, arg3) {
1198
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3639
+ module.exports.__wbindgen_is_object = function (arg0) {
3640
+ const val = getObject(arg0);
3641
+ const ret = typeof val === "object" && val !== null;
3642
+ return ret;
1199
3643
  };
1200
3644
 
1201
- module.exports.__wbg_error_4d17c5bb1ca90c94 = function (arg0, arg1, arg2, arg3) {
1202
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3645
+ module.exports.__wbindgen_is_string = function (arg0) {
3646
+ const ret = typeof getObject(arg0) === "string";
3647
+ return ret;
1203
3648
  };
1204
3649
 
1205
- module.exports.__wbg_info_1c7fba7da21072d1 = function (arg0, arg1, arg2, arg3) {
1206
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3650
+ module.exports.__wbindgen_is_undefined = function (arg0) {
3651
+ const ret = getObject(arg0) === undefined;
3652
+ return ret;
1207
3653
  };
1208
3654
 
1209
- module.exports.__wbg_log_4de37a0274d94769 = function (arg0, arg1, arg2, arg3) {
1210
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3655
+ module.exports.__wbindgen_jsval_eq = function (arg0, arg1) {
3656
+ const ret = getObject(arg0) === getObject(arg1);
3657
+ return ret;
1211
3658
  };
1212
3659
 
1213
- module.exports.__wbg_warn_2e2787d40aad9a81 = function (arg0, arg1, arg2, arg3) {
1214
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3660
+ module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
3661
+ const ret = getObject(arg0) == getObject(arg1);
3662
+ return ret;
3663
+ };
3664
+
3665
+ module.exports.__wbindgen_memory = function () {
3666
+ const ret = wasm.memory;
3667
+ return addHeapObject(ret);
3668
+ };
3669
+
3670
+ module.exports.__wbindgen_number_get = function (arg0, arg1) {
3671
+ const obj = getObject(arg1);
3672
+ const ret = typeof obj === "number" ? obj : undefined;
3673
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3674
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3675
+ };
3676
+
3677
+ module.exports.__wbindgen_number_new = function (arg0) {
3678
+ const ret = arg0;
3679
+ return addHeapObject(ret);
3680
+ };
3681
+
3682
+ module.exports.__wbindgen_object_clone_ref = function (arg0) {
3683
+ const ret = getObject(arg0);
3684
+ return addHeapObject(ret);
3685
+ };
3686
+
3687
+ module.exports.__wbindgen_object_drop_ref = function (arg0) {
3688
+ takeObject(arg0);
3689
+ };
3690
+
3691
+ module.exports.__wbindgen_string_get = function (arg0, arg1) {
3692
+ const obj = getObject(arg1);
3693
+ const ret = typeof obj === "string" ? obj : undefined;
3694
+ var ptr1 = isLikeNone(ret)
3695
+ ? 0
3696
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3697
+ var len1 = WASM_VECTOR_LEN;
3698
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3699
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1215
3700
  };
1216
3701
 
1217
- module.exports.__wbindgen_closure_wrapper1820 = function (arg0, arg1, arg2) {
1218
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
3702
+ module.exports.__wbindgen_string_new = function (arg0, arg1) {
3703
+ const ret = getStringFromWasm0(arg0, arg1);
1219
3704
  return addHeapObject(ret);
1220
3705
  };
1221
3706
 
3707
+ module.exports.__wbindgen_throw = function (arg0, arg1) {
3708
+ throw new Error(getStringFromWasm0(arg0, arg1));
3709
+ };
3710
+
1222
3711
  const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
1223
3712
  const bytes = require("fs").readFileSync(path);
1224
3713