@bitwarden/sdk-internal 0.2.0-main.11 → 0.2.0-main.111

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,11 +1,9 @@
1
1
  let imports = {};
2
2
  imports["__wbindgen_placeholder__"] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
4
+ const { TextEncoder, TextDecoder } = require(`util`);
5
5
 
6
- let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
6
+ let WASM_VECTOR_LEN = 0;
9
7
 
10
8
  let cachedUint8ArrayMemory0 = null;
11
9
 
@@ -16,44 +14,6 @@ function getUint8ArrayMemory0() {
16
14
  return cachedUint8ArrayMemory0;
17
15
  }
18
16
 
19
- function getStringFromWasm0(ptr, len) {
20
- ptr = ptr >>> 0;
21
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
22
- }
23
-
24
- const heap = new Array(128).fill(undefined);
25
-
26
- heap.push(undefined, null, true, false);
27
-
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
- function getObject(idx) {
40
- return heap[idx];
41
- }
42
-
43
- function dropObject(idx) {
44
- if (idx < 132) return;
45
- heap[idx] = heap_next;
46
- heap_next = idx;
47
- }
48
-
49
- function takeObject(idx) {
50
- const ret = getObject(idx);
51
- dropObject(idx);
52
- return ret;
53
- }
54
-
55
- let WASM_VECTOR_LEN = 0;
56
-
57
17
  let cachedTextEncoder = new TextEncoder("utf-8");
58
18
 
59
19
  const encodeString =
@@ -110,10 +70,6 @@ function passStringToWasm0(arg, malloc, realloc) {
110
70
  return ptr;
111
71
  }
112
72
 
113
- function isLikeNone(x) {
114
- return x === undefined || x === null;
115
- }
116
-
117
73
  let cachedDataViewMemory0 = null;
118
74
 
