@trylimbo/sdk-verifier-wasm 0.1.0-canary.100

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,1683 @@
1
+ /* @ts-self-types="./trylimbo_sdk_verifier.d.ts" */
2
+
3
+ export class AssetVerifier {
4
+ static __wrap(ptr) {
5
+ const obj = Object.create(AssetVerifier.prototype);
6
+ obj.__wbg_ptr = ptr;
7
+ AssetVerifierFinalization.register(obj, obj.__wbg_ptr, obj);
8
+ return obj;
9
+ }
10
+ __destroy_into_raw() {
11
+ const ptr = this.__wbg_ptr;
12
+ this.__wbg_ptr = 0;
13
+ AssetVerifierFinalization.unregister(this);
14
+ return ptr;
15
+ }
16
+ free() {
17
+ const ptr = this.__destroy_into_raw();
18
+ wasm.__wbg_assetverifier_free(ptr, 0);
19
+ }
20
+ /**
21
+ * # Errors
22
+ *
23
+ * Throws `TRUST_CONFIG_INVALID` when the trust anchors are invalid.
24
+ * @param {AssetVerifierOptions} options
25
+ * @returns {AssetVerifier}
26
+ */
27
+ static create(options) {
28
+ const ret = wasm.assetverifier_create(options);
29
+ if (ret[2]) {
30
+ throw takeFromExternrefTable0(ret[1]);
31
+ }
32
+ return AssetVerifier.__wrap(ret[0]);
33
+ }
34
+ /**
35
+ * Verify an asset against the configured trust anchors. `binders` compose
36
+ * soft-binding recovery after the embedded pass, tried in order,
37
+ * first hit wins; pass `[]` to proceed directly to registry `byContent` recovery.
38
+ *
39
+ * Reads the C2PA-native formats. A container format (MXF) is plugin-backed, and plugins
40
+ * are native, so a master is verified through the native SDK.
41
+ *
42
+ * # Errors
43
+ *
44
+ * Throws on a malformed `input`, a registry (or binder) failure, or a validation
45
+ * failure.
46
+ * @param {RangeSource} input
47
+ * @param {Binder[]} binders
48
+ * @returns {Promise<AssetVerification>}
49
+ */
50
+ verify(input, binders) {
51
+ const ptr0 = passArrayJsValueToWasm0(binders, wasm.__wbindgen_malloc);
52
+ const len0 = WASM_VECTOR_LEN;
53
+ const ret = wasm.assetverifier_verify(this.__wbg_ptr, input, ptr0, len0);
54
+ return ret;
55
+ }
56
+ }
57
+ if (Symbol.dispose) AssetVerifier.prototype[Symbol.dispose] = AssetVerifier.prototype.free;
58
+
59
+ /**
60
+ * A soft-binding binder a client runs itself. Build with `Binder.iscc()` or
61
+ * `Binder.held(binding)`, and pass a list to `verify`.
62
+ *
63
+ * Vendor watermark detection is registry-side in this SDK: configured detectors participate in
64
+ * `verify` through `byContent`, while `Binder.held` covers values already available to the caller.
65
+ */
66
+ export class Binder {
67
+ static __wrap(ptr) {
68
+ const obj = Object.create(Binder.prototype);
69
+ obj.__wbg_ptr = ptr;
70
+ BinderFinalization.register(obj, obj.__wbg_ptr, obj);
71
+ return obj;
72
+ }
73
+ static __unwrap(jsValue) {
74
+ if (!(jsValue instanceof Binder)) {
75
+ return 0;
76
+ }
77
+ return jsValue.__destroy_into_raw();
78
+ }
79
+ __destroy_into_raw() {
80
+ const ptr = this.__wbg_ptr;
81
+ this.__wbg_ptr = 0;
82
+ BinderFinalization.unregister(this);
83
+ return ptr;
84
+ }
85
+ free() {
86
+ const ptr = this.__destroy_into_raw();
87
+ wasm.__wbg_binder_free(ptr, 0);
88
+ }
89
+ /**
90
+ * Derive this binder's binding standalone; `undefined` when it finds none.
91
+ * Input is a `RangeSource` (format inferred from content when omitted).
92
+ *
93
+ * # Errors
94
+ *
95
+ * Throws on malformed or unreadable input.
96
+ * @param {RangeSource} content
97
+ * @param {string | null} [format]
98
+ * @returns {Promise<SoftBinding | undefined>}
99
+ */
100
+ derive(content, format) {
101
+ var ptr0 = isLikeNone(format) ? 0 : passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
102
+ var len0 = WASM_VECTOR_LEN;
103
+ const ret = wasm.binder_derive(this.__wbg_ptr, content, ptr0, len0);
104
+ return ret;
105
+ }
106
+ /**
107
+ * A binder contributing a binding you already hold (e.g. an out-of-band video ISCC).
108
+ * @param {SoftBinding} binding
109
+ * @returns {Binder}
110
+ */
111
+ static held(binding) {
112
+ const ret = wasm.binder_held(binding);
113
+ if (ret[2]) {
114
+ throw takeFromExternrefTable0(ret[1]);
115
+ }
116
+ return Binder.__wrap(ret[0]);
117
+ }
118
+ /**
119
+ * Local ISCC Image-Code for supported image formats.
120
+ * @returns {Binder}
121
+ */
122
+ static iscc() {
123
+ const ret = wasm.binder_iscc();
124
+ return Binder.__wrap(ret);
125
+ }
126
+ }
127
+ if (Symbol.dispose) Binder.prototype[Symbol.dispose] = Binder.prototype.free;
128
+
129
+ /**
130
+ * A [`RangeSource`](crate::wasm::RangeInput) over a `Blob`: a `File` off an `<input>`, a
131
+ * `Response.blob()`, a handle from the file system access API.
132
+ *
133
+ * The only source here that holds nothing. The SDK reads one slice at a time, so an asset larger
134
+ * than the tab's memory verifies at the disk's speed rather than the heap's, and neither ceiling
135
+ * the other two carry applies.
136
+ *
137
+ * # Worker only
138
+ *
139
+ * A `Blob` has exactly one synchronous read, `FileReaderSync`, and it is defined on workers alone.
140
+ * Constructing this on a document's own thread throws. That is the platform's constraint rather
141
+ * than the SDK's, and it is reported at construction rather than at the first read.
142
+ */
143
+ export class BlobSource {
144
+ __destroy_into_raw() {
145
+ const ptr = this.__wbg_ptr;
146
+ this.__wbg_ptr = 0;
147
+ BlobSourceFinalization.unregister(this);
148
+ return ptr;
149
+ }
150
+ free() {
151
+ const ptr = this.__destroy_into_raw();
152
+ wasm.__wbg_blobsource_free(ptr, 0);
153
+ }
154
+ /**
155
+ * The offset is a JS number rather than a `u32` because a `Blob` is the one store here that
156
+ * can outrun what a `u32` names, and it is the width the platform's own slice takes.
157
+ * @returns {number}
158
+ */
159
+ get length() {
160
+ const ret = wasm.blobsource_length(this.__wbg_ptr);
161
+ return ret;
162
+ }
163
+ /**
164
+ * # Errors
165
+ *
166
+ * Throws when this is not a worker thread, where a `Blob` cannot be read synchronously.
167
+ * @param {Blob} blob
168
+ */
169
+ constructor(blob) {
170
+ const ret = wasm.blobsource_new(blob);
171
+ if (ret[2]) {
172
+ throw takeFromExternrefTable0(ret[1]);
173
+ }
174
+ this.__wbg_ptr = ret[0];
175
+ BlobSourceFinalization.register(this, this.__wbg_ptr, this);
176
+ return this;
177
+ }
178
+ /**
179
+ * Answers the platform's own array, never routed through linear memory: the port's JS-facing
180
+ * half exists so this hop costs one copy rather than three.
181
+ *
182
+ * # Errors
183
+ *
184
+ * Throws when the platform refuses the slice or the read. Reading at or past the end is not a
185
+ * failure: it answers empty, which every caller already reads as an end of file.
186
+ * @param {number} offset
187
+ * @param {number} length
188
+ * @returns {Uint8Array}
189
+ */
190
+ readAt(offset, length) {
191
+ const ret = wasm.blobsource_readAt(this.__wbg_ptr, offset, length);
192
+ if (ret[2]) {
193
+ throw takeFromExternrefTable0(ret[1]);
194
+ }
195
+ return takeFromExternrefTable0(ret[0]);
196
+ }
197
+ }
198
+ if (Symbol.dispose) BlobSource.prototype[Symbol.dispose] = BlobSource.prototype.free;
199
+
200
+ /**
201
+ * A [`RangeSource`](crate::wasm::RangeInput) over bytes the caller already holds, read in place.
202
+ *
203
+ * [`MemorySource`] without the copy: the array stays on the JS side and only the window the SDK
204
+ * asks for crosses, so nothing is resident here and linear memory's 4 GiB ceiling never applies to
205
+ * the asset.
206
+ */
207
+ export class BytesSource {
208
+ __destroy_into_raw() {
209
+ const ptr = this.__wbg_ptr;
210
+ this.__wbg_ptr = 0;
211
+ BytesSourceFinalization.unregister(this);
212
+ return ptr;
213
+ }
214
+ free() {
215
+ const ptr = this.__destroy_into_raw();
216
+ wasm.__wbg_bytessource_free(ptr, 0);
217
+ }
218
+ /**
219
+ * @returns {number}
220
+ */
221
+ get length() {
222
+ const ret = wasm.bytessource_length(this.__wbg_ptr);
223
+ return ret;
224
+ }
225
+ /**
226
+ * @param {Uint8Array} data
227
+ */
228
+ constructor(data) {
229
+ const ret = wasm.bytessource_new(data);
230
+ this.__wbg_ptr = ret;
231
+ BytesSourceFinalization.register(this, this.__wbg_ptr, this);
232
+ return this;
233
+ }
234
+ /**
235
+ * @param {number} offset
236
+ * @param {number} length
237
+ * @returns {Uint8Array}
238
+ */
239
+ readAt(offset, length) {
240
+ const ret = wasm.bytessource_readAt(this.__wbg_ptr, offset, length);
241
+ return ret;
242
+ }
243
+ }
244
+ if (Symbol.dispose) BytesSource.prototype[Symbol.dispose] = BytesSource.prototype.free;
245
+
246
+ /**
247
+ * @returns {string}
248
+ */
249
+ export function C2PA_TRUST_LIST() {
250
+ let deferred1_0;
251
+ let deferred1_1;
252
+ try {
253
+ const ret = wasm.C2PA_TRUST_LIST();
254
+ deferred1_0 = ret[0];
255
+ deferred1_1 = ret[1];
256
+ return getStringFromWasm0(ret[0], ret[1]);
257
+ } finally {
258
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
259
+ }
260
+ }
261
+
262
+ /**
263
+ * @returns {string}
264
+ */
265
+ export function C2PA_TSA_TRUST_LIST() {
266
+ let deferred1_0;
267
+ let deferred1_1;
268
+ try {
269
+ const ret = wasm.C2PA_TSA_TRUST_LIST();
270
+ deferred1_0 = ret[0];
271
+ deferred1_1 = ret[1];
272
+ return getStringFromWasm0(ret[0], ret[1]);
273
+ } finally {
274
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
275
+ }
276
+ }
277
+
278
+ /**
279
+ * @returns {string}
280
+ */
281
+ export function DEV_CA() {
282
+ let deferred1_0;
283
+ let deferred1_1;
284
+ try {
285
+ const ret = wasm.DEV_CA();
286
+ deferred1_0 = ret[0];
287
+ deferred1_1 = ret[1];
288
+ return getStringFromWasm0(ret[0], ret[1]);
289
+ } finally {
290
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
291
+ }
292
+ }
293
+
294
+ export class IntoUnderlyingByteSource {
295
+ __destroy_into_raw() {
296
+ const ptr = this.__wbg_ptr;
297
+ this.__wbg_ptr = 0;
298
+ IntoUnderlyingByteSourceFinalization.unregister(this);
299
+ return ptr;
300
+ }
301
+ free() {
302
+ const ptr = this.__destroy_into_raw();
303
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
304
+ }
305
+ /**
306
+ * @returns {number}
307
+ */
308
+ get autoAllocateChunkSize() {
309
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
310
+ return ret >>> 0;
311
+ }
312
+ cancel() {
313
+ const ptr = this.__destroy_into_raw();
314
+ wasm.intounderlyingbytesource_cancel(ptr);
315
+ }
316
+ /**
317
+ * @param {ReadableByteStreamController} controller
318
+ * @returns {Promise<any>}
319
+ */
320
+ pull(controller) {
321
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
322
+ return ret;
323
+ }
324
+ /**
325
+ * @param {ReadableByteStreamController} controller
326
+ */
327
+ start(controller) {
328
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
329
+ }
330
+ /**
331
+ * @returns {ReadableStreamType}
332
+ */
333
+ get type() {
334
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
335
+ return __wbindgen_enum_ReadableStreamType[ret];
336
+ }
337
+ }
338
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
339
+
340
+ export class IntoUnderlyingSink {
341
+ __destroy_into_raw() {
342
+ const ptr = this.__wbg_ptr;
343
+ this.__wbg_ptr = 0;
344
+ IntoUnderlyingSinkFinalization.unregister(this);
345
+ return ptr;
346
+ }
347
+ free() {
348
+ const ptr = this.__destroy_into_raw();
349
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
350
+ }
351
+ /**
352
+ * @param {any} reason
353
+ * @returns {Promise<any>}
354
+ */
355
+ abort(reason) {
356
+ const ptr = this.__destroy_into_raw();
357
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
358
+ return ret;
359
+ }
360
+ /**
361
+ * @returns {Promise<any>}
362
+ */
363
+ close() {
364
+ const ptr = this.__destroy_into_raw();
365
+ const ret = wasm.intounderlyingsink_close(ptr);
366
+ return ret;
367
+ }
368
+ /**
369
+ * @param {any} chunk
370
+ * @returns {Promise<any>}
371
+ */
372
+ write(chunk) {
373
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
374
+ return ret;
375
+ }
376
+ }
377
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
378
+
379
+ export class IntoUnderlyingSource {
380
+ __destroy_into_raw() {
381
+ const ptr = this.__wbg_ptr;
382
+ this.__wbg_ptr = 0;
383
+ IntoUnderlyingSourceFinalization.unregister(this);
384
+ return ptr;
385
+ }
386
+ free() {
387
+ const ptr = this.__destroy_into_raw();
388
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
389
+ }
390
+ cancel() {
391
+ const ptr = this.__destroy_into_raw();
392
+ wasm.intounderlyingsource_cancel(ptr);
393
+ }
394
+ /**
395
+ * @param {ReadableStreamDefaultController} controller
396
+ * @returns {Promise<any>}
397
+ */
398
+ pull(controller) {
399
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
400
+ return ret;
401
+ }
402
+ }
403
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
404
+
405
+ /**
406
+ * An in-memory [`RangeSource`](crate::wasm::RangeInput), for a caller that already holds the whole
407
+ * asset as bytes.
408
+ *
409
+ * # Size ceiling
410
+ *
411
+ * The constructor copies the bytes into wasm linear memory, which is 32-bit addressed, so the
412
+ * asset and everything else the module allocates share a 4 GiB ceiling (a browser tab reaches its
413
+ * own memory limit well before that). [`BytesSource`] takes the same bytes without the copy, and
414
+ * [`BlobSource`] holds nothing at all.
415
+ */
416
+ export class MemorySource {
417
+ __destroy_into_raw() {
418
+ const ptr = this.__wbg_ptr;
419
+ this.__wbg_ptr = 0;
420
+ MemorySourceFinalization.unregister(this);
421
+ return ptr;
422
+ }
423
+ free() {
424
+ const ptr = this.__destroy_into_raw();
425
+ wasm.__wbg_memorysource_free(ptr, 0);
426
+ }
427
+ /**
428
+ * @returns {number}
429
+ */
430
+ get length() {
431
+ const ret = wasm.memorysource_length(this.__wbg_ptr);
432
+ return ret;
433
+ }
434
+ /**
435
+ * @param {Uint8Array} data
436
+ */
437
+ constructor(data) {
438
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
439
+ const len0 = WASM_VECTOR_LEN;
440
+ const ret = wasm.memorysource_new(ptr0, len0);
441
+ this.__wbg_ptr = ret;
442
+ MemorySourceFinalization.register(this, this.__wbg_ptr, this);
443
+ return this;
444
+ }
445
+ /**
446
+ * @param {number} offset
447
+ * @param {number} length
448
+ * @returns {Uint8Array}
449
+ */
450
+ readAt(offset, length) {
451
+ const ret = wasm.memorysource_readAt(this.__wbg_ptr, offset, length);
452
+ return ret;
453
+ }
454
+ }
455
+ if (Symbol.dispose) MemorySource.prototype[Symbol.dispose] = MemorySource.prototype.free;
456
+
457
+ /**
458
+ * One stream being validated. It owns the session keys and manifest ids its init segments
459
+ * advertised, so releasing the stream is dropping this object.
460
+ */
461
+ export class StreamValidation {
462
+ static __wrap(ptr) {
463
+ const obj = Object.create(StreamValidation.prototype);
464
+ obj.__wbg_ptr = ptr;
465
+ StreamValidationFinalization.register(obj, obj.__wbg_ptr, obj);
466
+ return obj;
467
+ }
468
+ __destroy_into_raw() {
469
+ const ptr = this.__wbg_ptr;
470
+ this.__wbg_ptr = 0;
471
+ StreamValidationFinalization.unregister(this);
472
+ return ptr;
473
+ }
474
+ free() {
475
+ const ptr = this.__destroy_into_raw();
476
+ wasm.__wbg_streamvalidation_free(ptr, 0);
477
+ }
478
+ /**
479
+ * Everything this stream's init segments have registered, as CBOR for another node to
480
+ * `StreamVerifier.resume` from.
481
+ *
482
+ * The one piece of stream state that leaves the SDK, and only because a clustered
483
+ * verifier needs it: the init URL is overwritten on rotation, so a node joining during
484
+ * the overlap cannot rebuild the previous key by refetching. One value, produced once
485
+ * and consumed once. Not a store.
486
+ *
487
+ * # Errors
488
+ *
489
+ * Throws an `SdkError` (`STREAM_INVALID`) when a registered session key cannot be
490
+ * re-encoded.
491
+ * @returns {Uint8Array}
492
+ */
493
+ export() {
494
+ const ret = wasm.streamvalidation_export(this.__wbg_ptr);
495
+ if (ret[3]) {
496
+ throw takeFromExternrefTable0(ret[2]);
497
+ }
498
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
499
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
500
+ return v1;
501
+ }
502
+ /**
503
+ * Validate a stream segment.
504
+ *
505
+ * # Errors
506
+ *
507
+ * Throws an `SdkError` on parse or signature failure, or when a media segment arrives
508
+ * before any init was processed for the stream.
509
+ * @param {RangeSource} data
510
+ * @returns {Promise<SegmentValidation>}
511
+ */
512
+ validate(data) {
513
+ const ret = wasm.streamvalidation_validate(this.__wbg_ptr, data);
514
+ return ret;
515
+ }
516
+ }
517
+ if (Symbol.dispose) StreamValidation.prototype[Symbol.dispose] = StreamValidation.prototype.free;
518
+
519
+ export class StreamVerifier {
520
+ static __wrap(ptr) {
521
+ const obj = Object.create(StreamVerifier.prototype);
522
+ obj.__wbg_ptr = ptr;
523
+ StreamVerifierFinalization.register(obj, obj.__wbg_ptr, obj);
524
+ return obj;
525
+ }
526
+ __destroy_into_raw() {
527
+ const ptr = this.__wbg_ptr;
528
+ this.__wbg_ptr = 0;
529
+ StreamVerifierFinalization.unregister(this);
530
+ return ptr;
531
+ }
532
+ free() {
533
+ const ptr = this.__destroy_into_raw();
534
+ wasm.__wbg_streamverifier_free(ptr, 0);
535
+ }
536
+ /**
537
+ * Create a `StreamVerifier`.
538
+ *
539
+ * # Errors
540
+ *
541
+ * Throws an `SdkError` (`TRUST_CONFIG_INVALID`) when the trust anchors are invalid.
542
+ * @param {StreamVerifierOptions} options
543
+ * @returns {StreamVerifier}
544
+ */
545
+ static create(options) {
546
+ const ret = wasm.streamverifier_create(options);
547
+ if (ret[2]) {
548
+ throw takeFromExternrefTable0(ret[1]);
549
+ }
550
+ return StreamVerifier.__wrap(ret[0]);
551
+ }
552
+ /**
553
+ * Open `stream_id` for validation, handing back a `StreamValidation` to feed segments to.
554
+ *
555
+ * No I/O: the handle carries the id so it cannot be mistyped or confused with another
556
+ * stream's, and classification still happens per segment. Opening one id twice hands
557
+ * back the same live session, so a component that remounts keeps the state its earlier
558
+ * handle accumulated.
559
+ * @param {string} stream_id
560
+ * @returns {StreamValidation}
561
+ */
562
+ open(stream_id) {
563
+ const ptr0 = passStringToWasm0(stream_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
564
+ const len0 = WASM_VECTOR_LEN;
565
+ const ret = wasm.streamverifier_open(this.__wbg_ptr, ptr0, len0);
566
+ return StreamValidation.__wrap(ret);
567
+ }
568
+ /**
569
+ * Open `stream_id` on the state another node exported, merged into whatever this one
570
+ * holds for that id already.
571
+ *
572
+ * # Errors
573
+ *
574
+ * Throws an `SdkError` (`STREAM_INVALID`) when `state` is not a value
575
+ * `StreamValidation.export` produced, or carries a version this SDK no longer reads.
576
+ * @param {string} stream_id
577
+ * @param {Uint8Array} state
578
+ * @returns {StreamValidation}
579
+ */
580
+ resume(stream_id, state) {
581
+ const ptr0 = passStringToWasm0(stream_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
582
+ const len0 = WASM_VECTOR_LEN;
583
+ const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
584
+ const len1 = WASM_VECTOR_LEN;
585
+ const ret = wasm.streamverifier_resume(this.__wbg_ptr, ptr0, len0, ptr1, len1);
586
+ if (ret[2]) {
587
+ throw takeFromExternrefTable0(ret[1]);
588
+ }
589
+ return StreamValidation.__wrap(ret[0]);
590
+ }
591
+ }
592
+ if (Symbol.dispose) StreamVerifier.prototype[Symbol.dispose] = StreamVerifier.prototype.free;
593
+
594
+ export function init_panic_hook() {
595
+ wasm.init_panic_hook();
596
+ }
597
+
598
+ /**
599
+ * Parse a detached C2PA manifest store: a `.c2pa` sidecar, or the bytes a registry serves for a
600
+ * manifest id.
601
+ *
602
+ * Contents, not a verdict. A hard binding is a hash of the asset, so a store read without one
603
+ * says nothing about whether the credential is authentic or which file it belongs to, and the
604
+ * validation fields it carries are not a state anything established here; verifying is
605
+ * `AssetVerifier.verify`, which takes the asset.
606
+ *
607
+ * # Errors
608
+ *
609
+ * Throws `READER_INVALID` when the bytes are not a manifest store c2pa can parse.
610
+ * @param {Uint8Array} manifest
611
+ * @returns {import('@contentauth/c2pa-types').ManifestStore}
612
+ */
613
+ export function parse(manifest) {
614
+ const ptr0 = passArray8ToWasm0(manifest, wasm.__wbindgen_malloc);
615
+ const len0 = WASM_VECTOR_LEN;
616
+ const ret = wasm.parse(ptr0, len0);
617
+ if (ret[2]) {
618
+ throw takeFromExternrefTable0(ret[1]);
619
+ }
620
+ return takeFromExternrefTable0(ret[0]);
621
+ }
622
+
623
+ /**
624
+ * The bytes of one resource in a detached manifest store, or `undefined` when it holds none
625
+ * under `uri`.
626
+ *
627
+ * `uri` is the `identifier` on a resource reference the store carries, so walking the chain in
628
+ * the parsed store is what produces it: any manifest's claim thumbnail, including a non-active
629
+ * one, and any ingredient's. Render it with the `format` beside that identifier. A `uri` naming a
630
+ * manifest rather than a resource answers that manifest's own JUMBF, so pass what a reference
631
+ * states, never a bare label.
632
+ *
633
+ * # Errors
634
+ *
635
+ * Throws `READER_INVALID` when the bytes are not a manifest store c2pa can parse, or the store
636
+ * holds the resource but cannot produce it.
637
+ * @param {Uint8Array} manifest
638
+ * @param {string} uri
639
+ * @returns {Uint8Array | undefined}
640
+ */
641
+ export function resource(manifest, uri) {
642
+ const ptr0 = passArray8ToWasm0(manifest, wasm.__wbindgen_malloc);
643
+ const len0 = WASM_VECTOR_LEN;
644
+ const ptr1 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
645
+ const len1 = WASM_VECTOR_LEN;
646
+ const ret = wasm.resource(ptr0, len0, ptr1, len1);
647
+ if (ret[3]) {
648
+ throw takeFromExternrefTable0(ret[2]);
649
+ }
650
+ let v3;
651
+ if (ret[0] !== 0) {
652
+ v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
653
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
654
+ }
655
+ return v3;
656
+ }
657
+
658
+ /**
659
+ * Every thumbnail the store references, by the `identifier` it references them under: each
660
+ * manifest's claim thumbnail and each ingredient's, whichever manifest carries them.
661
+ *
662
+ * One parse for the whole set, where `resource` pays one per call, so a chain view asks once
663
+ * instead of once per tile. Render each one as the `format` beside its identifier. A reference
664
+ * the store cannot produce is left out rather than failing the set.
665
+ *
666
+ * # Errors
667
+ *
668
+ * Throws `READER_INVALID` when the bytes are not a manifest store c2pa can parse.
669
+ * @param {Uint8Array} manifest
670
+ * @returns {Record<string, Uint8Array>}
671
+ */
672
+ export function thumbnails(manifest) {
673
+ const ptr0 = passArray8ToWasm0(manifest, wasm.__wbindgen_malloc);
674
+ const len0 = WASM_VECTOR_LEN;
675
+ const ret = wasm.thumbnails(ptr0, len0);
676
+ if (ret[2]) {
677
+ throw takeFromExternrefTable0(ret[1]);
678
+ }
679
+ return takeFromExternrefTable0(ret[0]);
680
+ }
681
+ function __wbg_get_imports() {
682
+ const import0 = {
683
+ __proto__: null,
684
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
685
+ const ret = Error(getStringFromWasm0(arg0, arg1));
686
+ return ret;
687
+ },
688
+ __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
689
+ const ret = Number(arg0);
690
+ return ret;
691
+ },
692
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
693
+ const ret = String(arg1);
694
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
695
+ const len1 = WASM_VECTOR_LEN;
696
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
697
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
698
+ },
699
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
700
+ const v = arg1;
701
+ const ret = typeof(v) === 'bigint' ? v : undefined;
702
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
703
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
704
+ },
705
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
706
+ const v = arg0;
707
+ const ret = typeof(v) === 'boolean' ? v : undefined;
708
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
709
+ },
710
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
711
+ const ret = debugString(arg1);
712
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
713
+ const len1 = WASM_VECTOR_LEN;
714
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
715
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
716
+ },
717
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
718
+ const ret = arg0 in arg1;
719
+ return ret;
720
+ },
721
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
722
+ const ret = typeof(arg0) === 'bigint';
723
+ return ret;
724
+ },
725
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
726
+ const ret = typeof(arg0) === 'function';
727
+ return ret;
728
+ },
729
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
730
+ const val = arg0;
731
+ const ret = typeof(val) === 'object' && val !== null;
732
+ return ret;
733
+ },
734
+ __wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
735
+ const ret = typeof(arg0) === 'string';
736
+ return ret;
737
+ },
738
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
739
+ const ret = arg0 === undefined;
740
+ return ret;
741
+ },
742
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
743
+ const ret = arg0 === arg1;
744
+ return ret;
745
+ },
746
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
747
+ const ret = arg0 == arg1;
748
+ return ret;
749
+ },
750
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
751
+ const obj = arg1;
752
+ const ret = typeof(obj) === 'number' ? obj : undefined;
753
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
754
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
755
+ },
756
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
757
+ const obj = arg1;
758
+ const ret = typeof(obj) === 'string' ? obj : undefined;
759
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
760
+ var len1 = WASM_VECTOR_LEN;
761
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
762
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
763
+ },
764
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
765
+ throw new Error(getStringFromWasm0(arg0, arg1));
766
+ },
767
+ __wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
768
+ arg0._wbg_cb_unref();
769
+ },
770
+ __wbg_abort_8bae0f33e7833997: function(arg0) {
771
+ arg0.abort();
772
+ },
773
+ __wbg_abort_eee9248a6d680839: function(arg0, arg1) {
774
+ arg0.abort(arg1);
775
+ },
776
+ __wbg_append_01c74e5c6b58aa64: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
777
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
778
+ }, arguments); },
779
+ __wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
780
+ const ret = arg0.arrayBuffer();
781
+ return ret;
782
+ }, arguments); },
783
+ __wbg_binder_unwrap: function(arg0) {
784
+ const ret = Binder.__unwrap(arg0);
785
+ return ret;
786
+ },
787
+ __wbg_body_18c9f2ac15ead4b2: function(arg0) {
788
+ const ret = arg0.body;
789
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
790
+ },
791
+ __wbg_buffer_54b87055582c8a81: function(arg0) {
792
+ const ret = arg0.buffer;
793
+ return ret;
794
+ },
795
+ __wbg_byobRequest_06b654bb15590436: function(arg0) {
796
+ const ret = arg0.byobRequest;
797
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
798
+ },
799
+ __wbg_byteLength_41862ca4020b9c43: function(arg0) {
800
+ const ret = arg0.byteLength;
801
+ return ret;
802
+ },
803
+ __wbg_byteOffset_d42e18c4441f628b: function(arg0) {
804
+ const ret = arg0.byteOffset;
805
+ return ret;
806
+ },
807
+ __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
808
+ const ret = arg0.call(arg1);
809
+ return ret;
810
+ }, arguments); },
811
+ __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
812
+ const ret = arg0.call(arg1, arg2);
813
+ return ret;
814
+ }, arguments); },
815
+ __wbg_call_e3b662382210db98: function() { return handleError(function (arg0, arg1, arg2, arg3) {
816
+ const ret = arg0.call(arg1, arg2, arg3);
817
+ return ret;
818
+ }, arguments); },
819
+ __wbg_cancel_3983a93e24cc66b3: function(arg0) {
820
+ const ret = arg0.cancel();
821
+ return ret;
822
+ },
823
+ __wbg_catch_c1a60df4c30d76d3: function(arg0, arg1) {
824
+ const ret = arg0.catch(arg1);
825
+ return ret;
826
+ },
827
+ __wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
828
+ const ret = clearTimeout(arg0);
829
+ return ret;
830
+ },
831
+ __wbg_close_249a23304523681b: function() { return handleError(function (arg0) {
832
+ arg0.close();
833
+ }, arguments); },
834
+ __wbg_close_72d318d9c16e83ef: function() { return handleError(function (arg0) {
835
+ arg0.close();
836
+ }, arguments); },
837
+ __wbg_done_89b2b13e91a60321: function(arg0) {
838
+ const ret = arg0.done;
839
+ return ret;
840
+ },
841
+ __wbg_enqueue_6d83b4c6281bafd6: function() { return handleError(function (arg0, arg1) {
842
+ arg0.enqueue(arg1);
843
+ }, arguments); },
844
+ __wbg_entries_015dc610cd81ede0: function(arg0) {
845
+ const ret = Object.entries(arg0);
846
+ return ret;
847
+ },
848
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
849
+ let deferred0_0;
850
+ let deferred0_1;
851
+ try {
852
+ deferred0_0 = arg0;
853
+ deferred0_1 = arg1;
854
+ console.error(getStringFromWasm0(arg0, arg1));
855
+ } finally {
856
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
857
+ }
858
+ },
859
+ __wbg_fetch_9dad4fe911207b37: function(arg0) {
860
+ const ret = fetch(arg0);
861
+ return ret;
862
+ },
863
+ __wbg_fetch_b5951fc96f52f786: function(arg0, arg1) {
864
+ const ret = arg0.fetch(arg1);
865
+ return ret;
866
+ },
867
+ __wbg_from_13e323c65fc8f464: function(arg0) {
868
+ const ret = Array.from(arg0);
869
+ return ret;
870
+ },
871
+ __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
872
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
873
+ }, arguments); },
874
+ __wbg_getReader_7455d080fa48369b: function(arg0) {
875
+ const ret = arg0.getReader();
876
+ return ret;
877
+ },
878
+ __wbg_getReader_b4b1868fbca77dbe: function() { return handleError(function (arg0) {
879
+ const ret = arg0.getReader();
880
+ return ret;
881
+ }, arguments); },
882
+ __wbg_getTime_d6f070c088c9b5ed: function(arg0) {
883
+ const ret = arg0.getTime();
884
+ return ret;
885
+ },
886
+ __wbg_get_18e0163e38e5048d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
887
+ const ret = arg1.get(getStringFromWasm0(arg2, arg3));
888
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
889
+ var len1 = WASM_VECTOR_LEN;
890
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
891
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
892
+ }, arguments); },
893
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
894
+ const ret = arg0[arg1 >>> 0];
895
+ return ret;
896
+ },
897
+ __wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
898
+ const ret = Reflect.get(arg0, arg1);
899
+ return ret;
900
+ }, arguments); },
901
+ __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
902
+ const ret = Reflect.get(arg0, arg1);
903
+ return ret;
904
+ }, arguments); },
905
+ __wbg_get_done_670108eb06ecbe46: function(arg0) {
906
+ const ret = arg0.done;
907
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
908
+ },
909
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
910
+ const ret = arg0[arg1 >>> 0];
911
+ return ret;
912
+ },
913
+ __wbg_get_value_f465f5be30aa0963: function(arg0) {
914
+ const ret = arg0.value;
915
+ return ret;
916
+ },
917
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
918
+ const ret = arg0[arg1];
919
+ return ret;
920
+ },
921
+ __wbg_has_8374cf06984d8bfc: function() { return handleError(function (arg0, arg1) {
922
+ const ret = Reflect.has(arg0, arg1);
923
+ return ret;
924
+ }, arguments); },
925
+ __wbg_headers_7b59c5203c8c475d: function(arg0) {
926
+ const ret = arg0.headers;
927
+ return ret;
928
+ },
929
+ __wbg_headers_cf9c80f30e2a4eff: function(arg0) {
930
+ const ret = arg0.headers;
931
+ return ret;
932
+ },
933
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
934
+ let result;
935
+ try {
936
+ result = arg0 instanceof ArrayBuffer;
937
+ } catch (_) {
938
+ result = false;
939
+ }
940
+ const ret = result;
941
+ return ret;
942
+ },
943
+ __wbg_instanceof_Promise_4cb210c0b8f8c959: function(arg0) {
944
+ let result;
945
+ try {
946
+ result = arg0 instanceof Promise;
947
+ } catch (_) {
948
+ result = false;
949
+ }
950
+ const ret = result;
951
+ return ret;
952
+ },
953
+ __wbg_instanceof_ReadableStreamDefaultReader_08a023749ad73fb6: function(arg0) {
954
+ let result;
955
+ try {
956
+ result = arg0 instanceof ReadableStreamDefaultReader;
957
+ } catch (_) {
958
+ result = false;
959
+ }
960
+ const ret = result;
961
+ return ret;
962
+ },
963
+ __wbg_instanceof_Response_c8b64b2256f01bec: function(arg0) {
964
+ let result;
965
+ try {
966
+ result = arg0 instanceof Response;
967
+ } catch (_) {
968
+ result = false;
969
+ }
970
+ const ret = result;
971
+ return ret;
972
+ },
973
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
974
+ let result;
975
+ try {
976
+ result = arg0 instanceof Uint8Array;
977
+ } catch (_) {
978
+ result = false;
979
+ }
980
+ const ret = result;
981
+ return ret;
982
+ },
983
+ __wbg_isArray_0677c962b281d01a: function(arg0) {
984
+ const ret = Array.isArray(arg0);
985
+ return ret;
986
+ },
987
+ __wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
988
+ const ret = Number.isSafeInteger(arg0);
989
+ return ret;
990
+ },
991
+ __wbg_iterator_6f722e4a93058b71: function() {
992
+ const ret = Symbol.iterator;
993
+ return ret;
994
+ },
995
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
996
+ const ret = arg0.length;
997
+ return ret;
998
+ },
999
+ __wbg_length_370319915dc99107: function(arg0) {
1000
+ const ret = arg0.length;
1001
+ return ret;
1002
+ },
1003
+ __wbg_new_0_3da9e97f24fc69be: function() {
1004
+ const ret = new Date();
1005
+ return ret;
1006
+ },
1007
+ __wbg_new_0d809930cd1354c6: function() { return handleError(function () {
1008
+ const ret = new Headers();
1009
+ return ret;
1010
+ }, arguments); },
1011
+ __wbg_new_1c3723faf11e3ba2: function() { return handleError(function () {
1012
+ const ret = new FileReaderSync();
1013
+ return ret;
1014
+ }, arguments); },
1015
+ __wbg_new_227d7c05414eb861: function() {
1016
+ const ret = new Error();
1017
+ return ret;
1018
+ },
1019
+ __wbg_new_32b398fb48b6d94a: function() {
1020
+ const ret = new Array();
1021
+ return ret;
1022
+ },
1023
+ __wbg_new_4339b2a2675a03e3: function() { return handleError(function () {
1024
+ const ret = new AbortController();
1025
+ return ret;
1026
+ }, arguments); },
1027
+ __wbg_new_7796ffc7ed656783: function() {
1028
+ const ret = new Map();
1029
+ return ret;
1030
+ },
1031
+ __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
1032
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1033
+ return ret;
1034
+ },
1035
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
1036
+ const ret = new Uint8Array(arg0);
1037
+ return ret;
1038
+ },
1039
+ __wbg_new_da52cf8fe3429cb2: function() {
1040
+ const ret = new Object();
1041
+ return ret;
1042
+ },
1043
+ __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
1044
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1045
+ return ret;
1046
+ },
1047
+ __wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
1048
+ try {
1049
+ var state0 = {a: arg0, b: arg1};
1050
+ var cb0 = (arg0, arg1) => {
1051
+ const a = state0.a;
1052
+ state0.a = 0;
1053
+ try {
1054
+ return wasm_bindgen__convert__closures_____invoke__h427ac36a6c93c398(a, state0.b, arg0, arg1);
1055
+ } finally {
1056
+ state0.a = a;
1057
+ }
1058
+ };
1059
+ const ret = new Promise(cb0);
1060
+ return ret;
1061
+ } finally {
1062
+ state0.a = 0;
1063
+ }
1064
+ },
1065
+ __wbg_new_with_byte_offset_and_length_54c7724ee3ec7d82: function(arg0, arg1, arg2) {
1066
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1067
+ return ret;
1068
+ },
1069
+ __wbg_new_with_length_e6785c33c8e4cce8: function(arg0) {
1070
+ const ret = new Uint8Array(arg0 >>> 0);
1071
+ return ret;
1072
+ },
1073
+ __wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
1074
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1075
+ return ret;
1076
+ }, arguments); },
1077
+ __wbg_next_6dbf2c0ac8cde20f: function(arg0) {
1078
+ const ret = arg0.next;
1079
+ return ret;
1080
+ },
1081
+ __wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
1082
+ const ret = arg0.next();
1083
+ return ret;
1084
+ }, arguments); },
1085
+ __wbg_now_86c0d4ba3fa605b8: function() {
1086
+ const ret = Date.now();
1087
+ return ret;
1088
+ },
1089
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
1090
+ const ret = arg0.now();
1091
+ return ret;
1092
+ },
1093
+ __wbg_parse_1c0d8a8656d7e016: function() { return handleError(function (arg0, arg1) {
1094
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1095
+ return ret;
1096
+ }, arguments); },
1097
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
1098
+ const ret = arg0.performance;
1099
+ return ret;
1100
+ },
1101
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
1102
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1103
+ },
1104
+ __wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
1105
+ const ret = arg0.queueMicrotask;
1106
+ return ret;
1107
+ },
1108
+ __wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
1109
+ queueMicrotask(arg0);
1110
+ },
1111
+ __wbg_readAsArrayBuffer_0324aee68fac500a: function() { return handleError(function (arg0, arg1) {
1112
+ const ret = arg0.readAsArrayBuffer(arg1);
1113
+ return ret;
1114
+ }, arguments); },
1115
+ __wbg_read_8afa15f12a160ef8: function(arg0) {
1116
+ const ret = arg0.read();
1117
+ return ret;
1118
+ },
1119
+ __wbg_releaseLock_5b92874cad775644: function(arg0) {
1120
+ arg0.releaseLock();
1121
+ },
1122
+ __wbg_resolve_2191a4dfe481c25b: function(arg0) {
1123
+ const ret = Promise.resolve(arg0);
1124
+ return ret;
1125
+ },
1126
+ __wbg_respond_510e32df8aeb6817: function() { return handleError(function (arg0, arg1) {
1127
+ arg0.respond(arg1 >>> 0);
1128
+ }, arguments); },
1129
+ __wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
1130
+ const ret = setTimeout(arg0, arg1);
1131
+ return ret;
1132
+ },
1133
+ __wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1134
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1135
+ }, arguments); },
1136
+ __wbg_set_4d7dd76f3dae2926: function(arg0, arg1, arg2) {
1137
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
1138
+ },
1139
+ __wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
1140
+ const ret = arg0.set(arg1, arg2);
1141
+ return ret;
1142
+ },
1143
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1144
+ arg0[arg1] = arg2;
1145
+ },
1146
+ __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
1147
+ const ret = Reflect.set(arg0, arg1, arg2);
1148
+ return ret;
1149
+ }, arguments); },
1150
+ __wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
1151
+ arg0[arg1 >>> 0] = arg2;
1152
+ },
1153
+ __wbg_set_body_029f2d171e0a005f: function(arg0, arg1) {
1154
+ arg0.body = arg1;
1155
+ },
1156
+ __wbg_set_cache_b4a740b195c051f4: function(arg0, arg1) {
1157
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1158
+ },
1159
+ __wbg_set_credentials_bb34a40189e3b43b: function(arg0, arg1) {
1160
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1161
+ },
1162
+ __wbg_set_headers_9c61d123c3ee1f10: function(arg0, arg1) {
1163
+ arg0.headers = arg1;
1164
+ },
1165
+ __wbg_set_method_5532d59b92d76467: function(arg0, arg1, arg2) {
1166
+ arg0.method = getStringFromWasm0(arg1, arg2);
1167
+ },
1168
+ __wbg_set_mode_66c79886ad78fc05: function(arg0, arg1) {
1169
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1170
+ },
1171
+ __wbg_set_signal_c4ef8faddb4c1446: function(arg0, arg1) {
1172
+ arg0.signal = arg1;
1173
+ },
1174
+ __wbg_signal_dad7cb35193abd31: function(arg0) {
1175
+ const ret = arg0.signal;
1176
+ return ret;
1177
+ },
1178
+ __wbg_size_6304a694765921a9: function(arg0) {
1179
+ const ret = arg0.size;
1180
+ return ret;
1181
+ },
1182
+ __wbg_slice_7c7553e3b38b0ddb: function() { return handleError(function (arg0, arg1, arg2) {
1183
+ const ret = arg0.slice(arg1, arg2);
1184
+ return ret;
1185
+ }, arguments); },
1186
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1187
+ const ret = arg1.stack;
1188
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
+ const len1 = WASM_VECTOR_LEN;
1190
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1191
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1192
+ },
1193
+ __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
1194
+ const ret = typeof global === 'undefined' ? null : global;
1195
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1196
+ },
1197
+ __wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
1198
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1199
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1200
+ },
1201
+ __wbg_static_accessor_SELF_146583524fe1469b: function() {
1202
+ const ret = typeof self === 'undefined' ? null : self;
1203
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1204
+ },
1205
+ __wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
1206
+ const ret = typeof window === 'undefined' ? null : window;
1207
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1208
+ },
1209
+ __wbg_status_c45b3b9b3033184a: function(arg0) {
1210
+ const ret = arg0.status;
1211
+ return ret;
1212
+ },
1213
+ __wbg_stringify_b54333f60f1e4dad: function() { return handleError(function (arg0) {
1214
+ const ret = JSON.stringify(arg0);
1215
+ return ret;
1216
+ }, arguments); },
1217
+ __wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
1218
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1219
+ return ret;
1220
+ },
1221
+ __wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
1222
+ const ret = arg0.then(arg1, arg2);
1223
+ return ret;
1224
+ },
1225
+ __wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
1226
+ const ret = arg0.then(arg1);
1227
+ return ret;
1228
+ },
1229
+ __wbg_url_abdb8fb08377f8c0: function(arg0, arg1) {
1230
+ const ret = arg1.url;
1231
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1232
+ const len1 = WASM_VECTOR_LEN;
1233
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1234
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1235
+ },
1236
+ __wbg_value_a5d5488a9589444a: function(arg0) {
1237
+ const ret = arg0.value;
1238
+ return ret;
1239
+ },
1240
+ __wbg_view_21f1d4a4f175dfa9: function(arg0) {
1241
+ const ret = arg0.view;
1242
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1243
+ },
1244
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1245
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2098, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1246
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h87666057de2caf05);
1247
+ return ret;
1248
+ },
1249
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1250
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3908, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1251
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h57ac022b707ce0a7);
1252
+ return ret;
1253
+ },
1254
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1255
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2780, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1256
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hfcd26b19c01d430a);
1257
+ return ret;
1258
+ },
1259
+ __wbindgen_cast_0000000000000004: function(arg0) {
1260
+ // Cast intrinsic for `F64 -> Externref`.
1261
+ const ret = arg0;
1262
+ return ret;
1263
+ },
1264
+ __wbindgen_cast_0000000000000005: function(arg0) {
1265
+ // Cast intrinsic for `I64 -> Externref`.
1266
+ const ret = arg0;
1267
+ return ret;
1268
+ },
1269
+ __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1270
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1271
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1272
+ return ret;
1273
+ },
1274
+ __wbindgen_cast_0000000000000007: function(arg0, arg1) {
1275
+ // Cast intrinsic for `Ref(String) -> Externref`.
1276
+ const ret = getStringFromWasm0(arg0, arg1);
1277
+ return ret;
1278
+ },
1279
+ __wbindgen_cast_0000000000000008: function(arg0) {
1280
+ // Cast intrinsic for `U64 -> Externref`.
1281
+ const ret = BigInt.asUintN(64, arg0);
1282
+ return ret;
1283
+ },
1284
+ __wbindgen_init_externref_table: function() {
1285
+ const table = wasm.__wbindgen_externrefs;
1286
+ const offset = table.grow(4);
1287
+ table.set(0, undefined);
1288
+ table.set(offset + 0, undefined);
1289
+ table.set(offset + 1, null);
1290
+ table.set(offset + 2, true);
1291
+ table.set(offset + 3, false);
1292
+ },
1293
+ };
1294
+ return {
1295
+ __proto__: null,
1296
+ "./trylimbo_sdk_verifier_bg.js": import0,
1297
+ };
1298
+ }
1299
+
1300
+ function wasm_bindgen__convert__closures_____invoke__hfcd26b19c01d430a(arg0, arg1) {
1301
+ wasm.wasm_bindgen__convert__closures_____invoke__hfcd26b19c01d430a(arg0, arg1);
1302
+ }
1303
+
1304
+ function wasm_bindgen__convert__closures_____invoke__h57ac022b707ce0a7(arg0, arg1, arg2) {
1305
+ wasm.wasm_bindgen__convert__closures_____invoke__h57ac022b707ce0a7(arg0, arg1, arg2);
1306
+ }
1307
+
1308
+ function wasm_bindgen__convert__closures_____invoke__h87666057de2caf05(arg0, arg1, arg2) {
1309
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h87666057de2caf05(arg0, arg1, arg2);
1310
+ if (ret[1]) {
1311
+ throw takeFromExternrefTable0(ret[0]);
1312
+ }
1313
+ }
1314
+
1315
+ function wasm_bindgen__convert__closures_____invoke__h427ac36a6c93c398(arg0, arg1, arg2, arg3) {
1316
+ wasm.wasm_bindgen__convert__closures_____invoke__h427ac36a6c93c398(arg0, arg1, arg2, arg3);
1317
+ }
1318
+
1319
+
1320
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
1321
+
1322
+
1323
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
1324
+
1325
+
1326
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
1327
+
1328
+
1329
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1330
+ const AssetVerifierFinalization = (typeof FinalizationRegistry === 'undefined')
1331
+ ? { register: () => {}, unregister: () => {} }
1332
+ : new FinalizationRegistry(ptr => wasm.__wbg_assetverifier_free(ptr, 1));
1333
+ const BinderFinalization = (typeof FinalizationRegistry === 'undefined')
1334
+ ? { register: () => {}, unregister: () => {} }
1335
+ : new FinalizationRegistry(ptr => wasm.__wbg_binder_free(ptr, 1));
1336
+ const BlobSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1337
+ ? { register: () => {}, unregister: () => {} }
1338
+ : new FinalizationRegistry(ptr => wasm.__wbg_blobsource_free(ptr, 1));
1339
+ const BytesSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1340
+ ? { register: () => {}, unregister: () => {} }
1341
+ : new FinalizationRegistry(ptr => wasm.__wbg_bytessource_free(ptr, 1));
1342
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1343
+ ? { register: () => {}, unregister: () => {} }
1344
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
1345
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
1346
+ ? { register: () => {}, unregister: () => {} }
1347
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr, 1));
1348
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1349
+ ? { register: () => {}, unregister: () => {} }
1350
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
1351
+ const MemorySourceFinalization = (typeof FinalizationRegistry === 'undefined')
1352
+ ? { register: () => {}, unregister: () => {} }
1353
+ : new FinalizationRegistry(ptr => wasm.__wbg_memorysource_free(ptr, 1));
1354
+ const StreamValidationFinalization = (typeof FinalizationRegistry === 'undefined')
1355
+ ? { register: () => {}, unregister: () => {} }
1356
+ : new FinalizationRegistry(ptr => wasm.__wbg_streamvalidation_free(ptr, 1));
1357
+ const StreamVerifierFinalization = (typeof FinalizationRegistry === 'undefined')
1358
+ ? { register: () => {}, unregister: () => {} }
1359
+ : new FinalizationRegistry(ptr => wasm.__wbg_streamverifier_free(ptr, 1));
1360
+
1361
+ function addToExternrefTable0(obj) {
1362
+ const idx = wasm.__externref_table_alloc();
1363
+ wasm.__wbindgen_externrefs.set(idx, obj);
1364
+ return idx;
1365
+ }
1366
+
1367
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1368
+ ? { register: () => {}, unregister: () => {} }
1369
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1370
+
1371
+ function debugString(val) {
1372
+ // primitive types
1373
+ const type = typeof val;
1374
+ if (type == 'number' || type == 'boolean' || val == null) {
1375
+ return `${val}`;
1376
+ }
1377
+ if (type == 'string') {
1378
+ return `"${val}"`;
1379
+ }
1380
+ if (type == 'symbol') {
1381
+ const description = val.description;
1382
+ if (description == null) {
1383
+ return 'Symbol';
1384
+ } else {
1385
+ return `Symbol(${description})`;
1386
+ }
1387
+ }
1388
+ if (type == 'function') {
1389
+ const name = val.name;
1390
+ if (typeof name == 'string' && name.length > 0) {
1391
+ return `Function(${name})`;
1392
+ } else {
1393
+ return 'Function';
1394
+ }
1395
+ }
1396
+ // objects
1397
+ if (Array.isArray(val)) {
1398
+ const length = val.length;
1399
+ let debug = '[';
1400
+ if (length > 0) {
1401
+ debug += debugString(val[0]);
1402
+ }
1403
+ for(let i = 1; i < length; i++) {
1404
+ debug += ', ' + debugString(val[i]);
1405
+ }
1406
+ debug += ']';
1407
+ return debug;
1408
+ }
1409
+ // Test for built-in
1410
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1411
+ let className;
1412
+ if (builtInMatches && builtInMatches.length > 1) {
1413
+ className = builtInMatches[1];
1414
+ } else {
1415
+ // Failed to match the standard '[object ClassName]'
1416
+ return toString.call(val);
1417
+ }
1418
+ if (className == 'Object') {
1419
+ // we're a user defined class or Object
1420
+ // JSON.stringify avoids problems with cycles, and is generally much
1421
+ // easier than looping through ownProperties of `val`.
1422
+ try {
1423
+ return 'Object(' + JSON.stringify(val) + ')';
1424
+ } catch (_) {
1425
+ return 'Object';
1426
+ }
1427
+ }
1428
+ // errors
1429
+ if (val instanceof Error) {
1430
+ return `${val.name}: ${val.message}\n${val.stack}`;
1431
+ }
1432
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1433
+ return className;
1434
+ }
1435
+
1436
+ function getArrayU8FromWasm0(ptr, len) {
1437
+ ptr = ptr >>> 0;
1438
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1439
+ }
1440
+
1441
+ let cachedDataViewMemory0 = null;
1442
+ function getDataViewMemory0() {
1443
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1444
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1445
+ }
1446
+ return cachedDataViewMemory0;
1447
+ }
1448
+
1449
+ function getStringFromWasm0(ptr, len) {
1450
+ return decodeText(ptr >>> 0, len);
1451
+ }
1452
+
1453
+ let cachedUint8ArrayMemory0 = null;
1454
+ function getUint8ArrayMemory0() {
1455
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1456
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1457
+ }
1458
+ return cachedUint8ArrayMemory0;
1459
+ }
1460
+
1461
+ function handleError(f, args) {
1462
+ try {
1463
+ return f.apply(this, args);
1464
+ } catch (e) {
1465
+ const idx = addToExternrefTable0(e);
1466
+ wasm.__wbindgen_exn_store(idx);
1467
+ }
1468
+ }
1469
+
1470
+ function isLikeNone(x) {
1471
+ return x === undefined || x === null;
1472
+ }
1473
+
1474
+ function makeMutClosure(arg0, arg1, f) {
1475
+ const state = { a: arg0, b: arg1, cnt: 1 };
1476
+ const real = (...args) => {
1477
+
1478
+ // First up with a closure we increment the internal reference
1479
+ // count. This ensures that the Rust closure environment won't
1480
+ // be deallocated while we're invoking it.
1481
+ state.cnt++;
1482
+ const a = state.a;
1483
+ state.a = 0;
1484
+ try {
1485
+ return f(a, state.b, ...args);
1486
+ } finally {
1487
+ state.a = a;
1488
+ real._wbg_cb_unref();
1489
+ }
1490
+ };
1491
+ real._wbg_cb_unref = () => {
1492
+ if (--state.cnt === 0) {
1493
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1494
+ state.a = 0;
1495
+ CLOSURE_DTORS.unregister(state);
1496
+ }
1497
+ };
1498
+ CLOSURE_DTORS.register(real, state, state);
1499
+ return real;
1500
+ }
1501
+
1502
+ function passArray8ToWasm0(arg, malloc) {
1503
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1504
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1505
+ WASM_VECTOR_LEN = arg.length;
1506
+ return ptr;
1507
+ }
1508
+
1509
+ function passArrayJsValueToWasm0(array, malloc) {
1510
+ const ptr = malloc(array.length * 4, 4) >>> 0;
1511
+ for (let i = 0; i < array.length; i++) {
1512
+ const add = addToExternrefTable0(array[i]);
1513
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
1514
+ }
1515
+ WASM_VECTOR_LEN = array.length;
1516
+ return ptr;
1517
+ }
1518
+
1519
+ function passStringToWasm0(arg, malloc, realloc) {
1520
+ if (realloc === undefined) {
1521
+ const buf = cachedTextEncoder.encode(arg);
1522
+ const ptr = malloc(buf.length, 1) >>> 0;
1523
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1524
+ WASM_VECTOR_LEN = buf.length;
1525
+ return ptr;
1526
+ }
1527
+
1528
+ let len = arg.length;
1529
+ let ptr = malloc(len, 1) >>> 0;
1530
+
1531
+ const mem = getUint8ArrayMemory0();
1532
+
1533
+ let offset = 0;
1534
+
1535
+ for (; offset < len; offset++) {
1536
+ const code = arg.charCodeAt(offset);
1537
+ if (code > 0x7F) break;
1538
+ mem[ptr + offset] = code;
1539
+ }
1540
+ if (offset !== len) {
1541
+ if (offset !== 0) {
1542
+ arg = arg.slice(offset);
1543
+ }
1544
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1545
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1546
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1547
+
1548
+ offset += ret.written;
1549
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1550
+ }
1551
+
1552
+ WASM_VECTOR_LEN = offset;
1553
+ return ptr;
1554
+ }
1555
+
1556
+ function takeFromExternrefTable0(idx) {
1557
+ const value = wasm.__wbindgen_externrefs.get(idx);
1558
+ wasm.__externref_table_dealloc(idx);
1559
+ return value;
1560
+ }
1561
+
1562
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1563
+ cachedTextDecoder.decode();
1564
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1565
+ let numBytesDecoded = 0;
1566
+ function decodeText(ptr, len) {
1567
+ numBytesDecoded += len;
1568
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1569
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1570
+ cachedTextDecoder.decode();
1571
+ numBytesDecoded = len;
1572
+ }
1573
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1574
+ }
1575
+
1576
+ const cachedTextEncoder = new TextEncoder();
1577
+
1578
+ if (!('encodeInto' in cachedTextEncoder)) {
1579
+ cachedTextEncoder.encodeInto = function (arg, view) {
1580
+ const buf = cachedTextEncoder.encode(arg);
1581
+ view.set(buf);
1582
+ return {
1583
+ read: arg.length,
1584
+ written: buf.length
1585
+ };
1586
+ };
1587
+ }
1588
+
1589
+ let WASM_VECTOR_LEN = 0;
1590
+
1591
+ let wasmModule, wasmInstance, wasm;
1592
+ function __wbg_finalize_init(instance, module) {
1593
+ wasmInstance = instance;
1594
+ wasm = instance.exports;
1595
+ wasmModule = module;
1596
+ cachedDataViewMemory0 = null;
1597
+ cachedUint8ArrayMemory0 = null;
1598
+ wasm.__wbindgen_start();
1599
+ return wasm;
1600
+ }
1601
+
1602
+ async function __wbg_load(module, imports) {
1603
+ if (typeof Response === 'function' && module instanceof Response) {
1604
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1605
+ try {
1606
+ return await WebAssembly.instantiateStreaming(module, imports);
1607
+ } catch (e) {
1608
+ const validResponse = module.ok && expectedResponseType(module.type);
1609
+
1610
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1611
+ 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);
1612
+
1613
+ } else { throw e; }
1614
+ }
1615
+ }
1616
+
1617
+ const bytes = await module.arrayBuffer();
1618
+ return await WebAssembly.instantiate(bytes, imports);
1619
+ } else {
1620
+ const instance = await WebAssembly.instantiate(module, imports);
1621
+
1622
+ if (instance instanceof WebAssembly.Instance) {
1623
+ return { instance, module };
1624
+ } else {
1625
+ return instance;
1626
+ }
1627
+ }
1628
+
1629
+ function expectedResponseType(type) {
1630
+ switch (type) {
1631
+ case 'basic': case 'cors': case 'default': return true;
1632
+ }
1633
+ return false;
1634
+ }
1635
+ }
1636
+
1637
+ function initSync(module) {
1638
+ if (wasm !== undefined) return wasm;
1639
+
1640
+
1641
+ if (module !== undefined) {
1642
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1643
+ ({module} = module)
1644
+ } else {
1645
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1646
+ }
1647
+ }
1648
+
1649
+ const imports = __wbg_get_imports();
1650
+ if (!(module instanceof WebAssembly.Module)) {
1651
+ module = new WebAssembly.Module(module);
1652
+ }
1653
+ const instance = new WebAssembly.Instance(module, imports);
1654
+ return __wbg_finalize_init(instance, module);
1655
+ }
1656
+
1657
+ async function __wbg_init(module_or_path) {
1658
+ if (wasm !== undefined) return wasm;
1659
+
1660
+
1661
+ if (module_or_path !== undefined) {
1662
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1663
+ ({module_or_path} = module_or_path)
1664
+ } else {
1665
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1666
+ }
1667
+ }
1668
+
1669
+ if (module_or_path === undefined) {
1670
+ module_or_path = new URL('trylimbo_sdk_verifier_bg.wasm', import.meta.url);
1671
+ }
1672
+ const imports = __wbg_get_imports();
1673
+
1674
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1675
+ module_or_path = fetch(module_or_path);
1676
+ }
1677
+
1678
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1679
+
1680
+ return __wbg_finalize_init(instance, module);
1681
+ }
1682
+
1683
+ export { initSync, __wbg_init as default };