@contentauth/c2pa-web 0.12.2 → 0.12.4
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,10 +1,10 @@
|
|
|
1
|
-
import { channel as
|
|
1
|
+
import { channel as z, transfer as J } from "highgain";
|
|
2
2
|
import { merge as p } from "ts-deepmerge";
|
|
3
|
-
const { createTx: z, rx: ee } = M(), { createTx: te, rx: L } = M("worker"), O = '(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 d(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 d(_[0])}addIngredientFromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,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 d(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 d(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 d(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),s=u;const i=o.wasmbuilder_fromJson(n,_,c,s);if(i[2])throw d(i[1]);return p.__wrap(i[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(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 d(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw d(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 d(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 d(e[1]);return d(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class A{static __wrap(e){const t=Object.create(A.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 d(e[1]);return d(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 s=g(n)?0:f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;return o.wasmreader_fromBlob(_,c,t,s,i)}static fromBlobFragment(e,t,n,_){const c=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;var i=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,s,t,n,i,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 d(e[1]);return d(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 d(_[1]);return d(_[0])}}Symbol.dispose&&(A.prototype[Symbol.dispose]=A.prototype.free);function q(r){const e=f(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw d(n[0])}function W(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_ef53bc310eb298a0:function(e,t){return Error(y(e,t))},__wbg_Number_6b506e6536831eaa:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: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_1a45e2c38d4d41b9:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0accd80f45e5faa2:function(e,t){const n=E(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_70a403a56e771704:function(e,t){return e in t},__wbg___wbindgen_is_bigint_6ffd6468a9bc44b9:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_754e9f305ff6029e:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_56732c2bc353f41d:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_c236cabd84a4d769:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_67b456be8673d3d7:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_1068e624fa87f6ab:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_2c56564c75129511:function(e,t){return e==t},__wbg___wbindgen_number_get_9bb1761122181af2: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_72bdf95d3ae505b1:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_1506f2235d1bdba0:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_61db23ac97f16c31:function(e){e._wbg_cb_unref()},__wbg_abort_2ec46222bf378517:function(e){e.abort()},__wbg_abort_b29d719932441c95:function(e,t){e.abort(t)},__wbg_append_e1746995edcb0170:function(){return b(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_05927079aabe6d46:function(){return b(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_2c6dc3b4b85d3547:function(e){return e.byteLength},__wbg_call_8a89609d89f6608a:function(){return b(function(e,t){return e.call(t)},arguments)},__wbg_call_9c758de292015997:function(){return b(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_60cf307fcc680536:function(e){return e.done},__wbg_entries_04b37a02507f1713: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_344c8d3849002659:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_d300fe49deab18f5:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_76dfc69825c9c552:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_8aa3112c6615eef6:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return b(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getTime_00b3f7db575e4ef5:function(e){return e.getTime()},__wbg_get_1f8f054ddbaa7db2:function(){return b(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_2b48c7d0d006a781:function(e,t){return e[t>>>0]},__wbg_get_de6a0f7d4d18a304:function(){return b(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_33f6e5c9e2f2d6b2:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_73740b27f436fed3:function(){return b(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_0feb63d2d374b44a:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_8f49811467741499:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_9fc06d9a951bcee6:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_d0db99486956c8e8:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_cb984bd66d7bd408:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_86f30649f63ef9c2:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_67c2c9c4313f4448:function(e){return Array.isArray(e)},__wbg_isSafeInteger_66acec27e09e99a7:function(e){return Number.isSafeInteger(e)},__wbg_iterator_8732428d309e270e:function(){return Symbol.iterator},__wbg_length_4a591ecaa01354d9:function(e){return e.length},__wbg_length_66f1a4b2e9026940:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_445c13a750296eb6:function(){return new Date},__wbg_new_0d09705104e164af:function(){return b(function(){return new AbortController},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_578aeef4b6b94378:function(e){return new Uint8Array(e)},__wbg_new_622fc80556be2e26:function(){return new Map},__wbg_new_a1b9f645bba64f0f:function(){return b(function(){return new FileReaderSync},arguments)},__wbg_new_ce1ab61c1c2b300d:function(){return new Object},__wbg_new_d90091b82fdf5b91:function(){return new Array},__wbg_new_e436d06bc8e77460:function(){return b(function(){return new Headers},arguments)},__wbg_new_from_slice_18fa1f71286d66b8:function(e,t){return new Uint8Array(v(e,t))},__wbg_new_typed_bf31d18f92484486:function(e,t){try{var n={a:e,b:t},_=(s,i)=>{const a=n.a;n.a=0;try{return G(a,n.b,s,i)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_36a4998e27b014c5:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_bcd02b79a793d27f:function(){return b(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_9e03acdf51c4960d:function(e){return e.next},__wbg_next_eb8ca7351fa27906:function(){return b(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_190933fa139cc119:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_3249fc62a0fafa30:function(e,t,n){Uint8Array.prototype.set.call(v(e,t),n)},__wbg_queueMicrotask_35c611f4a14830b2:function(e){queueMicrotask(e)},__wbg_queueMicrotask_404ed0a58e0b63cc:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return b(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_f1b8da05559618d9:function(){return b(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return b(function(){return module.require},arguments)},__wbg_resolve_25a7e548d5881dca:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_29c99a8aac1c01e5:function(e,t,n){e.set(v(t,n))},__wbg_set_52b1e1eb5bed906a:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_body_36614c7e61546809:function(e,t){e.body=t},__wbg_set_cache_488ea16c11cbf20d:function(e,t){e.cache=$[t]},__wbg_set_credentials_fa9c491a27c4bdf0:function(e,t){e.credentials=H[t]},__wbg_set_dca99999bba88a9a:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_7c1e39ece7826bec:function(e,t){e.headers=t},__wbg_set_method_7a6811dec7a4feff:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_c90e3667002857d4:function(e,t){e.mode=X[t]},__wbg_set_signal_d9da62b3f215c821:function(e,t){e.signal=t},__wbg_signal_e03304a84df9ed09:function(e){return e.signal},__wbg_size_9970092b88b1094c:function(e){return e.size},__wbg_slice_02bb778501725738:function(){return b(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_9d53f2689e622ca1:function(){const e=typeof global>"u"?null:global;return g(e)?0:M(e)},__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:M(e)},__wbg_static_accessor_SELF_4c59f6c7ea29a144:function(){const e=typeof self>"u"?null:self;return g(e)?0:M(e)},__wbg_static_accessor_WINDOW_e70ae9f2eb052253:function(){const e=typeof window>"u"?null:window;return g(e)?0:M(e)},__wbg_status_00549d55b78d949e:function(e){return e.status},__wbg_stringify_8286df6dcc591521:function(){return b(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_4aa221f6a4f5ab22:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_18f476d590e58992:function(e,t,n){return e.then(t,n)},__wbg_then_ac7b025999b52837:function(e,t){return e.then(t)},__wbg_url_6808f1c468f2d0cd: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_41ae57308c1f031c:function(e){return e.valueOf()},__wbg_value_f3625092ee4b37f4:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return A.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,P)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,C)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return v(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=v(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 C(r,e){o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke_______true_(r,e)}function P(r,e,t){const n=o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___wasm_bindgen_304c265eb9e6f0af___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_304c265eb9e6f0af___JsError___true_(r,e,t);if(n[1])throw d(n[0])}function G(r,e,t,n){o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined_______true_(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 M(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 E(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+=E(r[0]));for(let s=1;s<_;s++)c+=", "+E(r[s]);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 v(r,e){return r=r>>>0,B().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 S=null;function B(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}function b(r,e){try{return r.apply(this,e)}catch(t){const n=M(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 s=n.a;n.a=0;try{return t(s,n.b,...c)}finally{n.a=s,_._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 i=j.encode(r),a=e(i.length,1)>>>0;return B().subarray(a,a+i.length).set(i),u=i.length,a}let n=r.length,_=e(n,1)>>>0;const c=B();let s=0;for(;s<n;s++){const i=r.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==n){s!==0&&(r=r.slice(s)),_=t(_,n,n=s+r.length*3,1)>>>0;const i=B().subarray(_+s,_+n),a=j.encodeInto(r,i);s+=a.written,_=t(_,n,s,1)>>>0}return u=s,_}function d(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});T.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),T.decode(),O=e),T.decode(B().subarray(r,r+e))}const j=new TextEncoder;"encodeInto"in j||(j.encodeInto=function(r,e){const t=j.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,S=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=W();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function U(){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 J=Symbol("transfer");function R(r,e){return{type:J,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function V(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===J)}function D(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:s,result:i,error:a}=c,w=t.get(s);w&&(a?w.reject(a):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),a=[],w=[];return s.forEach(I=>{V(I)?(a.push(I.value),w.push(...I.transfer)):a.push(I)}),n.postMessage({method:c,args:a,id:i,channelName:r},{transfer:w}),new Promise((I,oe)=>{t.set(i,{resolve:I,reject:oe})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:s,args:i,id:a}=c;try{const w=await e[s](...i);V(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}=D(),{createTx:ne}=D("worker");function re(r){if(!(r!=null&&r.manifests))return r;const e=r.manifests,t=Object.assign(Object.create(null),e),n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&r.active_manifest&&(t[r.active_manifest]=n),r.manifests=t,r}const h=U(),l=U(),L=ne();te(_e({async initWorker(r,e){Z({module:r}),e&&q(e)},async reader_fromBlob(r,e,t){const n=await A.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await A.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){const e=h.get(r);return re(e.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 R(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 R(t,t.buffer)},async builder_sign(r,e,t,n,_){const s=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await L.sign(e,R(i,i.buffer),t.reserveSize)},n,_);return R(s,s.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await L.sign(e,R(a,a.buffer),t.reserveSize)},n,_);return R({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function _e(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', h = typeof self < "u" && self.Blob && new Blob([O], { type: "text/javascript;charset=utf-8" });
|
|
4
|
-
function
|
|
3
|
+
const { createTx: $, rx: ie } = z(), { createTx: ae, rx: P } = z("worker"), L = '(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 d(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 d(_[0])}addIngredientFromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,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 d(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 d(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 d(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),s=u;const i=o.wasmbuilder_fromJson(n,_,c,s);if(i[2])throw d(i[1]);return p.__wrap(i[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(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 d(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw d(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 d(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 d(e[1]);return d(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class A{static __wrap(e){const t=Object.create(A.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 d(e[1]);return d(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 s=g(n)?0:f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;return o.wasmreader_fromBlob(_,c,t,s,i)}static fromBlobFragment(e,t,n,_){const c=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;var i=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,s,t,n,i,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 d(e[1]);return d(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 d(_[1]);return d(_[0])}}Symbol.dispose&&(A.prototype[Symbol.dispose]=A.prototype.free);function q(r){const e=f(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw d(n[0])}function W(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_ef53bc310eb298a0:function(e,t){return Error(y(e,t))},__wbg_Number_6b506e6536831eaa:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: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_1a45e2c38d4d41b9:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0accd80f45e5faa2:function(e,t){const n=E(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_70a403a56e771704:function(e,t){return e in t},__wbg___wbindgen_is_bigint_6ffd6468a9bc44b9:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_754e9f305ff6029e:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_56732c2bc353f41d:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_c236cabd84a4d769:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_67b456be8673d3d7:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_1068e624fa87f6ab:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_2c56564c75129511:function(e,t){return e==t},__wbg___wbindgen_number_get_9bb1761122181af2: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_72bdf95d3ae505b1:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_1506f2235d1bdba0:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_61db23ac97f16c31:function(e){e._wbg_cb_unref()},__wbg_abort_2ec46222bf378517:function(e){e.abort()},__wbg_abort_b29d719932441c95:function(e,t){e.abort(t)},__wbg_append_e1746995edcb0170:function(){return b(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_05927079aabe6d46:function(){return b(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_2c6dc3b4b85d3547:function(e){return e.byteLength},__wbg_call_8a89609d89f6608a:function(){return b(function(e,t){return e.call(t)},arguments)},__wbg_call_9c758de292015997:function(){return b(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_60cf307fcc680536:function(e){return e.done},__wbg_entries_04b37a02507f1713: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_344c8d3849002659:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_d300fe49deab18f5:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_76dfc69825c9c552:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_8aa3112c6615eef6:function(){return b(function(e,t){globalThis.crypto.getRandomValues(v(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return b(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getTime_00b3f7db575e4ef5:function(e){return e.getTime()},__wbg_get_1f8f054ddbaa7db2:function(){return b(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_2b48c7d0d006a781:function(e,t){return e[t>>>0]},__wbg_get_de6a0f7d4d18a304:function(){return b(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_33f6e5c9e2f2d6b2:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_73740b27f436fed3:function(){return b(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_0feb63d2d374b44a:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_8f49811467741499:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_9fc06d9a951bcee6:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_d0db99486956c8e8:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_cb984bd66d7bd408:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_86f30649f63ef9c2:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_67c2c9c4313f4448:function(e){return Array.isArray(e)},__wbg_isSafeInteger_66acec27e09e99a7:function(e){return Number.isSafeInteger(e)},__wbg_iterator_8732428d309e270e:function(){return Symbol.iterator},__wbg_length_4a591ecaa01354d9:function(e){return e.length},__wbg_length_66f1a4b2e9026940:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_445c13a750296eb6:function(){return new Date},__wbg_new_0d09705104e164af:function(){return b(function(){return new AbortController},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_578aeef4b6b94378:function(e){return new Uint8Array(e)},__wbg_new_622fc80556be2e26:function(){return new Map},__wbg_new_a1b9f645bba64f0f:function(){return b(function(){return new FileReaderSync},arguments)},__wbg_new_ce1ab61c1c2b300d:function(){return new Object},__wbg_new_d90091b82fdf5b91:function(){return new Array},__wbg_new_e436d06bc8e77460:function(){return b(function(){return new Headers},arguments)},__wbg_new_from_slice_18fa1f71286d66b8:function(e,t){return new Uint8Array(v(e,t))},__wbg_new_typed_bf31d18f92484486:function(e,t){try{var n={a:e,b:t},_=(s,i)=>{const a=n.a;n.a=0;try{return G(a,n.b,s,i)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_36a4998e27b014c5:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_bcd02b79a793d27f:function(){return b(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_9e03acdf51c4960d:function(e){return e.next},__wbg_next_eb8ca7351fa27906:function(){return b(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_190933fa139cc119:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_3249fc62a0fafa30:function(e,t,n){Uint8Array.prototype.set.call(v(e,t),n)},__wbg_queueMicrotask_35c611f4a14830b2:function(e){queueMicrotask(e)},__wbg_queueMicrotask_404ed0a58e0b63cc:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return b(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_f1b8da05559618d9:function(){return b(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return b(function(){return module.require},arguments)},__wbg_resolve_25a7e548d5881dca:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_29c99a8aac1c01e5:function(e,t,n){e.set(v(t,n))},__wbg_set_52b1e1eb5bed906a:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_body_36614c7e61546809:function(e,t){e.body=t},__wbg_set_cache_488ea16c11cbf20d:function(e,t){e.cache=$[t]},__wbg_set_credentials_fa9c491a27c4bdf0:function(e,t){e.credentials=H[t]},__wbg_set_dca99999bba88a9a:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_7c1e39ece7826bec:function(e,t){e.headers=t},__wbg_set_method_7a6811dec7a4feff:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_c90e3667002857d4:function(e,t){e.mode=X[t]},__wbg_set_signal_d9da62b3f215c821:function(e,t){e.signal=t},__wbg_signal_e03304a84df9ed09:function(e){return e.signal},__wbg_size_9970092b88b1094c:function(e){return e.size},__wbg_slice_02bb778501725738:function(){return b(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_9d53f2689e622ca1:function(){const e=typeof global>"u"?null:global;return g(e)?0:M(e)},__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:M(e)},__wbg_static_accessor_SELF_4c59f6c7ea29a144:function(){const e=typeof self>"u"?null:self;return g(e)?0:M(e)},__wbg_static_accessor_WINDOW_e70ae9f2eb052253:function(){const e=typeof window>"u"?null:window;return g(e)?0:M(e)},__wbg_status_00549d55b78d949e:function(e){return e.status},__wbg_stringify_8286df6dcc591521:function(){return b(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_4aa221f6a4f5ab22:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_18f476d590e58992:function(e,t,n){return e.then(t,n)},__wbg_then_ac7b025999b52837:function(e,t){return e.then(t)},__wbg_url_6808f1c468f2d0cd: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_41ae57308c1f031c:function(e){return e.valueOf()},__wbg_value_f3625092ee4b37f4:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return A.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,P)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,C)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return v(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=v(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 C(r,e){o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke_______true_(r,e)}function P(r,e,t){const n=o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___wasm_bindgen_304c265eb9e6f0af___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_304c265eb9e6f0af___JsError___true_(r,e,t);if(n[1])throw d(n[0])}function G(r,e,t,n){o.wasm_bindgen_304c265eb9e6f0af___convert__closures_____invoke___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined___js_sys_74e7014fb12660c3___Function_fn_wasm_bindgen_304c265eb9e6f0af___JsValue_____wasm_bindgen_304c265eb9e6f0af___sys__Undefined_______true_(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 M(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 E(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+=E(r[0]));for(let s=1;s<_;s++)c+=", "+E(r[s]);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 v(r,e){return r=r>>>0,B().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 S=null;function B(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}function b(r,e){try{return r.apply(this,e)}catch(t){const n=M(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 s=n.a;n.a=0;try{return t(s,n.b,...c)}finally{n.a=s,_._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 i=j.encode(r),a=e(i.length,1)>>>0;return B().subarray(a,a+i.length).set(i),u=i.length,a}let n=r.length,_=e(n,1)>>>0;const c=B();let s=0;for(;s<n;s++){const i=r.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==n){s!==0&&(r=r.slice(s)),_=t(_,n,n=s+r.length*3,1)>>>0;const i=B().subarray(_+s,_+n),a=j.encodeInto(r,i);s+=a.written,_=t(_,n,s,1)>>>0}return u=s,_}function d(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});T.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),T.decode(),O=e),T.decode(B().subarray(r,r+e))}const j=new TextEncoder;"encodeInto"in j||(j.encodeInto=function(r,e){const t=j.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,S=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=W();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function U(){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 J=Symbol("transfer");function R(r,e){return{type:J,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function V(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===J)}function D(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:s,result:i,error:a}=c,w=t.get(s);w&&(a?w.reject(a):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),a=[],w=[];return s.forEach(I=>{V(I)?(a.push(I.value),w.push(...I.transfer)):a.push(I)}),n.postMessage({method:c,args:a,id:i,channelName:r},{transfer:w}),new Promise((I,oe)=>{t.set(i,{resolve:I,reject:oe})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:s,args:i,id:a}=c;try{const w=await e[s](...i);V(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}=D(),{createTx:ne}=D("worker");function re(r){if(!(r!=null&&r.manifests))return r;const e=r.manifests,t=Object.assign(Object.create(null),e),n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&r.active_manifest&&(t[r.active_manifest]=n),r.manifests=t,r}const h=U(),l=U(),L=ne();te(_e({async initWorker(r,e){Z({module:r}),e&&q(e)},async reader_fromBlob(r,e,t){const n=await A.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await A.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){const e=h.get(r);return re(e.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 R(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 R(t,t.buffer)},async builder_sign(r,e,t,n,_){const s=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await L.sign(e,R(i,i.buffer),t.reserveSize)},n,_);return R(s,s.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await L.sign(e,R(a,a.buffer),t.reserveSize)},n,_);return R({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function _e(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', v = typeof self < "u" && self.Blob && new Blob([L], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function D(e) {
|
|
5
5
|
let t;
|
|
6
6
|
try {
|
|
7
|
-
if (t =
|
|
7
|
+
if (t = v && (self.URL || self.webkitURL).createObjectURL(v), !t) throw "";
|
|
8
8
|
const _ = new Worker(t, {
|
|
9
9
|
name: e == null ? void 0 : e.name
|
|
10
10
|
});
|
|
@@ -13,7 +13,7 @@ function J(e) {
|
|
|
13
13
|
}), _;
|
|
14
14
|
} catch {
|
|
15
15
|
return new Worker(
|
|
16
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
16
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(L),
|
|
17
17
|
{
|
|
18
18
|
name: e == null ? void 0 : e.name
|
|
19
19
|
}
|
|
@@ -22,25 +22,25 @@ function J(e) {
|
|
|
22
22
|
t && (self.URL || self.webkitURL).revokeObjectURL(t);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function W(e) {
|
|
26
26
|
if (e.protocol !== "https:")
|
|
27
27
|
throw new Error(
|
|
28
28
|
`Worker source URL must use https, but got ${e.protocol}`
|
|
29
29
|
);
|
|
30
30
|
return e.toString();
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function C(e) {
|
|
33
33
|
const { wasm: t, settingsString: _, workerSrc: r } = e;
|
|
34
34
|
let n = 0;
|
|
35
|
-
const o = r ? new Worker(
|
|
36
|
-
|
|
35
|
+
const o = r ? new Worker(W(r), { type: "module" }) : new D(), i = $(o), a = /* @__PURE__ */ new Map();
|
|
36
|
+
P(
|
|
37
37
|
{
|
|
38
38
|
sign: async (c, u, f) => {
|
|
39
|
-
const
|
|
40
|
-
if (a.delete(c), !
|
|
39
|
+
const y = a.get(c);
|
|
40
|
+
if (a.delete(c), !y)
|
|
41
41
|
throw new Error("No signer registered for request");
|
|
42
|
-
const
|
|
43
|
-
return
|
|
42
|
+
const h = await y(u, f);
|
|
43
|
+
return J(h, h.buffer);
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
o
|
|
@@ -55,19 +55,19 @@ async function D(e) {
|
|
|
55
55
|
terminate: () => o.terminate()
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
class
|
|
58
|
+
class R extends Error {
|
|
59
59
|
constructor(t) {
|
|
60
60
|
super(
|
|
61
|
-
`The provided asset was too large. Size: ${t} bytes. Maximum: ${
|
|
61
|
+
`The provided asset was too large. Size: ${t} bytes. Maximum: ${m}.`
|
|
62
62
|
), this.name = "AssetTooLargeError";
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
class
|
|
65
|
+
class S extends Error {
|
|
66
66
|
constructor(t) {
|
|
67
67
|
super(`Unsupported format: ${t}.`), this.name = "UnsupportedFormatError";
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const q = [
|
|
71
71
|
"jpg",
|
|
72
72
|
"video/mp4",
|
|
73
73
|
"image/heif",
|
|
@@ -128,51 +128,51 @@ const $ = [
|
|
|
128
128
|
"jxl",
|
|
129
129
|
"image/jxl"
|
|
130
130
|
];
|
|
131
|
-
function
|
|
132
|
-
return
|
|
131
|
+
function A(e) {
|
|
132
|
+
return q.includes(e);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const V = {
|
|
135
135
|
userAnchors: !0,
|
|
136
136
|
trustAnchors: !0,
|
|
137
137
|
trustConfig: !0,
|
|
138
138
|
allowedList: !0
|
|
139
|
-
},
|
|
139
|
+
}, G = Object.keys(V), Y = {
|
|
140
140
|
builder: {
|
|
141
141
|
generateC2paArchive: !0
|
|
142
142
|
}
|
|
143
|
-
},
|
|
143
|
+
}, T = 1 * 1024 * 1024;
|
|
144
144
|
async function b(e, t) {
|
|
145
145
|
const _ = t ? p(e ?? {}, t) : e;
|
|
146
146
|
if (!_)
|
|
147
147
|
return;
|
|
148
|
-
const r = p(
|
|
149
|
-
return r.trust && n.push(
|
|
148
|
+
const r = p(Y, _), n = [];
|
|
149
|
+
return r.trust && n.push(E(r.trust)), r.cawgTrust && n.push(E(r.cawgTrust)), await Promise.all(n), JSON.stringify(k(r));
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function k(e) {
|
|
152
152
|
return Object.entries(e).reduce(
|
|
153
|
-
(_, [r, n]) => (_[
|
|
153
|
+
(_, [r, n]) => (_[X(r)] = typeof n == "object" && n !== null ? k(n) : n, _),
|
|
154
154
|
{}
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function X(e) {
|
|
158
158
|
return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
|
|
159
159
|
}
|
|
160
|
-
async function
|
|
160
|
+
async function E(e) {
|
|
161
161
|
try {
|
|
162
|
-
const t = Object.entries(e).filter(([_]) =>
|
|
162
|
+
const t = Object.entries(e).filter(([_]) => G.includes(_)).map(async ([_, r]) => {
|
|
163
163
|
if (r && typeof r == "object" && Array.isArray(r)) {
|
|
164
164
|
const n = r.map(async (a) => {
|
|
165
165
|
if (typeof a != "string")
|
|
166
166
|
throw new Error("Expected a string value for array item");
|
|
167
|
-
const s = await
|
|
168
|
-
if (
|
|
167
|
+
const s = await j(a);
|
|
168
|
+
if (F(_) && !x(s))
|
|
169
169
|
throw new Error(`Error parsing PEM file at: ${a}`);
|
|
170
170
|
return s;
|
|
171
171
|
}), i = (await Promise.all(n)).join("");
|
|
172
172
|
e[_] = i;
|
|
173
|
-
} else if (r && typeof r == "string" &&
|
|
174
|
-
const n = await
|
|
175
|
-
if (
|
|
173
|
+
} else if (r && typeof r == "string" && H(r)) {
|
|
174
|
+
const n = await j(r);
|
|
175
|
+
if (F(_) && !x(n))
|
|
176
176
|
throw new Error(`Error parsing PEM file at: ${r}`);
|
|
177
177
|
e[_] = n;
|
|
178
178
|
} else
|
|
@@ -184,69 +184,112 @@ async function F(e) {
|
|
|
184
184
|
throw new Error(`Failed to resolve trust settings. ${_}`, { cause: t });
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
187
|
+
const F = (e) => ["userAnchors", "trustAnchors"].includes(e), x = (e) => e.includes("-----BEGIN CERTIFICATE-----"), H = (e) => e.startsWith("http"), l = 2, K = 200, I = 2e3, B = 3e4;
|
|
188
|
+
function M(e) {
|
|
189
|
+
const t = Math.min(
|
|
190
|
+
K * 2 ** e,
|
|
191
|
+
I
|
|
192
|
+
), _ = Math.floor(Math.random() * 200);
|
|
193
|
+
return Math.min(t + _, I);
|
|
194
|
+
}
|
|
195
|
+
function Z(e) {
|
|
196
|
+
if (!e)
|
|
197
|
+
return null;
|
|
198
|
+
const t = Number(e);
|
|
199
|
+
if (!Number.isNaN(t))
|
|
200
|
+
return t * 1e3;
|
|
201
|
+
const _ = Date.parse(e);
|
|
202
|
+
return Number.isNaN(_) ? null : _ - Date.now();
|
|
203
|
+
}
|
|
204
|
+
async function j(e) {
|
|
205
|
+
for (let t = 0; ; t++) {
|
|
206
|
+
let _;
|
|
207
|
+
try {
|
|
208
|
+
_ = await fetch(e);
|
|
209
|
+
} catch (n) {
|
|
210
|
+
if (t < l) {
|
|
211
|
+
await new Promise((i) => setTimeout(i, M(t)));
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const o = n instanceof Error ? n.message : String(n);
|
|
215
|
+
throw new Error(`Network error fetching ${e}: ${o}`, { cause: n });
|
|
216
|
+
}
|
|
217
|
+
if (!_.ok) {
|
|
218
|
+
if (_.status === 429 || _.status >= 500) {
|
|
219
|
+
if (_.status === 429) {
|
|
220
|
+
const o = Z(_.headers.get("retry-after"));
|
|
221
|
+
if (o !== null) {
|
|
222
|
+
if (o > B)
|
|
223
|
+
throw new Error(
|
|
224
|
+
`Failed to fetch ${e}: server requested a Retry-After delay of ${Math.ceil(o / 1e3)}s, which exceeds the maximum allowed delay of ${B / 1e3}s`
|
|
225
|
+
);
|
|
226
|
+
if (t < l) {
|
|
227
|
+
await new Promise((i) => setTimeout(i, Math.max(o, 0)));
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
throw new Error(`Failed to fetch ${e}: ${_.status} ${_.statusText}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (t < l) {
|
|
234
|
+
await new Promise((o) => setTimeout(o, M(t)));
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
throw new Error(`Failed to fetch ${e}: ${_.status} ${_.statusText}`);
|
|
239
|
+
}
|
|
240
|
+
const r = await _.text();
|
|
241
|
+
if (r.length > T)
|
|
242
|
+
throw new Error(`Response from ${e} is too large. Max size is ${T} bytes.`);
|
|
243
|
+
return r;
|
|
195
244
|
}
|
|
196
|
-
if (!t.ok)
|
|
197
|
-
throw new Error(`Failed to fetch ${e}: ${t.status} ${t.statusText}`);
|
|
198
|
-
const _ = await t.text();
|
|
199
|
-
if (_.length > A)
|
|
200
|
-
throw new Error(`Response from ${e} is too large. Max size is ${A} bytes.`);
|
|
201
|
-
return _;
|
|
202
245
|
}
|
|
203
|
-
const
|
|
204
|
-
function
|
|
246
|
+
const m = 10 ** 9;
|
|
247
|
+
function Q(e, t) {
|
|
205
248
|
const { tx: _ } = e, r = t, n = new FinalizationRegistry(async (o) => {
|
|
206
249
|
await _.reader_free(o);
|
|
207
250
|
});
|
|
208
251
|
return {
|
|
209
252
|
async fromBlob(o, i, a) {
|
|
210
|
-
if (!
|
|
211
|
-
throw new
|
|
212
|
-
if (i.size >
|
|
213
|
-
throw new
|
|
253
|
+
if (!A(o))
|
|
254
|
+
throw new S(o);
|
|
255
|
+
if (i.size > m)
|
|
256
|
+
throw new R(i.size);
|
|
214
257
|
try {
|
|
215
|
-
const s = await b(r, a), c = await _.reader_fromBlob(o, i, s), u =
|
|
258
|
+
const s = await b(r, a), c = await _.reader_fromBlob(o, i, s), u = O(e, c, () => {
|
|
216
259
|
n.unregister(u);
|
|
217
260
|
});
|
|
218
261
|
return n.register(u, c, u), u;
|
|
219
262
|
} catch (s) {
|
|
220
|
-
return
|
|
263
|
+
return N(s);
|
|
221
264
|
}
|
|
222
265
|
},
|
|
223
266
|
async fromBlobFragment(o, i, a, s) {
|
|
224
|
-
if (!
|
|
225
|
-
throw new
|
|
226
|
-
if (i.size >
|
|
227
|
-
throw new
|
|
267
|
+
if (!A(o))
|
|
268
|
+
throw new S(o);
|
|
269
|
+
if (i.size > m)
|
|
270
|
+
throw new R(i.size);
|
|
228
271
|
try {
|
|
229
272
|
const c = await b(r, s), u = await _.reader_fromBlobFragment(
|
|
230
273
|
o,
|
|
231
274
|
i,
|
|
232
275
|
a,
|
|
233
276
|
c
|
|
234
|
-
), f =
|
|
277
|
+
), f = O(e, u, () => {
|
|
235
278
|
n.unregister(f);
|
|
236
279
|
});
|
|
237
280
|
return n.register(f, u, f), f;
|
|
238
281
|
} catch (c) {
|
|
239
|
-
return
|
|
282
|
+
return N(c);
|
|
240
283
|
}
|
|
241
284
|
}
|
|
242
285
|
};
|
|
243
286
|
}
|
|
244
|
-
function
|
|
287
|
+
function N(e) {
|
|
245
288
|
if (e instanceof Error && e.message === "C2pa(JumbfNotFound)")
|
|
246
289
|
return null;
|
|
247
290
|
throw e;
|
|
248
291
|
}
|
|
249
|
-
function
|
|
292
|
+
function O(e, t, _) {
|
|
250
293
|
const { tx: r } = e;
|
|
251
294
|
return {
|
|
252
295
|
async activeLabel() {
|
|
@@ -278,8 +321,8 @@ typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_was
|
|
|
278
321
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_wasmreader_free(e, 1));
|
|
279
322
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_wasmsigner_free(e, 1));
|
|
280
323
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbindgen_destroy_closure(e.a, e.b));
|
|
281
|
-
let
|
|
282
|
-
|
|
324
|
+
let ee = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
325
|
+
ee.decode();
|
|
283
326
|
const g = new TextEncoder();
|
|
284
327
|
"encodeInto" in g || (g.encodeInto = function(e, t) {
|
|
285
328
|
const _ = g.encode(e);
|
|
@@ -289,40 +332,40 @@ const g = new TextEncoder();
|
|
|
289
332
|
};
|
|
290
333
|
});
|
|
291
334
|
let d;
|
|
292
|
-
const
|
|
293
|
-
async function
|
|
335
|
+
const te = "sha512-ErrUz6A2ldqIdi5Avc5WdNkzIJvWFlfoA8tGPw6ctn1X1MNBhLi7wtloVeQzBB1ozTPV92M9lio2Y0uA4wq5UQ==";
|
|
336
|
+
async function U(e) {
|
|
294
337
|
const { alg: t } = e;
|
|
295
338
|
return {
|
|
296
339
|
reserveSize: await e.reserveSize(),
|
|
297
340
|
alg: t
|
|
298
341
|
};
|
|
299
342
|
}
|
|
300
|
-
function
|
|
343
|
+
function ne(e, t) {
|
|
301
344
|
const _ = t, { tx: r } = e, n = new FinalizationRegistry((o) => {
|
|
302
345
|
r.builder_free(o);
|
|
303
346
|
});
|
|
304
347
|
return {
|
|
305
348
|
async new(o) {
|
|
306
|
-
const i = await b(_, o), a = await r.builder_new(i), s =
|
|
349
|
+
const i = await b(_, o), a = await r.builder_new(i), s = w(e, a, () => {
|
|
307
350
|
n.unregister(s);
|
|
308
351
|
});
|
|
309
352
|
return n.register(s, a, s), s;
|
|
310
353
|
},
|
|
311
354
|
async fromDefinition(o, i) {
|
|
312
|
-
const a = JSON.stringify(o), s = await b(_, i), c = await r.builder_fromJson(a, s), u =
|
|
355
|
+
const a = JSON.stringify(o), s = await b(_, i), c = await r.builder_fromJson(a, s), u = w(e, c, () => {
|
|
313
356
|
n.unregister(u);
|
|
314
357
|
});
|
|
315
358
|
return n.register(u, c, u), u;
|
|
316
359
|
},
|
|
317
360
|
async fromArchive(o, i) {
|
|
318
|
-
const a = await b(_, i), s = await r.builder_fromArchive(o, a), c =
|
|
361
|
+
const a = await b(_, i), s = await r.builder_fromArchive(o, a), c = w(e, s, () => {
|
|
319
362
|
n.unregister(c);
|
|
320
363
|
});
|
|
321
364
|
return n.register(c, s, c), c;
|
|
322
365
|
}
|
|
323
366
|
};
|
|
324
367
|
}
|
|
325
|
-
function
|
|
368
|
+
function w(e, t, _) {
|
|
326
369
|
const { tx: r } = e;
|
|
327
370
|
return {
|
|
328
371
|
async setIntent(n) {
|
|
@@ -361,7 +404,7 @@ function l(e, t, _) {
|
|
|
361
404
|
return await r.builder_toArchive(t);
|
|
362
405
|
},
|
|
363
406
|
async sign(n, o, i) {
|
|
364
|
-
const a = await
|
|
407
|
+
const a = await U(n), s = e.registerSignReceiver(n.sign);
|
|
365
408
|
return await r.builder_sign(
|
|
366
409
|
t,
|
|
367
410
|
s,
|
|
@@ -371,7 +414,7 @@ function l(e, t, _) {
|
|
|
371
414
|
);
|
|
372
415
|
},
|
|
373
416
|
async signAndGetManifestBytes(n, o, i) {
|
|
374
|
-
const a = await
|
|
417
|
+
const a = await U(n), s = e.registerSignReceiver(n.sign);
|
|
375
418
|
return await r.builder_signAndGetManifestBytes(
|
|
376
419
|
t,
|
|
377
420
|
s,
|
|
@@ -385,20 +428,20 @@ function l(e, t, _) {
|
|
|
385
428
|
}
|
|
386
429
|
};
|
|
387
430
|
}
|
|
388
|
-
async function
|
|
389
|
-
const { wasmSrc: t, workerSrc: _, settings: r } = e, n = typeof t == "string" ? await
|
|
431
|
+
async function se(e) {
|
|
432
|
+
const { wasmSrc: t, workerSrc: _, settings: r } = e, n = typeof t == "string" ? await re(t) : t, o = await b(r, void 0), i = await C({ wasm: n, workerSrc: _, settingsString: o });
|
|
390
433
|
return {
|
|
391
|
-
reader:
|
|
392
|
-
builder:
|
|
434
|
+
reader: Q(i, r),
|
|
435
|
+
builder: ne(i, r),
|
|
393
436
|
dispose: i.terminate
|
|
394
437
|
};
|
|
395
438
|
}
|
|
396
|
-
async function
|
|
397
|
-
const t = await fetch(e, { integrity:
|
|
439
|
+
async function re(e) {
|
|
440
|
+
const t = await fetch(e, { integrity: te });
|
|
398
441
|
return await WebAssembly.compileStreaming(t);
|
|
399
442
|
}
|
|
400
443
|
export {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
444
|
+
q as R,
|
|
445
|
+
se as c,
|
|
446
|
+
A as i
|
|
404
447
|
};
|
package/dist/index.js
CHANGED