119
75
  function getDataViewMemory0() {
@@ -128,6 +84,66 @@ function getDataViewMemory0() {
128
84
  return cachedDataViewMemory0;
129
85
  }
130
86
 
87
+ let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
88
+
89
+ cachedTextDecoder.decode();
90
+
91
+ function getStringFromWasm0(ptr, len) {
92
+ ptr = ptr >>> 0;
93
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
94
+ }
95
+
96
+ function addToExternrefTable0(obj) {
97
+ const idx = wasm.__externref_table_alloc();
98
+ wasm.__wbindgen_export_4.set(idx, obj);
99
+ return idx;
100
+ }
101
+
102
+ function handleError(f, args) {
103
+ try {
104
+ return f.apply(this, args);
105
+ } catch (e) {
106
+ const idx = addToExternrefTable0(e);
107
+ wasm.__wbindgen_exn_store(idx);
108
+ }
109
+ }
110
+
111
+ function isLikeNone(x) {
112
+ return x === undefined || x === null;
113
+ }
114
+
115
+ const CLOSURE_DTORS =
116
+ typeof FinalizationRegistry === "undefined"
117
+ ? { register: () => {}, unregister: () => {} }
118
+ : new FinalizationRegistry((state) => {
119
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
120
+ });
121
+
122
+ function makeMutClosure(arg0, arg1, dtor, f) {
123
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
124
+ const real = (...args) => {
125
+ // First up with a closure we increment the internal reference
126
+ // count. This ensures that the Rust closure environment won't
127
+ // be deallocated while we're invoking it.
128
+ state.cnt++;
129
+ const a = state.a;
130
+ state.a = 0;
131
+ try {
132
+ return f(a, state.b, ...args);
133
+ } finally {
134
+ if (--state.cnt === 0) {
135
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
136
+ CLOSURE_DTORS.unregister(state);
137
+ } else {
138
+ state.a = a;
139
+ }
140
+ }
141
+ };
142
+ real.original = state;
143
+ CLOSURE_DTORS.register(real, state, state);
144
+ return real;
145
+ }
146
+
131
147
  function debugString(val) {
132
148
  // primitive types
133
149
  const type = typeof val;
@@ -169,7 +185,7 @@ function debugString(val) {
169
185
  // Test for built-in
170
186
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
171
187
  let className;
172
- if (builtInMatches.length > 1) {
188
+ if (builtInMatches && builtInMatches.length > 1) {
173
189
  className = builtInMatches[1];
174
190
  } else {
175
191
  // Failed to match the standard '[object ClassName]'
@@ -192,141 +208,198 @@ function debugString(val) {
192
208
  // TODO we could test for more things here, like `Set`s and `Map`s.
193
209
  return className;
194
210
  }
211
+ /**
212
+ * @param {any} error
213
+ * @returns {boolean}
214
+ */
215
+ module.exports.isEncryptionSettingsError = function (error) {
216
+ const ret = wasm.isEncryptionSettingsError(error);
217
+ return ret !== 0;
218
+ };
195
219
 
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
- });
220
+ /**
221
+ * @param {any} error
222
+ * @returns {boolean}
223
+ */
224
+ module.exports.isCryptoError = function (error) {
225
+ const ret = wasm.isCryptoError(error);
226
+ return ret !== 0;
227
+ };
202
228
 
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
- }
229
+ /**
230
+ * @param {any} error
231
+ * @returns {boolean}
232
+ */
233
+ module.exports.isSshKeyExportError = function (error) {
234
+ const ret = wasm.isSshKeyExportError(error);
235
+ return ret !== 0;
236
+ };
237
+
238
+ /**
239
+ * @param {any} error
240
+ * @returns {boolean}
241
+ */
242
+ module.exports.isSshKeyImportError = function (error) {
243
+ const ret = wasm.isSshKeyImportError(error);
244
+ return ret !== 0;
245
+ };
234
246
 
235
- let stack_pointer = 128;
247
+ /**
248
+ * @param {any} error
249
+ * @returns {boolean}
250
+ */
251
+ module.exports.isKeyGenerationError = function (error) {
252
+ const ret = wasm.isKeyGenerationError(error);
253
+ return ret !== 0;
254
+ };
236
255
 
237
- function addBorrowedObject(obj) {
238
- if (stack_pointer == 1) throw new Error("out of js stack");
239
- heap[--stack_pointer] = obj;
240
- return stack_pointer;
241
- }
242
256
  /**
243
257
  * @param {any} error
244
258
  * @returns {boolean}
245
259
  */
246
- module.exports.isCoreError = function (error) {
247
- try {
248
- const ret = wasm.isCoreError(addBorrowedObject(error));
249
- return ret !== 0;
250
- } finally {
251
- heap[stack_pointer++] = undefined;
252
- }
260
+ module.exports.isDecryptFileError = function (error) {
261
+ const ret = wasm.isDecryptFileError(error);
262
+ return ret !== 0;
253
263
  };
254
264
 
255
265
  /**
256
266
  * @param {any} error
257
267
  * @returns {boolean}
258
268
  */
259
- module.exports.isEncryptionSettingsError = function (error) {
260
- try {
261
- const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
262
- return ret !== 0;
263
- } finally {
264
- heap[stack_pointer++] = undefined;
265
- }
269
+ module.exports.isEncryptFileError = function (error) {
270
+ const ret = wasm.isEncryptFileError(error);
271
+ return ret !== 0;
266
272
  };
267
273
 
268
274
  /**
269
275
  * @param {any} error
270
276
  * @returns {boolean}
271
277
  */
272
- module.exports.isKeyGenerationError = function (error) {
273
- try {
274
- const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
275
- return ret !== 0;
276
- } finally {
277
- heap[stack_pointer++] = undefined;
278
- }
278
+ module.exports.isDecryptError = function (error) {
279
+ const ret = wasm.isDecryptError(error);
280
+ return ret !== 0;
279
281
  };
280
282
 
281
283
  /**
282
284
  * @param {any} error
283
285
  * @returns {boolean}
284
286
  */
285
- module.exports.isTestError = function (error) {
286
- try {
287
- const ret = wasm.isTestError(addBorrowedObject(error));
288
- return ret !== 0;
289
- } finally {
290
- heap[stack_pointer++] = undefined;
291
- }
287
+ module.exports.isEncryptError = function (error) {
288
+ const ret = wasm.isEncryptError(error);
289
+ return ret !== 0;
290
+ };
291
+
292
+ /**
293
+ * @param {any} error
294
+ * @returns {boolean}
295
+ */
296
+ module.exports.isTotpError = function (error) {
297
+ const ret = wasm.isTotpError(error);
298
+ return ret !== 0;
299
+ };
300
+
301
+ function takeFromExternrefTable0(idx) {
302
+ const value = wasm.__wbindgen_export_4.get(idx);
303
+ wasm.__externref_table_dealloc(idx);
304
+ return value;
305
+ }
306
+ /**
307
+ * @param {LogLevel} level
308
+ */
309
+ module.exports.set_log_level = function (level) {
310
+ wasm.set_log_level(level);
311
+ };
312
+
313
+ /**
314
+ * @param {LogLevel | null} [log_level]
315
+ */
316
+ module.exports.init_sdk = function (log_level) {
317
+ wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
292
318
  };
293
319
 
320
+ function getArrayU8FromWasm0(ptr, len) {
321
+ ptr = ptr >>> 0;
322
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
323
+ }
324
+
325
+ function passArray8ToWasm0(arg, malloc) {
326
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
327
+ getUint8ArrayMemory0().set(arg, ptr / 1);
328
+ WASM_VECTOR_LEN = arg.length;
329
+ return ptr;
330
+ }
294
331
  /**
332
+ * Generate a new SSH key pair
333
+ *
334
+ * # Arguments
335
+ * - `key_algorithm` - The algorithm to use for the key pair
336
+ *
337
+ * # Returns
338
+ * - `Ok(SshKey)` if the key was successfully generated
339
+ * - `Err(KeyGenerationError)` if the key could not be generated
295
340
  * @param {KeyAlgorithm} key_algorithm
296
- * @returns {GenerateSshKeyResult}
341
+ * @returns {SshKeyView}
297
342
  */
298
343
  module.exports.generate_ssh_key = function (key_algorithm) {
299
- 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);
309
- } finally {
310
- wasm.__wbindgen_add_to_stack_pointer(16);
344
+ const ret = wasm.generate_ssh_key(key_algorithm);
345
+ if (ret[2]) {
346
+ throw takeFromExternrefTable0(ret[1]);
311
347
  }
348
+ return takeFromExternrefTable0(ret[0]);
312
349
  };
313
350
 
314
- function handleError(f, args) {
315
- try {
316
- return f.apply(this, args);
317
- } catch (e) {
318
- wasm.__wbindgen_exn_store(addHeapObject(e));
351
+ /**
352
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
353
+ * to an OpenSSH private key with public key and fingerprint
354
+ *
355
+ * # Arguments
356
+ * - `imported_key` - The private key to convert
357
+ * - `password` - The password to use for decrypting the key
358
+ *
359
+ * # Returns
360
+ * - `Ok(SshKey)` if the key was successfully coneverted
361
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
362
+ * - `Err(WrongPassword)` if the password provided is incorrect
363
+ * - `Err(ParsingError)` if the key could not be parsed
364
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
365
+ * @param {string} imported_key
366
+ * @param {string | null} [password]
367
+ * @returns {SshKeyView}
368
+ */
369
+ module.exports.import_ssh_key = function (imported_key, password) {
370
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
+ const len0 = WASM_VECTOR_LEN;
372
+ var ptr1 = isLikeNone(password)
373
+ ? 0
374
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
375
+ var len1 = WASM_VECTOR_LEN;
376
+ const ret = wasm.import_ssh_key(ptr0, len0, ptr1, len1);
377
+ if (ret[2]) {
378
+ throw takeFromExternrefTable0(ret[1]);
319
379
  }
380
+ return takeFromExternrefTable0(ret[0]);
381
+ };
382
+
383
+ /**
384
+ * @param {any} error
385
+ * @returns {boolean}
386
+ */
387
+ module.exports.isTestError = function (error) {
388
+ const ret = wasm.isTestError(error);
389
+ return ret !== 0;
390
+ };
391
+
392
+ function __wbg_adapter_42(arg0, arg1, arg2) {
393
+ wasm.closure545_externref_shim(arg0, arg1, arg2);
320
394
  }
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
- );
395
+
396
+ function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
397
+ wasm.closure403_externref_shim(arg0, arg1, arg2, arg3);
328
398
  }
329
399
 
400
+ /**
401
+ * @enum {0 | 1 | 2 | 3 | 4}
402
+ */
330
403
  module.exports.LogLevel = Object.freeze({
331
404
  Trace: 0,
332
405
  0: "Trace",
@@ -362,14 +435,10 @@ class BitwardenClient {
362
435
  wasm.__wbg_bitwardenclient_free(ptr, 0);
363
436
  }
364
437
  /**
365
- * @param {ClientSettings | undefined} [settings]
366
- * @param {LogLevel | undefined} [log_level]
438
+ * @param {ClientSettings | null} [settings]
367
439
  */
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
- );
440
+ constructor(settings) {
441
+ const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addToExternrefTable0(settings));
373
442
  this.__wbg_ptr = ret >>> 0;
374
443
  BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
375
444
  return this;
@@ -383,17 +452,13 @@ class BitwardenClient {
383
452
  let deferred2_0;
384
453
  let deferred2_1;
385
454
  try {
386
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
387
455
  const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
388
456
  const len0 = WASM_VECTOR_LEN;
389
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
390
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
- deferred2_0 = r0;
393
- deferred2_1 = r1;
394
- return getStringFromWasm0(r0, r1);
457
+ const ret = wasm.bitwardenclient_echo(this.__wbg_ptr, ptr0, len0);
458
+ deferred2_0 = ret[0];
459
+ deferred2_1 = ret[1];
460
+ return getStringFromWasm0(ret[0], ret[1]);
395
461
  } finally {
396
- wasm.__wbindgen_add_to_stack_pointer(16);
397
462
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
398
463
  }
399
464
  }
@@ -404,27 +469,24 @@ class BitwardenClient {
404
469
  let deferred1_0;
405
470
  let deferred1_1;
406
471
  try {
407
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
409
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
410
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
411
- deferred1_0 = r0;
412
- deferred1_1 = r1;
413
- return getStringFromWasm0(r0, r1);
472
+ const ret = wasm.bitwardenclient_version(this.__wbg_ptr);
473
+ deferred1_0 = ret[0];
474
+ deferred1_1 = ret[1];
475
+ return getStringFromWasm0(ret[0], ret[1]);
414
476
  } finally {
415
- wasm.__wbindgen_add_to_stack_pointer(16);
416
477
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
417
478
  }
418
479
  }
419
480
  /**
420
481
  * @param {string} msg
421
- * @returns {Promise<void>}
422
482
  */
423
483
  throw(msg) {
424
484
  const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
425
485
  const len0 = WASM_VECTOR_LEN;
426
486
  const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
427
- return takeObject(ret);
487
+ if (ret[1]) {
488
+ throw takeFromExternrefTable0(ret[0]);
489
+ }
428
490
  }
429
491
  /**
430
492
  * Test method, calls http endpoint
@@ -435,339 +497,527 @@ class BitwardenClient {
435
497
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
436
498
  const len0 = WASM_VECTOR_LEN;
437
499
  const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
438
- return takeObject(ret);
500
+ return ret;
439
501
  }
440
502
  /**
441
- * @returns {ClientCrypto}
503
+ * @returns {CryptoClient}
442
504
  */
443
505
  crypto() {
444
506
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
445
- return ClientCrypto.__wrap(ret);
507
+ return CryptoClient.__wrap(ret);
446
508
  }
447
509
  /**
448
- * @returns {ClientVault}
510
+ * @returns {VaultClient}
449
511
  */
450
512
  vault() {
451
513
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
452
- return ClientVault.__wrap(ret);
514
+ return VaultClient.__wrap(ret);
453
515
  }
454
516
  }
455
517
  module.exports.BitwardenClient = BitwardenClient;
456
518
 
457
- const ClientCryptoFinalization =
519
+ const ClientFoldersFinalization =
458
520
  typeof FinalizationRegistry === "undefined"
459
521
  ? { register: () => {}, unregister: () => {} }
460
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
522
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
461
523
 
462
- class ClientCrypto {
524
+ class ClientFolders {
463
525
  static __wrap(ptr) {
464
526
  ptr = ptr >>> 0;
465
- const obj = Object.create(ClientCrypto.prototype);
527
+ const obj = Object.create(ClientFolders.prototype);
466
528
  obj.__wbg_ptr = ptr;
467
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
529
+ ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
468
530
  return obj;
469
531
  }
470
532
 
471
533
  __destroy_into_raw() {
472
534
  const ptr = this.__wbg_ptr;
473
535
  this.__wbg_ptr = 0;
474
- ClientCryptoFinalization.unregister(this);
536
+ ClientFoldersFinalization.unregister(this);
475
537
  return ptr;
476
538
  }
477
539
 
478
540
  free() {
479
541
  const ptr = this.__destroy_into_raw();
480
- wasm.__wbg_clientcrypto_free(ptr, 0);
481
- }
482
- /**
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>}
487
- */
488
- initialize_user_crypto(req) {
489
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
490
- return takeObject(ret);
542
+ wasm.__wbg_clientfolders_free(ptr, 0);
491
543
  }
492
544
  /**
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>}
545
+ * Decrypt folder
546
+ * @param {Folder} folder
547
+ * @returns {FolderView}
497
548
  */
498
- initialize_org_crypto(req) {
499
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
500
- return takeObject(ret);
549
+ decrypt(folder) {
550
+ const ret = wasm.clientfolders_decrypt(this.__wbg_ptr, folder);
551
+ if (ret[2]) {
552
+ throw takeFromExternrefTable0(ret[1]);
553
+ }
554
+ return takeFromExternrefTable0(ret[0]);
501
555
  }
502
556
  }
503
- module.exports.ClientCrypto = ClientCrypto;
557
+ module.exports.ClientFolders = ClientFolders;
504
558
 
505
- const ClientFoldersFinalization =
559
+ const ClientTotpFinalization =
506
560
  typeof FinalizationRegistry === "undefined"
507
561
  ? { register: () => {}, unregister: () => {} }
508
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
562
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
509
563
 
510
- class ClientFolders {
564
+ class ClientTotp {
511
565
  static __wrap(ptr) {
512
566
  ptr = ptr >>> 0;
513
- const obj = Object.create(ClientFolders.prototype);
567
+ const obj = Object.create(ClientTotp.prototype);
514
568
  obj.__wbg_ptr = ptr;
515
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
569
+ ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
516
570
  return obj;
517
571
  }
518
572
 
519
573
  __destroy_into_raw() {
520
574
  const ptr = this.__wbg_ptr;
521
575
  this.__wbg_ptr = 0;
522
- ClientFoldersFinalization.unregister(this);
576
+ ClientTotpFinalization.unregister(this);
523
577
  return ptr;
524
578
  }
525
579
 
526
580
  free() {
527
581
  const ptr = this.__destroy_into_raw();
528
- wasm.__wbg_clientfolders_free(ptr, 0);
582
+ wasm.__wbg_clienttotp_free(ptr, 0);
529
583
  }
530
584
  /**
531
- * Decrypt folder
532
- * @param {Folder} folder
533
- * @returns {FolderView}
585
+ * Generates a TOTP code from a provided key
586
+ *
587
+ * # Arguments
588
+ * - `key` - Can be:
589
+ * - A base32 encoded string
590
+ * - OTP Auth URI
591
+ * - Steam URI
592
+ * - `time_ms` - Optional timestamp in milliseconds
593
+ *
594
+ * # Returns
595
+ * - `Ok(TotpResponse)` containing the generated code and period
596
+ * - `Err(TotpError)` if code generation fails
597
+ * @param {string} key
598
+ * @param {number | null} [time_ms]
599
+ * @returns {TotpResponse}
534
600
  */
535
- decrypt(folder) {
536
- try {
537
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
539
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
540
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
541
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
542
- if (r2) {
543
- throw takeObject(r1);
544
- }
545
- return takeObject(r0);
546
- } finally {
547
- wasm.__wbindgen_add_to_stack_pointer(16);
601
+ generate_totp(key, time_ms) {
602
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
603
+ const len0 = WASM_VECTOR_LEN;
604
+ const ret = wasm.clienttotp_generate_totp(
605
+ this.__wbg_ptr,
606
+ ptr0,
607
+ len0,
608
+ !isLikeNone(time_ms),
609
+ isLikeNone(time_ms) ? 0 : time_ms,
610
+ );
611
+ if (ret[2]) {
612
+ throw takeFromExternrefTable0(ret[1]);
548
613
  }
614
+ return takeFromExternrefTable0(ret[0]);
549
615
  }
550
616
  }
551
- module.exports.ClientFolders = ClientFolders;
617
+ module.exports.ClientTotp = ClientTotp;
552
618
 
553
- const ClientVaultFinalization =
619
+ const CryptoClientFinalization =
554
620
  typeof FinalizationRegistry === "undefined"
555
621
  ? { register: () => {}, unregister: () => {} }
556
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
622
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
557
623
 
558
- class ClientVault {
624
+ class CryptoClient {
559
625
  static __wrap(ptr) {
560
626
  ptr = ptr >>> 0;
561
- const obj = Object.create(ClientVault.prototype);
627
+ const obj = Object.create(CryptoClient.prototype);
562
628
  obj.__wbg_ptr = ptr;
563
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
629
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
564
630
  return obj;
565
631
  }
566
632
 
567
633
  __destroy_into_raw() {
568
634
  const ptr = this.__wbg_ptr;
569
635
  this.__wbg_ptr = 0;
570
- ClientVaultFinalization.unregister(this);
636
+ CryptoClientFinalization.unregister(this);
571
637
  return ptr;
572
638
  }
573
639
 
574
640
  free() {
575
641
  const ptr = this.__destroy_into_raw();
576
- wasm.__wbg_clientvault_free(ptr, 0);
642
+ wasm.__wbg_cryptoclient_free(ptr, 0);
577
643
  }
578
644
  /**
579
- * @returns {ClientFolders}
645
+ * Initialization method for the user crypto. Needs to be called before any other crypto
646
+ * operations.
647
+ * @param {InitUserCryptoRequest} req
648
+ * @returns {Promise<void>}
580
649
  */
581
- folders() {
582
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
583
- return ClientFolders.__wrap(ret);
650
+ initialize_user_crypto(req) {
651
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, req);
652
+ return ret;
584
653
  }
585
- }
586
- module.exports.ClientVault = ClientVault;
587
-
588
- module.exports.__wbg_new_fe19e4f3db5c3999 = function (arg0, arg1) {
589
- let deferred0_0;
590
- let deferred0_1;
591
- try {
592
- deferred0_0 = arg0;
593
- deferred0_1 = arg1;
594
- const ret = new Error(getStringFromWasm0(arg0, arg1));
595
- return addHeapObject(ret);
596
- } finally {
597
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
654
+ /**
655
+ * Initialization method for the organization crypto. Needs to be called after
656
+ * `initialize_user_crypto` but before any other crypto operations.
657
+ * @param {InitOrgCryptoRequest} req
658
+ * @returns {Promise<void>}
659
+ */
660
+ initialize_org_crypto(req) {
661
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, req);
662
+ return ret;
598
663
  }
599
- };
664
+ /**
665
+ * Generates a new key pair and encrypts the private key with the provided user key.
666
+ * Crypto initialization not required.
667
+ * @param {string} user_key
668
+ * @returns {MakeKeyPairResponse}
669
+ */
670
+ make_key_pair(user_key) {
671
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
672
+ const len0 = WASM_VECTOR_LEN;
673
+ const ret = wasm.cryptoclient_make_key_pair(this.__wbg_ptr, ptr0, len0);
674
+ if (ret[2]) {
675
+ throw takeFromExternrefTable0(ret[1]);
676
+ }
677
+ return takeFromExternrefTable0(ret[0]);
678
+ }
679
+ /**
680
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
681
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
682
+ * Crypto initialization not required.
683
+ * @param {VerifyAsymmetricKeysRequest} request
684
+ * @returns {VerifyAsymmetricKeysResponse}
685
+ */
686
+ verify_asymmetric_keys(request) {
687
+ const ret = wasm.cryptoclient_verify_asymmetric_keys(this.__wbg_ptr, request);
688
+ if (ret[2]) {
689
+ throw takeFromExternrefTable0(ret[1]);
690
+ }
691
+ return takeFromExternrefTable0(ret[0]);
692
+ }
693
+ }
694
+ module.exports.CryptoClient = CryptoClient;
600
695
 
601
- module.exports.__wbg_setname_46d623c31ae39910 = function (arg0, arg1, arg2) {
602
- let deferred0_0;
603
- let deferred0_1;
604
- try {
605
- deferred0_0 = arg1;
606
- deferred0_1 = arg2;
607
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
608
- } finally {
609
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
696
+ const PureCryptoFinalization =
697
+ typeof FinalizationRegistry === "undefined"
698
+ ? { register: () => {}, unregister: () => {} }
699
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
700
+ /**
701
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
702
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
703
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
704
+ * responsible for state and keys.
705
+ */
706
+ class PureCrypto {
707
+ __destroy_into_raw() {
708
+ const ptr = this.__wbg_ptr;
709
+ this.__wbg_ptr = 0;
710
+ PureCryptoFinalization.unregister(this);
711
+ return ptr;
610
712
  }
611
- };
612
713
 
613
- module.exports.__wbg_setvariant_262a12673324f71b = function (arg0, arg1, arg2) {
614
- let deferred0_0;
615
- let deferred0_1;
616
- try {
617
- deferred0_0 = arg1;
618
- deferred0_1 = arg2;
619
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
620
- } finally {
621
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
714
+ free() {
715
+ const ptr = this.__destroy_into_raw();
716
+ wasm.__wbg_purecrypto_free(ptr, 0);
622
717
  }
623
- };
718
+ /**
719
+ * @param {string} enc_string
720
+ * @param {string} key_b64
721
+ * @returns {string}
722
+ */
723
+ static symmetric_decrypt(enc_string, key_b64) {
724
+ let deferred4_0;
725
+ let deferred4_1;
726
+ try {
727
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
728
+ const len0 = WASM_VECTOR_LEN;
729
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
730
+ const len1 = WASM_VECTOR_LEN;
731
+ const ret = wasm.purecrypto_symmetric_decrypt(ptr0, len0, ptr1, len1);
732
+ var ptr3 = ret[0];
733
+ var len3 = ret[1];
734
+ if (ret[3]) {
735
+ ptr3 = 0;
736
+ len3 = 0;
737
+ throw takeFromExternrefTable0(ret[2]);
738
+ }
739
+ deferred4_0 = ptr3;
740
+ deferred4_1 = len3;
741
+ return getStringFromWasm0(ptr3, len3);
742
+ } finally {
743
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
744
+ }
745
+ }
746
+ /**
747
+ * @param {string} enc_string
748
+ * @param {string} key_b64
749
+ * @returns {Uint8Array}
750
+ */
751
+ static symmetric_decrypt_to_bytes(enc_string, key_b64) {
752
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
753
+ const len0 = WASM_VECTOR_LEN;
754
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
755
+ const len1 = WASM_VECTOR_LEN;
756
+ const ret = wasm.purecrypto_symmetric_decrypt_to_bytes(ptr0, len0, ptr1, len1);
757
+ if (ret[3]) {
758
+ throw takeFromExternrefTable0(ret[2]);
759
+ }
760
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
761
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
762
+ return v3;
763
+ }
764
+ /**
765
+ * @param {Uint8Array} enc_bytes
766
+ * @param {string} key_b64
767
+ * @returns {Uint8Array}
768
+ */
769
+ static symmetric_decrypt_array_buffer(enc_bytes, key_b64) {
770
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
771
+ const len0 = WASM_VECTOR_LEN;
772
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
773
+ const len1 = WASM_VECTOR_LEN;
774
+ const ret = wasm.purecrypto_symmetric_decrypt_array_buffer(ptr0, len0, ptr1, len1);
775
+ if (ret[3]) {
776
+ throw takeFromExternrefTable0(ret[2]);
777
+ }
778
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
779
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
780
+ return v3;
781
+ }
782
+ /**
783
+ * @param {string} plain
784
+ * @param {string} key_b64
785
+ * @returns {string}
786
+ */
787
+ static symmetric_encrypt(plain, key_b64) {
788
+ let deferred4_0;
789
+ let deferred4_1;
790
+ try {
791
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
792
+ const len0 = WASM_VECTOR_LEN;
793
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
794
+ const len1 = WASM_VECTOR_LEN;
795
+ const ret = wasm.purecrypto_symmetric_encrypt(ptr0, len0, ptr1, len1);
796
+ var ptr3 = ret[0];
797
+ var len3 = ret[1];
798
+ if (ret[3]) {
799
+ ptr3 = 0;
800
+ len3 = 0;
801
+ throw takeFromExternrefTable0(ret[2]);
802
+ }
803
+ deferred4_0 = ptr3;
804
+ deferred4_1 = len3;
805
+ return getStringFromWasm0(ptr3, len3);
806
+ } finally {
807
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
808
+ }
809
+ }
810
+ /**
811
+ * @param {Uint8Array} plain
812
+ * @param {string} key_b64
813
+ * @returns {Uint8Array}
814
+ */
815
+ static symmetric_encrypt_to_array_buffer(plain, key_b64) {
816
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
817
+ const len0 = WASM_VECTOR_LEN;
818
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
819
+ const len1 = WASM_VECTOR_LEN;
820
+ const ret = wasm.purecrypto_symmetric_encrypt_to_array_buffer(ptr0, len0, ptr1, len1);
821
+ if (ret[3]) {
822
+ throw takeFromExternrefTable0(ret[2]);
823
+ }
824
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
825
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
826
+ return v3;
827
+ }
828
+ }
829
+ module.exports.PureCrypto = PureCrypto;
624
830
 
625
- module.exports.__wbindgen_string_new = function (arg0, arg1) {
626
- const ret = getStringFromWasm0(arg0, arg1);
627
- return addHeapObject(ret);
628
- };
831
+ const VaultClientFinalization =
832
+ typeof FinalizationRegistry === "undefined"
833
+ ? { register: () => {}, unregister: () => {} }
834
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
629
835
 
630
- module.exports.__wbg_get_ef828680c64da212 = function () {
631
- return handleError(function (arg0, arg1) {
632
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
633
- return addHeapObject(ret);
634
- }, arguments);
635
- };
836
+ class VaultClient {
837
+ static __wrap(ptr) {
838
+ ptr = ptr >>> 0;
839
+ const obj = Object.create(VaultClient.prototype);
840
+ obj.__wbg_ptr = ptr;
841
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
842
+ return obj;
843
+ }
636
844
 
637
- module.exports.__wbindgen_object_drop_ref = function (arg0) {
638
- takeObject(arg0);
639
- };
845
+ __destroy_into_raw() {
846
+ const ptr = this.__wbg_ptr;
847
+ this.__wbg_ptr = 0;
848
+ VaultClientFinalization.unregister(this);
849
+ return ptr;
850
+ }
640
851
 
641
- module.exports.__wbindgen_string_get = function (arg0, arg1) {
642
- const obj = getObject(arg1);
643
- const ret = typeof obj === "string" ? obj : undefined;
644
- var ptr1 = isLikeNone(ret)
645
- ? 0
646
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
647
- var len1 = WASM_VECTOR_LEN;
852
+ free() {
853
+ const ptr = this.__destroy_into_raw();
854
+ wasm.__wbg_vaultclient_free(ptr, 0);
855
+ }
856
+ /**
857
+ * @returns {ClientFolders}
858
+ */
859
+ folders() {
860
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
861
+ return ClientFolders.__wrap(ret);
862
+ }
863
+ /**
864
+ * @returns {ClientTotp}
865
+ */
866
+ totp() {
867
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
868
+ return ClientTotp.__wrap(ret);
869
+ }
870
+ }
871
+ module.exports.VaultClient = VaultClient;
872
+
873
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
874
+ const ret = String(arg1);
875
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
876
+ const len1 = WASM_VECTOR_LEN;
648
877
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
649
878
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
650
879
  };
651
880
 
652
- module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
653
- const ret = getObject(arg0) == getObject(arg1);
654
- return ret;
881
+ module.exports.__wbg_abort_775ef1d17fc65868 = function (arg0) {
882
+ arg0.abort();
655
883
  };
656
884
 
657
- module.exports.__wbindgen_is_object = function (arg0) {
658
- const val = getObject(arg0);
659
- const ret = typeof val === "object" && val !== null;
660
- return ret;
885
+ module.exports.__wbg_append_299d5d48292c0495 = function () {
886
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
887
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
888
+ }, arguments);
661
889
  };
662
890
 
663
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
664
- const ret = getObject(arg0)[getObject(arg1)];
665
- return addHeapObject(ret);
891
+ module.exports.__wbg_append_8c7dd8d641a5f01b = function () {
892
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
893
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
894
+ }, arguments);
666
895
  };
667
896
 
668
- module.exports.__wbindgen_is_undefined = function (arg0) {
669
- const ret = getObject(arg0) === undefined;
670
- return ret;
897
+ module.exports.__wbg_append_b2d1fc16de2a0e81 = function () {
898
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
899
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5));
900
+ }, arguments);
671
901
  };
672
902
 
673
- module.exports.__wbindgen_in = function (arg0, arg1) {
674
- const ret = getObject(arg0) in getObject(arg1);
675
- return ret;
903
+ module.exports.__wbg_append_b44785ebeb668479 = function () {
904
+ return handleError(function (arg0, arg1, arg2, arg3) {
905
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3);
906
+ }, arguments);
676
907
  };
677
908
 
678
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function (arg0) {
679
- const ret = Number.isSafeInteger(getObject(arg0));
909
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
910
+ const ret = arg0.buffer;
680
911
  return ret;
681
912
  };
682
913
 
683
- module.exports.__wbindgen_as_number = function (arg0) {
684
- const ret = +getObject(arg0);
685
- return ret;
914
+ module.exports.__wbg_call_672a4d21634d4a24 = function () {
915
+ return handleError(function (arg0, arg1) {
916
+ const ret = arg0.call(arg1);
917
+ return ret;
918
+ }, arguments);
686
919
  };
687
920
 
688
- module.exports.__wbindgen_is_string = function (arg0) {
689
- const ret = typeof getObject(arg0) === "string";
921
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
922
+ return handleError(function (arg0, arg1, arg2) {
923
+ const ret = arg0.call(arg1, arg2);
924
+ return ret;
925
+ }, arguments);
926
+ };
927
+
928
+ module.exports.__wbg_crypto_ed58b8e10a292839 = function (arg0) {
929
+ const ret = arg0.crypto;
690
930
  return ret;
691
931
  };
692
932
 
693
- module.exports.__wbg_entries_c02034de337d3ee2 = function (arg0) {
694
- const ret = Object.entries(getObject(arg0));
695
- return addHeapObject(ret);
933
+ module.exports.__wbg_debug_e17b51583ca6a632 = function (arg0, arg1, arg2, arg3) {
934
+ console.debug(arg0, arg1, arg2, arg3);
696
935
  };
697
936
 
698
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function (arg0) {
699
- const ret = getObject(arg0).length;
937
+ module.exports.__wbg_done_769e5ede4b31c67b = function (arg0) {
938
+ const ret = arg0.done;
700
939
  return ret;
701
940
  };
702
941
 
703
- module.exports.__wbg_get_5419cf6b954aa11d = function (arg0, arg1) {
704
- const ret = getObject(arg0)[arg1 >>> 0];
705
- return addHeapObject(ret);
942
+ module.exports.__wbg_entries_3265d4158b33e5dc = function (arg0) {
943
+ const ret = Object.entries(arg0);
944
+ return ret;
706
945
  };
707
946
 
708
- module.exports.__wbg_call_3bfa248576352471 = function () {
709
- return handleError(function (arg0, arg1, arg2) {
710
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
711
- return addHeapObject(ret);
712
- }, arguments);
947
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
948
+ let deferred0_0;
949
+ let deferred0_1;
950
+ try {
951
+ deferred0_0 = arg0;
952
+ deferred0_1 = arg1;
953
+ console.error(getStringFromWasm0(arg0, arg1));
954
+ } finally {
955
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
956
+ }
713
957
  };
714
958
 
715
- module.exports.__wbindgen_object_clone_ref = function (arg0) {
716
- const ret = getObject(arg0);
717
- return addHeapObject(ret);
959
+ module.exports.__wbg_error_80de38b3f7cc3c3c = function (arg0, arg1, arg2, arg3) {
960
+ console.error(arg0, arg1, arg2, arg3);
718
961
  };
719
962
 
720
- module.exports.__wbg_new_e69b5f66fda8f13c = function () {
721
- const ret = new Object();
722
- return addHeapObject(ret);
963
+ module.exports.__wbg_fetch_4465c2b10f21a927 = function (arg0) {
964
+ const ret = fetch(arg0);
965
+ return ret;
723
966
  };
724
967
 
725
- module.exports.__wbg_setmethod_ce2da76000b02f6a = function (arg0, arg1, arg2) {
726
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
968
+ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
969
+ const ret = arg0.fetch(arg1);
970
+ return ret;
727
971
  };
728
972
 
729
- module.exports.__wbg_new_a9ae04a5200606a5 = function () {
730
- return handleError(function () {
731
- const ret = new Headers();
732
- return addHeapObject(ret);
973
+ module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function () {
974
+ return handleError(function (arg0, arg1) {
975
+ arg0.getRandomValues(arg1);
733
976
  }, arguments);
734
977
  };
735
978
 
736
- module.exports.__wbg_setheaders_f5205d36e423a544 = function (arg0, arg1) {
737
- getObject(arg0).headers = getObject(arg1);
979
+ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
980
+ const ret = arg0.getTime();
981
+ return ret;
738
982
  };
739
983
 
740
- module.exports.__wbg_setmode_4919fd636102c586 = function (arg0, arg1) {
741
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
984
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
985
+ return handleError(function (arg0, arg1) {
986
+ const ret = Reflect.get(arg0, arg1);
987
+ return ret;
988
+ }, arguments);
742
989
  };
743
990
 
744
- module.exports.__wbg_setcredentials_a4e661320cdb9738 = function (arg0, arg1) {
745
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
991
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
992
+ const ret = arg0[arg1 >>> 0];
993
+ return ret;
746
994
  };
747
995
 
748
- module.exports.__wbg_setbody_aa8b691bec428bf4 = function (arg0, arg1) {
749
- getObject(arg0).body = getObject(arg1);
996
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
997
+ const ret = arg0[arg1];
998
+ return ret;
750
999
  };
751
1000
 
752
- module.exports.__wbg_signal_9acfcec9e7dffc22 = function (arg0) {
753
- const ret = getObject(arg0).signal;
754
- return addHeapObject(ret);
1001
+ module.exports.__wbg_has_a5ea9117f258a0ec = function () {
1002
+ return handleError(function (arg0, arg1) {
1003
+ const ret = Reflect.has(arg0, arg1);
1004
+ return ret;
1005
+ }, arguments);
755
1006
  };
756
1007
 
757
- module.exports.__wbg_setsignal_812ccb8269a7fd90 = function (arg0, arg1) {
758
- getObject(arg0).signal = getObject(arg1);
1008
+ module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
1009
+ const ret = arg0.headers;
1010
+ return ret;
759
1011
  };
760
1012
 
761
- module.exports.__wbg_append_8b3e7f74a47ea7d5 = function () {
762
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
763
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
764
- }, arguments);
1013
+ module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
1014
+ console.info(arg0, arg1, arg2, arg3);
765
1015
  };
766
1016
 
767
- module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
1017
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
768
1018
  let result;
769
1019
  try {
770
- result = getObject(arg0) instanceof Response;
1020
+ result = arg0 instanceof ArrayBuffer;
771
1021
  } catch (_) {
772
1022
  result = false;
773
1023
  }
@@ -775,448 +1025,487 @@ module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
775
1025
  return ret;
776
1026
  };
777
1027
 
778
- module.exports.__wbg_status_5f4e900d22140a18 = function (arg0) {
779
- const ret = getObject(arg0).status;
1028
+ module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
1029
+ let result;
1030
+ try {
1031
+ result = arg0 instanceof Response;
1032
+ } catch (_) {
1033
+ result = false;
1034
+ }
1035
+ const ret = result;
780
1036
  return ret;
781
1037
  };
782
1038
 
783
- module.exports.__wbg_url_58af972663531d16 = function (arg0, arg1) {
784
- const ret = getObject(arg1).url;
785
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
786
- const len1 = WASM_VECTOR_LEN;
787
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
788
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
789
- };
790
-
791
- module.exports.__wbg_headers_1b9bf90c73fae600 = function (arg0) {
792
- const ret = getObject(arg0).headers;
793
- return addHeapObject(ret);
1039
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
1040
+ let result;
1041
+ try {
1042
+ result = arg0 instanceof Uint8Array;
1043
+ } catch (_) {
1044
+ result = false;
1045
+ }
1046
+ const ret = result;
1047
+ return ret;
794
1048
  };
795
1049
 
796
- module.exports.__wbg_next_b06e115d1b01e10b = function () {
797
- return handleError(function (arg0) {
798
- const ret = getObject(arg0).next();
799
- return addHeapObject(ret);
800
- }, arguments);
1050
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
1051
+ const ret = Number.isSafeInteger(arg0);
1052
+ return ret;
801
1053
  };
802
1054
 
803
- module.exports.__wbg_done_983b5ffcaec8c583 = function (arg0) {
804
- const ret = getObject(arg0).done;
1055
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function () {
1056
+ const ret = Symbol.iterator;
805
1057
  return ret;
806
1058
  };
807
1059
 
808
- module.exports.__wbg_value_2ab8a198c834c26a = function (arg0) {
809
- const ret = getObject(arg0).value;
810
- return addHeapObject(ret);
1060
+ module.exports.__wbg_length_a446193dc22c12f8 = function (arg0) {
1061
+ const ret = arg0.length;
1062
+ return ret;
811
1063
  };
812
1064
 
813
- module.exports.__wbg_stringify_eead5648c09faaf8 = function () {
814
- return handleError(function (arg0) {
815
- const ret = JSON.stringify(getObject(arg0));
816
- return addHeapObject(ret);
817
- }, arguments);
1065
+ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
1066
+ const ret = arg0.length;
1067
+ return ret;
818
1068
  };
819
1069
 
820
- module.exports.__wbg_abort_c57daab47a6c1215 = function (arg0) {
821
- getObject(arg0).abort();
1070
+ module.exports.__wbg_log_cad59bb680daec67 = function (arg0, arg1, arg2, arg3) {
1071
+ console.log(arg0, arg1, arg2, arg3);
822
1072
  };
823
1073
 
824
- module.exports.__wbg_text_ebeee8b31af4c919 = function () {
825
- return handleError(function (arg0) {
826
- const ret = getObject(arg0).text();
827
- return addHeapObject(ret);
828
- }, arguments);
1074
+ module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function (arg0) {
1075
+ const ret = arg0.msCrypto;
1076
+ return ret;
829
1077
  };
830
1078
 
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;
1079
+ module.exports.__wbg_new0_f788a2397c7ca929 = function () {
1080
+ const ret = new Date();
838
1081
  return ret;
839
1082
  };
840
1083
 
841
- module.exports.__wbindgen_error_new = function (arg0, arg1) {
842
- const ret = new Error(getStringFromWasm0(arg0, arg1));
843
- return addHeapObject(ret);
1084
+ module.exports.__wbg_new_018dcc2d6c8c2f6a = function () {
1085
+ return handleError(function () {
1086
+ const ret = new Headers();
1087
+ return ret;
1088
+ }, arguments);
844
1089
  };
845
1090
 
846
- module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
1091
+ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
847
1092
  try {
848
1093
  var state0 = { a: arg0, b: arg1 };
849
1094
  var cb0 = (arg0, arg1) => {
850
1095
  const a = state0.a;
851
1096
  state0.a = 0;
852
1097
  try {
853
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
1098
+ return __wbg_adapter_152(a, state0.b, arg0, arg1);
854
1099
  } finally {
855
1100
  state0.a = a;
856
1101
  }
857
1102
  };
858
1103
  const ret = new Promise(cb0);
859
- return addHeapObject(ret);
1104
+ return ret;
860
1105
  } finally {
861
1106
  state0.a = state0.b = 0;
862
1107
  }
863
1108
  };
864
1109
 
865
- module.exports.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
866
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1110
+ module.exports.__wbg_new_405e22f390576ce2 = function () {
1111
+ const ret = new Object();
1112
+ return ret;
1113
+ };
1114
+
1115
+ module.exports.__wbg_new_78feb108b6472713 = function () {
1116
+ const ret = new Array();
1117
+ return ret;
867
1118
  };
868
1119
 
869
- module.exports.__wbg_new_abda76e883ba8a5f = function () {
1120
+ module.exports.__wbg_new_8a6f238a6ece86ea = function () {
870
1121
  const ret = new Error();
871
- return addHeapObject(ret);
1122
+ return ret;
872
1123
  };
873
1124
 
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);
1125
+ module.exports.__wbg_new_9fd39a253424609a = function () {
1126
+ return handleError(function () {
1127
+ const ret = new FormData();
1128
+ return ret;
1129
+ }, arguments);
880
1130
  };
881
1131
 
882
- module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
1132
+ module.exports.__wbg_new_a12002a7f91c75be = function (arg0) {
1133
+ const ret = new Uint8Array(arg0);
1134
+ return ret;
1135
+ };
1136
+
1137
+ module.exports.__wbg_new_c68d7209be747379 = function (arg0, arg1) {
1138
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1139
+ return ret;
1140
+ };
1141
+
1142
+ module.exports.__wbg_new_e25e5aab09ff45db = function () {
1143
+ return handleError(function () {
1144
+ const ret = new AbortController();
1145
+ return ret;
1146
+ }, arguments);
1147
+ };
1148
+
1149
+ module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
883
1150
  let deferred0_0;
884
1151
  let deferred0_1;
885
1152
  try {
886
1153
  deferred0_0 = arg0;
887
1154
  deferred0_1 = arg1;
888
- console.error(getStringFromWasm0(arg0, arg1));
1155
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1156
+ return ret;
889
1157
  } finally {
890
1158
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
891
1159
  }
892
1160
  };
893
1161
 
894
- module.exports.__wbg_crypto_1d1f22824a6a080c = function (arg0) {
895
- const ret = getObject(arg0).crypto;
896
- return addHeapObject(ret);
1162
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) {
1163
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1164
+ return ret;
897
1165
  };
898
1166
 
899
- module.exports.__wbg_process_4a72847cc503995b = function (arg0) {
900
- const ret = getObject(arg0).process;
901
- return addHeapObject(ret);
1167
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
1168
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1169
+ return ret;
902
1170
  };
903
1171
 
904
- module.exports.__wbg_versions_f686565e586dd935 = function (arg0) {
905
- const ret = getObject(arg0).versions;
906
- return addHeapObject(ret);
1172
+ module.exports.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
1173
+ const ret = new Uint8Array(arg0 >>> 0);
1174
+ return ret;
907
1175
  };
908
1176
 
909
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function (arg0) {
910
- const ret = getObject(arg0).node;
911
- return addHeapObject(ret);
1177
+ module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function () {
1178
+ return handleError(function (arg0, arg1, arg2) {
1179
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1180
+ return ret;
1181
+ }, arguments);
912
1182
  };
913
1183
 
914
- module.exports.__wbg_require_cca90b1a94a0255b = function () {
915
- return handleError(function () {
916
- const ret = module.require;
917
- return addHeapObject(ret);
1184
+ module.exports.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function () {
1185
+ return handleError(function (arg0, arg1) {
1186
+ const ret = new Blob(arg0, arg1);
1187
+ return ret;
918
1188
  }, arguments);
919
1189
  };
920
1190
 
921
- module.exports.__wbindgen_is_function = function (arg0) {
922
- const ret = typeof getObject(arg0) === "function";
1191
+ module.exports.__wbg_next_25feadfc0913fea9 = function (arg0) {
1192
+ const ret = arg0.next;
923
1193
  return ret;
924
1194
  };
925
1195
 
926
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function (arg0) {
927
- const ret = getObject(arg0).msCrypto;
928
- return addHeapObject(ret);
929
- };
930
-
931
- module.exports.__wbg_newwithlength_76462a666eca145f = function (arg0) {
932
- const ret = new Uint8Array(arg0 >>> 0);
933
- return addHeapObject(ret);
1196
+ module.exports.__wbg_next_6574e1a8a62d1055 = function () {
1197
+ return handleError(function (arg0) {
1198
+ const ret = arg0.next();
1199
+ return ret;
1200
+ }, arguments);
934
1201
  };
935
1202
 
936
- module.exports.__wbindgen_memory = function () {
937
- const ret = wasm.memory;
938
- return addHeapObject(ret);
1203
+ module.exports.__wbg_node_02999533c4ea02e3 = function (arg0) {
1204
+ const ret = arg0.node;
1205
+ return ret;
939
1206
  };
940
1207
 
941
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
942
- const ret = getObject(arg0).buffer;
943
- return addHeapObject(ret);
1208
+ module.exports.__wbg_process_5c1d670bc53614b8 = function (arg0) {
1209
+ const ret = arg0.process;
1210
+ return ret;
944
1211
  };
945
1212
 
946
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (arg0, arg1, arg2) {
947
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
948
- return addHeapObject(ret);
1213
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function (arg0, arg1) {
1214
+ const ret = arg0.push(arg1);
1215
+ return ret;
949
1216
  };
950
1217
 
951
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function () {
952
- return handleError(function (arg0, arg1) {
953
- getObject(arg0).randomFillSync(takeObject(arg1));
954
- }, arguments);
1218
+ module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function (arg0) {
1219
+ queueMicrotask(arg0);
955
1220
  };
956
1221
 
957
- module.exports.__wbg_subarray_975a06f9dbd16995 = function (arg0, arg1, arg2) {
958
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
959
- return addHeapObject(ret);
1222
+ module.exports.__wbg_queueMicrotask_d3219def82552485 = function (arg0) {
1223
+ const ret = arg0.queueMicrotask;
1224
+ return ret;
960
1225
  };
961
1226
 
962
- module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function () {
1227
+ module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function () {
963
1228
  return handleError(function (arg0, arg1) {
964
- getObject(arg0).getRandomValues(getObject(arg1));
1229
+ arg0.randomFillSync(arg1);
965
1230
  }, arguments);
966
1231
  };
967
1232
 
968
- module.exports.__wbg_new_fec2611eb9180f95 = function (arg0) {
969
- const ret = new Uint8Array(getObject(arg0));
970
- return addHeapObject(ret);
1233
+ module.exports.__wbg_require_79b1e9274cde3c87 = function () {
1234
+ return handleError(function () {
1235
+ const ret = module.require;
1236
+ return ret;
1237
+ }, arguments);
971
1238
  };
972
1239
 
973
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function (arg0, arg1, arg2) {
974
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1240
+ module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
1241
+ const ret = Promise.resolve(arg0);
1242
+ return ret;
975
1243
  };
976
1244
 
977
- module.exports.__wbg_self_bf91bf94d9e04084 = function () {
978
- return handleError(function () {
979
- const ret = self.self;
980
- return addHeapObject(ret);
981
- }, arguments);
1245
+ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
1246
+ arg0[arg1] = arg2;
982
1247
  };
983
1248
 
984
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function () {
985
- return handleError(function () {
986
- const ret = window.window;
987
- return addHeapObject(ret);
988
- }, arguments);
1249
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
1250
+ arg0.set(arg1, arg2 >>> 0);
989
1251
  };
990
1252
 
991
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function () {
992
- return handleError(function () {
993
- const ret = globalThis.globalThis;
994
- return addHeapObject(ret);
995
- }, arguments);
1253
+ module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
1254
+ arg0.body = arg1;
996
1255
  };
997
1256
 
998
- module.exports.__wbg_global_3eca19bb09e9c484 = function () {
999
- return handleError(function () {
1000
- const ret = global.global;
1001
- return addHeapObject(ret);
1002
- }, arguments);
1257
+ module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function (arg0, arg1) {
1258
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1003
1259
  };
1004
1260
 
1005
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function (arg0, arg1) {
1006
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1007
- return addHeapObject(ret);
1261
+ module.exports.__wbg_setheaders_834c0bdb6a8949ad = function (arg0, arg1) {
1262
+ arg0.headers = arg1;
1008
1263
  };
1009
1264
 
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);
1265
+ module.exports.__wbg_setmethod_3c5280fe5d890842 = function (arg0, arg1, arg2) {
1266
+ arg0.method = getStringFromWasm0(arg1, arg2);
1015
1267
  };
1016
1268
 
1017
- module.exports.__wbg_iterator_695d699a44d6234c = function () {
1018
- const ret = Symbol.iterator;
1019
- return addHeapObject(ret);
1269
+ module.exports.__wbg_setmode_5dc300b865044b65 = function (arg0, arg1) {
1270
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1020
1271
  };
1021
1272
 
1022
- module.exports.__wbg_next_13b477da1eaa3897 = function (arg0) {
1023
- const ret = getObject(arg0).next;
1024
- return addHeapObject(ret);
1273
+ module.exports.__wbg_setname_c0e2d6f348c746f4 = function (arg0, arg1, arg2) {
1274
+ let deferred0_0;
1275
+ let deferred0_1;
1276
+ try {
1277
+ deferred0_0 = arg1;
1278
+ deferred0_1 = arg2;
1279
+ arg0.name = getStringFromWasm0(arg1, arg2);
1280
+ } finally {
1281
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1282
+ }
1025
1283
  };
1026
1284
 
1027
- module.exports.__wbg_new_034f913e7636e987 = function () {
1028
- const ret = new Array();
1029
- return addHeapObject(ret);
1285
+ module.exports.__wbg_setsignal_75b21ef3a81de905 = function (arg0, arg1) {
1286
+ arg0.signal = arg1;
1030
1287
  };
1031
1288
 
1032
- module.exports.__wbg_push_36cf4d81d7da33d1 = function (arg0, arg1) {
1033
- const ret = getObject(arg0).push(getObject(arg1));
1034
- return ret;
1289
+ module.exports.__wbg_settype_39ed370d3edd403c = function (arg0, arg1, arg2) {
1290
+ arg0.type = getStringFromWasm0(arg1, arg2);
1035
1291
  };
1036
1292
 
1037
- module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function (arg0) {
1038
- let result;
1293
+ module.exports.__wbg_setvariant_d1d41b778dfe9c17 = function (arg0, arg1, arg2) {
1294
+ let deferred0_0;
1295
+ let deferred0_1;
1039
1296
  try {
1040
- result = getObject(arg0) instanceof ArrayBuffer;
1041
- } catch (_) {
1042
- result = false;
1297
+ deferred0_0 = arg1;
1298
+ deferred0_1 = arg2;
1299
+ arg0.variant = getStringFromWasm0(arg1, arg2);
1300
+ } finally {
1301
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1043
1302
  }
1044
- const ret = result;
1045
- return ret;
1046
1303
  };
1047
1304
 
1048
- module.exports.__wbg_new_70a2f23d1565c04c = function (arg0, arg1) {
1049
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1050
- return addHeapObject(ret);
1305
+ module.exports.__wbg_signal_aaf9ad74119f20a4 = function (arg0) {
1306
+ const ret = arg0.signal;
1307
+ return ret;
1051
1308
  };
1052
1309
 
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);
1310
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
1311
+ const ret = arg1.stack;
1312
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1313
+ const len1 = WASM_VECTOR_LEN;
1314
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1315
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1058
1316
  };
1059
1317
 
1060
- module.exports.__wbg_resolve_0aad7c1484731c99 = function (arg0) {
1061
- const ret = Promise.resolve(getObject(arg0));
1062
- return addHeapObject(ret);
1318
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () {
1319
+ const ret = typeof global === "undefined" ? null : global;
1320
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1063
1321
  };
1064
1322
 
1065
- module.exports.__wbg_then_748f75edfb032440 = function (arg0, arg1) {
1066
- const ret = getObject(arg0).then(getObject(arg1));
1067
- return addHeapObject(ret);
1323
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () {
1324
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
1325
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1068
1326
  };
1069
1327
 
1070
- module.exports.__wbg_then_4866a7d9f55d8f3e = function (arg0, arg1, arg2) {
1071
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1072
- return addHeapObject(ret);
1328
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () {
1329
+ const ret = typeof self === "undefined" ? null : self;
1330
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1073
1331
  };
1074
1332
 
1075
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function (arg0) {
1076
- const ret = getObject(arg0).length;
1077
- return ret;
1333
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () {
1334
+ const ret = typeof window === "undefined" ? null : window;
1335
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1078
1336
  };
1079
1337
 
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;
1338
+ module.exports.__wbg_status_f6360336ca686bf0 = function (arg0) {
1339
+ const ret = arg0.status;
1088
1340
  return ret;
1089
1341
  };
1090
1342
 
1091
- module.exports.__wbg_new_4e7308fbedde3997 = function () {
1092
- return handleError(function () {
1093
- const ret = new FormData();
1094
- return addHeapObject(ret);
1343
+ module.exports.__wbg_stringify_f7ed6987935b4a24 = function () {
1344
+ return handleError(function (arg0) {
1345
+ const ret = JSON.stringify(arg0);
1346
+ return ret;
1095
1347
  }, arguments);
1096
1348
  };
1097
1349
 
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));
1350
+ module.exports.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) {
1351
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1352
+ return ret;
1353
+ };
1354
+
1355
+ module.exports.__wbg_text_7805bea50de2af49 = function () {
1356
+ return handleError(function (arg0) {
1357
+ const ret = arg0.text();
1358
+ return ret;
1101
1359
  }, arguments);
1102
1360
  };
1103
1361
 
1104
- module.exports.__wbg_settype_623d2ee701e6310a = function (arg0, arg1, arg2) {
1105
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1362
+ module.exports.__wbg_then_44b73946d2fb3e7d = function (arg0, arg1) {
1363
+ const ret = arg0.then(arg1);
1364
+ return ret;
1106
1365
  };
1107
1366
 
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);
1367
+ module.exports.__wbg_then_48b406749878a531 = function (arg0, arg1, arg2) {
1368
+ const ret = arg0.then(arg1, arg2);
1369
+ return ret;
1113
1370
  };
1114
1371
 
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);
1372
+ module.exports.__wbg_url_ae10c34ca209681d = function (arg0, arg1) {
1373
+ const ret = arg1.url;
1374
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1375
+ const len1 = WASM_VECTOR_LEN;
1376
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1377
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1119
1378
  };
1120
1379
 
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);
1380
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
1381
+ const ret = arg0.value;
1382
+ return ret;
1129
1383
  };
1130
1384
 
1131
- module.exports.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) {
1132
- const ret = fetch(getObject(arg0));
1133
- return addHeapObject(ret);
1385
+ module.exports.__wbg_versions_c71aa1626a93e0a1 = function (arg0) {
1386
+ const ret = arg0.versions;
1387
+ return ret;
1134
1388
  };
1135
1389
 
1136
- module.exports.__wbg_fetch_1fdc4448ed9eec00 = function (arg0, arg1) {
1137
- const ret = getObject(arg0).fetch(getObject(arg1));
1138
- return addHeapObject(ret);
1390
+ module.exports.__wbg_warn_aaf1f4664a035bd6 = function (arg0, arg1, arg2, arg3) {
1391
+ console.warn(arg0, arg1, arg2, arg3);
1139
1392
  };
1140
1393
 
1141
- module.exports.__wbg_new_75169ae5a9683c55 = function () {
1142
- return handleError(function () {
1143
- const ret = new AbortController();
1144
- return addHeapObject(ret);
1145
- }, arguments);
1394
+ module.exports.__wbindgen_as_number = function (arg0) {
1395
+ const ret = +arg0;
1396
+ return ret;
1146
1397
  };
1147
1398
 
1148
1399
  module.exports.__wbindgen_boolean_get = function (arg0) {
1149
- const v = getObject(arg0);
1400
+ const v = arg0;
1150
1401
  const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
1151
1402
  return ret;
1152
1403
  };
1153
1404
 
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);
1405
+ module.exports.__wbindgen_cb_drop = function (arg0) {
1406
+ const obj = arg0.original;
1407
+ if (obj.cnt-- == 1) {
1408
+ obj.a = 0;
1409
+ return true;
1410
+ }
1411
+ const ret = false;
1412
+ return ret;
1159
1413
  };
1160
1414
 
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);
1415
+ module.exports.__wbindgen_closure_wrapper2146 = function (arg0, arg1, arg2) {
1416
+ const ret = makeMutClosure(arg0, arg1, 546, __wbg_adapter_42);
1417
+ return ret;
1167
1418
  };
1168
1419
 
1169
1420
  module.exports.__wbindgen_debug_string = function (arg0, arg1) {
1170
- const ret = debugString(getObject(arg1));
1421
+ const ret = debugString(arg1);
1171
1422
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1172
1423
  const len1 = WASM_VECTOR_LEN;
1173
1424
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1174
1425
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1175
1426
  };
1176
1427
 
1177
- module.exports.__wbindgen_throw = function (arg0, arg1) {
1178
- throw new Error(getStringFromWasm0(arg0, arg1));
1428
+ module.exports.__wbindgen_error_new = function (arg0, arg1) {
1429
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1430
+ return ret;
1179
1431
  };
1180
1432
 
1181
- module.exports.__wbg_queueMicrotask_848aa4969108a57e = function (arg0) {
1182
- const ret = getObject(arg0).queueMicrotask;
1183
- return addHeapObject(ret);
1433
+ module.exports.__wbindgen_in = function (arg0, arg1) {
1434
+ const ret = arg0 in arg1;
1435
+ return ret;
1184
1436
  };
1185
1437
 
1186
- module.exports.__wbg_queueMicrotask_c5419c06eab41e73 = function (arg0) {
1187
- queueMicrotask(getObject(arg0));
1438
+ module.exports.__wbindgen_init_externref_table = function () {
1439
+ const table = wasm.__wbindgen_export_4;
1440
+ const offset = table.grow(4);
1441
+ table.set(0, undefined);
1442
+ table.set(offset + 0, undefined);
1443
+ table.set(offset + 1, null);
1444
+ table.set(offset + 2, true);
1445
+ table.set(offset + 3, false);
1188
1446
  };
1189
1447
 
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);
1448
+ module.exports.__wbindgen_is_function = function (arg0) {
1449
+ const ret = typeof arg0 === "function";
1450
+ return ret;
1195
1451
  };
1196
1452
 
1197
- module.exports.__wbg_debug_a0b6c2c5ac9a4bfd = function (arg0, arg1, arg2, arg3) {
1198
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1453
+ module.exports.__wbindgen_is_object = function (arg0) {
1454
+ const val = arg0;
1455
+ const ret = typeof val === "object" && val !== null;
1456
+ return ret;
1199
1457
  };
1200
1458
 
1201
- module.exports.__wbg_error_4d17c5bb1ca90c94 = function (arg0, arg1, arg2, arg3) {
1202
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1459
+ module.exports.__wbindgen_is_string = function (arg0) {
1460
+ const ret = typeof arg0 === "string";
1461
+ return ret;
1203
1462
  };
1204
1463
 
1205
- module.exports.__wbg_info_1c7fba7da21072d1 = function (arg0, arg1, arg2, arg3) {
1206
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1464
+ module.exports.__wbindgen_is_undefined = function (arg0) {
1465
+ const ret = arg0 === undefined;
1466
+ return ret;
1207
1467
  };
1208
1468
 
1209
- module.exports.__wbg_log_4de37a0274d94769 = function (arg0, arg1, arg2, arg3) {
1210
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1469
+ module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
1470
+ const ret = arg0 == arg1;
1471
+ return ret;
1211
1472
  };
1212
1473
 
1213
- module.exports.__wbg_warn_2e2787d40aad9a81 = function (arg0, arg1, arg2, arg3) {
1214
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1474
+ module.exports.__wbindgen_memory = function () {
1475
+ const ret = wasm.memory;
1476
+ return ret;
1215
1477
  };
1216
1478
 
1217
- module.exports.__wbindgen_closure_wrapper1799 = function (arg0, arg1, arg2) {
1218
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
1219
- return addHeapObject(ret);
1479
+ module.exports.__wbindgen_number_get = function (arg0, arg1) {
1480
+ const obj = arg1;
1481
+ const ret = typeof obj === "number" ? obj : undefined;
1482
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1483
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1484
+ };
1485
+
1486
+ module.exports.__wbindgen_number_new = function (arg0) {
1487
+ const ret = arg0;
1488
+ return ret;
1489
+ };
1490
+
1491
+ module.exports.__wbindgen_string_get = function (arg0, arg1) {
1492
+ const obj = arg1;
1493
+ const ret = typeof obj === "string" ? obj : undefined;
1494
+ var ptr1 = isLikeNone(ret)
1495
+ ? 0
1496
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1497
+ var len1 = WASM_VECTOR_LEN;
1498
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1499
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1500
+ };
1501
+
1502
+ module.exports.__wbindgen_string_new = function (arg0, arg1) {
1503
+ const ret = getStringFromWasm0(arg0, arg1);
1504
+ return ret;
1505
+ };
1506
+
1507
+ module.exports.__wbindgen_throw = function (arg0, arg1) {
1508
+ throw new Error(getStringFromWasm0(arg0, arg1));
1220
1509
  };
1221
1510
 
1222
1511
  const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
@@ -1226,3 +1515,5 @@ const wasmModule = new WebAssembly.Module(bytes);
1226
1515
  const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
1227
1516
  wasm = wasmInstance.exports;
1228
1517
  module.exports.__wasm = wasm;
1518
+
1519
+ wasm.__wbindgen_start();