pdf.js/external/quickjs/quickjs-eval.js

41 lines
500 KiB
JavaScript
Raw Normal View History

var Module = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(Module) {
Module = Module || {};
var b;b||(b=typeof Module !== 'undefined' ? Module : {});var h,n;b.ready=new Promise(function(a,c){h=a;n=c});var q={},r;for(r in b)b.hasOwnProperty(r)&&(q[r]=b[r]);var t="";"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src);_scriptDir&&(t=_scriptDir);0!==t.indexOf("blob:")?t=t.substr(0,t.lastIndexOf("/")+1):t="";var aa=b.print||console.log.bind(console),u=b.printErr||console.warn.bind(console);for(r in q)q.hasOwnProperty(r)&&(b[r]=q[r]);q=null;var v;
b.wasmBinary&&(v=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!==typeof WebAssembly&&w("no native wasm support detected");var x,z=!1;function A(a){var c=b["_"+a];c||w("Assertion failed: Cannot call unknown function "+(a+", make sure it is exported"));return c}
function B(a,c,d,e){var f={string:function(l){var p=0;if(null!==l&&void 0!==l&&0!==l){var U=(l.length<<2)+1;p=C(U);D(l,E,p,U)}return p},array:function(l){var p=C(l.length);F.set(l,p);return p}},g=A(a),k=[];a=0;if(e)for(var m=0;m<e.length;m++){var y=f[d[m]];y?(0===a&&(a=G()),k[m]=y(e[m])):k[m]=e[m]}d=g.apply(null,k);d=function(l){return"string"===c?H(l):"boolean"===c?!!l:l}(d);0!==a&&I(a);return d}var J="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function K(a,c,d){var e=c+d;for(d=c;a[d]&&!(d>=e);)++d;if(16<d-c&&a.subarray&&J)return J.decode(a.subarray(c,d));for(e="";c<d;){var f=a[c++];if(f&128){var g=a[c++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var k=a[c++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[c++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function H(a){return a?K(E,a,void 0):""}
function D(a,c,d,e){if(0<e){e=d+e-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(d>=e)break;c[d++]=g}else{if(2047>=g){if(d+1>=e)break;c[d++]=192|g>>6}else{if(65535>=g){if(d+2>=e)break;c[d++]=224|g>>12}else{if(d+3>=e)break;c[d++]=240|g>>18;c[d++]=128|g>>12&63}c[d++]=128|g>>6&63}c[d++]=128|g&63}}c[d]=0}}
function L(a){for(var c=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:c+4}return c}function ba(a){var c=L(a)+1,d=M(c);d&&D(a,F,d,c);return d}var ca,F,E,N;
function da(){var a=x.buffer;ca=a;b.HEAP8=F=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAP32=N=new Int32Array(a);b.HEAPU8=E=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var O,ea=[],fa=[],ha=[],ia=[];function ja(){var a=b.preRun.shift();ea.unshift(a)}var P=0,Q=null,R=null;b.preloadedImages={};b.preloadedAudios={};
function w(a){if(b.onAbort)b.onAbort(a);u(a);z=!0;a=new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");n(a);throw a;}function S(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet-stream;base64,")}var T="data:application/octet-stream;base64,AGFzbQEAAAABxQZsYAR/fn9/AX5gA39/fwF/YAJ/fwF/YAJ/fwBgAX8Bf2AFf35/f38BfmADf39/AGAB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we6B7kHuAe3B7YHtQeyBbQHswfYBLIHsQewB9YErweuB6wH1wSrB6oHqQeoB6cHpgelB6QHoweiB5oDoQegB58HngedB5wHmweaB5kHmAeXB5YH/QOVB5QHsQWzBZIHkQePB44HjQeMB4oHiQeIB4cH0gTRBIYHhAeDB4IHgQeAB/8G/gb9BvwG+wb6BvkG+Ab3BvYG9Qb0BvMG8gbxBvAG7wbuBu0G7AbqBukG6AbnBuYG5QbkBuMG4gbhBuAG3wbeBt0G3AbbBtoG2QjQCNII2QbaCNYIzgivBNQI1QixBNgCmgXNCNMIzAjYBtEI2AjbCM8I3gjXCKQCsAO/CL4I3AjXBtYG1QbUBtMG0gbRBtAGzwbOBs0GzAbLBsoGyQbIBscGxgbFBsQGwwbCBsEGygTABskEvga9BrwGuwa6BrkGuAa3BrQGswa
function la(){var a=T;try{if(a==T&&v)return new Uint8Array(v);if(S(a))try{var c=ma(a.slice(37)),d=new Uint8Array(c.length);for(a=0;a<c.length;++a)d[a]=c.charCodeAt(a);var e=d}catch(g){throw Error("Converting base64 string to bytes failed.");}else e=void 0;var f=e;if(f)return f;throw"both async and sync fetching of the wasm failed";}catch(g){w(g)}}
function na(){return v||"function"!==typeof fetch?Promise.resolve().then(function(){return la()}):fetch(T,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+T+"'";return a.arrayBuffer()}).catch(function(){return la()})}function V(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var d=c.B;"number"===typeof d?void 0===c.A?O.get(d)():O.get(d)(c.A):d(void 0===c.A?null:c.A)}}}function W(a){var c=L(a)+1,d=M(c);D(a,E,d,c);return d}
function oa(){}var pa=[null,[],[]];function qa(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}if(!ra){ra=!0;var c=(new Date).getFullYear(),d=new Date(c,0,1),e=new Date(c,6,1);c=d.getTimezoneOffset();var f=e.getTimezoneOffset(),g=Math.max(c,f);N[sa()>>2]=60*g;N[ta()>>2]=Number(c!=f);d=a(d);e=a(e);d=ba(d);e=ba(e);f<c?(N[X()>>2]=d,N[X()+4>>2]=e):(N[X()>>2]=e,N[X()+4>>2]=d)}}var ra;
oa=(a,c,d)=>{a=H(a);c=null!==c?JSON.parse(H(c)):[];try{const e=b.externalCall(a,c);return e?W(e):null}catch(e){return b.HEAPU8[d]=1,W(e.message)}};
var ma="function"===typeof atob?atob:function(a){var c="",d=0;a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));e=e<<2|f>>4;
f=(f&15)<<4|g>>2;var m=(g&3)<<6|k;c+=String.fromCharCode(e);64!==g&&(c+=String.fromCharCode(f));64!==k&&(c+=String.fromCharCode(m))}while(d<a.length);return c},ua={a:function(a,c,d,e){w("Assertion failed: "+H(a)+", at: "+[c?H(c):"unknown filename",d,e?H(e):"unknown function"])},b:function(){w()},g:oa,f:function(a,c){a=H(a);let d;try{d=window.JSON.parse(a)}catch(e){d=a}0!==c?window.alert(a):window.console.log("DUMP",d)},e:function(a){var c=E.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=
2){var e=c*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0<e%65536&&(e+=65536-e%65536);a:{try{x.grow(Math.min(2147483648,e)-ca.byteLength+65535>>>16);da();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},d:function(a,c,d,e){for(var f=0,g=0;g<d;g++){for(var k=N[c+8*g>>2],m=N[c+(8*g+4)>>2],y=0;y<m;y++){var l=E[k+y],p=pa[a];0===l||10===l?((1===a?aa:u)(K(p,0)),p.length=0):p.push(l)}f+=m}N[e>>2]=f;return 0},c:function(a){var c=Date.now();N[a>>2]=c/1E3|0;N[a+4>>2]=c%1E3*1E3|0;return 0},h:function(a,
c){qa();a=new Date(1E3*N[a>>2]);N[c>>2]=a.getSeconds();N[c+4>>2]=a.getMinutes();N[c+8>>2]=a.getHours();N[c+12>>2]=a.getDate();N[c+16>>2]=a.getMonth();N[c+20>>2]=a.getFullYear()-1900;N[c+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);N[c+28>>2]=(a.getTime()-d.getTime())/864E5|0;N[c+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;N[c+32>>2]=a;a=N[X()+(a?4:0)>>2];N[c+40>>2]=a;
return c},i:function(a){a=H(a);window.console.log(a)},j:function(a,c,d,e){a=H(a);c=H(c);d=H(d);d=`Quickjs -- ${a}: ${c}\n${d}`;0!==e?window.alert(d):window.console.error(d)}};
(function(){function a(f){b.asm=f.exports;x=b.asm.k;da();O=b.asm.t;fa.unshift(b.asm.l);P--;b.monitorRunDependencies&&b.monitorRunDependencies(P);0==P&&(null!==Q&&(clearInterval(Q),Q=null),R&&(f=R,R=null,f()))}function c(f){a(f.instance)}function d(f){return na().then(function(g){return WebAssembly.instantiate(g,e)}).then(f,function(g){u("failed to asynchronously prepare wasm: "+g);w(g)})}var e={a:ua};P++;b.monitorRunDependencies&&b.monitorRunDependencies(P);if(b.instantiateWasm)try{return b.instantiateWasm(e,
a)}catch(f){return u("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return v||"function"!==typeof WebAssembly.instantiateStreaming||S(T)||"function"!==typeof fetch?d(c):fetch(T,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(g){u("wasm streaming compile failed: "+g);u("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(n);return{}})();
b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.l).apply(null,arguments)};b._evalInSandbox=function(){return(b._evalInSandbox=b.asm.m).apply(null,arguments)};b._nukeSandbox=function(){return(b._nukeSandbox=b.asm.n).apply(null,arguments)};b._init=function(){return(b._init=b.asm.o).apply(null,arguments)};b._commFun=function(){return(b._commFun=b.asm.p).apply(null,arguments)};b._dumpMemoryUse=function(){return(b._dumpMemoryUse=b.asm.q).apply(null,arguments)};
var M=b._malloc=function(){return(M=b._malloc=b.asm.r).apply(null,arguments)};b._free=function(){return(b._free=b.asm.s).apply(null,arguments)};
var X=b.__get_tzname=function(){return(X=b.__get_tzname=b.asm.u).apply(null,arguments)},ta=b.__get_daylight=function(){return(ta=b.__get_daylight=b.asm.v).apply(null,arguments)},sa=b.__get_timezone=function(){return(sa=b.__get_timezone=b.asm.w).apply(null,arguments)},G=b.stackSave=function(){return(G=b.stackSave=b.asm.x).apply(null,arguments)},I=b.stackRestore=function(){return(I=b.stackRestore=b.asm.y).apply(null,arguments)},C=b.stackAlloc=function(){return(C=b.stackAlloc=b.asm.z).apply(null,arguments)};
b.ccall=B;b.cwrap=function(a,c,d,e){d=d||[];var f=d.every(function(g){return"number"===g});return"string"!==c&&f&&!e?A(a):function(){return B(a,c,d,arguments,e)}};b.stringToNewUTF8=W;var Y;R=function va(){Y||Z();Y||(R=va)};
function Z(){function a(){if(!Y&&(Y=!0,b.calledRun=!0,!z)){V(fa);V(ha);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();ia.unshift(c)}V(ia)}}if(!(0<P)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)ja();V(ea);0<P||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=Z;
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();Z();
return Module.ready
}
);
})();
export default Module;