@learncard/didkit-plugin 1.9.3 → 1.9.5

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.
@@ -0,0 +1,1425 @@
1
+ let wasm;
2
+
3
+ let WASM_VECTOR_LEN = 0;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
+
16
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
17
+ ? function (arg, view) {
18
+ return cachedTextEncoder.encodeInto(arg, view);
19
+ }
20
+ : function (arg, view) {
21
+ const buf = cachedTextEncoder.encode(arg);
22
+ view.set(buf);
23
+ return {
24
+ read: arg.length,
25
+ written: buf.length
26
+ };
27
+ });
28
+
29
+ function passStringToWasm0(arg, malloc, realloc) {
30
+
31
+ if (realloc === undefined) {
32
+ const buf = cachedTextEncoder.encode(arg);
33
+ const ptr = malloc(buf.length, 1) >>> 0;
34
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
35
+ WASM_VECTOR_LEN = buf.length;
36
+ return ptr;
37
+ }
38
+
39
+ let len = arg.length;
40
+ let ptr = malloc(len, 1) >>> 0;
41
+
42
+ const mem = getUint8ArrayMemory0();
43
+
44
+ let offset = 0;
45
+
46
+ for (; offset < len; offset++) {
47
+ const code = arg.charCodeAt(offset);
48
+ if (code > 0x7F) break;
49
+ mem[ptr + offset] = code;
50
+ }
51
+
52
+ if (offset !== len) {
53
+ if (offset !== 0) {
54
+ arg = arg.slice(offset);
55
+ }
56
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
57
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
58
+ const ret = encodeString(arg, view);
59
+
60
+ offset += ret.written;
61
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
62
+ }
63
+
64
+ WASM_VECTOR_LEN = offset;
65
+ return ptr;
66
+ }
67
+
68
+ let cachedDataViewMemory0 = null;
69
+
70
+ function getDataViewMemory0() {
71
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
72
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
73
+ }
74
+ return cachedDataViewMemory0;
75
+ }
76
+
77
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
78
+
79
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
80
+
81
+ function getStringFromWasm0(ptr, len) {
82
+ ptr = ptr >>> 0;
83
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
84
+ }
85
+
86
+ function addToExternrefTable0(obj) {
87
+ const idx = wasm.__externref_table_alloc();
88
+ wasm.__wbindgen_export_4.set(idx, obj);
89
+ return idx;
90
+ }
91
+
92
+ function handleError(f, args) {
93
+ try {
94
+ return f.apply(this, args);
95
+ } catch (e) {
96
+ const idx = addToExternrefTable0(e);
97
+ wasm.__wbindgen_exn_store(idx);
98
+ }
99
+ }
100
+
101
+ function getArrayU8FromWasm0(ptr, len) {
102
+ ptr = ptr >>> 0;
103
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
104
+ }
105
+
106
+ function isLikeNone(x) {
107
+ return x === undefined || x === null;
108
+ }
109
+
110
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
111
+ ? { register: () => {}, unregister: () => {} }
112
+ : new FinalizationRegistry(state => {
113
+ wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b)
114
+ });
115
+
116
+ function makeMutClosure(arg0, arg1, dtor, f) {
117
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
118
+ const real = (...args) => {
119
+ // First up with a closure we increment the internal reference
120
+ // count. This ensures that the Rust closure environment won't
121
+ // be deallocated while we're invoking it.
122
+ state.cnt++;
123
+ const a = state.a;
124
+ state.a = 0;
125
+ try {
126
+ return f(a, state.b, ...args);
127
+ } finally {
128
+ if (--state.cnt === 0) {
129
+ wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
130
+ CLOSURE_DTORS.unregister(state);
131
+ } else {
132
+ state.a = a;
133
+ }
134
+ }
135
+ };
136
+ real.original = state;
137
+ CLOSURE_DTORS.register(real, state, state);
138
+ return real;
139
+ }
140
+
141
+ function debugString(val) {
142
+ // primitive types
143
+ const type = typeof val;
144
+ if (type == 'number' || type == 'boolean' || val == null) {
145
+ return `${val}`;
146
+ }
147
+ if (type == 'string') {
148
+ return `"${val}"`;
149
+ }
150
+ if (type == 'symbol') {
151
+ const description = val.description;
152
+ if (description == null) {
153
+ return 'Symbol';
154
+ } else {
155
+ return `Symbol(${description})`;
156
+ }
157
+ }
158
+ if (type == 'function') {
159
+ const name = val.name;
160
+ if (typeof name == 'string' && name.length > 0) {
161
+ return `Function(${name})`;
162
+ } else {
163
+ return 'Function';
164
+ }
165
+ }
166
+ // objects
167
+ if (Array.isArray(val)) {
168
+ const length = val.length;
169
+ let debug = '[';
170
+ if (length > 0) {
171
+ debug += debugString(val[0]);
172
+ }
173
+ for(let i = 1; i < length; i++) {
174
+ debug += ', ' + debugString(val[i]);
175
+ }
176
+ debug += ']';
177
+ return debug;
178
+ }
179
+ // Test for built-in
180
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
181
+ let className;
182
+ if (builtInMatches && builtInMatches.length > 1) {
183
+ className = builtInMatches[1];
184
+ } else {
185
+ // Failed to match the standard '[object ClassName]'
186
+ return toString.call(val);
187
+ }
188
+ if (className == 'Object') {
189
+ // we're a user defined class or Object
190
+ // JSON.stringify avoids problems with cycles, and is generally much
191
+ // easier than looping through ownProperties of `val`.
192
+ try {
193
+ return 'Object(' + JSON.stringify(val) + ')';
194
+ } catch (_) {
195
+ return 'Object';
196
+ }
197
+ }
198
+ // errors
199
+ if (val instanceof Error) {
200
+ return `${val.name}: ${val.message}\n${val.stack}`;
201
+ }
202
+ // TODO we could test for more things here, like `Set`s and `Map`s.
203
+ return className;
204
+ }
205
+ /**
206
+ * @param {string} invocation
207
+ * @returns {Promise<any>}
208
+ */
209
+ export function verifyInvocationSignature(invocation) {
210
+ const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
211
+ const len0 = WASM_VECTOR_LEN;
212
+ const ret = wasm.verifyInvocationSignature(ptr0, len0);
213
+ return ret;
214
+ }
215
+
216
+ function takeFromExternrefTable0(idx) {
217
+ const value = wasm.__wbindgen_export_4.get(idx);
218
+ wasm.__externref_table_dealloc(idx);
219
+ return value;
220
+ }
221
+ /**
222
+ * @param {string} method_pattern
223
+ * @param {string} jwk
224
+ * @returns {string}
225
+ */
226
+ export function keyToDID(method_pattern, jwk) {
227
+ let deferred4_0;
228
+ let deferred4_1;
229
+ try {
230
+ const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
231
+ const len0 = WASM_VECTOR_LEN;
232
+ const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
233
+ const len1 = WASM_VECTOR_LEN;
234
+ const ret = wasm.keyToDID(ptr0, len0, ptr1, len1);
235
+ var ptr3 = ret[0];
236
+ var len3 = ret[1];
237
+ if (ret[3]) {
238
+ ptr3 = 0; len3 = 0;
239
+ throw takeFromExternrefTable0(ret[2]);
240
+ }
241
+ deferred4_0 = ptr3;
242
+ deferred4_1 = len3;
243
+ return getStringFromWasm0(ptr3, len3);
244
+ } finally {
245
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
246
+ }
247
+ }
248
+
249
+ /**
250
+ * @param {string} capability
251
+ * @param {string} preparation
252
+ * @param {string} signature
253
+ * @returns {Promise<any>}
254
+ */
255
+ export function completeDelegateCapability(capability, preparation, signature) {
256
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
257
+ const len0 = WASM_VECTOR_LEN;
258
+ const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
259
+ const len1 = WASM_VECTOR_LEN;
260
+ const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
261
+ const len2 = WASM_VECTOR_LEN;
262
+ const ret = wasm.completeDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2);
263
+ return ret;
264
+ }
265
+
266
+ /**
267
+ * @param {string} method_pattern
268
+ * @param {string} jwk
269
+ * @returns {Promise<any>}
270
+ */
271
+ export function keyToVerificationMethod(method_pattern, jwk) {
272
+ const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
+ const len0 = WASM_VECTOR_LEN;
274
+ const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
275
+ const len1 = WASM_VECTOR_LEN;
276
+ const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
277
+ return ret;
278
+ }
279
+
280
+ /**
281
+ * @param {string} credential
282
+ * @param {string} linked_data_proof_options
283
+ * @param {string} public_key
284
+ * @returns {Promise<any>}
285
+ */
286
+ export function prepareIssueCredential(credential, linked_data_proof_options, public_key) {
287
+ const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
288
+ const len0 = WASM_VECTOR_LEN;
289
+ const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
+ const len1 = WASM_VECTOR_LEN;
291
+ const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
292
+ const len2 = WASM_VECTOR_LEN;
293
+ const ret = wasm.prepareIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
294
+ return ret;
295
+ }
296
+
297
+ /**
298
+ * @param {string} invocation
299
+ * @param {string} target_id
300
+ * @param {string} linked_data_proof_options
301
+ * @param {string} key
302
+ * @returns {Promise<any>}
303
+ */
304
+ export function invokeCapability(invocation, target_id, linked_data_proof_options, key) {
305
+ const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
306
+ const len0 = WASM_VECTOR_LEN;
307
+ const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
308
+ const len1 = WASM_VECTOR_LEN;
309
+ const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
310
+ const len2 = WASM_VECTOR_LEN;
311
+ const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
312
+ const len3 = WASM_VECTOR_LEN;
313
+ const ret = wasm.invokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
314
+ return ret;
315
+ }
316
+
317
+ function passArray8ToWasm0(arg, malloc) {
318
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
319
+ getUint8ArrayMemory0().set(arg, ptr / 1);
320
+ WASM_VECTOR_LEN = arg.length;
321
+ return ptr;
322
+ }
323
+ /**
324
+ * @param {Uint8Array} bytes
325
+ * @returns {string}
326
+ */
327
+ export function generateSecp256k1KeyFromBytes(bytes) {
328
+ let deferred3_0;
329
+ let deferred3_1;
330
+ try {
331
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
332
+ const len0 = WASM_VECTOR_LEN;
333
+ const ret = wasm.generateSecp256k1KeyFromBytes(ptr0, len0);
334
+ var ptr2 = ret[0];
335
+ var len2 = ret[1];
336
+ if (ret[3]) {
337
+ ptr2 = 0; len2 = 0;
338
+ throw takeFromExternrefTable0(ret[2]);
339
+ }
340
+ deferred3_0 = ptr2;
341
+ deferred3_1 = len2;
342
+ return getStringFromWasm0(ptr2, len2);
343
+ } finally {
344
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
345
+ }
346
+ }
347
+
348
+ /**
349
+ * @param {string} credential
350
+ * @param {string} preparation
351
+ * @param {string} signature
352
+ * @returns {Promise<any>}
353
+ */
354
+ export function completeIssueCredential(credential, preparation, signature) {
355
+ const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ const len0 = WASM_VECTOR_LEN;
357
+ const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
358
+ const len1 = WASM_VECTOR_LEN;
359
+ const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
360
+ const len2 = WASM_VECTOR_LEN;
361
+ const ret = wasm.completeIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
362
+ return ret;
363
+ }
364
+
365
+ /**
366
+ * @returns {string}
367
+ */
368
+ export function generateSecp256k1Key() {
369
+ let deferred2_0;
370
+ let deferred2_1;
371
+ try {
372
+ const ret = wasm.generateSecp256k1Key();
373
+ var ptr1 = ret[0];
374
+ var len1 = ret[1];
375
+ if (ret[3]) {
376
+ ptr1 = 0; len1 = 0;
377
+ throw takeFromExternrefTable0(ret[2]);
378
+ }
379
+ deferred2_0 = ptr1;
380
+ deferred2_1 = len1;
381
+ return getStringFromWasm0(ptr1, len1);
382
+ } finally {
383
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
384
+ }
385
+ }
386
+
387
+ /**
388
+ * @param {string} capability
389
+ * @param {string} linked_data_proof_options
390
+ * @param {string} parents
391
+ * @param {string} key
392
+ * @returns {Promise<any>}
393
+ */
394
+ export function delegateCapability(capability, linked_data_proof_options, parents, key) {
395
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
396
+ const len0 = WASM_VECTOR_LEN;
397
+ const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
398
+ const len1 = WASM_VECTOR_LEN;
399
+ const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
400
+ const len2 = WASM_VECTOR_LEN;
401
+ const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
402
+ const len3 = WASM_VECTOR_LEN;
403
+ const ret = wasm.delegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
404
+ return ret;
405
+ }
406
+
407
+ /**
408
+ * @param {string} capability
409
+ * @param {string} linked_data_proof_options
410
+ * @param {string} parents
411
+ * @param {string} public_key
412
+ * @returns {Promise<any>}
413
+ */
414
+ export function prepareDelegateCapability(capability, linked_data_proof_options, parents, public_key) {
415
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
416
+ const len0 = WASM_VECTOR_LEN;
417
+ const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
418
+ const len1 = WASM_VECTOR_LEN;
419
+ const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
420
+ const len2 = WASM_VECTOR_LEN;
421
+ const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
422
+ const len3 = WASM_VECTOR_LEN;
423
+ const ret = wasm.prepareDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
424
+ return ret;
425
+ }
426
+
427
+ function passArrayJsValueToWasm0(array, malloc) {
428
+ const ptr = malloc(array.length * 4, 4) >>> 0;
429
+ for (let i = 0; i < array.length; i++) {
430
+ const add = addToExternrefTable0(array[i]);
431
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
432
+ }
433
+ WASM_VECTOR_LEN = array.length;
434
+ return ptr;
435
+ }
436
+ /**
437
+ * @param {any} cleartext
438
+ * @param {string[]} recipients
439
+ * @returns {Promise<any>}
440
+ */
441
+ export function createDagJwe(cleartext, recipients) {
442
+ const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
443
+ const len0 = WASM_VECTOR_LEN;
444
+ const ret = wasm.createDagJwe(cleartext, ptr0, len0);
445
+ return ret;
446
+ }
447
+
448
+ /**
449
+ * @param {string} invocation
450
+ * @param {string} preparation
451
+ * @param {string} signature
452
+ * @returns {Promise<any>}
453
+ */
454
+ export function completeInvokeCapability(invocation, preparation, signature) {
455
+ const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
456
+ const len0 = WASM_VECTOR_LEN;
457
+ const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
458
+ const len1 = WASM_VECTOR_LEN;
459
+ const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
460
+ const len2 = WASM_VECTOR_LEN;
461
+ const ret = wasm.completeInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2);
462
+ return ret;
463
+ }
464
+
465
+ /**
466
+ * @param {string} delegation
467
+ * @returns {Promise<any>}
468
+ */
469
+ export function verifyDelegation(delegation) {
470
+ const ptr0 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
471
+ const len0 = WASM_VECTOR_LEN;
472
+ const ret = wasm.verifyDelegation(ptr0, len0);
473
+ return ret;
474
+ }
475
+
476
+ /**
477
+ * @param {string} did
478
+ * @returns {Promise<any>}
479
+ */
480
+ export function didToVerificationMethod(did) {
481
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
482
+ const len0 = WASM_VECTOR_LEN;
483
+ const ret = wasm.didToVerificationMethod(ptr0, len0);
484
+ return ret;
485
+ }
486
+
487
+ /**
488
+ * @param {string} vp
489
+ * @param {string} proof_options
490
+ * @param {string} context_map
491
+ * @returns {Promise<any>}
492
+ */
493
+ export function verifyPresentation(vp, proof_options, context_map) {
494
+ const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
495
+ const len0 = WASM_VECTOR_LEN;
496
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
497
+ const len1 = WASM_VECTOR_LEN;
498
+ const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
499
+ const len2 = WASM_VECTOR_LEN;
500
+ const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
501
+ return ret;
502
+ }
503
+
504
+ /**
505
+ * @param {string} presentation
506
+ * @param {string} linked_data_proof_options
507
+ * @param {string} public_key
508
+ * @returns {Promise<any>}
509
+ */
510
+ export function prepareIssuePresentation(presentation, linked_data_proof_options, public_key) {
511
+ const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
512
+ const len0 = WASM_VECTOR_LEN;
513
+ const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
514
+ const len1 = WASM_VECTOR_LEN;
515
+ const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
516
+ const len2 = WASM_VECTOR_LEN;
517
+ const ret = wasm.prepareIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
518
+ return ret;
519
+ }
520
+
521
+ /**
522
+ * @param {string} credential
523
+ * @param {string} proof_options
524
+ * @param {string} key
525
+ * @param {string} context_map
526
+ * @returns {Promise<any>}
527
+ */
528
+ export function issueCredential(credential, proof_options, key, context_map) {
529
+ const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
530
+ const len0 = WASM_VECTOR_LEN;
531
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
532
+ const len1 = WASM_VECTOR_LEN;
533
+ const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
534
+ const len2 = WASM_VECTOR_LEN;
535
+ const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
536
+ const len3 = WASM_VECTOR_LEN;
537
+ const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
538
+ return ret;
539
+ }
540
+
541
+ /**
542
+ * @param {string} did
543
+ * @param {string} input_metadata
544
+ * @returns {Promise<any>}
545
+ */
546
+ export function didResolver(did, input_metadata) {
547
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
548
+ const len0 = WASM_VECTOR_LEN;
549
+ const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
550
+ const len1 = WASM_VECTOR_LEN;
551
+ const ret = wasm.didResolver(ptr0, len0, ptr1, len1);
552
+ return ret;
553
+ }
554
+
555
+ /**
556
+ * @param {string} cleartext
557
+ * @param {string[]} recipients
558
+ * @returns {Promise<any>}
559
+ */
560
+ export function createJwe(cleartext, recipients) {
561
+ const ptr0 = passStringToWasm0(cleartext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len0 = WASM_VECTOR_LEN;
563
+ const ptr1 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
564
+ const len1 = WASM_VECTOR_LEN;
565
+ const ret = wasm.createJwe(ptr0, len0, ptr1, len1);
566
+ return ret;
567
+ }
568
+
569
+ /**
570
+ * @param {string} invocation
571
+ * @param {string} target_id
572
+ * @param {string} linked_data_proof_options
573
+ * @param {string} public_key
574
+ * @returns {Promise<any>}
575
+ */
576
+ export function prepareInvokeCapability(invocation, target_id, linked_data_proof_options, public_key) {
577
+ const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
578
+ const len0 = WASM_VECTOR_LEN;
579
+ const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
580
+ const len1 = WASM_VECTOR_LEN;
581
+ const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
582
+ const len2 = WASM_VECTOR_LEN;
583
+ const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
584
+ const len3 = WASM_VECTOR_LEN;
585
+ const ret = wasm.prepareInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
586
+ return ret;
587
+ }
588
+
589
+ /**
590
+ * @param {string} jwe
591
+ * @param {string[]} jwks
592
+ * @returns {Promise<any>}
593
+ */
594
+ export function decryptJwe(jwe, jwks) {
595
+ const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
596
+ const len0 = WASM_VECTOR_LEN;
597
+ const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
598
+ const len1 = WASM_VECTOR_LEN;
599
+ const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
600
+ return ret;
601
+ }
602
+
603
+ /**
604
+ * @param {string} tz
605
+ * @returns {Promise<any>}
606
+ */
607
+ export function JWKFromTezos(tz) {
608
+ const ptr0 = passStringToWasm0(tz, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
609
+ const len0 = WASM_VECTOR_LEN;
610
+ const ret = wasm.JWKFromTezos(ptr0, len0);
611
+ return ret;
612
+ }
613
+
614
+ /**
615
+ * @returns {string}
616
+ */
617
+ export function generateEd25519Key() {
618
+ let deferred2_0;
619
+ let deferred2_1;
620
+ try {
621
+ const ret = wasm.generateEd25519Key();
622
+ var ptr1 = ret[0];
623
+ var len1 = ret[1];
624
+ if (ret[3]) {
625
+ ptr1 = 0; len1 = 0;
626
+ throw takeFromExternrefTable0(ret[2]);
627
+ }
628
+ deferred2_0 = ptr1;
629
+ deferred2_1 = len1;
630
+ return getStringFromWasm0(ptr1, len1);
631
+ } finally {
632
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
633
+ }
634
+ }
635
+
636
+ /**
637
+ * @param {string} presentation
638
+ * @param {string} proof_options
639
+ * @param {string} key
640
+ * @param {string} context_map
641
+ * @returns {Promise<any>}
642
+ */
643
+ export function issuePresentation(presentation, proof_options, key, context_map) {
644
+ const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
645
+ const len0 = WASM_VECTOR_LEN;
646
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
647
+ const len1 = WASM_VECTOR_LEN;
648
+ const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
649
+ const len2 = WASM_VECTOR_LEN;
650
+ const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
651
+ const len3 = WASM_VECTOR_LEN;
652
+ const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
653
+ return ret;
654
+ }
655
+
656
+ /**
657
+ * @returns {Promise<any>}
658
+ */
659
+ export function clearCache() {
660
+ const ret = wasm.clearCache();
661
+ return ret;
662
+ }
663
+
664
+ /**
665
+ * @param {string} vc
666
+ * @param {string} proof_options
667
+ * @param {string} context_map
668
+ * @returns {Promise<any>}
669
+ */
670
+ export function verifyCredential(vc, proof_options, context_map) {
671
+ const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
672
+ const len0 = WASM_VECTOR_LEN;
673
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
674
+ const len1 = WASM_VECTOR_LEN;
675
+ const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
676
+ const len2 = WASM_VECTOR_LEN;
677
+ const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
678
+ return ret;
679
+ }
680
+
681
+ /**
682
+ * @param {string} did
683
+ * @param {string} input_metadata
684
+ * @returns {Promise<any>}
685
+ */
686
+ export function resolveDID(did, input_metadata) {
687
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
688
+ const len0 = WASM_VECTOR_LEN;
689
+ const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
690
+ const len1 = WASM_VECTOR_LEN;
691
+ const ret = wasm.resolveDID(ptr0, len0, ptr1, len1);
692
+ return ret;
693
+ }
694
+
695
+ /**
696
+ * @param {string} url
697
+ * @returns {Promise<any>}
698
+ */
699
+ export function contextLoader(url) {
700
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
701
+ const len0 = WASM_VECTOR_LEN;
702
+ const ret = wasm.contextLoader(ptr0, len0);
703
+ return ret;
704
+ }
705
+
706
+ /**
707
+ * @param {string} invocation
708
+ * @param {string} delegation
709
+ * @returns {Promise<any>}
710
+ */
711
+ export function verifyInvocation(invocation, delegation) {
712
+ const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
713
+ const len0 = WASM_VECTOR_LEN;
714
+ const ptr1 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
715
+ const len1 = WASM_VECTOR_LEN;
716
+ const ret = wasm.verifyInvocation(ptr0, len0, ptr1, len1);
717
+ return ret;
718
+ }
719
+
720
+ /**
721
+ * @param {Uint8Array} bytes
722
+ * @returns {string}
723
+ */
724
+ export function generateEd25519KeyFromBytes(bytes) {
725
+ let deferred3_0;
726
+ let deferred3_1;
727
+ try {
728
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
729
+ const len0 = WASM_VECTOR_LEN;
730
+ const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
731
+ var ptr2 = ret[0];
732
+ var len2 = ret[1];
733
+ if (ret[3]) {
734
+ ptr2 = 0; len2 = 0;
735
+ throw takeFromExternrefTable0(ret[2]);
736
+ }
737
+ deferred3_0 = ptr2;
738
+ deferred3_1 = len2;
739
+ return getStringFromWasm0(ptr2, len2);
740
+ } finally {
741
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
742
+ }
743
+ }
744
+
745
+ /**
746
+ * @param {string} jwe
747
+ * @param {string[]} jwks
748
+ * @returns {Promise<any>}
749
+ */
750
+ export function decryptDagJwe(jwe, jwks) {
751
+ const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
752
+ const len0 = WASM_VECTOR_LEN;
753
+ const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
754
+ const len1 = WASM_VECTOR_LEN;
755
+ const ret = wasm.decryptDagJwe(ptr0, len0, ptr1, len1);
756
+ return ret;
757
+ }
758
+
759
+ /**
760
+ * @param {string} holder
761
+ * @param {string} linked_data_proof_options
762
+ * @param {string} key
763
+ * @param {string} context_map
764
+ * @returns {Promise<any>}
765
+ */
766
+ export function DIDAuth(holder, linked_data_proof_options, key, context_map) {
767
+ const ptr0 = passStringToWasm0(holder, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
768
+ const len0 = WASM_VECTOR_LEN;
769
+ const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
770
+ const len1 = WASM_VECTOR_LEN;
771
+ const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
772
+ const len2 = WASM_VECTOR_LEN;
773
+ const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
+ const len3 = WASM_VECTOR_LEN;
775
+ const ret = wasm.DIDAuth(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
776
+ return ret;
777
+ }
778
+
779
+ /**
780
+ * @param {string} presentation
781
+ * @param {string} preparation
782
+ * @param {string} signature
783
+ * @returns {Promise<any>}
784
+ */
785
+ export function completeIssuePresentation(presentation, preparation, signature) {
786
+ const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
787
+ const len0 = WASM_VECTOR_LEN;
788
+ const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
789
+ const len1 = WASM_VECTOR_LEN;
790
+ const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
791
+ const len2 = WASM_VECTOR_LEN;
792
+ const ret = wasm.completeIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
793
+ return ret;
794
+ }
795
+
796
+ /**
797
+ * @returns {string}
798
+ */
799
+ export function getVersion() {
800
+ let deferred1_0;
801
+ let deferred1_1;
802
+ try {
803
+ const ret = wasm.getVersion();
804
+ deferred1_0 = ret[0];
805
+ deferred1_1 = ret[1];
806
+ return getStringFromWasm0(ret[0], ret[1]);
807
+ } finally {
808
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
809
+ }
810
+ }
811
+
812
+ function __wbg_adapter_54(arg0, arg1, arg2) {
813
+ wasm.closure4149_externref_shim(arg0, arg1, arg2);
814
+ }
815
+
816
+ function __wbg_adapter_172(arg0, arg1, arg2, arg3) {
817
+ wasm.closure4546_externref_shim(arg0, arg1, arg2, arg3);
818
+ }
819
+
820
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
821
+
822
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
823
+
824
+ async function __wbg_load(module, imports) {
825
+ if (typeof Response === 'function' && module instanceof Response) {
826
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
827
+ try {
828
+ return await WebAssembly.instantiateStreaming(module, imports);
829
+
830
+ } catch (e) {
831
+ if (module.headers.get('Content-Type') != 'application/wasm') {
832
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
833
+
834
+ } else {
835
+ throw e;
836
+ }
837
+ }
838
+ }
839
+
840
+ const bytes = await module.arrayBuffer();
841
+ return await WebAssembly.instantiate(bytes, imports);
842
+
843
+ } else {
844
+ const instance = await WebAssembly.instantiate(module, imports);
845
+
846
+ if (instance instanceof WebAssembly.Instance) {
847
+ return { instance, module };
848
+
849
+ } else {
850
+ return instance;
851
+ }
852
+ }
853
+ }
854
+
855
+ function __wbg_get_imports() {
856
+ const imports = {};
857
+ imports.wbg = {};
858
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
859
+ const ret = String(arg1);
860
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
861
+ const len1 = WASM_VECTOR_LEN;
862
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
863
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
864
+ };
865
+ imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
866
+ arg0.abort();
867
+ };
868
+ imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
869
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
870
+ }, arguments) };
871
+ imports.wbg.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
872
+ const ret = arg0.arrayBuffer();
873
+ return ret;
874
+ }, arguments) };
875
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
876
+ const ret = arg0.buffer;
877
+ return ret;
878
+ };
879
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
880
+ const ret = arg0.call(arg1);
881
+ return ret;
882
+ }, arguments) };
883
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
884
+ const ret = arg0.call(arg1, arg2);
885
+ return ret;
886
+ }, arguments) };
887
+ imports.wbg.__wbg_crypto_038798f665f985e2 = function(arg0) {
888
+ const ret = arg0.crypto;
889
+ return ret;
890
+ };
891
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
892
+ const ret = arg0.crypto;
893
+ return ret;
894
+ };
895
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
896
+ const ret = arg0.done;
897
+ return ret;
898
+ };
899
+ imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
900
+ const ret = Object.entries(arg0);
901
+ return ret;
902
+ };
903
+ imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
904
+ const ret = arg0.fetch(arg1);
905
+ return ret;
906
+ };
907
+ imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
908
+ const ret = fetch(arg0);
909
+ return ret;
910
+ };
911
+ imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
912
+ const ret = Array.from(arg0);
913
+ return ret;
914
+ };
915
+ imports.wbg.__wbg_getRandomValues_371e7ade8bd92088 = function(arg0, arg1) {
916
+ arg0.getRandomValues(arg1);
917
+ };
918
+ imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
919
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
920
+ }, arguments) };
921
+ imports.wbg.__wbg_getRandomValues_7dfe5bd1b67c9ca1 = function(arg0) {
922
+ const ret = arg0.getRandomValues;
923
+ return ret;
924
+ };
925
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
926
+ arg0.getRandomValues(arg1);
927
+ }, arguments) };
928
+ imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
929
+ const ret = arg0.getTime();
930
+ return ret;
931
+ };
932
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
933
+ const ret = Reflect.get(arg0, arg1);
934
+ return ret;
935
+ }, arguments) };
936
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
937
+ const ret = arg0[arg1 >>> 0];
938
+ return ret;
939
+ };
940
+ imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
941
+ const ret = Reflect.has(arg0, arg1);
942
+ return ret;
943
+ }, arguments) };
944
+ imports.wbg.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
945
+ const ret = arg0.headers;
946
+ return ret;
947
+ };
948
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
949
+ let result;
950
+ try {
951
+ result = arg0 instanceof ArrayBuffer;
952
+ } catch (_) {
953
+ result = false;
954
+ }
955
+ const ret = result;
956
+ return ret;
957
+ };
958
+ imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
959
+ let result;
960
+ try {
961
+ result = arg0 instanceof Map;
962
+ } catch (_) {
963
+ result = false;
964
+ }
965
+ const ret = result;
966
+ return ret;
967
+ };
968
+ imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
969
+ let result;
970
+ try {
971
+ result = arg0 instanceof Response;
972
+ } catch (_) {
973
+ result = false;
974
+ }
975
+ const ret = result;
976
+ return ret;
977
+ };
978
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
979
+ let result;
980
+ try {
981
+ result = arg0 instanceof Uint8Array;
982
+ } catch (_) {
983
+ result = false;
984
+ }
985
+ const ret = result;
986
+ return ret;
987
+ };
988
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
989
+ const ret = Array.isArray(arg0);
990
+ return ret;
991
+ };
992
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
993
+ const ret = Number.isSafeInteger(arg0);
994
+ return ret;
995
+ };
996
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
997
+ const ret = Symbol.iterator;
998
+ return ret;
999
+ };
1000
+ imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1001
+ const ret = Object.keys(arg0);
1002
+ return ret;
1003
+ };
1004
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1005
+ const ret = arg0.length;
1006
+ return ret;
1007
+ };
1008
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1009
+ const ret = arg0.length;
1010
+ return ret;
1011
+ };
1012
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1013
+ const ret = arg0.msCrypto;
1014
+ return ret;
1015
+ };
1016
+ imports.wbg.__wbg_msCrypto_ff35fce085fab2a3 = function(arg0) {
1017
+ const ret = arg0.msCrypto;
1018
+ return ret;
1019
+ };
1020
+ imports.wbg.__wbg_new0_f788a2397c7ca929 = function() {
1021
+ const ret = new Date();
1022
+ return ret;
1023
+ };
1024
+ imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
1025
+ const ret = new Headers();
1026
+ return ret;
1027
+ }, arguments) };
1028
+ imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1029
+ try {
1030
+ var state0 = {a: arg0, b: arg1};
1031
+ var cb0 = (arg0, arg1) => {
1032
+ const a = state0.a;
1033
+ state0.a = 0;
1034
+ try {
1035
+ return __wbg_adapter_172(a, state0.b, arg0, arg1);
1036
+ } finally {
1037
+ state0.a = a;
1038
+ }
1039
+ };
1040
+ const ret = new Promise(cb0);
1041
+ return ret;
1042
+ } finally {
1043
+ state0.a = state0.b = 0;
1044
+ }
1045
+ };
1046
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1047
+ const ret = new Object();
1048
+ return ret;
1049
+ };
1050
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1051
+ const ret = new Map();
1052
+ return ret;
1053
+ };
1054
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
1055
+ const ret = new Array();
1056
+ return ret;
1057
+ };
1058
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1059
+ const ret = new Uint8Array(arg0);
1060
+ return ret;
1061
+ };
1062
+ imports.wbg.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
1063
+ const ret = new AbortController();
1064
+ return ret;
1065
+ }, arguments) };
1066
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1067
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1068
+ return ret;
1069
+ };
1070
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1071
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1072
+ return ret;
1073
+ };
1074
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1075
+ const ret = new Uint8Array(arg0 >>> 0);
1076
+ return ret;
1077
+ };
1078
+ imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
1079
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1080
+ return ret;
1081
+ }, arguments) };
1082
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1083
+ const ret = arg0.next;
1084
+ return ret;
1085
+ };
1086
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1087
+ const ret = arg0.next();
1088
+ return ret;
1089
+ }, arguments) };
1090
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1091
+ const ret = arg0.node;
1092
+ return ret;
1093
+ };
1094
+ imports.wbg.__wbg_now_d18023d54d4e5500 = function(arg0) {
1095
+ const ret = arg0.now();
1096
+ return ret;
1097
+ };
1098
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1099
+ const ret = arg0.process;
1100
+ return ret;
1101
+ };
1102
+ imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1103
+ const ret = arg0.push(arg1);
1104
+ return ret;
1105
+ };
1106
+ imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
1107
+ queueMicrotask(arg0);
1108
+ };
1109
+ imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
1110
+ const ret = arg0.queueMicrotask;
1111
+ return ret;
1112
+ };
1113
+ imports.wbg.__wbg_randomFillSync_994ac6d9ade7a695 = function(arg0, arg1, arg2) {
1114
+ arg0.randomFillSync(getArrayU8FromWasm0(arg1, arg2));
1115
+ };
1116
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1117
+ arg0.randomFillSync(arg1);
1118
+ }, arguments) };
1119
+ imports.wbg.__wbg_require_0d6aeaec3c042c88 = function(arg0, arg1, arg2) {
1120
+ const ret = arg0.require(getStringFromWasm0(arg1, arg2));
1121
+ return ret;
1122
+ };
1123
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1124
+ const ret = module.require;
1125
+ return ret;
1126
+ }, arguments) };
1127
+ imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1128
+ const ret = Promise.resolve(arg0);
1129
+ return ret;
1130
+ };
1131
+ imports.wbg.__wbg_self_25aabeb5a7b41685 = function() { return handleError(function () {
1132
+ const ret = self.self;
1133
+ return ret;
1134
+ }, arguments) };
1135
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1136
+ arg0[arg1 >>> 0] = arg2;
1137
+ };
1138
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1139
+ arg0[arg1] = arg2;
1140
+ };
1141
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1142
+ arg0.set(arg1, arg2 >>> 0);
1143
+ };
1144
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
1145
+ const ret = arg0.set(arg1, arg2);
1146
+ return ret;
1147
+ };
1148
+ imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1149
+ const ret = Reflect.set(arg0, arg1, arg2);
1150
+ return ret;
1151
+ }, arguments) };
1152
+ imports.wbg.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
1153
+ arg0.body = arg1;
1154
+ };
1155
+ imports.wbg.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
1156
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1157
+ };
1158
+ imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
1159
+ arg0.headers = arg1;
1160
+ };
1161
+ imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
1162
+ arg0.method = getStringFromWasm0(arg1, arg2);
1163
+ };
1164
+ imports.wbg.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
1165
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1166
+ };
1167
+ imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
1168
+ arg0.signal = arg1;
1169
+ };
1170
+ imports.wbg.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
1171
+ const ret = arg0.signal;
1172
+ return ret;
1173
+ };
1174
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1175
+ const ret = typeof global === 'undefined' ? null : global;
1176
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1177
+ };
1178
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1179
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1180
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1181
+ };
1182
+ imports.wbg.__wbg_static_accessor_MODULE_ef3aa2eb251158a5 = function() {
1183
+ const ret = module;
1184
+ return ret;
1185
+ };
1186
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1187
+ const ret = typeof self === 'undefined' ? null : self;
1188
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1189
+ };
1190
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1191
+ const ret = typeof window === 'undefined' ? null : window;
1192
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1193
+ };
1194
+ imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) {
1195
+ const ret = arg0.status;
1196
+ return ret;
1197
+ };
1198
+ imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
1199
+ const ret = JSON.stringify(arg0);
1200
+ return ret;
1201
+ }, arguments) };
1202
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1203
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1204
+ return ret;
1205
+ };
1206
+ imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1207
+ const ret = arg0.then(arg1);
1208
+ return ret;
1209
+ };
1210
+ imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1211
+ const ret = arg0.then(arg1, arg2);
1212
+ return ret;
1213
+ };
1214
+ imports.wbg.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
1215
+ const ret = arg1.url;
1216
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1217
+ const len1 = WASM_VECTOR_LEN;
1218
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1219
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1220
+ };
1221
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1222
+ const ret = arg0.value;
1223
+ return ret;
1224
+ };
1225
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1226
+ const ret = arg0.versions;
1227
+ return ret;
1228
+ };
1229
+ imports.wbg.__wbindgen_bigint_from_i128 = function(arg0, arg1) {
1230
+ const ret = arg0 << BigInt(64) | BigInt.asUintN(64, arg1);
1231
+ return ret;
1232
+ };
1233
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1234
+ const ret = arg0;
1235
+ return ret;
1236
+ };
1237
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1238
+ const ret = BigInt.asUintN(64, arg0);
1239
+ return ret;
1240
+ };
1241
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
1242
+ const v = arg1;
1243
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1244
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1245
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1246
+ };
1247
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
1248
+ const v = arg0;
1249
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1250
+ return ret;
1251
+ };
1252
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
1253
+ const obj = arg0.original;
1254
+ if (obj.cnt-- == 1) {
1255
+ obj.a = 0;
1256
+ return true;
1257
+ }
1258
+ const ret = false;
1259
+ return ret;
1260
+ };
1261
+ imports.wbg.__wbindgen_closure_wrapper12203 = function(arg0, arg1, arg2) {
1262
+ const ret = makeMutClosure(arg0, arg1, 4150, __wbg_adapter_54);
1263
+ return ret;
1264
+ };
1265
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1266
+ const ret = debugString(arg1);
1267
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1268
+ const len1 = WASM_VECTOR_LEN;
1269
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1270
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1271
+ };
1272
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1273
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1274
+ return ret;
1275
+ };
1276
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
1277
+ const ret = arg0 in arg1;
1278
+ return ret;
1279
+ };
1280
+ imports.wbg.__wbindgen_init_externref_table = function() {
1281
+ const table = wasm.__wbindgen_export_4;
1282
+ const offset = table.grow(4);
1283
+ table.set(0, undefined);
1284
+ table.set(offset + 0, undefined);
1285
+ table.set(offset + 1, null);
1286
+ table.set(offset + 2, true);
1287
+ table.set(offset + 3, false);
1288
+ ;
1289
+ };
1290
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
1291
+ const ret = typeof(arg0) === 'bigint';
1292
+ return ret;
1293
+ };
1294
+ imports.wbg.__wbindgen_is_function = function(arg0) {
1295
+ const ret = typeof(arg0) === 'function';
1296
+ return ret;
1297
+ };
1298
+ imports.wbg.__wbindgen_is_null = function(arg0) {
1299
+ const ret = arg0 === null;
1300
+ return ret;
1301
+ };
1302
+ imports.wbg.__wbindgen_is_object = function(arg0) {
1303
+ const val = arg0;
1304
+ const ret = typeof(val) === 'object' && val !== null;
1305
+ return ret;
1306
+ };
1307
+ imports.wbg.__wbindgen_is_string = function(arg0) {
1308
+ const ret = typeof(arg0) === 'string';
1309
+ return ret;
1310
+ };
1311
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
1312
+ const ret = arg0 === undefined;
1313
+ return ret;
1314
+ };
1315
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
1316
+ const ret = arg0 === arg1;
1317
+ return ret;
1318
+ };
1319
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1320
+ const ret = arg0 == arg1;
1321
+ return ret;
1322
+ };
1323
+ imports.wbg.__wbindgen_memory = function() {
1324
+ const ret = wasm.memory;
1325
+ return ret;
1326
+ };
1327
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1328
+ const obj = arg1;
1329
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1330
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1331
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1332
+ };
1333
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1334
+ const ret = arg0;
1335
+ return ret;
1336
+ };
1337
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1338
+ const obj = arg1;
1339
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1340
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1341
+ var len1 = WASM_VECTOR_LEN;
1342
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1343
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1344
+ };
1345
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1346
+ const ret = getStringFromWasm0(arg0, arg1);
1347
+ return ret;
1348
+ };
1349
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1350
+ throw new Error(getStringFromWasm0(arg0, arg1));
1351
+ };
1352
+
1353
+ return imports;
1354
+ }
1355
+
1356
+ function __wbg_init_memory(imports, memory) {
1357
+
1358
+ }
1359
+
1360
+ function __wbg_finalize_init(instance, module) {
1361
+ wasm = instance.exports;
1362
+ __wbg_init.__wbindgen_wasm_module = module;
1363
+ cachedDataViewMemory0 = null;
1364
+ cachedUint8ArrayMemory0 = null;
1365
+
1366
+
1367
+ wasm.__wbindgen_start();
1368
+ return wasm;
1369
+ }
1370
+
1371
+ function initSync(module) {
1372
+ if (wasm !== undefined) return wasm;
1373
+
1374
+
1375
+ if (typeof module !== 'undefined') {
1376
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1377
+ ({module} = module)
1378
+ } else {
1379
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1380
+ }
1381
+ }
1382
+
1383
+ const imports = __wbg_get_imports();
1384
+
1385
+ __wbg_init_memory(imports);
1386
+
1387
+ if (!(module instanceof WebAssembly.Module)) {
1388
+ module = new WebAssembly.Module(module);
1389
+ }
1390
+
1391
+ const instance = new WebAssembly.Instance(module, imports);
1392
+
1393
+ return __wbg_finalize_init(instance, module);
1394
+ }
1395
+
1396
+ async function __wbg_init(module_or_path) {
1397
+ if (wasm !== undefined) return wasm;
1398
+
1399
+
1400
+ if (typeof module_or_path !== 'undefined') {
1401
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1402
+ ({module_or_path} = module_or_path)
1403
+ } else {
1404
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1405
+ }
1406
+ }
1407
+
1408
+ if (typeof module_or_path === 'undefined') {
1409
+ module_or_path = new URL('didkit_wasm_bg.wasm', import.meta.url);
1410
+ }
1411
+ const imports = __wbg_get_imports();
1412
+
1413
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1414
+ module_or_path = fetch(module_or_path);
1415
+ }
1416
+
1417
+ __wbg_init_memory(imports);
1418
+
1419
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1420
+
1421
+ return __wbg_finalize_init(instance, module);
1422
+ }
1423
+
1424
+ export { initSync };
1425
+ export default __wbg_init;