@contentauth/c2pa-web 0.8.0 → 0.8.2
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.
- package/README.md +11 -5
- package/dist/c2pa-DlCQhbLd.js +382 -0
- package/dist/index.js +1 -1
- package/dist/inline.js +7 -7
- package/dist/lib/builder.d.ts +11 -1
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/settings.d.ts +1 -0
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/lib/worker/rpc.d.ts +3 -1
- package/dist/lib/worker/rpc.d.ts.map +1 -1
- package/dist/resources/c2pa_bg.wasm +0 -0
- package/package.json +5 -4
- package/dist/c2pa-DFKe4lKd.js +0 -369
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install @contentauth/c2pa-web
|
|
|
12
12
|
|
|
13
13
|
## Importing the library
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Due to [specific requirements](https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/Loading_and_running) for handling Wasm modules, there are two ways to import the library:
|
|
16
16
|
|
|
17
17
|
- Using a separate Wasm binary, which provides better performance.
|
|
18
18
|
- Using an inline Wasm binary, which is more convenient.
|
|
@@ -22,7 +22,7 @@ There are two ways to import the library, due to [specific requirements](https:/
|
|
|
22
22
|
The recommended way to import the library is to fetch the Wasm binary over the network at runtime.
|
|
23
23
|
This requires that the Wasm binary be hosted separately.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Use a solution appropriate to your tooling; for example, using Vite:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
28
|
import { createC2pa } from '@contentauth/c2pa-web';
|
|
@@ -32,7 +32,7 @@ import wasmSrc from '@contentauth/c2pa-web/resources/c2pa.wasm?url';
|
|
|
32
32
|
const c2pa = createC2pa({ wasmSrc });
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Alternatively, you can request the binary from a CDN:
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { createC2pa } from '@contentauth/c2pa-web';
|
|
@@ -288,9 +288,15 @@ For the full list, see the [API reference](https://contentauth.github.io/c2pa-js
|
|
|
288
288
|
|
|
289
289
|
### Prerequisites
|
|
290
290
|
|
|
291
|
-
Ensure the repo-wide prerequisites
|
|
291
|
+
Ensure the repo-wide prerequisites are installed:
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
- [Node.js](https://nodejs.org/) v22+
|
|
294
|
+
- [NX](https://nx.dev/getting-started/intro)
|
|
295
|
+
- [pnpm](https://pnpm.io/)
|
|
296
|
+
|
|
297
|
+
See the [c2pa-js README](../../README.md#prerequisites) for details.
|
|
298
|
+
|
|
299
|
+
Then, install [the additional prerequisites for `c2pa-wasm`](../c2pa-wasm/README.md#prerequisites).
|
|
294
300
|
|
|
295
301
|
### Building
|
|
296
302
|
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { channel as E, transfer as z } from "highgain";
|
|
2
|
+
import { merge as O } from "ts-deepmerge";
|
|
3
|
+
const { createTx: N, rx: Z } = E(), { createTx: Q, rx: U } = E("worker"), T = '(function(){"use strict";class p{static __wrap(e){const t=Object.create(p.prototype);return t.__wbg_ptr=e,x.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw b(t[0])}addIngredient(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,n);if(_[1])throw b(_[0])}addIngredientFromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,i=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,i,s,n)}addRedaction(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addRedaction(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}addResourceFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}static fromArchive(e,t){var n=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;const c=o.wasmbuilder_fromArchive(e,n,_);if(c[2])throw b(c[1]);return p.__wrap(c[0])}static fromJson(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;var c=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;const s=o.wasmbuilder_fromJson(n,_,c,i);if(s[2])throw b(s[1]);return p.__wrap(s[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}static new(e){var t=g(e)?0:f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;const _=o.wasmbuilder_new(t,n);if(_[2])throw b(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw b(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}setRemoteUrl(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,n)}setThumbnailFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}sign(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,n)}signAndGetManifestBytes(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,n)}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class v{static __wrap(e){const t=Object.create(v.prototype);return t.__wbg_ptr=e,k.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=y(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}crJson(){let e,t;try{const n=o.wasmreader_crJson(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;var i=g(n)?0:f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmreader_fromBlob(_,c,t,i,s)}static fromBlobFragment(e,t,n,_){const c=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;var s=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,i,t,n,s,a)}json(){let e,t;try{const n=o.wasmreader_json(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}resourceToBytes(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,n);if(_[2])throw b(_[1]);return b(_[0])}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);function C(r){const e=f(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw b(n[0])}function J(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_3639a60ed15f87e7:function(e,t){return Error(y(e,t))},__wbg_Number_a3d737fd183f7dca:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b:function(e,t){const n=t,_=typeof n=="bigint"?n:void 0;m().setBigInt64(e+8,g(_)?BigInt(0):_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_07cb72cfcc952e2b:function(e,t){const n=j(t),_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg___wbindgen_in_2617fa76397620d3:function(e,t){return e in t},__wbg___wbindgen_is_bigint_d6a8167cac401b95:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_2f0fd7ceb86e64c5:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_5b22ff2418063a9c:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_eddc07a3efad52e6:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_244a92c34d3b6ec0:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_403eaa3610500a25:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62:function(e,t){return e==t},__wbg___wbindgen_number_get_dd6d69a6079f26f1:function(e,t){const n=t,_=typeof n=="number"?n:void 0;m().setFloat64(e+8,g(_)?0:_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_string_get_965592073e5d848c:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;m().setInt32(e+4,i,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_9c75d47bf9e7731e:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_158e43e869788cdc:function(e){e._wbg_cb_unref()},__wbg_abort_43913e33ecb83d0d:function(e,t){e.abort(t)},__wbg_abort_87eb7f23cf4b73d1:function(e){e.abort()},__wbg_append_8df396311184f750:function(){return d(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_87e3ac06d961f7a0:function(){return d(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_1f57c71e64ee0180:function(e){return e.byteLength},__wbg_call_a41d6421b30a32c5:function(){return d(function(e,t,n){return e.call(t,n)},arguments)},__wbg_call_add9e5a76382e668:function(){return d(function(e,t){return e.call(t)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_b1afd6201ac045e0:function(e){return e.done},__wbg_entries_bb9843ba73dc70d6:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,_;try{n=e,_=t,console.error(y(e,t))}finally{o.__wbindgen_free(n,_,1)}},__wbg_fetch_1a030943aa8e0c38:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_ff141b1e4c69b979:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return d(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getRandomValues_ef12552bf5acd2fe:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getTime_e599bee315e19eba:function(e){return e.getTime()},__wbg_get_41476db20fef99a8:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_652f640b3b0b6e3e:function(e,t){return e[t>>>0]},__wbg_get_9cfea9b7bbf12a15:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_be562b1421656321:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_3a6f31f647e0ba22:function(){return d(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_de17f740bce997ae:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_eab9f28fbec23477:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_10d4edf60fcf9327:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_1208ac2399c33e10:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_370b83aa6c17e88a:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_57d77acd50e4c44d:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_c6c6ef8308995bcf:function(e){return Array.isArray(e)},__wbg_isSafeInteger_3c56c421a5b4cce4:function(e){return Number.isSafeInteger(e)},__wbg_iterator_9d68985a1d096fc2:function(){return Symbol.iterator},__wbg_length_0a6ce016dc1460b0:function(e){return e.length},__wbg_length_ba3c032602efe310:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_e486ec9936f7edbf:function(){return new Date},__wbg_new_18865c63fa645c6f:function(){return d(function(){return new Headers},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_2fad8ca02fd00684:function(){return new Object},__wbg_new_3baa8d9866155c79:function(){return new Array},__wbg_new_46ae4e4ff2a07a64:function(){return new Map},__wbg_new_51ff470dc2f61e27:function(){return d(function(){return new AbortController},arguments)},__wbg_new_8454eee672b2ba6e:function(e){return new Uint8Array(e)},__wbg_new_b440b9ba53cb2554:function(){return d(function(){return new FileReaderSync},arguments)},__wbg_new_from_slice_5a173c243af2e823:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_1137602701dc87d4:function(e,t){try{var n={a:e,b:t},_=(i,s)=>{const a=n.a;n.a=0;try{return P(a,n.b,i,s)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_9011f5da794bf5d9:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_da311e12114f4d1e:function(){return d(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_261c3c48c6e309a5:function(e){return e.next},__wbg_next_aacee310bcfe6461:function(){return d(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_4f457f10f864aec5:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_fd4050e806e1d519:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_queueMicrotask_40ac6ffc2848ba77:function(e){queueMicrotask(e)},__wbg_queueMicrotask_74d092439f6494c1:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return d(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_952b5bb25ca28be4:function(){return d(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return d(function(){return module.require},arguments)},__wbg_resolve_9feb5d906ca62419:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_82f7a370f604db70:function(e,t,n){return e.set(t,n)},__wbg_set_b0d9dc239ecdb765:function(e,t,n){e.set(A(t,n))},__wbg_set_body_aaff4f5f9991f342:function(e,t){e.body=t},__wbg_set_cache_d1f2b7b4dfa39317:function(e,t){e.cache=$[t]},__wbg_set_credentials_f31e4d30b974ce14:function(e,t){e.credentials=H[t]},__wbg_set_f614f6a0608d1d1d:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_ae96049ea40e9eef:function(e,t){e.headers=t},__wbg_set_method_0eea8a5597775fa1:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_9fe47bff60a1580d:function(e,t){e.mode=X[t]},__wbg_set_signal_8c5cf4c3b27bd8a8:function(e,t){e.signal=t},__wbg_signal_4643ce883b92b553:function(e){return e.signal},__wbg_size_7aa12780f92a63e8:function(e){return e.size},__wbg_slice_4fa1187be1acab2b:function(){return d(function(e,t,n){return e.slice(t,n)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(e,t){const n=t.stack,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:S(e)},__wbg_static_accessor_GLOBAL_e039bc914f83e74e:function(){const e=typeof global>"u"?null:global;return g(e)?0:S(e)},__wbg_static_accessor_SELF_8bf8c48c28420ad5:function(){const e=typeof self>"u"?null:self;return g(e)?0:S(e)},__wbg_static_accessor_WINDOW_6aeee9b51652ee0f:function(){const e=typeof window>"u"?null:window;return g(e)?0:S(e)},__wbg_status_157e67ab07d01f8a:function(e){return e.status},__wbg_stringify_7fd5cae8859a6f10:function(){return d(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_fbe3cef290e1fa43:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_20a157d939b514f5:function(e,t){return e.then(t)},__wbg_then_5ef9b762bc91555c:function(e,t,n){return e.then(t,n)},__wbg_url_a0e994e7d0317efc:function(e,t){const n=t.url,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_valueOf_96c1596174cf4ec4:function(e){return e.valueOf()},__wbg_value_f852716acdeb3e82:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return v.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,G)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,V)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return A(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return y(e,t)},__wbindgen_cast_0000000000000007:function(e){return BigInt.asUintN(64,e)},__wbindgen_cast_0000000000000008:function(e,t){var n=A(e,t).slice();return o.__wbindgen_free(e,t*1,1),n},__wbindgen_init_externref_table:function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function V(r,e){o.wasm_bindgen__convert__closures_____invoke__hb660c60820732a9e(r,e)}function G(r,e,t){const n=o.wasm_bindgen__convert__closures_____invoke__h4aa26a54fe4da3a7(r,e,t);if(n[1])throw b(n[0])}function P(r,e,t,n){o.wasm_bindgen__convert__closures_____invoke__h71c2fa3b316ba280(r,e,t,n)}const $=["default","no-store","reload","no-cache","force-cache","only-if-cached"],H=["omit","same-origin","include"],X=["same-origin","no-cors","cors","navigate"],x=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmbuilder_free(r,1)),k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmreader_free(r,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>o.__wbg_wasmsigner_free(r,1));function S(r){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,r),e}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbindgen_destroy_closure(r.a,r.b));function j(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const _=r.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=r.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(r)){const _=r.length;let c="[";_>0&&(c+=j(r[0]));for(let i=1;i<_;i++)c+=", "+j(r[i]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(r));let n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}\n${r.stack}`:n}function A(r,e){return r=r>>>0,M().subarray(r/1,r/1+e)}let F=null;function m(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==o.memory.buffer)&&(F=new DataView(o.memory.buffer)),F}function y(r,e){return K(r>>>0,e)}let B=null;function M(){return(B===null||B.byteLength===0)&&(B=new Uint8Array(o.memory.buffer)),B}function d(r,e){try{return r.apply(this,e)}catch(t){const n=S(t);o.__wbindgen_exn_store(n)}}function g(r){return r==null}function z(r,e,t){const n={a:r,b:e,cnt:1},_=(...c)=>{n.cnt++;const i=n.a;n.a=0;try{return t(i,n.b,...c)}finally{n.a=i,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{--n.cnt===0&&(o.__wbindgen_destroy_closure(n.a,n.b),n.a=0,N.unregister(n))},N.register(_,n,n),_}function f(r,e,t){if(t===void 0){const s=T.encode(r),a=e(s.length,1)>>>0;return M().subarray(a,a+s.length).set(s),u=s.length,a}let n=r.length,_=e(n,1)>>>0;const c=M();let i=0;for(;i<n;i++){const s=r.charCodeAt(i);if(s>127)break;c[_+i]=s}if(i!==n){i!==0&&(r=r.slice(i)),_=t(_,n,n=i+r.length*3,1)>>>0;const s=M().subarray(_+i,_+n),a=T.encodeInto(r,s);i+=a.written,_=t(_,n,i,1)>>>0}return u=i,_}function b(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=e),E.decode(M().subarray(r,r+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(r,e){const t=T.encode(r);return e.set(t),{read:r.length,written:t.length}});let u=0,o;function Q(r,e){return o=r.exports,F=null,B=null,o.__wbindgen_start(),o}function Z(r){if(o!==void 0)return o;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function D(){let r=0;const e=new Map;return{add(t){const n=r++;return e.set(n,t),n},get(t){const n=e.get(t);if(!n)throw new Error("Attempted to use an object that has been freed");return n},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function I(r,e){return{type:L,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function U(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===L)}function q(r="default"){return{createTx(e){const t=new Map,n=e??self;return n.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==r)return;const{id:i,result:s,error:a}=c,w=t.get(i);w&&(a?w.reject(a):w.resolve(s),t.delete(i))}),new Proxy({},{get(_,c){return(...i)=>{const s=ee(),a=[],w=[];return i.forEach(R=>{U(R)?(a.push(R.value),w.push(...R.transfer)):a.push(R)}),n.postMessage({method:c,args:a,id:s,channelName:r},{transfer:w}),new Promise((R,_e)=>{t.set(s,{resolve:R,reject:_e})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:i,args:s,id:a}=c;try{const w=await e[i](...s);U(w)?n.postMessage({result:w.value,id:a,channelName:r},{transfer:w.transfer}):n.postMessage({result:w,id:a,channelName:r})}catch(w){n.postMessage({error:w,id:a,channelName:r})}})}}}function ee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const{rx:te}=q(),{createTx:ne}=q("worker"),h=D(),l=D(),W=ne();te(re({async initWorker(r,e){Z({module:r}),e&&C(e)},async reader_fromBlob(r,e,t){const n=await v.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await v.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){return h.get(r).manifestStore()},reader_activeManifest(r){return h.get(r).activeManifest()},reader_json(r){return h.get(r).json()},reader_crJson(r){return h.get(r).crJson()},reader_resourceToBytes(r,e){const n=h.get(r).resourceToBytes(e);return I(n,n.buffer)},reader_free(r){h.get(r).free(),h.remove(r)},builder_new(r){const e=p.new(r);return l.add(e)},builder_fromJson(r,e){const t=p.fromJson(r,e);return l.add(t)},builder_fromArchive(r,e){const t=p.fromArchive(r,e);return l.add(t)},builder_setIntent(r,e){l.get(r).setIntent(e)},builder_addAction(r,e){l.get(r).addAction(e)},builder_addRedaction(r,e,t){l.get(r).addRedaction(e,t)},builder_setRemoteUrl(r,e){l.get(r).setRemoteUrl(e)},builder_setNoEmbed(r,e){l.get(r).setNoEmbed(e)},builder_setThumbnailFromBlob(r,e,t){l.get(r).setThumbnailFromBlob(e,t)},builder_addIngredient(r,e){l.get(r).addIngredient(e)},async builder_addIngredientFromBlob(r,e,t,n){await l.get(r).addIngredientFromBlob(e,t,n)},builder_addResourceFromBlob(r,e,t){l.get(r).addResourceFromBlob(e,t)},builder_getDefinition(r){return l.get(r).getDefinition()},builder_toArchive(r){const t=l.get(r).toArchive();return I(t,t.buffer)},async builder_sign(r,e,t,n,_){const i=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async s=>await W.sign(e,I(s,s.buffer),t.reserveSize)},n,_);return I(i,i.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:i,asset:s}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await W.sign(e,I(a,a.buffer),t.reserveSize)},n,_);return I({manifest:i,asset:s},[i.buffer,s.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function re(r){const e={};for(const[t,n]of Object.entries(r))e[t]=async(..._)=>{try{return await n(..._)}catch(c){throw typeof c=="string"?new Error(c):c}};return e}})();\n', m = typeof self < "u" && self.Blob && new Blob([T], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function L(e) {
|
|
5
|
+
let t;
|
|
6
|
+
try {
|
|
7
|
+
if (t = m && (self.URL || self.webkitURL).createObjectURL(m), !t) throw "";
|
|
8
|
+
const _ = new Worker(t, {
|
|
9
|
+
name: e == null ? void 0 : e.name
|
|
10
|
+
});
|
|
11
|
+
return _.addEventListener("error", () => {
|
|
12
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
13
|
+
}), _;
|
|
14
|
+
} catch {
|
|
15
|
+
return new Worker(
|
|
16
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(T),
|
|
17
|
+
{
|
|
18
|
+
name: e == null ? void 0 : e.name
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
} finally {
|
|
22
|
+
t && (self.URL || self.webkitURL).revokeObjectURL(t);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function k(e) {
|
|
26
|
+
const { wasm: t, settingsString: _ } = e;
|
|
27
|
+
let r = 0;
|
|
28
|
+
const n = new L(), o = N(n), i = /* @__PURE__ */ new Map();
|
|
29
|
+
U(
|
|
30
|
+
{
|
|
31
|
+
sign: async (c, s, j) => {
|
|
32
|
+
const l = i.get(c);
|
|
33
|
+
if (i.delete(c), !l)
|
|
34
|
+
throw new Error("No signer registered for request");
|
|
35
|
+
const w = await l(s, j);
|
|
36
|
+
return z(w, w.buffer);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
n
|
|
40
|
+
);
|
|
41
|
+
function a(c) {
|
|
42
|
+
const s = r++;
|
|
43
|
+
return i.set(s, c), s;
|
|
44
|
+
}
|
|
45
|
+
return await o.initWorker(t, _), {
|
|
46
|
+
tx: o,
|
|
47
|
+
registerSignReceiver: a,
|
|
48
|
+
terminate: () => n.terminate()
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
class y extends Error {
|
|
52
|
+
constructor(t) {
|
|
53
|
+
super(
|
|
54
|
+
`The provided asset was too large. Size: ${t} bytes. Maximum: ${g}.`
|
|
55
|
+
), this.name = "AssetTooLargeError";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class p extends Error {
|
|
59
|
+
constructor(t) {
|
|
60
|
+
super(`Unsupported format: ${t}.`), this.name = "UnsupportedFormatError";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const J = [
|
|
64
|
+
"jpg",
|
|
65
|
+
"video/mp4",
|
|
66
|
+
"image/heif",
|
|
67
|
+
"video/x-msvideo",
|
|
68
|
+
"pdf",
|
|
69
|
+
"image/png",
|
|
70
|
+
"application/c2pa",
|
|
71
|
+
"video/quicktime",
|
|
72
|
+
"video/avi",
|
|
73
|
+
"image/gif",
|
|
74
|
+
"application/xml",
|
|
75
|
+
"text/xml",
|
|
76
|
+
"application/xhtml+xml",
|
|
77
|
+
"tiff",
|
|
78
|
+
"audio/wave",
|
|
79
|
+
"mp4",
|
|
80
|
+
"image/avif",
|
|
81
|
+
"image/dng",
|
|
82
|
+
"png",
|
|
83
|
+
"dng",
|
|
84
|
+
"image/svg+xml",
|
|
85
|
+
"image/heic",
|
|
86
|
+
"application/mp4",
|
|
87
|
+
"image/x-nikon-nef",
|
|
88
|
+
"video/msvideo",
|
|
89
|
+
"tif",
|
|
90
|
+
"wav",
|
|
91
|
+
"xml",
|
|
92
|
+
"audio/vnd.wave",
|
|
93
|
+
"xhtml",
|
|
94
|
+
"gif",
|
|
95
|
+
"application/x-troff-msvideo",
|
|
96
|
+
"webp",
|
|
97
|
+
"heic",
|
|
98
|
+
"application/pdf",
|
|
99
|
+
"audio/mpeg",
|
|
100
|
+
"application/x-c2pa-manifest-store",
|
|
101
|
+
"jpeg",
|
|
102
|
+
"image/x-adobe-dng",
|
|
103
|
+
"audio/wav",
|
|
104
|
+
"mp3",
|
|
105
|
+
"mov",
|
|
106
|
+
"image/tiff",
|
|
107
|
+
"audio/mp4",
|
|
108
|
+
"application/svg+xml",
|
|
109
|
+
"arw",
|
|
110
|
+
"c2pa",
|
|
111
|
+
"svg",
|
|
112
|
+
"avi",
|
|
113
|
+
"audio/x-wav",
|
|
114
|
+
"m4a",
|
|
115
|
+
"image/x-sony-arw",
|
|
116
|
+
"image/jpeg",
|
|
117
|
+
"avif",
|
|
118
|
+
"image/webp",
|
|
119
|
+
"nef",
|
|
120
|
+
"heif"
|
|
121
|
+
];
|
|
122
|
+
function h(e) {
|
|
123
|
+
return J.includes(e);
|
|
124
|
+
}
|
|
125
|
+
const W = {
|
|
126
|
+
userAnchors: !0,
|
|
127
|
+
trustAnchors: !0,
|
|
128
|
+
trustConfig: !0,
|
|
129
|
+
allowedList: !0
|
|
130
|
+
}, C = Object.keys(W), P = {
|
|
131
|
+
builder: {
|
|
132
|
+
generateC2paArchive: !0
|
|
133
|
+
}
|
|
134
|
+
}, v = 1 * 1024 * 1024;
|
|
135
|
+
async function u(e) {
|
|
136
|
+
const t = O(P, e), _ = [];
|
|
137
|
+
return t.trust && _.push(R(t.trust)), t.cawgTrust && _.push(R(t.cawgTrust)), await Promise.all(_), JSON.stringify(M(t));
|
|
138
|
+
}
|
|
139
|
+
function M(e) {
|
|
140
|
+
return Object.entries(e).reduce(
|
|
141
|
+
(_, [r, n]) => (_[D(r)] = typeof n == "object" && n !== null ? M(n) : n, _),
|
|
142
|
+
{}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function D(e) {
|
|
146
|
+
return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
|
|
147
|
+
}
|
|
148
|
+
async function R(e) {
|
|
149
|
+
try {
|
|
150
|
+
const t = Object.entries(e).filter(([_]) => C.includes(_)).map(async ([_, r]) => {
|
|
151
|
+
if (r && typeof r == "object" && Array.isArray(r)) {
|
|
152
|
+
const n = r.map(async (a) => {
|
|
153
|
+
if (typeof a != "string")
|
|
154
|
+
throw new Error("Expected a string value for array item");
|
|
155
|
+
const c = await B(a);
|
|
156
|
+
if (A(_) && !S(c))
|
|
157
|
+
throw new Error(`Error parsing PEM file at: ${a}`);
|
|
158
|
+
return c;
|
|
159
|
+
}), i = (await Promise.all(n)).join("");
|
|
160
|
+
e[_] = i;
|
|
161
|
+
} else if (r && typeof r == "string" && q(r)) {
|
|
162
|
+
const n = await B(r);
|
|
163
|
+
if (A(_) && !S(n))
|
|
164
|
+
throw new Error(`Error parsing PEM file at: ${r}`);
|
|
165
|
+
e[_] = n;
|
|
166
|
+
} else
|
|
167
|
+
return r;
|
|
168
|
+
});
|
|
169
|
+
await Promise.all(t);
|
|
170
|
+
} catch (t) {
|
|
171
|
+
throw new Error("Failed to resolve trust settings.", { cause: t });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const A = (e) => ["userAnchors", "trustAnchors"].includes(e), S = (e) => e.includes("-----BEGIN CERTIFICATE-----"), q = (e) => e.startsWith("http");
|
|
175
|
+
async function B(e) {
|
|
176
|
+
const _ = await (await fetch(e)).text();
|
|
177
|
+
if (_.length > v)
|
|
178
|
+
throw new Error(`Response from ${e} is too large. Max size is ${v} bytes.`);
|
|
179
|
+
return _;
|
|
180
|
+
}
|
|
181
|
+
const g = 10 ** 9;
|
|
182
|
+
function $(e) {
|
|
183
|
+
const { tx: t } = e, _ = new FinalizationRegistry(async (r) => {
|
|
184
|
+
await t.reader_free(r);
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
async fromBlob(r, n, o) {
|
|
188
|
+
if (!h(r))
|
|
189
|
+
throw new p(r);
|
|
190
|
+
if (n.size > g)
|
|
191
|
+
throw new y(n.size);
|
|
192
|
+
try {
|
|
193
|
+
const i = o && await u(o), a = await t.reader_fromBlob(r, n, i), c = I(e, a, () => {
|
|
194
|
+
_.unregister(c);
|
|
195
|
+
});
|
|
196
|
+
return _.register(c, a, c), c;
|
|
197
|
+
} catch (i) {
|
|
198
|
+
return F(i);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
async fromBlobFragment(r, n, o, i) {
|
|
202
|
+
if (!h(r))
|
|
203
|
+
throw new p(r);
|
|
204
|
+
if (n.size > g)
|
|
205
|
+
throw new y(n.size);
|
|
206
|
+
try {
|
|
207
|
+
const a = i && await u(i), c = await t.reader_fromBlobFragment(
|
|
208
|
+
r,
|
|
209
|
+
n,
|
|
210
|
+
o,
|
|
211
|
+
a
|
|
212
|
+
), s = I(e, c, () => {
|
|
213
|
+
_.unregister(s);
|
|
214
|
+
});
|
|
215
|
+
return _.register(s, c, s), s;
|
|
216
|
+
} catch (a) {
|
|
217
|
+
return F(a);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function F(e) {
|
|
223
|
+
if (e instanceof Error && e.message === "C2pa(JumbfNotFound)")
|
|
224
|
+
return null;
|
|
225
|
+
throw e;
|
|
226
|
+
}
|
|
227
|
+
function I(e, t, _) {
|
|
228
|
+
const { tx: r } = e;
|
|
229
|
+
return {
|
|
230
|
+
async activeLabel() {
|
|
231
|
+
return await r.reader_activeLabel(t);
|
|
232
|
+
},
|
|
233
|
+
async manifestStore() {
|
|
234
|
+
return await r.reader_manifestStore(t);
|
|
235
|
+
},
|
|
236
|
+
async activeManifest() {
|
|
237
|
+
return await r.reader_activeManifest(t);
|
|
238
|
+
},
|
|
239
|
+
async json() {
|
|
240
|
+
const n = await r.reader_json(t);
|
|
241
|
+
return JSON.parse(n);
|
|
242
|
+
},
|
|
243
|
+
async crJson() {
|
|
244
|
+
const n = await r.reader_crJson(t);
|
|
245
|
+
return JSON.parse(n);
|
|
246
|
+
},
|
|
247
|
+
async resourceToBytes(n) {
|
|
248
|
+
return await r.reader_resourceToBytes(t, n);
|
|
249
|
+
},
|
|
250
|
+
async free() {
|
|
251
|
+
_(), await r.reader_free(t);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmbuilder_free(e, 1));
|
|
256
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmreader_free(e, 1));
|
|
257
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmsigner_free(e, 1));
|
|
258
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbindgen_destroy_closure(e.a, e.b));
|
|
259
|
+
let G = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
260
|
+
G.decode();
|
|
261
|
+
const b = new TextEncoder();
|
|
262
|
+
"encodeInto" in b || (b.encodeInto = function(e, t) {
|
|
263
|
+
const _ = b.encode(e);
|
|
264
|
+
return t.set(_), {
|
|
265
|
+
read: e.length,
|
|
266
|
+
written: _.length
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
let f;
|
|
270
|
+
const V = "sha512-85H5W9PEIFDMXW7vSiWM4cqQYBgtKPq8rpdLBgPVu2nvzjLBDqm4AmPFCUgzd9WCRRCzMidMsO5C0E4Uj11dug==";
|
|
271
|
+
async function x(e) {
|
|
272
|
+
const { alg: t } = e;
|
|
273
|
+
return {
|
|
274
|
+
reserveSize: await e.reserveSize(),
|
|
275
|
+
alg: t
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function K(e) {
|
|
279
|
+
const { tx: t } = e, _ = new FinalizationRegistry((r) => {
|
|
280
|
+
t.builder_free(r);
|
|
281
|
+
});
|
|
282
|
+
return {
|
|
283
|
+
async new(r) {
|
|
284
|
+
const n = r && await u(r), o = await t.builder_new(n), i = d(e, o, () => {
|
|
285
|
+
_.unregister(i);
|
|
286
|
+
});
|
|
287
|
+
return _.register(i, o, i), i;
|
|
288
|
+
},
|
|
289
|
+
async fromDefinition(r, n) {
|
|
290
|
+
const o = JSON.stringify(r), i = n && await u(n), a = await t.builder_fromJson(o, i), c = d(e, a, () => {
|
|
291
|
+
_.unregister(c);
|
|
292
|
+
});
|
|
293
|
+
return _.register(c, a, c), c;
|
|
294
|
+
},
|
|
295
|
+
async fromArchive(r, n) {
|
|
296
|
+
const o = n && await u(n), i = await t.builder_fromArchive(r, o), a = d(e, i, () => {
|
|
297
|
+
_.unregister(a);
|
|
298
|
+
});
|
|
299
|
+
return _.register(a, i, a), a;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function d(e, t, _) {
|
|
304
|
+
const { tx: r } = e;
|
|
305
|
+
return {
|
|
306
|
+
async setIntent(n) {
|
|
307
|
+
await r.builder_setIntent(t, n);
|
|
308
|
+
},
|
|
309
|
+
async addAction(n) {
|
|
310
|
+
await r.builder_addAction(t, n);
|
|
311
|
+
},
|
|
312
|
+
async addRedaction(n, o) {
|
|
313
|
+
await r.builder_addRedaction(t, n, o);
|
|
314
|
+
},
|
|
315
|
+
async setRemoteUrl(n) {
|
|
316
|
+
await r.builder_setRemoteUrl(t, n);
|
|
317
|
+
},
|
|
318
|
+
async setNoEmbed(n) {
|
|
319
|
+
await r.builder_setNoEmbed(t, n);
|
|
320
|
+
},
|
|
321
|
+
async setThumbnailFromBlob(n, o) {
|
|
322
|
+
await r.builder_setThumbnailFromBlob(t, n, o);
|
|
323
|
+
},
|
|
324
|
+
async addIngredient(n) {
|
|
325
|
+
const o = JSON.stringify(n);
|
|
326
|
+
await r.builder_addIngredient(t, o);
|
|
327
|
+
},
|
|
328
|
+
async addIngredientFromBlob(n, o, i) {
|
|
329
|
+
const a = JSON.stringify(n);
|
|
330
|
+
await r.builder_addIngredientFromBlob(t, a, o, i);
|
|
331
|
+
},
|
|
332
|
+
async addResourceFromBlob(n, o) {
|
|
333
|
+
await r.builder_addResourceFromBlob(t, n, o);
|
|
334
|
+
},
|
|
335
|
+
async getDefinition() {
|
|
336
|
+
return await r.builder_getDefinition(t);
|
|
337
|
+
},
|
|
338
|
+
async toArchive() {
|
|
339
|
+
return await r.builder_toArchive(t);
|
|
340
|
+
},
|
|
341
|
+
async sign(n, o, i) {
|
|
342
|
+
const a = await x(n), c = e.registerSignReceiver(n.sign);
|
|
343
|
+
return await r.builder_sign(
|
|
344
|
+
t,
|
|
345
|
+
c,
|
|
346
|
+
a,
|
|
347
|
+
o,
|
|
348
|
+
i
|
|
349
|
+
);
|
|
350
|
+
},
|
|
351
|
+
async signAndGetManifestBytes(n, o, i) {
|
|
352
|
+
const a = await x(n), c = e.registerSignReceiver(n.sign);
|
|
353
|
+
return await r.builder_signAndGetManifestBytes(
|
|
354
|
+
t,
|
|
355
|
+
c,
|
|
356
|
+
a,
|
|
357
|
+
o,
|
|
358
|
+
i
|
|
359
|
+
);
|
|
360
|
+
},
|
|
361
|
+
async free() {
|
|
362
|
+
_(), await r.builder_free(t);
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
async function ee(e) {
|
|
367
|
+
const { wasmSrc: t, settings: _ } = e, r = typeof t == "string" ? await X(t) : t, n = _ ? await u(_) : void 0, o = await k({ wasm: r, settingsString: n });
|
|
368
|
+
return {
|
|
369
|
+
reader: $(o),
|
|
370
|
+
builder: K(o),
|
|
371
|
+
dispose: o.terminate
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
async function X(e) {
|
|
375
|
+
const t = await fetch(e, { integrity: V });
|
|
376
|
+
return await WebAssembly.compileStreaming(t);
|
|
377
|
+
}
|
|
378
|
+
export {
|
|
379
|
+
J as R,
|
|
380
|
+
ee as c,
|
|
381
|
+
h as i
|
|
382
|
+
};
|
package/dist/index.js
CHANGED