@contentauth/c2pa-web 0.14.6 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- var G = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
2
- var de = G((fe, C) => {
1
+ var $ = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
2
+ var be = $((le, P) => {
3
3
  class h {
4
4
  static __wrap(e) {
5
5
  const t = Object.create(h.prototype);
6
- return t.__wbg_ptr = e, k.register(t, t.__wbg_ptr, t), t;
6
+ return t.__wbg_ptr = e, z.register(t, t.__wbg_ptr, t), t;
7
7
  }
8
8
  __destroy_into_raw() {
9
9
  const e = this.__wbg_ptr;
10
- return this.__wbg_ptr = 0, k.unregister(this), e;
10
+ return this.__wbg_ptr = 0, z.unregister(this), e;
11
11
  }
12
12
  free() {
13
13
  const e = this.__destroy_into_raw();
@@ -20,7 +20,7 @@ var de = G((fe, C) => {
20
20
  addAction(e) {
21
21
  const t = o.wasmbuilder_addAction(this.__wbg_ptr, e);
22
22
  if (t[1])
23
- throw d(t[0]);
23
+ throw b(t[0]);
24
24
  }
25
25
  /**
26
26
  * Add an assertion to the manifest under `label` with the given `data`.
@@ -28,9 +28,9 @@ var de = G((fe, C) => {
28
28
  * @param {any} data
29
29
  */
30
30
  addAssertion(e, t) {
31
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addAssertion(this.__wbg_ptr, n, _, t);
31
+ const n = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addAssertion(this.__wbg_ptr, n, _, t);
32
32
  if (c[1])
33
- throw d(c[0]);
33
+ throw b(c[0]);
34
34
  }
35
35
  /**
36
36
  * Add an ingredient to the manifest from a JSON ingredient definition without a blob
@@ -40,9 +40,9 @@ var de = G((fe, C) => {
40
40
  * @param {string} json
41
41
  */
42
42
  addIngredient(e) {
43
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmbuilder_addIngredient(this.__wbg_ptr, t, n);
43
+ const t = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmbuilder_addIngredient(this.__wbg_ptr, t, n);
44
44
  if (_[1])
45
- throw d(_[0]);
45
+ throw b(_[0]);
46
46
  }
47
47
  /**
48
48
  * Add an ingredient to the manifest from a JSON ingredient definition and a [`Blob`].
@@ -57,8 +57,8 @@ var de = G((fe, C) => {
57
57
  * @returns {Promise<void>}
58
58
  */
59
59
  addIngredientFromBlob(e, t, n) {
60
- const _ = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a, i = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
61
- return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr, _, c, i, s, n);
60
+ const _ = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a, s = d(t, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
61
+ return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr, _, c, s, i, n);
62
62
  }
63
63
  /**
64
64
  * Add a redaction for a JUMBF URI with the given reason.
@@ -69,9 +69,9 @@ var de = G((fe, C) => {
69
69
  * @param {any} reason
70
70
  */
71
71
  addRedaction(e, t) {
72
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addRedaction(this.__wbg_ptr, n, _, t);
72
+ const n = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addRedaction(this.__wbg_ptr, n, _, t);
73
73
  if (c[1])
74
- throw d(c[0]);
74
+ throw b(c[0]);
75
75
  }
76
76
  /**
77
77
  * Add a [`Blob`] to the manifest as a resource. The ID must match an identifier in the manifest.
@@ -79,9 +79,9 @@ var de = G((fe, C) => {
79
79
  * @param {Blob} blob
80
80
  */
81
81
  addResourceFromBlob(e, t) {
82
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr, n, _, t);
82
+ const n = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr, n, _, t);
83
83
  if (c[1])
84
- throw d(c[0]);
84
+ throw b(c[0]);
85
85
  }
86
86
  /**
87
87
  * Retains actions and ingredients together in one step, per
@@ -96,9 +96,9 @@ var de = G((fe, C) => {
96
96
  * @param {Uint32Array} ingredient_indices
97
97
  */
98
98
  filterActionsAndIngredientsAt(e, t) {
99
- const n = E(e, o.__wbindgen_malloc), _ = a, c = E(t, o.__wbindgen_malloc), i = a, s = o.wasmbuilder_filterActionsAndIngredientsAt(this.__wbg_ptr, n, _, c, i);
100
- if (s[1])
101
- throw d(s[0]);
99
+ const n = E(e, o.__wbindgen_malloc), _ = a, c = E(t, o.__wbindgen_malloc), s = a, i = o.wasmbuilder_filterActionsAndIngredientsAt(this.__wbg_ptr, n, _, c, s);
100
+ if (i[1])
101
+ throw b(i[0]);
102
102
  }
103
103
  /**
104
104
  * Retains only the actions at the given 0-based indices into the actions currently returned
@@ -120,7 +120,7 @@ var de = G((fe, C) => {
120
120
  filterActionsAt(e) {
121
121
  const t = E(e, o.__wbindgen_malloc), n = a, _ = o.wasmbuilder_filterActionsAt(this.__wbg_ptr, t, n);
122
122
  if (_[1])
123
- throw d(_[0]);
123
+ throw b(_[0]);
124
124
  }
125
125
  /**
126
126
  * Retains ingredients, rescuing an otherwise-orphaned ingredient when its 0-based index into
@@ -134,7 +134,7 @@ var de = G((fe, C) => {
134
134
  filterIngredientsAt(e) {
135
135
  const t = E(e, o.__wbindgen_malloc), n = a, _ = o.wasmbuilder_filterIngredientsAt(this.__wbg_ptr, t, n);
136
136
  if (_[1])
137
- throw d(_[0]);
137
+ throw b(_[0]);
138
138
  }
139
139
  /**
140
140
  * Attempts to create a new `WasmBuilder` from a builder archive.
@@ -144,10 +144,10 @@ var de = G((fe, C) => {
144
144
  * @returns {WasmBuilder}
145
145
  */
146
146
  static fromArchive(e, t) {
147
- var n = w(t) ? 0 : b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
147
+ var n = w(t) ? 0 : d(t, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
148
148
  const c = o.wasmbuilder_fromArchive(e, n, _);
149
149
  if (c[2])
150
- throw d(c[1]);
150
+ throw b(c[1]);
151
151
  return h.__wrap(c[0]);
152
152
  }
153
153
  /**
@@ -158,12 +158,12 @@ var de = G((fe, C) => {
158
158
  * @returns {WasmBuilder}
159
159
  */
160
160
  static fromJson(e, t) {
161
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
162
- var c = w(t) ? 0 : b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
163
- const s = o.wasmbuilder_fromJson(n, _, c, i);
164
- if (s[2])
165
- throw d(s[1]);
166
- return h.__wrap(s[0]);
161
+ const n = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a;
162
+ var c = w(t) ? 0 : d(t, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
163
+ const i = o.wasmbuilder_fromJson(n, _, c, s);
164
+ if (i[2])
165
+ throw b(i[1]);
166
+ return h.__wrap(i[0]);
167
167
  }
168
168
  /**
169
169
  * Get the current manifest definition.
@@ -172,8 +172,8 @@ var de = G((fe, C) => {
172
172
  getDefinition() {
173
173
  const e = o.wasmbuilder_getDefinition(this.__wbg_ptr);
174
174
  if (e[2])
175
- throw d(e[1]);
176
- return d(e[0]);
175
+ throw b(e[1]);
176
+ return b(e[0]);
177
177
  }
178
178
  /**
179
179
  * Creates a new `WasmBuilder` with a minimal manifest definition.
@@ -182,10 +182,10 @@ var de = G((fe, C) => {
182
182
  * @returns {WasmBuilder}
183
183
  */
184
184
  static new(e) {
185
- var t = w(e) ? 0 : b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
185
+ var t = w(e) ? 0 : d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
186
186
  const _ = o.wasmbuilder_new(t, n);
187
187
  if (_[2])
188
- throw d(_[1]);
188
+ throw b(_[1]);
189
189
  return h.__wrap(_[0]);
190
190
  }
191
191
  /**
@@ -195,7 +195,7 @@ var de = G((fe, C) => {
195
195
  setIntent(e) {
196
196
  const t = o.wasmbuilder_setIntent(this.__wbg_ptr, e);
197
197
  if (t[1])
198
- throw d(t[0]);
198
+ throw b(t[0]);
199
199
  }
200
200
  /**
201
201
  * Sets the state of the no_embed flag.
@@ -212,7 +212,7 @@ var de = G((fe, C) => {
212
212
  * @param {string} url
213
213
  */
214
214
  setRemoteUrl(e) {
215
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
215
+ const t = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a;
216
216
  o.wasmbuilder_setRemoteUrl(this.__wbg_ptr, t, n);
217
217
  }
218
218
  /**
@@ -221,32 +221,40 @@ var de = G((fe, C) => {
221
221
  * @param {Blob} blob
222
222
  */
223
223
  setThumbnailFromBlob(e, t) {
224
- const n = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr, n, _, t);
224
+ const n = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), _ = a, c = o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr, n, _, t);
225
225
  if (c[1])
226
- throw d(c[0]);
226
+ throw b(c[0]);
227
227
  }
228
228
  /**
229
229
  * Sign an asset using the provided SignerDefinition, format, and source Blob.
230
+ *
231
+ * `identity_assertions` is an array of `IdentityAssertionDefinition` (see
232
+ * `wasm_identity_assertion`'s typescript_custom_section); pass an empty
233
+ * array when no CAWG identity assertions are requested.
230
234
  * @param {SignerDefinition} signer_definition
235
+ * @param {any} identity_assertions
231
236
  * @param {string} format
232
237
  * @param {Blob} source
233
238
  * @returns {Promise<Uint8Array>}
234
239
  */
235
- sign(e, t, n) {
236
- const _ = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
237
- return o.wasmbuilder_sign(this.__wbg_ptr, e, _, c, n);
240
+ sign(e, t, n, _) {
241
+ const c = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
242
+ return o.wasmbuilder_sign(this.__wbg_ptr, e, t, c, s, _);
238
243
  }
239
244
  /**
240
245
  * Sign an asset using the provided SignerDefinition, format, and source Blob.
241
246
  * Use this method to get both the manifest bytes and the bytes of the signed asset.
247
+ *
248
+ * See [`Self::sign`] for `identity_assertions`.
242
249
  * @param {SignerDefinition} signer_definition
250
+ * @param {any} identity_assertions
243
251
  * @param {string} format
244
252
  * @param {Blob} source
245
253
  * @returns {Promise<any>}
246
254
  */
247
- signAndGetManifestBytes(e, t, n) {
248
- const _ = b(t, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
249
- return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr, e, _, c, n);
255
+ signAndGetManifestBytes(e, t, n, _) {
256
+ const c = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
257
+ return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr, e, t, c, s, _);
250
258
  }
251
259
  /**
252
260
  * "Save" a builder to an archive.
@@ -255,8 +263,8 @@ var de = G((fe, C) => {
255
263
  toArchive() {
256
264
  const e = o.wasmbuilder_toArchive(this.__wbg_ptr);
257
265
  if (e[2])
258
- throw d(e[1]);
259
- return d(e[0]);
266
+ throw b(e[1]);
267
+ return b(e[0]);
260
268
  }
261
269
  /**
262
270
  * Replaces the actions in the `c2pa.actions`/`c2pa.actions.v2` assertions with
@@ -285,13 +293,13 @@ var de = G((fe, C) => {
285
293
  updateActionsAt(e) {
286
294
  const t = o.wasmbuilder_updateActionsAt(this.__wbg_ptr, e);
287
295
  if (t[1])
288
- throw d(t[0]);
296
+ throw b(t[0]);
289
297
  }
290
298
  }
291
299
  Symbol.dispose && (h.prototype[Symbol.dispose] = h.prototype.free);
292
- class I {
300
+ class M {
293
301
  static __wrap(e) {
294
- const t = Object.create(I.prototype);
302
+ const t = Object.create(M.prototype);
295
303
  return t.__wbg_ptr = e, N.register(t, t.__wbg_ptr, t), t;
296
304
  }
297
305
  __destroy_into_raw() {
@@ -318,8 +326,8 @@ var de = G((fe, C) => {
318
326
  activeManifest() {
319
327
  const e = o.wasmreader_activeManifest(this.__wbg_ptr);
320
328
  if (e[2])
321
- throw d(e[1]);
322
- return d(e[0]);
329
+ throw b(e[1]);
330
+ return b(e[0]);
323
331
  }
324
332
  /**
325
333
  * Returns the asset's manifest store as crJSON.
@@ -343,9 +351,9 @@ var de = G((fe, C) => {
343
351
  * @returns {Promise<WasmReader>}
344
352
  */
345
353
  static fromBlob(e, t, n) {
346
- const _ = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
347
- var i = w(n) ? 0 : b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
348
- return o.wasmreader_fromBlob(_, c, t, i, s);
354
+ const _ = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
355
+ var s = w(n) ? 0 : d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
356
+ return o.wasmreader_fromBlob(_, c, t, s, i);
349
357
  }
350
358
  /**
351
359
  * Attempts to create a new `WasmReader` from an asset format, a `Blob` of the bytes of the initial segment, and a fragment `Blob`.
@@ -357,9 +365,28 @@ var de = G((fe, C) => {
357
365
  * @returns {Promise<WasmReader>}
358
366
  */
359
367
  static fromBlobFragment(e, t, n, _) {
360
- const c = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
361
- var s = w(_) ? 0 : b(_, o.__wbindgen_malloc, o.__wbindgen_realloc), u = a;
362
- return o.wasmreader_fromBlobFragment(c, i, t, n, s, u);
368
+ const c = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
369
+ var i = w(_) ? 0 : d(_, o.__wbindgen_malloc, o.__wbindgen_realloc), u = a;
370
+ return o.wasmreader_fromBlobFragment(c, s, t, n, i, u);
371
+ }
372
+ /**
373
+ * Attempts to create a new `WasmReader` from an asset format and the asset's raw bytes.
374
+ *
375
+ * Unlike [`WasmReader::from_blob`], this entry point does not use any browser-only Web
376
+ * APIs (`Blob`, `FileReaderSync`). The bytes are read from an in-memory [`Cursor`], which
377
+ * implements [`Read`] + [`Seek`], so this can be called from non-browser JavaScript
378
+ * runtimes such as Node.js, Deno, Bun, and Cloudflare Workers (workerd).
379
+ *
380
+ * Optionally accepts a context JSON string to configure the reader.
381
+ * @param {string} format
382
+ * @param {Uint8Array} bytes
383
+ * @param {string | null} [context_json]
384
+ * @returns {Promise<WasmReader>}
385
+ */
386
+ static fromBytes(e, t, n) {
387
+ const _ = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a, s = ne(t, o.__wbindgen_malloc), i = a;
388
+ var u = w(n) ? 0 : d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), g = a;
389
+ return o.wasmreader_fromBytes(_, c, s, i, u, g);
363
390
  }
364
391
  /**
365
392
  * Returns a JSON representation of the asset's manifest store.
@@ -381,8 +408,8 @@ var de = G((fe, C) => {
381
408
  manifestStore() {
382
409
  const e = o.wasmreader_manifestStore(this.__wbg_ptr);
383
410
  if (e[2])
384
- throw d(e[1]);
385
- return d(e[0]);
411
+ throw b(e[1]);
412
+ return b(e[0]);
386
413
  }
387
414
  /**
388
415
  * Accepts a URI reference to a binary object in the resource store and returns a `js_sys::Uint8Array` containing the resource's bytes.
@@ -390,18 +417,13 @@ var de = G((fe, C) => {
390
417
  * @returns {Uint8Array}
391
418
  */
392
419
  resourceToBytes(e) {
393
- const t = b(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmreader_resourceToBytes(this.__wbg_ptr, t, n);
420
+ const t = d(e, o.__wbindgen_malloc, o.__wbindgen_realloc), n = a, _ = o.wasmreader_resourceToBytes(this.__wbg_ptr, t, n);
394
421
  if (_[2])
395
- throw d(_[1]);
396
- return d(_[0]);
422
+ throw b(_[1]);
423
+ return b(_[0]);
397
424
  }
398
425
  }
399
- Symbol.dispose && (I.prototype[Symbol.dispose] = I.prototype.free);
400
- function $(r) {
401
- const e = b(r, o.__wbindgen_malloc, o.__wbindgen_realloc), t = a, n = o.loadSettings(e, t);
402
- if (n[1])
403
- throw d(n[0]);
404
- }
426
+ Symbol.dispose && (M.prototype[Symbol.dispose] = M.prototype.free);
405
427
  function H() {
406
428
  return {
407
429
  __proto__: null,
@@ -413,6 +435,10 @@ var de = G((fe, C) => {
413
435
  __wbg_Number_6b506e6536831eaa: function(e) {
414
436
  return Number(e);
415
437
  },
438
+ __wbg_String_8564e559799eccda: function(e, t) {
439
+ const n = String(t), _ = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
440
+ m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
441
+ },
416
442
  __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(e, t) {
417
443
  const n = t, _ = typeof n == "bigint" ? n : void 0;
418
444
  m().setBigInt64(e + 8, w(_) ? BigInt(0) : _, !0), m().setInt32(e + 0, !w(_), !0);
@@ -422,7 +448,7 @@ var de = G((fe, C) => {
422
448
  return w(n) ? 16777215 : n ? 1 : 0;
423
449
  },
424
450
  __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(e, t) {
425
- const n = x(t), _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
451
+ const n = x(t), _ = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
426
452
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
427
453
  },
428
454
  __wbg___wbindgen_in_70a403a56e771704: function(e, t) {
@@ -434,6 +460,9 @@ var de = G((fe, C) => {
434
460
  __wbg___wbindgen_is_function_754e9f305ff6029e: function(e) {
435
461
  return typeof e == "function";
436
462
  },
463
+ __wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(e) {
464
+ return e === null;
465
+ },
437
466
  __wbg___wbindgen_is_object_56732c2bc353f41d: function(e) {
438
467
  const t = e;
439
468
  return typeof t == "object" && t !== null;
@@ -456,8 +485,8 @@ var de = G((fe, C) => {
456
485
  },
457
486
  __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(e, t) {
458
487
  const n = t, _ = typeof n == "string" ? n : void 0;
459
- var c = w(_) ? 0 : b(_, o.__wbindgen_malloc, o.__wbindgen_realloc), i = a;
460
- m().setInt32(e + 4, i, !0), m().setInt32(e + 0, c, !0);
488
+ var c = w(_) ? 0 : d(_, o.__wbindgen_malloc, o.__wbindgen_realloc), s = a;
489
+ m().setInt32(e + 4, s, !0), m().setInt32(e + 0, c, !0);
461
490
  },
462
491
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(e, t) {
463
492
  throw new Error(y(e, t));
@@ -525,17 +554,17 @@ var de = G((fe, C) => {
525
554
  },
526
555
  __wbg_getRandomValues_3f44b700395062e5: function() {
527
556
  return l(function(e, t) {
528
- globalThis.crypto.getRandomValues(A(e, t));
557
+ globalThis.crypto.getRandomValues(v(e, t));
529
558
  }, arguments);
530
559
  },
531
560
  __wbg_getRandomValues_76dfc69825c9c552: function() {
532
561
  return l(function(e, t) {
533
- globalThis.crypto.getRandomValues(A(e, t));
562
+ globalThis.crypto.getRandomValues(v(e, t));
534
563
  }, arguments);
535
564
  },
536
565
  __wbg_getRandomValues_8aa3112c6615eef6: function() {
537
566
  return l(function(e, t) {
538
- globalThis.crypto.getRandomValues(A(e, t));
567
+ globalThis.crypto.getRandomValues(v(e, t));
539
568
  }, arguments);
540
569
  },
541
570
  __wbg_getRandomValues_c44a50d8cfdaebeb: function() {
@@ -670,15 +699,15 @@ var de = G((fe, C) => {
670
699
  }, arguments);
671
700
  },
672
701
  __wbg_new_from_slice_18fa1f71286d66b8: function(e, t) {
673
- return new Uint8Array(A(e, t));
702
+ return new Uint8Array(v(e, t));
674
703
  },
675
704
  __wbg_new_typed_bf31d18f92484486: function(e, t) {
676
705
  try {
677
- var n = { a: e, b: t }, _ = (i, s) => {
706
+ var n = { a: e, b: t }, _ = (s, i) => {
678
707
  const u = n.a;
679
708
  n.a = 0;
680
709
  try {
681
- return K(u, n.b, i, s);
710
+ return K(u, n.b, s, i);
682
711
  } finally {
683
712
  n.a = u;
684
713
  }
@@ -714,7 +743,7 @@ var de = G((fe, C) => {
714
743
  return e.process;
715
744
  },
716
745
  __wbg_prototypesetcall_3249fc62a0fafa30: function(e, t, n) {
717
- Uint8Array.prototype.set.call(A(e, t), n);
746
+ Uint8Array.prototype.set.call(v(e, t), n);
718
747
  },
719
748
  __wbg_queueMicrotask_35c611f4a14830b2: function(e) {
720
749
  queueMicrotask(e);
@@ -734,7 +763,7 @@ var de = G((fe, C) => {
734
763
  },
735
764
  __wbg_require_b4edbdcf3e2a1ef0: function() {
736
765
  return l(function() {
737
- return C.require;
766
+ return P.require;
738
767
  }, arguments);
739
768
  },
740
769
  __wbg_resolve_25a7e548d5881dca: function(e) {
@@ -744,7 +773,7 @@ var de = G((fe, C) => {
744
773
  return setTimeout(e, t);
745
774
  },
746
775
  __wbg_set_29c99a8aac1c01e5: function(e, t, n) {
747
- e.set(A(t, n));
776
+ e.set(v(t, n));
748
777
  },
749
778
  __wbg_set_52b1e1eb5bed906a: function(e, t, n) {
750
779
  return e.set(t, n);
@@ -788,24 +817,24 @@ var de = G((fe, C) => {
788
817
  }, arguments);
789
818
  },
790
819
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
791
- const n = t.stack, _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
820
+ const n = t.stack, _ = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
792
821
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
793
822
  },
794
823
  __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
795
824
  const e = typeof global > "u" ? null : global;
796
- return w(e) ? 0 : R(e);
825
+ return w(e) ? 0 : S(e);
797
826
  },
798
827
  __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
799
828
  const e = typeof globalThis > "u" ? null : globalThis;
800
- return w(e) ? 0 : R(e);
829
+ return w(e) ? 0 : S(e);
801
830
  },
802
831
  __wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
803
832
  const e = typeof self > "u" ? null : self;
804
- return w(e) ? 0 : R(e);
833
+ return w(e) ? 0 : S(e);
805
834
  },
806
835
  __wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
807
836
  const e = typeof window > "u" ? null : window;
808
- return w(e) ? 0 : R(e);
837
+ return w(e) ? 0 : S(e);
809
838
  },
810
839
  __wbg_status_00549d55b78d949e: function(e) {
811
840
  return e.status;
@@ -825,7 +854,7 @@ var de = G((fe, C) => {
825
854
  return e.then(t);
826
855
  },
827
856
  __wbg_url_6808f1c468f2d0cd: function(e, t) {
828
- const n = t.url, _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
857
+ const n = t.url, _ = d(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = a;
829
858
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
830
859
  },
831
860
  __wbg_valueOf_41ae57308c1f031c: function(e) {
@@ -838,13 +867,13 @@ var de = G((fe, C) => {
838
867
  return e.versions;
839
868
  },
840
869
  __wbg_wasmreader_new: function(e) {
841
- return I.__wrap(e);
870
+ return M.__wrap(e);
842
871
  },
843
872
  __wbindgen_cast_0000000000000001: function(e, t) {
844
- return J(e, t, Y);
873
+ return L(e, t, Y);
845
874
  },
846
875
  __wbindgen_cast_0000000000000002: function(e, t) {
847
- return J(e, t, X);
876
+ return L(e, t, X);
848
877
  },
849
878
  __wbindgen_cast_0000000000000003: function(e) {
850
879
  return e;
@@ -853,7 +882,7 @@ var de = G((fe, C) => {
853
882
  return e;
854
883
  },
855
884
  __wbindgen_cast_0000000000000005: function(e, t) {
856
- return A(e, t);
885
+ return v(e, t);
857
886
  },
858
887
  __wbindgen_cast_0000000000000006: function(e, t) {
859
888
  return y(e, t);
@@ -862,7 +891,7 @@ var de = G((fe, C) => {
862
891
  return BigInt.asUintN(64, e);
863
892
  },
864
893
  __wbindgen_cast_0000000000000008: function(e, t) {
865
- var n = A(e, t).slice();
894
+ var n = v(e, t).slice();
866
895
  return o.__wbindgen_free(e, t * 1, 1), n;
867
896
  },
868
897
  __wbindgen_init_externref_table: function() {
@@ -878,22 +907,22 @@ var de = G((fe, C) => {
878
907
  function Y(r, e, t) {
879
908
  const n = o.wasm_bindgen_4d7940e3be85a6dc___convert__closures_____invoke___wasm_bindgen_4d7940e3be85a6dc___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_4d7940e3be85a6dc___JsError___true_(r, e, t);
880
909
  if (n[1])
881
- throw d(n[0]);
910
+ throw b(n[0]);
882
911
  }
883
912
  function K(r, e, t, n) {
884
913
  o.wasm_bindgen_4d7940e3be85a6dc___convert__closures_____invoke___js_sys_a576b80f2209464___Function_fn_wasm_bindgen_4d7940e3be85a6dc___JsValue_____wasm_bindgen_4d7940e3be85a6dc___sys__Undefined___js_sys_a576b80f2209464___Function_fn_wasm_bindgen_4d7940e3be85a6dc___JsValue_____wasm_bindgen_4d7940e3be85a6dc___sys__Undefined_______true_(r, e, t, n);
885
914
  }
886
- const Q = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"], Z = ["omit", "same-origin", "include"], ee = ["same-origin", "no-cors", "cors", "navigate"], k = typeof FinalizationRegistry > "u" ? { register: () => {
915
+ const Q = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"], Z = ["omit", "same-origin", "include"], ee = ["same-origin", "no-cors", "cors", "navigate"], z = typeof FinalizationRegistry > "u" ? { register: () => {
887
916
  }, unregister: () => {
888
917
  } } : new FinalizationRegistry((r) => o.__wbg_wasmbuilder_free(r, 1)), N = typeof FinalizationRegistry > "u" ? { register: () => {
889
918
  }, unregister: () => {
890
919
  } } : new FinalizationRegistry((r) => o.__wbg_wasmreader_free(r, 1));
891
920
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((r) => o.__wbg_wasmsigner_free(r, 1));
892
- function R(r) {
921
+ function S(r) {
893
922
  const e = o.__externref_table_alloc();
894
923
  return o.__wbindgen_externrefs.set(e, r), e;
895
924
  }
896
- const z = typeof FinalizationRegistry > "u" ? { register: () => {
925
+ const J = typeof FinalizationRegistry > "u" ? { register: () => {
897
926
  }, unregister: () => {
898
927
  } } : new FinalizationRegistry((r) => o.__wbindgen_destroy_closure(r.a, r.b));
899
928
  function x(r) {
@@ -914,8 +943,8 @@ var de = G((fe, C) => {
914
943
  const _ = r.length;
915
944
  let c = "[";
916
945
  _ > 0 && (c += x(r[0]));
917
- for (let i = 1; i < _; i++)
918
- c += ", " + x(r[i]);
946
+ for (let s = 1; s < _; s++)
947
+ c += ", " + x(r[s]);
919
948
  return c += "]", c;
920
949
  }
921
950
  const t = /\[object ([^\]]+)\]/.exec(toString.call(r));
@@ -933,84 +962,88 @@ var de = G((fe, C) => {
933
962
  return r instanceof Error ? `${r.name}: ${r.message}
934
963
  ${r.stack}` : n;
935
964
  }
936
- function A(r, e) {
937
- return r = r >>> 0, T().subarray(r / 1, r / 1 + e);
965
+ function v(r, e) {
966
+ return r = r >>> 0, R().subarray(r / 1, r / 1 + e);
938
967
  }
939
- let v = null;
968
+ let I = null;
940
969
  function m() {
941
- return (v === null || v.buffer.detached === !0 || v.buffer.detached === void 0 && v.buffer !== o.memory.buffer) && (v = new DataView(o.memory.buffer)), v;
970
+ return (I === null || I.buffer.detached === !0 || I.buffer.detached === void 0 && I.buffer !== o.memory.buffer) && (I = new DataView(o.memory.buffer)), I;
942
971
  }
943
972
  function y(r, e) {
944
- return re(r >>> 0, e);
973
+ return _e(r >>> 0, e);
945
974
  }
946
- let S = null;
975
+ let B = null;
947
976
  function te() {
948
- return (S === null || S.byteLength === 0) && (S = new Uint32Array(o.memory.buffer)), S;
977
+ return (B === null || B.byteLength === 0) && (B = new Uint32Array(o.memory.buffer)), B;
949
978
  }
950
- let B = null;
951
- function T() {
952
- return (B === null || B.byteLength === 0) && (B = new Uint8Array(o.memory.buffer)), B;
979
+ let T = null;
980
+ function R() {
981
+ return (T === null || T.byteLength === 0) && (T = new Uint8Array(o.memory.buffer)), T;
953
982
  }
954
983
  function l(r, e) {
955
984
  try {
956
985
  return r.apply(this, e);
957
986
  } catch (t) {
958
- const n = R(t);
987
+ const n = S(t);
959
988
  o.__wbindgen_exn_store(n);
960
989
  }
961
990
  }
962
991
  function w(r) {
963
992
  return r == null;
964
993
  }
965
- function J(r, e, t) {
994
+ function L(r, e, t) {
966
995
  const n = { a: r, b: e, cnt: 1 }, _ = (...c) => {
967
996
  n.cnt++;
968
- const i = n.a;
997
+ const s = n.a;
969
998
  n.a = 0;
970
999
  try {
971
- return t(i, n.b, ...c);
1000
+ return t(s, n.b, ...c);
972
1001
  } finally {
973
- n.a = i, _._wbg_cb_unref();
1002
+ n.a = s, _._wbg_cb_unref();
974
1003
  }
975
1004
  };
976
1005
  return _._wbg_cb_unref = () => {
977
- --n.cnt === 0 && (o.__wbindgen_destroy_closure(n.a, n.b), n.a = 0, z.unregister(n));
978
- }, z.register(_, n, n), _;
1006
+ --n.cnt === 0 && (o.__wbindgen_destroy_closure(n.a, n.b), n.a = 0, J.unregister(n));
1007
+ }, J.register(_, n, n), _;
979
1008
  }
980
1009
  function E(r, e) {
981
1010
  const t = e(r.length * 4, 4) >>> 0;
982
1011
  return te().set(r, t / 4), a = r.length, t;
983
1012
  }
984
- function b(r, e, t) {
1013
+ function ne(r, e) {
1014
+ const t = e(r.length * 1, 1) >>> 0;
1015
+ return R().set(r, t / 1), a = r.length, t;
1016
+ }
1017
+ function d(r, e, t) {
985
1018
  if (t === void 0) {
986
- const s = j.encode(r), u = e(s.length, 1) >>> 0;
987
- return T().subarray(u, u + s.length).set(s), a = s.length, u;
1019
+ const i = j.encode(r), u = e(i.length, 1) >>> 0;
1020
+ return R().subarray(u, u + i.length).set(i), a = i.length, u;
988
1021
  }
989
1022
  let n = r.length, _ = e(n, 1) >>> 0;
990
- const c = T();
991
- let i = 0;
992
- for (; i < n; i++) {
993
- const s = r.charCodeAt(i);
994
- if (s > 127) break;
995
- c[_ + i] = s;
1023
+ const c = R();
1024
+ let s = 0;
1025
+ for (; s < n; s++) {
1026
+ const i = r.charCodeAt(s);
1027
+ if (i > 127) break;
1028
+ c[_ + s] = i;
996
1029
  }
997
- if (i !== n) {
998
- i !== 0 && (r = r.slice(i)), _ = t(_, n, n = i + r.length * 3, 1) >>> 0;
999
- const s = T().subarray(_ + i, _ + n), u = j.encodeInto(r, s);
1000
- i += u.written, _ = t(_, n, i, 1) >>> 0;
1030
+ if (s !== n) {
1031
+ s !== 0 && (r = r.slice(s)), _ = t(_, n, n = s + r.length * 3, 1) >>> 0;
1032
+ const i = R().subarray(_ + s, _ + n), u = j.encodeInto(r, i);
1033
+ s += u.written, _ = t(_, n, s, 1) >>> 0;
1001
1034
  }
1002
- return a = i, _;
1035
+ return a = s, _;
1003
1036
  }
1004
- function d(r) {
1037
+ function b(r) {
1005
1038
  const e = o.__wbindgen_externrefs.get(r);
1006
1039
  return o.__externref_table_dealloc(r), e;
1007
1040
  }
1008
1041
  let O = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
1009
1042
  O.decode();
1010
- const ne = 2146435072;
1043
+ const re = 2146435072;
1011
1044
  let U = 0;
1012
- function re(r, e) {
1013
- return U += e, U >= ne && (O = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), O.decode(), U = e), O.decode(T().subarray(r, r + e));
1045
+ function _e(r, e) {
1046
+ return U += e, U >= re && (O = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), O.decode(), U = e), O.decode(R().subarray(r, r + e));
1014
1047
  }
1015
1048
  const j = new TextEncoder();
1016
1049
  "encodeInto" in j || (j.encodeInto = function(r, e) {
@@ -1021,18 +1054,18 @@ ${r.stack}` : n;
1021
1054
  };
1022
1055
  });
1023
1056
  let a = 0, o;
1024
- function _e(r, e) {
1025
- return o = r.exports, v = null, S = null, B = null, o.__wbindgen_start(), o;
1057
+ function oe(r, e) {
1058
+ return o = r.exports, I = null, B = null, T = null, o.__wbindgen_start(), o;
1026
1059
  }
1027
- function oe(r) {
1060
+ function ce(r) {
1028
1061
  if (o !== void 0) return o;
1029
1062
  r !== void 0 && (Object.getPrototypeOf(r) === Object.prototype ? { module: r } = r : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
1030
1063
  const e = H();
1031
1064
  r instanceof WebAssembly.Module || (r = new WebAssembly.Module(r));
1032
1065
  const t = new WebAssembly.Instance(r, e);
1033
- return _e(t);
1066
+ return oe(t);
1034
1067
  }
1035
- function D() {
1068
+ function W() {
1036
1069
  let r = 0;
1037
1070
  const e = /* @__PURE__ */ new Map();
1038
1071
  return {
@@ -1052,17 +1085,17 @@ ${r.stack}` : n;
1052
1085
  };
1053
1086
  }
1054
1087
  const q = Symbol("transfer");
1055
- function M(r, e) {
1088
+ function F(r, e) {
1056
1089
  return {
1057
1090
  type: q,
1058
1091
  value: r,
1059
1092
  transfer: e ? Array.isArray(e) ? e : [e] : [r]
1060
1093
  };
1061
1094
  }
1062
- function L(r) {
1095
+ function V(r) {
1063
1096
  return !!(r && typeof r == "object" && Reflect.get(r, "type") === q);
1064
1097
  }
1065
- function W(r = "default") {
1098
+ function C(r = "default") {
1066
1099
  return {
1067
1100
  createTx(e) {
1068
1101
  const t = /* @__PURE__ */ new Map(), n = e ?? self;
@@ -1070,21 +1103,21 @@ ${r.stack}` : n;
1070
1103
  const { data: c } = _;
1071
1104
  if (c.channelName !== r)
1072
1105
  return;
1073
- const { id: i, result: s, error: u } = c, g = t.get(i);
1074
- g && (u ? g.reject(u) : g.resolve(s), t.delete(i));
1106
+ const { id: s, result: i, error: u } = c, g = t.get(s);
1107
+ g && (u ? g.reject(u) : g.resolve(i), t.delete(s));
1075
1108
  }), new Proxy(
1076
1109
  {},
1077
1110
  {
1078
1111
  get(_, c) {
1079
- return (...i) => {
1080
- const s = ce(), u = [], g = [];
1081
- return i.forEach((F) => {
1082
- L(F) ? (u.push(F.value), g.push(...F.transfer)) : u.push(F);
1112
+ return (...s) => {
1113
+ const i = se(), u = [], g = [];
1114
+ return s.forEach((A) => {
1115
+ V(A) ? (u.push(A.value), g.push(...A.transfer)) : u.push(A);
1083
1116
  }), n.postMessage(
1084
- { method: c, args: u, id: s, channelName: r },
1117
+ { method: c, args: u, id: i, channelName: r },
1085
1118
  { transfer: g }
1086
- ), new Promise((F, P) => {
1087
- t.set(s, { resolve: F, reject: P });
1119
+ ), new Promise((A, G) => {
1120
+ t.set(i, { resolve: A, reject: G });
1088
1121
  });
1089
1122
  };
1090
1123
  }
@@ -1097,10 +1130,10 @@ ${r.stack}` : n;
1097
1130
  const { data: c } = _;
1098
1131
  if (c.channelName !== r)
1099
1132
  return;
1100
- const { method: i, args: s, id: u } = c;
1133
+ const { method: s, args: i, id: u } = c;
1101
1134
  try {
1102
- const g = await e[i](...s);
1103
- L(g) ? n.postMessage(
1135
+ const g = await e[s](...i);
1136
+ V(g) ? n.postMessage(
1104
1137
  { result: g.value, id: u, channelName: r },
1105
1138
  { transfer: g.transfer }
1106
1139
  ) : n.postMessage({ result: g, id: u, channelName: r });
@@ -1111,28 +1144,40 @@ ${r.stack}` : n;
1111
1144
  }
1112
1145
  };
1113
1146
  }
1114
- function ce() {
1147
+ function se() {
1115
1148
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
1116
1149
  }
1117
- const { rx: ie } = W(), { createTx: se } = W("worker");
1118
- function ae(r) {
1150
+ const { rx: ie } = C(), { createTx: ae } = C("worker");
1151
+ function ue(r) {
1119
1152
  if (!(r != null && r.manifests))
1120
1153
  return r;
1121
1154
  const e = r.manifests, t = Object.assign(/* @__PURE__ */ Object.create(null), e), n = Object.getPrototypeOf(e);
1122
1155
  return n !== null && n !== Object.prototype && (t.__proto__ = n), r.manifests = t, r;
1123
1156
  }
1124
- const p = D(), f = D(), V = se();
1157
+ const p = W(), f = W(), k = ae();
1158
+ function D(r) {
1159
+ return r.map((e) => ({
1160
+ sigType: e.sigType,
1161
+ reserveSize: e.reserveSize,
1162
+ referencedAssertions: e.referencedAssertions,
1163
+ roles: e.roles,
1164
+ sign: async (t) => {
1165
+ const n = t.referencedAssertions.map((c) => c.hash.buffer);
1166
+ return await k.cawgSign(e.requestId, F(t, n));
1167
+ }
1168
+ }));
1169
+ }
1125
1170
  ie(
1126
- ue({
1127
- async initWorker(r, e) {
1128
- oe({ module: r }), e && $(e);
1171
+ de({
1172
+ async initWorker(r) {
1173
+ ce({ module: r });
1129
1174
  },
1130
1175
  async reader_fromBlob(r, e, t) {
1131
- const n = await I.fromBlob(r, e, t);
1176
+ const n = await M.fromBlob(r, e, t);
1132
1177
  return p.add(n);
1133
1178
  },
1134
1179
  async reader_fromBlobFragment(r, e, t, n) {
1135
- const _ = await I.fromBlobFragment(
1180
+ const _ = await M.fromBlobFragment(
1136
1181
  r,
1137
1182
  e,
1138
1183
  t,
@@ -1145,7 +1190,7 @@ ${r.stack}` : n;
1145
1190
  },
1146
1191
  reader_manifestStore(r) {
1147
1192
  const e = p.get(r);
1148
- return ae(e.manifestStore());
1193
+ return ue(e.manifestStore());
1149
1194
  },
1150
1195
  reader_activeManifest(r) {
1151
1196
  return p.get(r).activeManifest();
@@ -1158,7 +1203,7 @@ ${r.stack}` : n;
1158
1203
  },
1159
1204
  reader_resourceToBytes(r, e) {
1160
1205
  const n = p.get(r).resourceToBytes(e);
1161
- return M(n, n.buffer);
1206
+ return F(n, n.buffer);
1162
1207
  },
1163
1208
  reader_free(r) {
1164
1209
  p.get(r).free(), p.remove(r);
@@ -1225,44 +1270,46 @@ ${r.stack}` : n;
1225
1270
  },
1226
1271
  builder_toArchive(r) {
1227
1272
  const t = f.get(r).toArchive();
1228
- return M(t, t.buffer);
1273
+ return F(t, t.buffer);
1229
1274
  },
1230
- async builder_sign(r, e, t, n, _) {
1275
+ async builder_sign(r, e, t, n, _, c) {
1231
1276
  const i = await f.get(r).sign(
1232
1277
  {
1233
1278
  reserveSize: t.reserveSize,
1234
1279
  alg: t.alg,
1235
- sign: async (s) => await V.sign(
1280
+ sign: async (u) => await k.sign(
1236
1281
  e,
1237
- M(s, s.buffer),
1282
+ F(u, u.buffer),
1238
1283
  t.reserveSize
1239
1284
  )
1240
1285
  },
1241
- n,
1242
- _
1286
+ D(n),
1287
+ _,
1288
+ c
1243
1289
  );
1244
- return M(i, i.buffer);
1290
+ return F(i, i.buffer);
1245
1291
  },
1246
- async builder_signAndGetManifestBytes(r, e, t, n, _) {
1247
- const c = f.get(r), { manifest: i, asset: s } = await c.signAndGetManifestBytes(
1292
+ async builder_signAndGetManifestBytes(r, e, t, n, _, c) {
1293
+ const s = f.get(r), { manifest: i, asset: u } = await s.signAndGetManifestBytes(
1248
1294
  {
1249
1295
  reserveSize: t.reserveSize,
1250
1296
  alg: t.alg,
1251
- sign: async (u) => await V.sign(
1297
+ sign: async (g) => await k.sign(
1252
1298
  e,
1253
- M(u, u.buffer),
1299
+ F(g, g.buffer),
1254
1300
  t.reserveSize
1255
1301
  )
1256
1302
  },
1257
- n,
1258
- _
1303
+ D(n),
1304
+ _,
1305
+ c
1259
1306
  );
1260
- return M(
1307
+ return F(
1261
1308
  {
1262
1309
  manifest: i,
1263
- asset: s
1310
+ asset: u
1264
1311
  },
1265
- [i.buffer, s.buffer]
1312
+ [i.buffer, u.buffer]
1266
1313
  );
1267
1314
  },
1268
1315
  builder_free(r) {
@@ -1270,7 +1317,7 @@ ${r.stack}` : n;
1270
1317
  }
1271
1318
  })
1272
1319
  );
1273
- function ue(r) {
1320
+ function de(r) {
1274
1321
  const e = {};
1275
1322
  for (const [t, n] of Object.entries(r))
1276
1323
  e[t] = async (..._) => {
@@ -1283,4 +1330,4 @@ ${r.stack}` : n;
1283
1330
  return e;
1284
1331
  }
1285
1332
  });
1286
- export default de();
1333
+ export default be();