@contentauth/c2pa-web 0.5.1 → 0.5.3
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/dist/{c2pa-BgMc2N9M.js → c2pa-Cza5UxsC.js} +38 -38
- package/dist/common.d.ts +3 -3
- package/dist/common.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/inline.js +3 -3
- package/dist/resources/c2pa_bg.wasm +0 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { channel as F, transfer as E } from "highgain";
|
|
2
|
-
import { merge as
|
|
3
|
-
const { createTx: M, rx: V } = F(), { createTx: Z, rx: z } = F("worker"), x = '(function(){"use strict";let o,S=null;function M(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}let j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();const C=2146435072;let x=0;function V(n,e){return x+=e,x>=C&&(j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),j.decode(),x=e),j.decode(M().subarray(n,n+e))}function l(n,e){return n=n>>>0,V(n,e)}function y(n){return n==null}let A=null;function m(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==o.memory.buffer)&&(A=new DataView(o.memory.buffer)),A}function E(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let c="[";_>0&&(c+=E(n[0]));for(let s=1;s<_;s++)c+=", "+E(n[s]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(n));let r;if(t&&t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}let u=0;const R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(n,e){const t=R.encode(n);return e.set(t),{read:n.length,written:t.length}});function d(n,e,t){if(t===void 0){const i=R.encode(n),b=e(i.length,1)>>>0;return M().subarray(b,b+i.length).set(i),u=i.length,b}let r=n.length,_=e(r,1)>>>0;const c=M();let s=0;for(;s<r;s++){const i=n.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==r){s!==0&&(n=n.slice(s)),_=t(_,r,r=s+n.length*3,1)>>>0;const i=M().subarray(_+s,_+r),b=R.encodeInto(n,i);s+=b.written,_=t(_,r,s,1)>>>0}return u=s,_}function T(n){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,n),e}function f(n,e){try{return n.apply(this,e)}catch(t){const r=T(t);o.__wbindgen_exn_store(r)}}function F(n,e){return n=n>>>0,M().subarray(n/1,n/1+e)}const O=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function N(n,e,t,r){const _={a:n,b:e,cnt:1,dtor:t},c=(...s)=>{_.cnt++;const i=_.a;_.a=0;try{return r(i,_.b,...s)}finally{_.a=i,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{--_.cnt===0&&(_.dtor(_.a,_.b),_.a=0,O.unregister(_))},O.register(c,_,_),c}function a(n){const e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}function G(n){const e=d(n,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.loadSettings(e,t);if(r[1])throw a(r[0])}function P(n,e){o.wasm_bindgen__convert__closures_____invoke__hbb73f02d9cb5eeb0(n,e)}function $(n,e,t){o.wasm_bindgen__convert__closures_____invoke__hedbe22ff1e6181ec(n,e,t)}function J(n,e,t,r){o.wasm_bindgen__convert__closures_____invoke__h1fd2c9ff95892b8d(n,e,t,r)}const H=["default","no-store","reload","no-cache","force-cache","only-if-cached"],X=["omit","same-origin","include"],Y=["same-origin","no-cors","cors","navigate"],k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmbuilder_free(n>>>0,1));class h{static __wrap(e){e=e>>>0;const t=Object.create(h.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_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw a(t[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw a(t[0])}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}static fromArchive(e){const t=o.wasmbuilder_fromArchive(e);if(t[2])throw a(t[1]);return h.__wrap(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}setRemoteUrl(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,r)}addResourceFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}setThumbnailFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}addIngredientFromBlob(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u,b=o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,r);if(b[1])throw a(b[0])}signAndGetManifestBytes(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,r)}static new(){const e=o.wasmbuilder_new();if(e[2])throw a(e[1]);return h.__wrap(e[0])}sign(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,r)}static fromJson(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_fromJson(t,r);if(_[2])throw a(_[1]);return h.__wrap(_[0])}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);const z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmreader_free(n>>>0,1));class v{static __wrap(e){e=e>>>0;const t=Object.create(v.prototype);return t.__wbg_ptr=e,z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,z.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=l(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}resourceToBytes(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,r);if(_[2])throw a(_[1]);return a(_[0])}static fromBlobFragment(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmreader_fromBlobFragment(_,c,t,r)}json(){let e,t;try{const r=o.wasmreader_json(this.__wbg_ptr);return e=r[0],t=r[1],l(r[0],r[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;return o.wasmreader_fromBlob(r,_,t)}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free),typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>o.__wbg_wasmsigner_free(n>>>0,1));function K(){const n={};return n.wbg={},n.wbg.__wbg_Error_e83987f665cf5504=function(e,t){return Error(l(e,t))},n.wbg.__wbg_Number_bb48ca12f395cd08=function(e){return Number(e)},n.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd=function(e,t){const r=t,_=typeof r=="bigint"?r:void 0;m().setBigInt64(e+8,y(_)?BigInt(0):_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68=function(e){const t=e,r=typeof t=="boolean"?t:void 0;return y(r)?16777215:r?1:0},n.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763=function(e,t){const r=E(t),_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f=function(e,t){return e in t},n.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b=function(e){return typeof e=="bigint"},n.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377=function(e){return typeof e=="function"},n.wbg.__wbg___wbindgen_is_object_c818261d21f283a4=function(e){const t=e;return typeof t=="object"&&t!==null},n.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd=function(e){return typeof e=="string"},n.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478=function(e){return e===void 0},n.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50=function(e,t){return e===t},n.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147=function(e,t){return e==t},n.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d=function(e,t){const r=t,_=typeof r=="number"?r:void 0;m().setFloat64(e+8,y(_)?0:_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b=function(e,t){const r=t,_=typeof r=="string"?r:void 0;var c=y(_)?0:d(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},n.wbg.__wbg___wbindgen_throw_b855445ff6a94295=function(e,t){throw new Error(l(e,t))},n.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9=function(e){e._wbg_cb_unref()},n.wbg.__wbg_abort_28ad55c5825b004d=function(e,t){e.abort(t)},n.wbg.__wbg_abort_e7eb059f72f9ed0c=function(e){e.abort()},n.wbg.__wbg_append_b577eb3a177bc0fa=function(){return f(function(e,t,r,_,c){e.append(l(t,r),l(_,c))},arguments)},n.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3=function(){return f(function(e){return e.arrayBuffer()},arguments)},n.wbg.__wbg_byteLength_bcd42e4025299788=function(e){return e.byteLength},n.wbg.__wbg_call_525440f72fbfc0ea=function(){return f(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_call_e762c39fa8ea36bf=function(){return f(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_clearTimeout_7a42b49784aea641=function(e){return clearTimeout(e)},n.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},n.wbg.__wbg_done_2042aa2670fb1db1=function(e){return e.done},n.wbg.__wbg_entries_e171b586f8f6bdbf=function(e){return Object.entries(e)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let r,_;try{r=e,_=t,console.error(l(e,t))}finally{o.__wbindgen_free(r,_,1)}},n.wbg.__wbg_fetch_74a3e84ebd2c9a0e=function(e){return fetch(e)},n.wbg.__wbg_fetch_f8ba0e29a9d6de0d=function(e,t){return e.fetch(t)},n.wbg.__wbg_from_a4ad7cbddd0d7135=function(e){return Array.from(e)},n.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7=function(){return f(function(e,t){globalThis.crypto.getRandomValues(F(e,t))},arguments)},n.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return f(function(e,t){e.getRandomValues(t)},arguments)},n.wbg.__wbg_getTime_14776bfb48a1bff9=function(e){return e.getTime()},n.wbg.__wbg_get_7bed016f185add81=function(e,t){return e[t>>>0]},n.wbg.__wbg_get_efcb449f58ec27c2=function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,t){return e[t]},n.wbg.__wbg_has_787fafc980c3ccdb=function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},n.wbg.__wbg_headers_b87d7eaba61c3278=function(e){return e.headers},n.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38=function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7=function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},n.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef=function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},n.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c=function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},n.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98=function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_isArray_96e0af9891d0945d=function(e){return Array.isArray(e)},n.wbg.__wbg_isSafeInteger_d216eda7911dde36=function(e){return Number.isSafeInteger(e)},n.wbg.__wbg_iterator_e5822695327a3c39=function(){return Symbol.iterator},n.wbg.__wbg_length_69bca3cb64fc8748=function(e){return e.length},n.wbg.__wbg_length_cdd215e10d9dd507=function(e){return e.length},n.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},n.wbg.__wbg_new_0_f9740686d739025c=function(){return new Date},n.wbg.__wbg_new_0d96c0bf6ceac0b0=function(){return f(function(){return new FileReaderSync},arguments)},n.wbg.__wbg_new_1acc0b6eea89d040=function(){return new Object},n.wbg.__wbg_new_2531773dac38ebb3=function(){return f(function(){return new AbortController},arguments)},n.wbg.__wbg_new_3c3d849046688a66=function(e,t){try{var r={a:e,b:t},_=(s,i)=>{const b=r.a;r.a=0;try{return J(b,r.b,s,i)}finally{r.a=b}};return new Promise(_)}finally{r.a=r.b=0}},n.wbg.__wbg_new_5a79be3ab53b8aa5=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_68651c719dcda04e=function(){return new Map},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_9edf9838a2def39c=function(){return f(function(){return new Headers},arguments)},n.wbg.__wbg_new_a7442b4b19c1a356=function(e,t){return new Error(l(e,t))},n.wbg.__wbg_new_e17d9f43105b08be=function(){return new Array},n.wbg.__wbg_new_from_slice_92f4d78ca282a2d2=function(e,t){return new Uint8Array(F(e,t))},n.wbg.__wbg_new_no_args_ee98eee5275000a4=function(e,t){return new Function(l(e,t))},n.wbg.__wbg_new_with_length_01aa0dc35aa13543=function(e){return new Uint8Array(e>>>0)},n.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1=function(){return f(function(e,t,r){return new Request(l(e,t),r)},arguments)},n.wbg.__wbg_next_020810e0ae8ebcb0=function(){return f(function(e){return e.next()},arguments)},n.wbg.__wbg_next_2c826fe5dfec6b6a=function(e){return e.next},n.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},n.wbg.__wbg_now_793306c526e2e3b6=function(){return Date.now()},n.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},n.wbg.__wbg_prototypesetcall_2a6620b6922694b2=function(e,t,r){Uint8Array.prototype.set.call(F(e,t),r)},n.wbg.__wbg_queueMicrotask_34d692c25c47d05b=function(e){return e.queueMicrotask},n.wbg.__wbg_queueMicrotask_9d76cacb20c84d58=function(e){queueMicrotask(e)},n.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return f(function(e,t){e.randomFillSync(t)},arguments)},n.wbg.__wbg_readAsArrayBuffer_36927e3348e676c3=function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},n.wbg.__wbg_require_60cc747a6bc5215a=function(){return f(function(){return module.require},arguments)},n.wbg.__wbg_resolve_caf97c30b83f7053=function(e){return Promise.resolve(e)},n.wbg.__wbg_setTimeout_7bb3429662ab1e70=function(e,t){return setTimeout(e,t)},n.wbg.__wbg_set_3f1d0b984ed272ed=function(e,t,r){e[t]=r},n.wbg.__wbg_set_907fb406c34a251d=function(e,t,r){return e.set(t,r)},n.wbg.__wbg_set_9e6516df7b7d0f19=function(e,t,r){e.set(F(t,r))},n.wbg.__wbg_set_body_3c365989753d61f4=function(e,t){e.body=t},n.wbg.__wbg_set_c213c871859d6500=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_set_cache_2f9deb19b92b81e3=function(e,t){e.cache=H[t]},n.wbg.__wbg_set_credentials_f621cd2d85c0c228=function(e,t){e.credentials=X[t]},n.wbg.__wbg_set_headers_6926da238cd32ee4=function(e,t){e.headers=t},n.wbg.__wbg_set_method_c02d8cbbe204ac2d=function(e,t,r){e.method=l(t,r)},n.wbg.__wbg_set_mode_52ef73cfa79639cb=function(e,t){e.mode=Y[t]},n.wbg.__wbg_set_signal_dda2cf7ccb6bee0f=function(e,t){e.signal=t},n.wbg.__wbg_signal_4db5aa055bf9eb9a=function(e){return e.signal},n.wbg.__wbg_size_0a5a003dbf5dfee8=function(e){return e.size},n.wbg.__wbg_slice_4947c0e051116da5=function(){return f(function(e,t,r){return e.slice(t,r)},arguments)},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){const r=t.stack,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e=function(){const e=typeof global>"u"?null:global;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac=function(){const e=typeof globalThis>"u"?null:globalThis;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b=function(){const e=typeof self>"u"?null:self;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2=function(){const e=typeof window>"u"?null:window;return y(e)?0:T(e)},n.wbg.__wbg_status_de7eed5a7a5bfd5d=function(e){return e.status},n.wbg.__wbg_stringify_b5fb28f6465d9c3e=function(){return f(function(e){return JSON.stringify(e)},arguments)},n.wbg.__wbg_subarray_480600f3d6a9f26c=function(e,t,r){return e.subarray(t>>>0,r>>>0)},n.wbg.__wbg_then_4f46f6544e6b4a28=function(e,t){return e.then(t)},n.wbg.__wbg_then_70d05cf780a18d77=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_url_b36d2a5008eb056f=function(e,t){const r=t.url,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_valueOf_e1f2752ef9caddb2=function(e){return e.valueOf()},n.wbg.__wbg_value_692627309814bb8c=function(e){return e.value},n.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},n.wbg.__wbg_wasmreader_new=function(e){return v.__wrap(e)},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){return l(e,t)},n.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,t){return BigInt.asUintN(64,e)|t<<BigInt(64)},n.wbg.__wbindgen_cast_3f8afe4d69afce15=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h4e2af4dd32e0f9a7,$)},n.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){return BigInt.asUintN(64,e)},n.wbg.__wbindgen_cast_77bc3e92745e9a35=function(e,t){var r=F(e,t).slice();return o.__wbindgen_free(e,t*1,1),r},n.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return e},n.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,t){return F(e,t)},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return e},n.wbg.__wbindgen_cast_eea71553507a2f52=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h3685db4568587cc8,P)},n.wbg.__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)},n}function Q(n,e){return o=n.exports,A=null,S=null,o.__wbindgen_start(),o}function Z(n){if(o!==void 0)return o;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=K();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return Q(t)}function D(){let n=0;const e=new Map;return{add(t){const r=n++;return e.set(r,t),r},get(t){const r=e.get(t);if(!r)throw new Error("Attempted to use an object that has been freed");return r},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function B(n,e){return{type:L,value:n,transfer:e?Array.isArray(e)?e:[e]:[n]}}function U(n){return!!(n&&typeof n=="object"&&Reflect.get(n,"type")===L)}function q(n="default"){return{createTx(e){const t=new Map,r=e??self;return r.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==n)return;const{id:s,result:i,error:b}=c,w=t.get(s);w&&(b?w.reject(b):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),b=[],w=[];return s.forEach(I=>{U(I)?(b.push(I.value),w.push(...I.transfer)):b.push(I)}),r.postMessage({method:c,args:b,id:i,channelName:n},{transfer:w}),new Promise((I,re)=>{t.set(i,{resolve:I,reject:re})})}}})},rx(e,t){const r=t??self;r.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==n)return;const{method:s,args:i,id:b}=c;try{const w=await e[s](...i);U(w)?r.postMessage({result:w.value,id:b,channelName:n},{transfer:w.transfer}):r.postMessage({result:w,id:b,channelName:n})}catch(w){r.postMessage({error:w,id:b,channelName:n})}})}}}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"),p=D(),g=D(),W=ne();te({async initWorker(n,e){Z({module:n}),e&&G(e)},async reader_fromBlob(n,e){const t=await v.fromBlob(n,e);return p.add(t)},async reader_fromBlobFragment(n,e,t){const r=await v.fromBlobFragment(n,e,t);return p.add(r)},reader_activeLabel(n){return p.get(n).activeLabel()??null},reader_manifestStore(n){return p.get(n).manifestStore()},reader_activeManifest(n){return p.get(n).activeManifest()},reader_json(n){return p.get(n).json()},reader_resourceToBytes(n,e){const r=p.get(n).resourceToBytes(e);return B(r,r.buffer)},reader_free(n){p.get(n).free(),p.remove(n)},builder_new(){const n=h.new();return g.add(n)},builder_fromJson(n){const e=h.fromJson(n);return g.add(e)},builder_fromArchive(n){const e=h.fromArchive(n);return g.add(e)},builder_setIntent(n,e){g.get(n).setIntent(e)},builder_addAction(n,e){g.get(n).addAction(e)},builder_setRemoteUrl(n,e){g.get(n).setRemoteUrl(e)},builder_setNoEmbed(n,e){g.get(n).setNoEmbed(e)},builder_setThumbnailFromBlob(n,e,t){g.get(n).setThumbnailFromBlob(e,t)},builder_addIngredientFromBlob(n,e,t,r){g.get(n).addIngredientFromBlob(e,t,r)},builder_addResourceFromBlob(n,e,t){g.get(n).addResourceFromBlob(e,t)},builder_getDefinition(n){return g.get(n).getDefinition()},builder_toArchive(n){const t=g.get(n).toArchive();return B(t,t.buffer)},async builder_sign(n,e,t,r,_){const s=await g.get(n).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await W.sign(e,B(i,i.buffer),t.reserveSize)},r,_);return B(s,s.buffer)},async builder_signAndGetManifestBytes(n,e,t,r,_){const c=g.get(n),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async b=>await W.sign(e,B(b,b.buffer),t.reserveSize)},r,_);return B({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(n){g.get(n).free(),g.remove(n)}})})();\n', l = typeof self < "u" && self.Blob && new Blob([x], { type: "text/javascript;charset=utf-8" });
|
|
4
|
-
function
|
|
2
|
+
import { merge as M } from "ts-deepmerge";
|
|
3
|
+
const { createTx: j, rx: V } = F(), { createTx: H, rx: z } = F("worker"), x = '(function(){"use strict";let o,S=null;function M(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}let j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();const C=2146435072;let x=0;function V(n,e){return x+=e,x>=C&&(j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),j.decode(),x=e),j.decode(M().subarray(n,n+e))}function l(n,e){return n=n>>>0,V(n,e)}function y(n){return n==null}let A=null;function m(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==o.memory.buffer)&&(A=new DataView(o.memory.buffer)),A}function E(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let c="[";_>0&&(c+=E(n[0]));for(let s=1;s<_;s++)c+=", "+E(n[s]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(n));let r;if(t&&t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}let u=0;const R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(n,e){const t=R.encode(n);return e.set(t),{read:n.length,written:t.length}});function d(n,e,t){if(t===void 0){const i=R.encode(n),b=e(i.length,1)>>>0;return M().subarray(b,b+i.length).set(i),u=i.length,b}let r=n.length,_=e(r,1)>>>0;const c=M();let s=0;for(;s<r;s++){const i=n.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==r){s!==0&&(n=n.slice(s)),_=t(_,r,r=s+n.length*3,1)>>>0;const i=M().subarray(_+s,_+r),b=R.encodeInto(n,i);s+=b.written,_=t(_,r,s,1)>>>0}return u=s,_}function T(n){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,n),e}function f(n,e){try{return n.apply(this,e)}catch(t){const r=T(t);o.__wbindgen_exn_store(r)}}function F(n,e){return n=n>>>0,M().subarray(n/1,n/1+e)}const O=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function N(n,e,t,r){const _={a:n,b:e,cnt:1,dtor:t},c=(...s)=>{_.cnt++;const i=_.a;_.a=0;try{return r(i,_.b,...s)}finally{_.a=i,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{--_.cnt===0&&(_.dtor(_.a,_.b),_.a=0,O.unregister(_))},O.register(c,_,_),c}function a(n){const e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}function G(n){const e=d(n,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.loadSettings(e,t);if(r[1])throw a(r[0])}function P(n,e){o.wasm_bindgen__convert__closures_____invoke__hbb73f02d9cb5eeb0(n,e)}function $(n,e,t){o.wasm_bindgen__convert__closures_____invoke__hedbe22ff1e6181ec(n,e,t)}function J(n,e,t,r){o.wasm_bindgen__convert__closures_____invoke__h1fd2c9ff95892b8d(n,e,t,r)}const H=["default","no-store","reload","no-cache","force-cache","only-if-cached"],X=["omit","same-origin","include"],Y=["same-origin","no-cors","cors","navigate"],k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmbuilder_free(n>>>0,1));class h{static __wrap(e){e=e>>>0;const t=Object.create(h.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_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw a(t[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw a(t[0])}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}static fromArchive(e){const t=o.wasmbuilder_fromArchive(e);if(t[2])throw a(t[1]);return h.__wrap(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}setRemoteUrl(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,r)}addResourceFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}setThumbnailFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}addIngredientFromBlob(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u,b=o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,r);if(b[1])throw a(b[0])}signAndGetManifestBytes(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,r)}static new(){const e=o.wasmbuilder_new();if(e[2])throw a(e[1]);return h.__wrap(e[0])}sign(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,r)}static fromJson(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_fromJson(t,r);if(_[2])throw a(_[1]);return h.__wrap(_[0])}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);const z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmreader_free(n>>>0,1));class v{static __wrap(e){e=e>>>0;const t=Object.create(v.prototype);return t.__wbg_ptr=e,z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,z.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=l(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}resourceToBytes(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,r);if(_[2])throw a(_[1]);return a(_[0])}static fromBlobFragment(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmreader_fromBlobFragment(_,c,t,r)}json(){let e,t;try{const r=o.wasmreader_json(this.__wbg_ptr);return e=r[0],t=r[1],l(r[0],r[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;return o.wasmreader_fromBlob(r,_,t)}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free),typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>o.__wbg_wasmsigner_free(n>>>0,1));function K(){const n={};return n.wbg={},n.wbg.__wbg_Error_e83987f665cf5504=function(e,t){return Error(l(e,t))},n.wbg.__wbg_Number_bb48ca12f395cd08=function(e){return Number(e)},n.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd=function(e,t){const r=t,_=typeof r=="bigint"?r:void 0;m().setBigInt64(e+8,y(_)?BigInt(0):_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68=function(e){const t=e,r=typeof t=="boolean"?t:void 0;return y(r)?16777215:r?1:0},n.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763=function(e,t){const r=E(t),_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f=function(e,t){return e in t},n.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b=function(e){return typeof e=="bigint"},n.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377=function(e){return typeof e=="function"},n.wbg.__wbg___wbindgen_is_object_c818261d21f283a4=function(e){const t=e;return typeof t=="object"&&t!==null},n.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd=function(e){return typeof e=="string"},n.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478=function(e){return e===void 0},n.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50=function(e,t){return e===t},n.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147=function(e,t){return e==t},n.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d=function(e,t){const r=t,_=typeof r=="number"?r:void 0;m().setFloat64(e+8,y(_)?0:_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b=function(e,t){const r=t,_=typeof r=="string"?r:void 0;var c=y(_)?0:d(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},n.wbg.__wbg___wbindgen_throw_b855445ff6a94295=function(e,t){throw new Error(l(e,t))},n.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9=function(e){e._wbg_cb_unref()},n.wbg.__wbg_abort_28ad55c5825b004d=function(e,t){e.abort(t)},n.wbg.__wbg_abort_e7eb059f72f9ed0c=function(e){e.abort()},n.wbg.__wbg_append_b577eb3a177bc0fa=function(){return f(function(e,t,r,_,c){e.append(l(t,r),l(_,c))},arguments)},n.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3=function(){return f(function(e){return e.arrayBuffer()},arguments)},n.wbg.__wbg_byteLength_bcd42e4025299788=function(e){return e.byteLength},n.wbg.__wbg_call_525440f72fbfc0ea=function(){return f(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_call_e762c39fa8ea36bf=function(){return f(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_clearTimeout_7a42b49784aea641=function(e){return clearTimeout(e)},n.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},n.wbg.__wbg_done_2042aa2670fb1db1=function(e){return e.done},n.wbg.__wbg_entries_e171b586f8f6bdbf=function(e){return Object.entries(e)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let r,_;try{r=e,_=t,console.error(l(e,t))}finally{o.__wbindgen_free(r,_,1)}},n.wbg.__wbg_fetch_74a3e84ebd2c9a0e=function(e){return fetch(e)},n.wbg.__wbg_fetch_f8ba0e29a9d6de0d=function(e,t){return e.fetch(t)},n.wbg.__wbg_from_a4ad7cbddd0d7135=function(e){return Array.from(e)},n.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7=function(){return f(function(e,t){globalThis.crypto.getRandomValues(F(e,t))},arguments)},n.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return f(function(e,t){e.getRandomValues(t)},arguments)},n.wbg.__wbg_getTime_14776bfb48a1bff9=function(e){return e.getTime()},n.wbg.__wbg_get_7bed016f185add81=function(e,t){return e[t>>>0]},n.wbg.__wbg_get_efcb449f58ec27c2=function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,t){return e[t]},n.wbg.__wbg_has_787fafc980c3ccdb=function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},n.wbg.__wbg_headers_b87d7eaba61c3278=function(e){return e.headers},n.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38=function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7=function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},n.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef=function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},n.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c=function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},n.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98=function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_isArray_96e0af9891d0945d=function(e){return Array.isArray(e)},n.wbg.__wbg_isSafeInteger_d216eda7911dde36=function(e){return Number.isSafeInteger(e)},n.wbg.__wbg_iterator_e5822695327a3c39=function(){return Symbol.iterator},n.wbg.__wbg_length_69bca3cb64fc8748=function(e){return e.length},n.wbg.__wbg_length_cdd215e10d9dd507=function(e){return e.length},n.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},n.wbg.__wbg_new_0_f9740686d739025c=function(){return new Date},n.wbg.__wbg_new_0d96c0bf6ceac0b0=function(){return f(function(){return new FileReaderSync},arguments)},n.wbg.__wbg_new_1acc0b6eea89d040=function(){return new Object},n.wbg.__wbg_new_2531773dac38ebb3=function(){return f(function(){return new AbortController},arguments)},n.wbg.__wbg_new_3c3d849046688a66=function(e,t){try{var r={a:e,b:t},_=(s,i)=>{const b=r.a;r.a=0;try{return J(b,r.b,s,i)}finally{r.a=b}};return new Promise(_)}finally{r.a=r.b=0}},n.wbg.__wbg_new_5a79be3ab53b8aa5=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_68651c719dcda04e=function(){return new Map},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_9edf9838a2def39c=function(){return f(function(){return new Headers},arguments)},n.wbg.__wbg_new_a7442b4b19c1a356=function(e,t){return new Error(l(e,t))},n.wbg.__wbg_new_e17d9f43105b08be=function(){return new Array},n.wbg.__wbg_new_from_slice_92f4d78ca282a2d2=function(e,t){return new Uint8Array(F(e,t))},n.wbg.__wbg_new_no_args_ee98eee5275000a4=function(e,t){return new Function(l(e,t))},n.wbg.__wbg_new_with_length_01aa0dc35aa13543=function(e){return new Uint8Array(e>>>0)},n.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1=function(){return f(function(e,t,r){return new Request(l(e,t),r)},arguments)},n.wbg.__wbg_next_020810e0ae8ebcb0=function(){return f(function(e){return e.next()},arguments)},n.wbg.__wbg_next_2c826fe5dfec6b6a=function(e){return e.next},n.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},n.wbg.__wbg_now_793306c526e2e3b6=function(){return Date.now()},n.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},n.wbg.__wbg_prototypesetcall_2a6620b6922694b2=function(e,t,r){Uint8Array.prototype.set.call(F(e,t),r)},n.wbg.__wbg_queueMicrotask_34d692c25c47d05b=function(e){return e.queueMicrotask},n.wbg.__wbg_queueMicrotask_9d76cacb20c84d58=function(e){queueMicrotask(e)},n.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return f(function(e,t){e.randomFillSync(t)},arguments)},n.wbg.__wbg_readAsArrayBuffer_36927e3348e676c3=function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},n.wbg.__wbg_require_60cc747a6bc5215a=function(){return f(function(){return module.require},arguments)},n.wbg.__wbg_resolve_caf97c30b83f7053=function(e){return Promise.resolve(e)},n.wbg.__wbg_setTimeout_7bb3429662ab1e70=function(e,t){return setTimeout(e,t)},n.wbg.__wbg_set_3f1d0b984ed272ed=function(e,t,r){e[t]=r},n.wbg.__wbg_set_907fb406c34a251d=function(e,t,r){return e.set(t,r)},n.wbg.__wbg_set_9e6516df7b7d0f19=function(e,t,r){e.set(F(t,r))},n.wbg.__wbg_set_body_3c365989753d61f4=function(e,t){e.body=t},n.wbg.__wbg_set_c213c871859d6500=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_set_cache_2f9deb19b92b81e3=function(e,t){e.cache=H[t]},n.wbg.__wbg_set_credentials_f621cd2d85c0c228=function(e,t){e.credentials=X[t]},n.wbg.__wbg_set_headers_6926da238cd32ee4=function(e,t){e.headers=t},n.wbg.__wbg_set_method_c02d8cbbe204ac2d=function(e,t,r){e.method=l(t,r)},n.wbg.__wbg_set_mode_52ef73cfa79639cb=function(e,t){e.mode=Y[t]},n.wbg.__wbg_set_signal_dda2cf7ccb6bee0f=function(e,t){e.signal=t},n.wbg.__wbg_signal_4db5aa055bf9eb9a=function(e){return e.signal},n.wbg.__wbg_size_0a5a003dbf5dfee8=function(e){return e.size},n.wbg.__wbg_slice_4947c0e051116da5=function(){return f(function(e,t,r){return e.slice(t,r)},arguments)},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){const r=t.stack,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e=function(){const e=typeof global>"u"?null:global;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac=function(){const e=typeof globalThis>"u"?null:globalThis;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b=function(){const e=typeof self>"u"?null:self;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2=function(){const e=typeof window>"u"?null:window;return y(e)?0:T(e)},n.wbg.__wbg_status_de7eed5a7a5bfd5d=function(e){return e.status},n.wbg.__wbg_stringify_b5fb28f6465d9c3e=function(){return f(function(e){return JSON.stringify(e)},arguments)},n.wbg.__wbg_subarray_480600f3d6a9f26c=function(e,t,r){return e.subarray(t>>>0,r>>>0)},n.wbg.__wbg_then_4f46f6544e6b4a28=function(e,t){return e.then(t)},n.wbg.__wbg_then_70d05cf780a18d77=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_url_b36d2a5008eb056f=function(e,t){const r=t.url,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_valueOf_e1f2752ef9caddb2=function(e){return e.valueOf()},n.wbg.__wbg_value_692627309814bb8c=function(e){return e.value},n.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},n.wbg.__wbg_wasmreader_new=function(e){return v.__wrap(e)},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){return l(e,t)},n.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,t){return BigInt.asUintN(64,e)|t<<BigInt(64)},n.wbg.__wbindgen_cast_3f8afe4d69afce15=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h4e2af4dd32e0f9a7,$)},n.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){return BigInt.asUintN(64,e)},n.wbg.__wbindgen_cast_77bc3e92745e9a35=function(e,t){var r=F(e,t).slice();return o.__wbindgen_free(e,t*1,1),r},n.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return e},n.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,t){return F(e,t)},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return e},n.wbg.__wbindgen_cast_eea71553507a2f52=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h3685db4568587cc8,P)},n.wbg.__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)},n}function Q(n,e){return o=n.exports,A=null,S=null,o.__wbindgen_start(),o}function Z(n){if(o!==void 0)return o;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=K();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return Q(t)}function D(){let n=0;const e=new Map;return{add(t){const r=n++;return e.set(r,t),r},get(t){const r=e.get(t);if(!r)throw new Error("Attempted to use an object that has been freed");return r},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function B(n,e){return{type:L,value:n,transfer:e?Array.isArray(e)?e:[e]:[n]}}function U(n){return!!(n&&typeof n=="object"&&Reflect.get(n,"type")===L)}function q(n="default"){return{createTx(e){const t=new Map,r=e??self;return r.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==n)return;const{id:s,result:i,error:b}=c,w=t.get(s);w&&(b?w.reject(b):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),b=[],w=[];return s.forEach(I=>{U(I)?(b.push(I.value),w.push(...I.transfer)):b.push(I)}),r.postMessage({method:c,args:b,id:i,channelName:n},{transfer:w}),new Promise((I,re)=>{t.set(i,{resolve:I,reject:re})})}}})},rx(e,t){const r=t??self;r.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==n)return;const{method:s,args:i,id:b}=c;try{const w=await e[s](...i);U(w)?r.postMessage({result:w.value,id:b,channelName:n},{transfer:w.transfer}):r.postMessage({result:w,id:b,channelName:n})}catch(w){r.postMessage({error:w,id:b,channelName:n})}})}}}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"),p=D(),g=D(),W=ne();te({async initWorker(n,e){Z({module:n}),e&&G(e)},async reader_fromBlob(n,e){const t=await v.fromBlob(n,e);return p.add(t)},async reader_fromBlobFragment(n,e,t){const r=await v.fromBlobFragment(n,e,t);return p.add(r)},reader_activeLabel(n){return p.get(n).activeLabel()??null},reader_manifestStore(n){return p.get(n).manifestStore()},reader_activeManifest(n){return p.get(n).activeManifest()},reader_json(n){return p.get(n).json()},reader_resourceToBytes(n,e){const r=p.get(n).resourceToBytes(e);return B(r,r.buffer)},reader_free(n){p.get(n).free(),p.remove(n)},builder_new(){const n=h.new();return g.add(n)},builder_fromJson(n){const e=h.fromJson(n);return g.add(e)},builder_fromArchive(n){const e=h.fromArchive(n);return g.add(e)},builder_setIntent(n,e){g.get(n).setIntent(e)},builder_addAction(n,e){g.get(n).addAction(e)},builder_setRemoteUrl(n,e){g.get(n).setRemoteUrl(e)},builder_setNoEmbed(n,e){g.get(n).setNoEmbed(e)},builder_setThumbnailFromBlob(n,e,t){g.get(n).setThumbnailFromBlob(e,t)},builder_addIngredientFromBlob(n,e,t,r){g.get(n).addIngredientFromBlob(e,t,r)},builder_addResourceFromBlob(n,e,t){g.get(n).addResourceFromBlob(e,t)},builder_getDefinition(n){return g.get(n).getDefinition()},builder_toArchive(n){const t=g.get(n).toArchive();return B(t,t.buffer)},async builder_sign(n,e,t,r,_){const s=await g.get(n).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await W.sign(e,B(i,i.buffer),t.reserveSize)},r,_);return B(s,s.buffer)},async builder_signAndGetManifestBytes(n,e,t,r,_){const c=g.get(n),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async b=>await W.sign(e,B(b,b.buffer),t.reserveSize)},r,_);return B({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(n){g.get(n).free(),g.remove(n)}})})();\n', l = typeof self < "u" && self.Blob && new Blob([x], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function U(e) {
|
|
5
5
|
let n;
|
|
6
6
|
try {
|
|
7
7
|
if (n = l && (self.URL || self.webkitURL).createObjectURL(l), !n) throw "";
|
|
@@ -22,25 +22,25 @@ function N(e) {
|
|
|
22
22
|
n && (self.URL || self.webkitURL).revokeObjectURL(n);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
25
|
+
async function N(e) {
|
|
26
26
|
const { wasm: n, settingsString: _ } = e;
|
|
27
27
|
let r = 0;
|
|
28
|
-
const t = new
|
|
28
|
+
const t = new U(), o = j(t), i = /* @__PURE__ */ new Map();
|
|
29
29
|
z(
|
|
30
30
|
{
|
|
31
|
-
sign: async (
|
|
32
|
-
const w = i.get(
|
|
33
|
-
if (i.delete(
|
|
31
|
+
sign: async (c, s, T) => {
|
|
32
|
+
const w = i.get(c);
|
|
33
|
+
if (i.delete(c), !w)
|
|
34
34
|
throw new Error("No signer registered for request");
|
|
35
|
-
const d = await w(
|
|
35
|
+
const d = await w(s, T);
|
|
36
36
|
return E(d, d.buffer);
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
t
|
|
40
40
|
);
|
|
41
|
-
function a(
|
|
42
|
-
const
|
|
43
|
-
return i.set(
|
|
41
|
+
function a(c) {
|
|
42
|
+
const s = r++;
|
|
43
|
+
return i.set(s, c), s;
|
|
44
44
|
}
|
|
45
45
|
return await o.initWorker(n, _), {
|
|
46
46
|
tx: o,
|
|
@@ -60,7 +60,7 @@ class y extends Error {
|
|
|
60
60
|
super(`Unsupported format: ${n}.`), this.name = "UnsupportedFormatError";
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const O = [
|
|
64
64
|
"jpg",
|
|
65
65
|
"video/mp4",
|
|
66
66
|
"image/heif",
|
|
@@ -119,8 +119,8 @@ const U = [
|
|
|
119
119
|
"nef",
|
|
120
120
|
"heif"
|
|
121
121
|
];
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function h(e) {
|
|
123
|
+
return O.includes(e);
|
|
124
124
|
}
|
|
125
125
|
const f = 10 ** 9;
|
|
126
126
|
function L(e) {
|
|
@@ -129,7 +129,7 @@ function L(e) {
|
|
|
129
129
|
});
|
|
130
130
|
return {
|
|
131
131
|
async fromBlob(r, t) {
|
|
132
|
-
if (!
|
|
132
|
+
if (!h(r))
|
|
133
133
|
throw new y(r);
|
|
134
134
|
if (t.size > f)
|
|
135
135
|
throw new m(t.size);
|
|
@@ -139,11 +139,11 @@ function L(e) {
|
|
|
139
139
|
});
|
|
140
140
|
return _.register(i, o, i), i;
|
|
141
141
|
} catch (o) {
|
|
142
|
-
return
|
|
142
|
+
return p(o);
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
145
|
async fromBlobFragment(r, t, o) {
|
|
146
|
-
if (!
|
|
146
|
+
if (!h(r))
|
|
147
147
|
throw new y(r);
|
|
148
148
|
if (t.size > f)
|
|
149
149
|
throw new m(t.size);
|
|
@@ -157,12 +157,12 @@ function L(e) {
|
|
|
157
157
|
});
|
|
158
158
|
return _.register(a, i, a), a;
|
|
159
159
|
} catch (i) {
|
|
160
|
-
return
|
|
160
|
+
return p(i);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function p(e) {
|
|
166
166
|
if (e instanceof Error && e.message === "C2pa(JumbfNotFound)")
|
|
167
167
|
return null;
|
|
168
168
|
throw e;
|
|
@@ -205,22 +205,22 @@ typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => e.dtor(e.a,
|
|
|
205
205
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => g.__wbg_wasmbuilder_free(e >>> 0, 1));
|
|
206
206
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => g.__wbg_wasmreader_free(e >>> 0, 1));
|
|
207
207
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => g.__wbg_wasmsigner_free(e >>> 0, 1));
|
|
208
|
-
const
|
|
208
|
+
const W = "sha512-ZSS+ycEiOigY5q2NyuGdoUdUXpbKJKKlRzWykomKo+orNaLWUc16UKz64Ffc4/Qu+SAFHYbRPtqMc3vnChBFyg==", D = {
|
|
209
209
|
builder: {
|
|
210
210
|
generateC2paArchive: !0
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
async function
|
|
214
|
-
const n =
|
|
213
|
+
async function q(e) {
|
|
214
|
+
const n = M(D, e), _ = [];
|
|
215
215
|
return n.trust && _.push(A(n.trust)), n.cawgTrust && _.push(A(n.cawgTrust)), await Promise.all(_), JSON.stringify(I(n));
|
|
216
216
|
}
|
|
217
217
|
function I(e) {
|
|
218
218
|
return Object.entries(e).reduce(
|
|
219
|
-
(_, [r, t]) => (_[
|
|
219
|
+
(_, [r, t]) => (_[C(r)] = typeof t == "object" ? I(t) : t, _),
|
|
220
220
|
{}
|
|
221
221
|
);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function C(e) {
|
|
224
224
|
return e.replace(/[A-Z]/g, (n) => `_${n.toLowerCase()}`);
|
|
225
225
|
}
|
|
226
226
|
async function A(e) {
|
|
@@ -228,13 +228,13 @@ async function A(e) {
|
|
|
228
228
|
const n = Object.entries(e).map(async ([_, r]) => {
|
|
229
229
|
if (Array.isArray(r)) {
|
|
230
230
|
const t = r.map(async (a) => {
|
|
231
|
-
const
|
|
232
|
-
if (R(_) && !S(
|
|
231
|
+
const s = await (await fetch(a)).text();
|
|
232
|
+
if (R(_) && !S(s))
|
|
233
233
|
throw new Error(`Error parsing PEM file at: ${a}`);
|
|
234
|
-
return
|
|
234
|
+
return s;
|
|
235
235
|
}), i = (await Promise.all(t)).join("");
|
|
236
236
|
e[_] = i;
|
|
237
|
-
} else if (r &&
|
|
237
|
+
} else if (r && P(r)) {
|
|
238
238
|
const o = await (await fetch(r)).text();
|
|
239
239
|
if (R(_) && !S(o))
|
|
240
240
|
throw new Error(`Error parsing PEM file at: ${r}`);
|
|
@@ -247,7 +247,7 @@ async function A(e) {
|
|
|
247
247
|
throw new Error("Failed to resolve trust settings.", { cause: n });
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
const R = (e) => ["userAnchors", "trustAnchors"].includes(e), S = (e) => e.includes("-----BEGIN CERTIFICATE-----"),
|
|
250
|
+
const R = (e) => ["userAnchors", "trustAnchors"].includes(e), S = (e) => e.includes("-----BEGIN CERTIFICATE-----"), P = (e) => e.startsWith("http");
|
|
251
251
|
async function B(e) {
|
|
252
252
|
const { alg: n } = e;
|
|
253
253
|
return {
|
|
@@ -312,20 +312,20 @@ function u(e, n, _) {
|
|
|
312
312
|
return await r.builder_toArchive(n);
|
|
313
313
|
},
|
|
314
314
|
async sign(t, o, i) {
|
|
315
|
-
const a = await B(t),
|
|
315
|
+
const a = await B(t), c = e.registerSignReceiver(t.sign);
|
|
316
316
|
return await r.builder_sign(
|
|
317
317
|
n,
|
|
318
|
-
|
|
318
|
+
c,
|
|
319
319
|
a,
|
|
320
320
|
o,
|
|
321
321
|
i
|
|
322
322
|
);
|
|
323
323
|
},
|
|
324
324
|
async signAndGetManifestBytes(t, o, i) {
|
|
325
|
-
const a = await B(t),
|
|
325
|
+
const a = await B(t), c = e.registerSignReceiver(t.sign);
|
|
326
326
|
return await r.builder_signAndGetManifestBytes(
|
|
327
327
|
n,
|
|
328
|
-
|
|
328
|
+
c,
|
|
329
329
|
a,
|
|
330
330
|
o,
|
|
331
331
|
i
|
|
@@ -337,7 +337,7 @@ function u(e, n, _) {
|
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
async function X(e) {
|
|
340
|
-
const { wasmSrc: n, settings: _ } = e, r = typeof n == "string" ? await $(n) : n, t = _ ? await
|
|
340
|
+
const { wasmSrc: n, settings: _ } = e, r = typeof n == "string" ? await $(n) : n, t = _ ? await q(_) : void 0, o = await N({ wasm: r, settingsString: t });
|
|
341
341
|
return {
|
|
342
342
|
reader: L(o),
|
|
343
343
|
builder: J(o),
|
|
@@ -345,11 +345,11 @@ async function X(e) {
|
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
347
|
async function $(e) {
|
|
348
|
-
const n = await fetch(e, { integrity:
|
|
348
|
+
const n = await fetch(e, { integrity: W });
|
|
349
349
|
return await WebAssembly.compileStreaming(n);
|
|
350
350
|
}
|
|
351
351
|
export {
|
|
352
|
-
|
|
352
|
+
O as R,
|
|
353
353
|
X as c,
|
|
354
|
-
|
|
354
|
+
h as i
|
|
355
355
|
};
|
package/dist/common.d.ts
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type * from './lib/c2pa.js';
|
|
10
10
|
export type { Reader, ReaderFactory } from './lib/reader.js';
|
|
11
|
-
export type { Builder, BuilderFactory } from './lib/builder.js';
|
|
12
|
-
export type { Signer } from './lib/signer.js';
|
|
11
|
+
export type { Builder, BuilderFactory, ManifestAndAssetBytes, } from './lib/builder.js';
|
|
12
|
+
export type { Signer, SigningAlg } from './lib/signer.js';
|
|
13
13
|
export { isSupportedReaderFormat, READER_SUPPORTED_FORMATS, } from './lib/supportedFormats.js';
|
|
14
|
-
export type { Settings, VerifySettings, TrustSettings, } from './lib/settings.js';
|
|
14
|
+
export type { Settings, VerifySettings, TrustSettings, BuilderSettings, CawgTrustSettings, } from './lib/settings.js';
|
|
15
15
|
export type * from '@contentauth/c2pa-types';
|
|
16
16
|
//# sourceMappingURL=common.d.ts.map
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mBAAmB,eAAe,CAAC;AAEnC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE7D,YAAY,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mBAAmB,eAAe,CAAC;AAEnC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE7D,YAAY,EACV,OAAO,EACP,cAAc,EACd,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,mBAAmB,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED