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