41 lines
269 KiB
JavaScript
41 lines
269 KiB
JavaScript
|
(function(){
|
||
|
shadow$provide[594]=function(ka,N,Ba,w){function m(){if(null===x||x.buffer!==e.memory.buffer)x=new Uint8Array(e.memory.buffer);return x}function G(O,T){return k.decode(m().subarray(O,O+T))}function p(O){y===z.length&&z.push(z.length+1);const T=y;y=z[T];z[T]=O;return T}function l(O){const T=z[O];36>O||(z[O]=y,y=O);return T}function c(){if(null===K||K.buffer!==e.memory.buffer)K=new Int32Array(e.memory.buffer);return K}function h(O,T,L){if(void 0===L)return O=D.encode(O),T=T(O.length),m().subarray(T,
|
||
|
T+O.length).set(O),A=O.length,T;let Y=O.length;T=T(Y);const P=m();let W=0;for(;W<Y;W++){const J=O.charCodeAt(W);if(127<J)break;P[T+W]=J}W!==Y&&(0!==W&&(O=O.slice(W)),T=L(T,Y,Y=W+3*O.length),L=m().subarray(T+W,T+Y),O=r(O,L),W+=O.written);A=W;return T}function n(O,T){T=T(1*O.length);m().set(O,T/1);A=O.length;return T}function t(O,T){return m().subarray(O/1,O/1+T)}function a(O){return function(){try{return O.apply(this,arguments)}catch(T){e.__wbindgen_exn_store(p(T))}}}async function u(O,T){if("function"===
|
||
|
typeof Response&&O instanceof Response){if("function"===typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(O,T)}catch(L){if("application/wasm"!=O.headers.get("Content-Type"))console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",L);else throw L;}O=await O.arrayBuffer();return await WebAssembly.instantiate(O,
|
||
|
T)}T=await WebAssembly.instantiate(O,T);return T instanceof WebAssembly.Instance?{instance:T,module:O}:T}async function g(O){const T={wbg:{}};T.wbg.__wbindgen_string_new=function(P,W){P=G(P,W);return p(P)};T.wbg.__wbg_new_f59cbefd64f2876f=function(P,W){P=Error(G(P,W));return p(P)};T.wbg.__wbindgen_object_clone_ref=function(P){return p(z[P])};T.wbg.__wbg_instanceof_Window_49f532f06a9786ee=function(P){return z[P]instanceof Window};T.wbg.__wbindgen_object_drop_ref=function(P){l(P)};T.wbg.__wbg_performance_87e4f3b6f966469f=
|
||
|
function(P){P=z[P].performance;return void 0===P||null===P?0:p(P)};T.wbg.__wbg_now_7628760b7b640632=function(P){return z[P].now()};T.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return p(Y)};T.wbg.__wbg_self_77eca7b42660e1bb=a(function(){return p(self.self)});T.wbg.__wbg_window_51dac01569f1ba70=a(function(){return p(window.window)});T.wbg.__wbg_globalThis_34bac2d08ebb9b58=a(function(){return p(globalThis.globalThis)});T.wbg.__wbg_global_1c436164a66c9c22=a(function(){return p(ka.global)});
|
||
|
T.wbg.__wbindgen_is_undefined=function(P){return void 0===z[P]};T.wbg.__wbg_newnoargs_ab5e899738c0eff4=function(P,W){P=new Function(G(P,W));return p(P)};T.wbg.__wbg_call_ab183a630df3a257=a(function(P,W){P=z[P].call(z[W]);return p(P)});T.wbg.__wbg_self_86b4b13392c7af56=a(function(){return p(self.self)});T.wbg.__wbg_require_f5521a5b85ad2542=function(P,W,J){P=z[P].require(G(W,J));return p(P)};T.wbg.__wbg_crypto_b8c92eaac23d0d80=function(P){return p(z[P].crypto)};T.wbg.__wbg_msCrypto_9ad6677321a08dd8=
|
||
|
function(P){return p(z[P].msCrypto)};T.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(P){return p(z[P].getRandomValues)};T.wbg.__wbg_newwithlength_48451d71403bfede=function(P){P=new Uint8Array(P>>>0);return p(P)};T.wbg.__wbg_subarray_6b2dd31c84ee881f=function(P,W,J){P=z[P].subarray(W>>>0,J>>>0);return p(P)};T.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(P,W){z[P].getRandomValues(z[W])};T.wbg.__wbg_length_e9f6f145de2fede5=function(P){return z[P].length};T.wbg.__wbindgen_memory=function(){return p(e.memory)};
|
||
|
T.wbg.__wbg_buffer_bc64154385c04ac4=function(P){return p(z[P].buffer)};T.wbg.__wbg_new_22a33711cf65b661=function(P){P=new Uint8Array(z[P]);return p(P)};T.wbg.__wbg_set_b29de3f25280c6ec=function(P,W,J){z[P].set(z[W],J>>>0)};T.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(P,W,J){z[P].randomFillSync(t(W,J))};T.wbg.__wbindgen_throw=function(P,W){throw Error(G(P,W));};T.wbg.__wbindgen_rethrow=function(P){throw l(P);};if("string"===typeof O||"function"===typeof Request&&O instanceof Request||"function"===
|
||
|
typeof URL&&O instanceof URL)O=fetch(O);const {instance:L,module:Y}=await u(await O,T);e=L.exports;g.__wbindgen_wasm_module=Y;return e}Object.defineProperty(w,"__esModule",{value:!0});w.decrypt_with_user_passphrase=async function(O,T){return(await ca).decrypt_with_user_passphrase(O,T)};w.decrypt_with_x25519=async function(O,T){return(await ca).decrypt_with_x25519(O,T)};w.encrypt_with_user_passphrase=async function(O,T,L){return(await ca).encrypt_with_user_passphrase(O,T,L)};w.encrypt_with_x25519=
|
||
|
async function(O,T,L){return(await ca).encrypt_with_x25519(O,T,L)};w.keygen=async function(){return(await ca).keygen()};let e,k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();let x=null;const z=Array(32).fill(void 0);z.push(void 0,null,!0,!1);let y=z.length,K=null,E=null,A=0,D=new TextEncoder("utf-8");const r="function"===typeof D.encodeInto?function(O,T){return D.encodeInto(O,T)}:function(O,T){const L=D.encode(O);T.set(L);return{read:O.length,written:L.length}};var V=Object.freeze({__proto__:null,
|
||
|
keygen:function(){try{var O=e.__wbindgen_add_to_stack_pointer(-16);e.keygen(O);var T=c()[O/4],L=c()[O/4+1];if(null===E||E.buffer!==e.memory.buffer)E=new Uint32Array(e.memory.buffer);const P=E.subarray(T/4,T/4+L);O=[];for(let W=0;W<P.length;W++)O.push(l(P[W]));var Y=O.slice();e.__wbindgen_free(T,4*L);return Y}finally{e.__wbindgen_add_to_stack_pointer(16)}},encrypt_with_x25519:function(O,T,L){try{const S=e.__wbindgen_add_to_stack_pointer(-16);var Y=h(O,e.__wbindgen_malloc,e.__wbindgen_realloc);O=A;
|
||
|
var P=n(T,e.__wbindgen_malloc);e.encrypt_with_x25519(S,Y,O,P,A,L);var W=c()[S/4],J=c()[S/4+1],M=t(W,J).slice();e.__wbindgen_free(W,1*J);return M}finally{e.__wbindgen_add_to_stack_pointer(16)}},decrypt_with_x25519:function(O,T){try{const M=e.__wbindgen_add_to_stack_pointer(-16);var L=h(O,e.__wbindgen_malloc,e.__wbindgen_realloc);O=A;var Y=n(T,e.__wbindgen_malloc);e.decrypt_with_x25519(M,L,O,Y,A);var P=c()[M/4],W=c()[M/4+1],J=t(P,W).slice();e.__wbindgen_free(P,1*W);return J}finally{e.__wbindgen_add_to_stack_pointer(16)}},
|
||
|
encrypt_with_user_passphrase:function(O,T,L){try{const S=e.__wbindgen_add_to_stack_pointer(-16);var Y=h(O,e.__wbindgen_malloc,e.__wbindgen_realloc);O=A;var P=n(T,e.__wbindgen_malloc);e.encrypt_with_user_passphrase(S,Y,O,P,A,L);var W=c()[S/4],J=c()[S/4+1],M=t(W,J).slice();e.__wbindgen_free(W,1*J);return M}finally{e.__wbindgen_add_to_stack_pointer(16)}},decrypt_with_user_passphrase:function(O,T){try{const M=e.__wbindgen_add_to_stack_pointer(-16);var L=h(O,e.__wbindgen_malloc,e.__wbindgen_realloc);O=
|
||
|
A;var Y=n(T,e.__wbindgen_malloc);e.decrypt_with_user_passphrase(M,L,O,Y,A);var P=c()[M/4],W=c()[M/4+1],J=t(P,W).slice();e.__wbindgen_free(P,1*W);return J}finally{e.__wbindgen_add_to_stack_pointer(16)}},"default":g});const ea=[62,0,0,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,0,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Q=function(O){let T=O.endsWith("\x3d\x3d")?2:O.endsWith("\x3d")?
|
||
|
1:0,L=O.length,Y=new Uint8Array(L/4*3),P;for(let W=0,J=0;W<L;W+=4,J+=3)P=ea[O.charCodeAt(W)-43]<<18|ea[O.charCodeAt(W+1)-43]<<12|ea[O.charCodeAt(W+2)-43]<<6|ea[O.charCodeAt(W+3)-43],Y[J]=P>>16,Y[J+1]=P>>8&255,Y[J+2]=P&255;return Y.subarray(0,Y.length-T)}("AGFzbQEAAAAB6QEiYAN/f38Bf2ACf38Bf2ACf38AYAN/f38AYAF/AGABfwF/YAR/f39/AGAAAX9gBX9/f39/AGADf35+AGAGf39/f39/AGAFf39/f38Bf2ADf39/AX5gBH9/f38Bf2ADf35/AGABfwF+YAR/f35/AGACf34AYAJ/fABgBn9/f39/fwF/YAAAYAd/f39/f39/AGAJf39/f39/f39/AGAFf399f38AYAV/f3x/fwBgBX9+fn5+AGAEf31/fwBgBH98f38AYAd/f39/f39/AX9gAX4Bf2ADfn9/AX9gAn9/AX5gAn5+AX5gAX8BfALhCB8Dd2JnFV9fd2JpbmRnZW5fc3RyaW5nX25ldwABA3diZxpfX3diZ19uZXdfZjU5Y2JlZmQ2NGYyODc2ZgABA3diZxtfX3diaW5kZ2VuX29iamVjdF9jbG9uZV9yZWYABQN3YmcoX193YmdfaW5zdGFuY2VvZl9XaW5kb3dfNDlmNTMyZjA2YTk3ODZlZQAFA3diZxpfX3diaW5kZ2VuX29iamVjdF9kcm9wX3JlZgAEA3diZyJfX3diZ19wZXJmb3JtYW5jZV84N2U0ZjNiNmY5NjY0NjlmAAUDd2JnGl9fd2JnX25vd183NjI4NzYwYjdiNjQwNjMyACEDd2JnLV9fd2JnX3N0YXRpY19hY2Nlc3Nvcl9NT0RVTEVfNDUyYjQ2ODBlODYxNGM4MQAHA3diZxtfX3diZ19zZWxmXzc3ZWNhN2I0MjY2MGUxYmIABwN3YmcdX193Ymdfd2luZG93XzUxZGFjMDE1NjlmMWJhNzAABwN3YmchX193YmdfZ2xvYmFs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gwhBCAAKAIIIQMgACgCBCEFIAAoAgAhB0Hl8MGLBiEMQe7IgZkDIQpBstqIywchD0H0yoHZBiESQQohEANAIAMgD2oiBq0gBCASaiIRrUIghoQgFK0gCK1CIIaEhSJXQiCIp0EQdyIIIBVqIhetQiCGIFenQRB3Ig8gFmoiEq2EIAOtIAStQiCGhIUiV0IgiKdBDHciBCARaiIRrUIghiBXp0EMdyIDIAZqIgathCAPrSAIrUIghoSFIldCIIinQQh3IgggF2oiF61CIIYgEiBXp0EIdyIeaiISrYQgA60gBK1CIIaEhSJXQiCIp0EHdyIEIAZqIgOtQiCGIFenQQd3IgYgCyAHIAxqIgytIAUgCmoiCq1CIIaEIAmtIA2tQiCGhIUiV0IgiKdBEHciCWoiC61CIIYgDiBXp0EQdyIPaiIOrYQgB60gBa1CIIaEhSJXQiCIp0EMdyIFIApqIgdqIgqthCAMIFenQQx3IhhqIgytIAetQiCGhCAPrSAJrUIghoSFIldCIIinQQh3IgetQiCGIFenQQh3IgmthIUiV0IgiKdBEHciJiAJIA5qIipqIgmtQiCGIBcgV6dBEHciDmoiF62EIAatIAStQiCGhIUiV0IgiKdBDHciBCADaiIPrUIghiBXp0EMdyIDIApqIgqthCAOrSAmrUIghoSFIldCIIinQQh3Ig0gCWoiDq1CIIYgV6dBCHciCSAXaiIVrYQgA60gBK1CIIaEhSJXp0EHdyEDICqtIAcgC2oiBK1CIIaEIBitIAWtQiCGhIUiWEIgiKdBB3ciBSAMaiIHrUIghiBYp0EHdyIGIBF
|
||
|
ca=(async()=>{await g(Q);return V})()};
|
||
|
'use strict';
|
||
|
$APP.$frontend$extensions$age_encryption$keygen$$ = function() {
|
||
|
return $module$node_modules$$kanru$rage_wasm$dist$index$$.keygen();
|
||
|
};
|
||
|
$APP.$frontend$extensions$age_encryption$encrypt_with_x25519$$ = function($public_key$jscomp$2$$, $content$jscomp$302$$, $armor$$) {
|
||
|
return $module$node_modules$$kanru$rage_wasm$dist$index$$.encrypt_with_x25519($public_key$jscomp$2$$, $content$jscomp$302$$, $armor$$);
|
||
|
};
|
||
|
$APP.$frontend$extensions$age_encryption$decrypt_with_x25519$$ = function($secret_key$jscomp$1$$, $content$jscomp$303$$) {
|
||
|
return $module$node_modules$$kanru$rage_wasm$dist$index$$.decrypt_with_x25519($secret_key$jscomp$1$$, $content$jscomp$303$$);
|
||
|
};
|
||
|
$APP.$frontend$extensions$age_encryption$encrypt_with_user_passphrase$$ = function($passphrase$jscomp$2$$, $content$jscomp$304$$, $armor$jscomp$1$$) {
|
||
|
return $module$node_modules$$kanru$rage_wasm$dist$index$$.encrypt_with_user_passphrase($passphrase$jscomp$2$$, $content$jscomp$304$$, $armor$jscomp$1$$);
|
||
|
};
|
||
|
$APP.$frontend$extensions$age_encryption$decrypt_with_user_passphrase$$ = function($passphrase$jscomp$3$$, $content$jscomp$305$$) {
|
||
|
return $module$node_modules$$kanru$rage_wasm$dist$index$$.decrypt_with_user_passphrase($passphrase$jscomp$3$$, $content$jscomp$305$$);
|
||
|
};
|
||
|
$APP.$JSCompiler_StaticMethods_beforeLoadModuleCode$$("age-encryption");
|
||
|
var $module$node_modules$$kanru$rage_wasm$dist$index$$ = $APP.$shadow$js$require$$(594);
|
||
|
$APP.$frontend$extensions$age_encryption$$ = {};
|
||
|
$APP.$module$contents$shadow$loader_mm$$.$setLoaded$();
|
||
|
|
||
|
}).call(this);
|
||
|
//# sourceMappingURL=age-encryption.js.map
|