Files
squoosh/codecs/webp/dec/webp_dec.js
Ingvar Stepanyan de543b3206 Further speed improvements
- Store Emscripten cache inside node_modules/.em_cache. Docker image ships without LTO libs, so Emscripten has to rebuild stdlibs on every build otherwise.
 - Merge webp_enc + webp_dec build scripts. Core libwebp library is same in both cases, so there's no point in storing and building two copies of it.
2020-05-13 19:39:27 +01:00

79 lines
26 KiB
JavaScript

var webp_dec = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(webp_dec) {
webp_dec = webp_dec || {};
var e;e||(e=typeof webp_dec !== 'undefined' ? webp_dec : {});var r={},w;for(w in e)e.hasOwnProperty(w)&&(r[w]=e[w]);var aa=!1,z=!1,ba=!1,ca=!1;aa="object"===typeof window;z="function"===typeof importScripts;ba="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node;ca=!aa&&!ba&&!z;var A="",da,B,ea,ha;
if(ba)A=z?require("path").dirname(A)+"/":__dirname+"/",da=function(a,b){ea||(ea=require("fs"));ha||(ha=require("path"));a=ha.normalize(a);return ea.readFileSync(a,b?null:"utf8")},B=function(a){a=da(a,!0);a.buffer||(a=new Uint8Array(a));a.buffer||D("Assertion failed: undefined");return a},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(a){throw a;}),process.on("unhandledRejection",D),e.inspect=function(){return"[Emscripten Module object]"};
else if(ca)"undefined"!=typeof read&&(da=function(a){return read(a)}),B=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");"object"===typeof a||D("Assertion failed: undefined");return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(aa||z)z?A=self.location.href:document.currentScript&&(A=document.currentScript.src),_scriptDir&&
(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.lastIndexOf("/")+1):A="",da=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},z&&(B=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});var ia=e.print||console.log.bind(console),E=e.printErr||console.warn.bind(console);for(w in r)r.hasOwnProperty(w)&&(e[w]=r[w]);r=null;var F;e.wasmBinary&&(F=e.wasmBinary);var noExitRuntime;
e.noExitRuntime&&(noExitRuntime=e.noExitRuntime);"object"!==typeof WebAssembly&&E("no native wasm support detected");var G,ja=new WebAssembly.Table({initial:138,maximum:138,element:"anyfunc"}),ka=!1,la="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function ma(a,b,c){var d=H;if(0<c){c=b+c-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var q=a.charCodeAt(++f);g=65536+((g&1023)<<10)|q&1023}if(127>=g){if(b>=c)break;d[b++]=g}else{if(2047>=g){if(b+1>=c)break;d[b++]=192|g>>6}else{if(65535>=g){if(b+2>=c)break;d[b++]=224|g>>12}else{if(b+3>=c)break;d[b++]=240|g>>18;d[b++]=128|g>>12&63}d[b++]=128|g>>6&63}d[b++]=128|g&63}}d[b]=0}}var na="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;
function oa(a){var b;for(b=a>>1;I[b];)++b;b<<=1;if(32<b-a&&na)return na.decode(H.subarray(a,b));b=0;for(var c="";;){var d=I[a+2*b>>1];if(0==d)return c;++b;c+=String.fromCharCode(d)}}function pa(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var f=0;f<c;++f)I[b>>1]=a.charCodeAt(f),b+=2;I[b>>1]=0;return b-d}function qa(a){return 2*a.length}
function ra(a){for(var b=0,c="";;){var d=J[a+4*b>>2];if(0==d)return c;++b;65536<=d?(d-=65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023)):c+=String.fromCharCode(d)}}function sa(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var d=b;c=d+c-4;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var q=a.charCodeAt(++f);g=65536+((g&1023)<<10)|q&1023}J[b>>2]=g;b+=4;if(b+4>c)break}J[b>>2]=0;return b-d}
function ta(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&++c;b+=4}return b}var K,ua,H,I,va,J,L,wa,xa;function ya(a){K=a;e.HEAP8=ua=new Int8Array(a);e.HEAP16=I=new Int16Array(a);e.HEAP32=J=new Int32Array(a);e.HEAPU8=H=new Uint8Array(a);e.HEAPU16=va=new Uint16Array(a);e.HEAPU32=L=new Uint32Array(a);e.HEAPF32=wa=new Float32Array(a);e.HEAPF64=xa=new Float64Array(a)}var za=e.INITIAL_MEMORY||16777216;e.wasmMemory?G=e.wasmMemory:G=new WebAssembly.Memory({initial:za/65536});
G&&(K=G.buffer);za=K.byteLength;ya(K);J[3336]=5256384;function Aa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var c=b.ka;"number"===typeof c?void 0===b.ba?e.dynCall_v(c):e.dynCall_vi(c,b.ba):c(void 0===b.ba?null:b.ba)}}}var Ba=[],Ca=[],Da=[],Ea=[];function Fa(){var a=e.preRun.shift();Ba.unshift(a)}var M=0,Ga=null,N=null;e.preloadedImages={};e.preloadedAudios={};
function D(a){if(e.onAbort)e.onAbort(a);ia(a);E(a);ka=!0;throw new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");}function Ha(){var a=O;return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet-stream;base64,")}var O="webp_dec.wasm";if(!Ha()){var Ia=O;O=e.locateFile?e.locateFile(Ia,A):A+Ia}
function Ja(){try{if(F)return new Uint8Array(F);if(B)return B(O);throw"both async and sync fetching of the wasm failed";}catch(a){D(a)}}function Ka(){return F||!aa&&!z||"function"!==typeof fetch?new Promise(function(a){a(Ja())}):fetch(O,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+O+"'";return a.arrayBuffer()}).catch(function(){return Ja()})}Ca.push({ka:function(){La()}});function Ma(){return 0<Ma.X}
function Na(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var Oa=void 0;function P(a){for(var b="";H[a];)b+=Oa[H[a++]];return b}var Q={},R={},Pa={};function Qa(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}
function Ra(a,b){a=Qa(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)}function Sa(a){var b=Error,c=Ra(a,function(d){this.name=a;this.message=d;d=Error(d).stack;void 0!==d&&(this.stack=this.toString()+"\n"+d.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}
var Ta=void 0;function S(a){throw new Ta(a);}var Ua=void 0;function Va(a){throw new Ua(a);}function Wa(a,b,c){function d(h){h=c(h);h.length!==a.length&&Va("Mismatched type converter count");for(var l=0;l<a.length;++l)T(a[l],h[l])}a.forEach(function(h){Pa[h]=b});var f=Array(b.length),g=[],q=0;b.forEach(function(h,l){R.hasOwnProperty(h)?f[l]=R[h]:(g.push(h),Q.hasOwnProperty(h)||(Q[h]=[]),Q[h].push(function(){f[l]=R[h];++q;q===g.length&&d(f)}))});0===g.length&&d(f)}
function T(a,b,c){c=c||{};if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var d=b.name;a||S('type "'+d+'" must have a positive integer typeid pointer');if(R.hasOwnProperty(a)){if(c.na)return;S("Cannot register type '"+d+"' twice")}R[a]=b;delete Pa[a];Q.hasOwnProperty(a)&&(b=Q[a],delete Q[a],b.forEach(function(f){f()}))}function Xa(a){return{count:a.count,W:a.W,Y:a.Y,L:a.L,N:a.N,O:a.O,P:a.P}}
function Ya(a){S(a.K.N.M.name+" instance already deleted")}var Za=!1;function $a(){}function ab(a){--a.count.value;0===a.count.value&&(a.O?a.P.V(a.O):a.N.M.V(a.L))}function bb(a){if("undefined"===typeof FinalizationGroup)return bb=function(b){return b},a;Za=new FinalizationGroup(function(b){for(var c=b.next();!c.done;c=b.next())c=c.value,c.L?ab(c):console.warn("object already deleted: "+c.L)});bb=function(b){Za.register(b,b.K,b.K);return b};$a=function(b){Za.unregister(b.K)};return bb(a)}
var cb=void 0,db=[];function eb(){for(;db.length;){var a=db.pop();a.K.W=!1;a["delete"]()}}function U(){}var fb={};function gb(a,b){var c=e;if(void 0===c[a].S){var d=c[a];c[a]=function(){c[a].S.hasOwnProperty(arguments.length)||S("Function '"+b+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+c[a].S+")!");return c[a].S[arguments.length].apply(this,arguments)};c[a].S=[];c[a].S[d.ha]=d}}
function hb(a,b,c){e.hasOwnProperty(a)?((void 0===c||void 0!==e[a].S&&void 0!==e[a].S[c])&&S("Cannot register public name '"+a+"' twice"),gb(a,a),e.hasOwnProperty(c)&&S("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),e[a].S[c]=b):(e[a]=b,void 0!==c&&(e[a].ta=c))}function ib(a,b,c,d,f,g,q,h){this.name=a;this.constructor=b;this.U=c;this.V=d;this.R=f;this.la=g;this.Z=q;this.ja=h}
function jb(a,b,c){for(;b!==c;)b.Z||S("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.Z(a),b=b.R;return a}function kb(a,b){if(null===b)return this.da&&S("null is not a valid "+this.name),0;b.K||S('Cannot pass "'+V(b)+'" as a '+this.name);b.K.L||S("Cannot pass deleted object as a pointer of type "+this.name);return jb(b.K.L,b.K.N.M,this.M)}
function lb(a,b){if(null===b){this.da&&S("null is not a valid "+this.name);if(this.aa){var c=this.pa();null!==a&&a.push(this.V,c);return c}return 0}b.K||S('Cannot pass "'+V(b)+'" as a '+this.name);b.K.L||S("Cannot pass deleted object as a pointer of type "+this.name);!this.$&&b.K.N.$&&S("Cannot convert argument of type "+(b.K.P?b.K.P.name:b.K.N.name)+" to parameter type "+this.name);c=jb(b.K.L,b.K.N.M,this.M);if(this.aa)switch(void 0===b.K.O&&S("Passing raw pointer to smart pointer is illegal"),this.ra){case 0:b.K.P===
this?c=b.K.O:S("Cannot convert argument of type "+(b.K.P?b.K.P.name:b.K.N.name)+" to parameter type "+this.name);break;case 1:c=b.K.O;break;case 2:if(b.K.P===this)c=b.K.O;else{var d=b.clone();c=this.qa(c,mb(function(){d["delete"]()}));null!==a&&a.push(this.V,c)}break;default:S("Unsupporting sharing policy")}return c}
function nb(a,b){if(null===b)return this.da&&S("null is not a valid "+this.name),0;b.K||S('Cannot pass "'+V(b)+'" as a '+this.name);b.K.L||S("Cannot pass deleted object as a pointer of type "+this.name);b.K.N.$&&S("Cannot convert argument of type "+b.K.N.name+" to parameter type "+this.name);return jb(b.K.L,b.K.N.M,this.M)}function pb(a){return this.fromWireType(L[a>>2])}function qb(a,b,c){if(b===c)return a;if(void 0===c.R)return null;a=qb(a,b,c.R);return null===a?null:c.ja(a)}var rb={};
function sb(a,b){for(void 0===b&&S("ptr should not be undefined");a.R;)b=a.Z(b),a=a.R;return rb[b]}function tb(a,b){b.N&&b.L||Va("makeClassHandle requires ptr and ptrType");!!b.P!==!!b.O&&Va("Both smartPtrType and smartPtr must be specified");b.count={value:1};return bb(Object.create(a,{K:{value:b}}))}function W(a,b,c,d){this.name=a;this.M=b;this.da=c;this.$=d;this.aa=!1;this.V=this.qa=this.pa=this.ga=this.ra=this.oa=void 0;void 0!==b.R?this.toWireType=lb:(this.toWireType=d?kb:nb,this.T=null)}
function ub(a,b,c){e.hasOwnProperty(a)||Va("Replacing nonexistant public symbol");void 0!==e[a].S&&void 0!==c?e[a].S[c]=b:(e[a]=b,e[a].ha=c)}
function X(a,b){a=P(a);var c=e["dynCall_"+a];for(var d=[],f=1;f<a.length;++f)d.push("a"+f);f="return function dynCall_"+(a+"_"+b)+"("+d.join(", ")+") {\n";f+=" return dynCall(rawFunction"+(d.length?", ":"")+d.join(", ")+");\n";c=(new Function("dynCall","rawFunction",f+"};\n"))(c,b);"function"!==typeof c&&S("unknown function pointer with signature "+a+": "+b);return c}var vb=void 0;function wb(a){a=xb(a);var b=P(a);Y(a);return b}
function yb(a,b){function c(g){f[g]||R[g]||(Pa[g]?Pa[g].forEach(c):(d.push(g),f[g]=!0))}var d=[],f={};b.forEach(c);throw new vb(a+": "+d.map(wb).join([", "]));}function zb(a){for(;a.length;){var b=a.pop();a.pop()(b)}}function Ab(a,b,c){a instanceof Object||S(c+' with invalid "this": '+a);a instanceof b.M.constructor||S(c+' incompatible with "this" of type '+a.constructor.name);a.K.L||S("cannot call emscripten binding method "+c+" on deleted object");return jb(a.K.L,a.K.N.M,b.M)}
var Bb=[],Z=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Cb(a){4<a&&0===--Z[a].ea&&(Z[a]=void 0,Bb.push(a))}function mb(a){switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Bb.length?Bb.pop():Z.length;Z[b]={ea:1,value:a};return b}}function V(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}
function Db(a,b){switch(b){case 2:return function(c){return this.fromWireType(wa[c>>2])};case 3:return function(c){return this.fromWireType(xa[c>>3])};default:throw new TypeError("Unknown float type: "+a);}}function Eb(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Ra(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}
function Fb(a,b){for(var c=[],d=0;d<a;d++)c.push(J[(b>>2)+d]);return c}function Gb(a,b,c){switch(b){case 0:return c?function(d){return ua[d]}:function(d){return H[d]};case 1:return c?function(d){return I[d>>1]}:function(d){return va[d>>1]};case 2:return c?function(d){return J[d>>2]}:function(d){return L[d>>2]};default:throw new TypeError("Unknown integer type: "+a);}}for(var Hb=Array(256),Ib=0;256>Ib;++Ib)Hb[Ib]=String.fromCharCode(Ib);Oa=Hb;Ta=e.BindingError=Sa("BindingError");
Ua=e.InternalError=Sa("InternalError");U.prototype.isAliasOf=function(a){if(!(this instanceof U&&a instanceof U))return!1;var b=this.K.N.M,c=this.K.L,d=a.K.N.M;for(a=a.K.L;b.R;)c=b.Z(c),b=b.R;for(;d.R;)a=d.Z(a),d=d.R;return b===d&&c===a};U.prototype.clone=function(){this.K.L||Ya(this);if(this.K.Y)return this.K.count.value+=1,this;var a=bb(Object.create(Object.getPrototypeOf(this),{K:{value:Xa(this.K)}}));a.K.count.value+=1;a.K.W=!1;return a};
U.prototype["delete"]=function(){this.K.L||Ya(this);this.K.W&&!this.K.Y&&S("Object already scheduled for deletion");$a(this);ab(this.K);this.K.Y||(this.K.O=void 0,this.K.L=void 0)};U.prototype.isDeleted=function(){return!this.K.L};U.prototype.deleteLater=function(){this.K.L||Ya(this);this.K.W&&!this.K.Y&&S("Object already scheduled for deletion");db.push(this);1===db.length&&cb&&cb(eb);this.K.W=!0;return this};W.prototype.ma=function(a){this.ga&&(a=this.ga(a));return a};
W.prototype.fa=function(a){this.V&&this.V(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=pb;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()};
W.prototype.fromWireType=function(a){function b(){return this.aa?tb(this.M.U,{N:this.oa,L:c,P:this,O:a}):tb(this.M.U,{N:this,L:a})}var c=this.ma(a);if(!c)return this.fa(a),null;var d=sb(this.M,c);if(void 0!==d){if(0===d.K.count.value)return d.K.L=c,d.K.O=a,d.clone();d=d.clone();this.fa(a);return d}d=this.M.la(c);d=fb[d];if(!d)return b.call(this);d=this.$?d.ia:d.pointerType;var f=qb(c,this.M,d.M);return null===f?b.call(this):this.aa?tb(d.M.U,{N:d,L:f,P:this,O:a}):tb(d.M.U,{N:d,L:f})};
e.getInheritedInstanceCount=function(){return Object.keys(rb).length};e.getLiveInheritedInstances=function(){var a=[],b;for(b in rb)rb.hasOwnProperty(b)&&a.push(rb[b]);return a};e.flushPendingDeletes=eb;e.setDelayFunction=function(a){cb=a;db.length&&cb&&cb(eb)};vb=e.UnboundTypeError=Sa("UnboundTypeError");e.count_emval_handles=function(){for(var a=0,b=5;b<Z.length;++b)void 0!==Z[b]&&++a;return a};e.get_first_emval=function(){for(var a=5;a<Z.length;++a)if(void 0!==Z[a])return Z[a];return null};
var Kb={n:function(a){return Jb(a)},m:function(a){"uncaught_exception"in Ma?Ma.X++:Ma.X=1;throw a;},k:function(a,b,c,d,f){var g=Na(c);b=P(b);T(a,{name:b,fromWireType:function(q){return!!q},toWireType:function(q,h){return h?d:f},argPackAdvance:8,readValueFromPointer:function(q){if(1===c)var h=ua;else if(2===c)h=I;else if(4===c)h=J;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(h[q>>g])},T:null})},o:function(a,b,c,d,f,g,q,h,l,m,k,p,t){k=P(k);g=X(f,g);h&&(h=X(q,h));
m&&(m=X(l,m));t=X(p,t);var v=Qa(k);hb(v,function(){yb("Cannot construct "+k+" due to unbound types",[d])});Wa([a,b,c],d?[d]:[],function(n){n=n[0];if(d){var u=n.M;var x=u.U}else x=U.prototype;n=Ra(v,function(){if(Object.getPrototypeOf(this)!==y)throw new Ta("Use 'new' to construct "+k);if(void 0===C.X)throw new Ta(k+" has no accessible constructor");var ob=C.X[arguments.length];if(void 0===ob)throw new Ta("Tried to invoke ctor of "+k+" with invalid number of parameters ("+arguments.length+") - expected ("+
Object.keys(C.X).toString()+") parameters instead!");return ob.apply(this,arguments)});var y=Object.create(x,{constructor:{value:n}});n.prototype=y;var C=new ib(k,n,y,t,u,g,h,m);u=new W(k,C,!0,!1);x=new W(k+"*",C,!1,!1);var fa=new W(k+" const*",C,!1,!0);fb[a]={pointerType:x,ia:fa};ub(v,n);return[u,x,fa]})},e:function(a,b,c,d,f,g,q,h,l,m){b=P(b);f=X(d,f);Wa([],[a],function(k){k=k[0];var p=k.name+"."+b,t={get:function(){yb("Cannot access "+p+" due to unbound types",[c,q])},enumerable:!0,configurable:!0};
l?t.set=function(){yb("Cannot access "+p+" due to unbound types",[c,q])}:t.set=function(){S(p+" is a read-only property")};Object.defineProperty(k.M.U,b,t);Wa([],l?[c,q]:[c],function(v){var n=v[0],u={get:function(){var y=Ab(this,k,p+" getter");return n.fromWireType(f(g,y))},enumerable:!0};if(l){l=X(h,l);var x=v[1];u.set=function(y){var C=Ab(this,k,p+" setter"),fa=[];l(m,C,x.toWireType(fa,y));zb(fa)}}Object.defineProperty(k.M.U,b,u);return[]});return[]})},q:function(a,b){b=P(b);T(a,{name:b,fromWireType:function(c){var d=
Z[c].value;Cb(c);return d},toWireType:function(c,d){return mb(d)},argPackAdvance:8,readValueFromPointer:pb,T:null})},h:function(a,b,c){c=Na(c);b=P(b);T(a,{name:b,fromWireType:function(d){return d},toWireType:function(d,f){if("number"!==typeof f&&"boolean"!==typeof f)throw new TypeError('Cannot convert "'+V(f)+'" to '+this.name);return f},argPackAdvance:8,readValueFromPointer:Db(b,c),T:null})},d:function(a,b,c,d,f,g){var q=Fb(b,c);a=P(a);f=X(d,f);hb(a,function(){yb("Cannot call "+a+" due to unbound types",
q)},b-1);Wa([],q,function(h){var l=[h[0],null].concat(h.slice(1)),m=h=a,k=f,p=l.length;2>p&&S("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var t=null!==l[1]&&!1,v=!1,n=1;n<l.length;++n)if(null!==l[n]&&void 0===l[n].T){v=!0;break}var u="void"!==l[0].name,x="",y="";for(n=0;n<p-2;++n)x+=(0!==n?", ":"")+"arg"+n,y+=(0!==n?", ":"")+"arg"+n+"Wired";m="return function "+Qa(m)+"("+x+") {\nif (arguments.length !== "+(p-2)+") {\nthrowBindingError('function "+m+" called with ' + arguments.length + ' arguments, expected "+
(p-2)+" args!');\n}\n";v&&(m+="var destructors = [];\n");var C=v?"destructors":"null";x="throwBindingError invoker fn runDestructors retType classParam".split(" ");k=[S,k,g,zb,l[0],l[1]];t&&(m+="var thisWired = classParam.toWireType("+C+", this);\n");for(n=0;n<p-2;++n)m+="var arg"+n+"Wired = argType"+n+".toWireType("+C+", arg"+n+"); // "+l[n+2].name+"\n",x.push("argType"+n),k.push(l[n+2]);t&&(y="thisWired"+(0<y.length?", ":"")+y);m+=(u?"var rv = ":"")+"invoker(fn"+(0<y.length?", ":"")+y+");\n";if(v)m+=
"runDestructors(destructors);\n";else for(n=t?1:2;n<l.length;++n)p=1===n?"thisWired":"arg"+(n-2)+"Wired",null!==l[n].T&&(m+=p+"_dtor("+p+"); // "+l[n].name+"\n",x.push(p+"_dtor"),k.push(l[n].T));u&&(m+="var ret = retType.fromWireType(rv);\nreturn ret;\n");x.push(m+"}\n");l=Eb(x).apply(null,k);ub(h,l,b-1);return[]})},b:function(a,b,c,d,f){function g(m){return m}b=P(b);-1===f&&(f=4294967295);var q=Na(c);if(0===d){var h=32-8*c;g=function(m){return m<<h>>>h}}var l=-1!=b.indexOf("unsigned");T(a,{name:b,
fromWireType:g,toWireType:function(m,k){if("number"!==typeof k&&"boolean"!==typeof k)throw new TypeError('Cannot convert "'+V(k)+'" to '+this.name);if(k<d||k>f)throw new TypeError('Passing a number "'+V(k)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+d+", "+f+"]!");return l?k>>>0:k|0},argPackAdvance:8,readValueFromPointer:Gb(b,q,0!==d),T:null})},a:function(a,b,c){function d(g){g>>=2;var q=L;return new f(K,q[g+1],q[g])}var f=[Int8Array,Uint8Array,
Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=P(c);T(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{na:!0})},i:function(a,b){b=P(b);var c="std::string"===b;T(a,{name:b,fromWireType:function(d){var f=L[d>>2];if(c){var g=H[d+4+f],q=0;0!=g&&(q=g,H[d+4+f]=0);var h=d+4;for(g=0;g<=f;++g){var l=d+4+g;if(0==H[l]){if(h){for(var m=H,k=h+NaN,p=h;m[p]&&!(p>=k);)++p;if(16<p-h&&m.subarray&&la)h=la.decode(m.subarray(h,p));else{for(k="";h<p;){var t=m[h++];if(t&
128){var v=m[h++]&63;if(192==(t&224))k+=String.fromCharCode((t&31)<<6|v);else{var n=m[h++]&63;t=224==(t&240)?(t&15)<<12|v<<6|n:(t&7)<<18|v<<12|n<<6|m[h++]&63;65536>t?k+=String.fromCharCode(t):(t-=65536,k+=String.fromCharCode(55296|t>>10,56320|t&1023))}}else k+=String.fromCharCode(t)}h=k}}else h="";if(void 0===u)var u=h;else u+=String.fromCharCode(0),u+=h;h=l+1}}0!=q&&(H[d+4+f]=q)}else{u=Array(f);for(g=0;g<f;++g)u[g]=String.fromCharCode(H[d+4+g]);u=u.join("")}Y(d);return u},toWireType:function(d,f){f instanceof
ArrayBuffer&&(f=new Uint8Array(f));var g="string"===typeof f;g||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Int8Array||S("Cannot pass non-string to std::string");var q=(c&&g?function(){for(var m=0,k=0;k<f.length;++k){var p=f.charCodeAt(k);55296<=p&&57343>=p&&(p=65536+((p&1023)<<10)|f.charCodeAt(++k)&1023);127>=p?++m:m=2047>=p?m+2:65535>=p?m+3:m+4}return m}:function(){return f.length})(),h=Jb(4+q+1);L[h>>2]=q;if(c&&g)ma(f,h+4,q+1);else if(g)for(g=0;g<q;++g){var l=f.charCodeAt(g);
255<l&&(Y(h),S("String has UTF-16 code units that do not fit in 8 bits"));H[h+4+g]=l}else for(g=0;g<q;++g)H[h+4+g]=f[g];null!==d&&d.push(Y,h);return h},argPackAdvance:8,readValueFromPointer:pb,T:function(d){Y(d)}})},f:function(a,b,c){c=P(c);if(2===b){var d=oa;var f=pa;var g=qa;var q=function(){return va};var h=1}else 4===b&&(d=ra,f=sa,g=ta,q=function(){return L},h=2);T(a,{name:c,fromWireType:function(l){var m=L[l>>2],k=q(),p=k[l+4+m*b>>h],t=0;0!=p&&(t=p,k[l+4+m*b>>h]=0);var v=l+4;for(p=0;p<=m;++p){var n=
l+4+p*b;if(0==k[n>>h]){v=d(v);if(void 0===u)var u=v;else u+=String.fromCharCode(0),u+=v;v=n+b}}0!=t&&(k[l+4+m*b>>h]=t);Y(l);return u},toWireType:function(l,m){"string"!==typeof m&&S("Cannot pass non-string to C++ string type "+c);var k=g(m),p=Jb(4+k+b);L[p>>2]=k>>h;f(m,p+4,k+b);null!==l&&l.push(Y,p);return p},argPackAdvance:8,readValueFromPointer:pb,T:function(l){Y(l)}})},l:function(a,b){b=P(b);T(a,{sa:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},g:Cb,r:function(a){4<
a&&(Z[a].ea+=1)},j:function(a,b){var c=R[a];void 0===c&&S("_emval_take_value has unknown type "+wb(a));a=c.readValueFromPointer(b);return mb(a)},p:function(a,b,c){H.copyWithin(a,b,b+c)},c:function(a){var b=H.length;if(2147418112<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(16777216,a,d);0<d%65536&&(d+=65536-d%65536);a:{try{G.grow(Math.min(2147418112,d)-K.byteLength+65535>>16);ya(G.buffer);var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},memory:G,
table:ja},Lb=function(){function a(f){e.asm=f.exports;M--;e.monitorRunDependencies&&e.monitorRunDependencies(M);0==M&&(null!==Ga&&(clearInterval(Ga),Ga=null),N&&(f=N,N=null,f()))}function b(f){a(f.instance)}function c(f){return Ka().then(function(g){return WebAssembly.instantiate(g,d)}).then(f,function(g){E("failed to asynchronously prepare wasm: "+g);D(g)})}var d={a:Kb};M++;e.monitorRunDependencies&&e.monitorRunDependencies(M);if(e.instantiateWasm)try{return e.instantiateWasm(d,a)}catch(f){return E("Module.instantiateWasm callback failed with error: "+
f),!1}(function(){if(F||"function"!==typeof WebAssembly.instantiateStreaming||Ha()||"function"!==typeof fetch)return c(b);fetch(O,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(b,function(g){E("wasm streaming compile failed: "+g);E("falling back to ArrayBuffer instantiation");c(b)})})})();return{}}();e.asm=Lb;
var La=e.___wasm_call_ctors=function(){return(La=e.___wasm_call_ctors=e.asm.s).apply(null,arguments)},Y=e._free=function(){return(Y=e._free=e.asm.t).apply(null,arguments)},Jb=e._malloc=function(){return(Jb=e._malloc=e.asm.u).apply(null,arguments)},xb=e.___getTypeName=function(){return(xb=e.___getTypeName=e.asm.v).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.w).apply(null,arguments)};
e.dynCall_ii=function(){return(e.dynCall_ii=e.asm.x).apply(null,arguments)};e.dynCall_vi=function(){return(e.dynCall_vi=e.asm.y).apply(null,arguments)};e.dynCall_iii=function(){return(e.dynCall_iii=e.asm.z).apply(null,arguments)};e.dynCall_viii=function(){return(e.dynCall_viii=e.asm.A).apply(null,arguments)};e.dynCall_vii=function(){return(e.dynCall_vii=e.asm.B).apply(null,arguments)};e.dynCall_i=function(){return(e.dynCall_i=e.asm.C).apply(null,arguments)};
e.dynCall_v=function(){return(e.dynCall_v=e.asm.D).apply(null,arguments)};e.dynCall_iiii=function(){return(e.dynCall_iiii=e.asm.E).apply(null,arguments)};e.dynCall_iiiiiii=function(){return(e.dynCall_iiiiiii=e.asm.F).apply(null,arguments)};e.dynCall_viiii=function(){return(e.dynCall_viiii=e.asm.G).apply(null,arguments)};e.dynCall_viiiii=function(){return(e.dynCall_viiiii=e.asm.H).apply(null,arguments)};e.dynCall_viiiiiiiii=function(){return(e.dynCall_viiiiiiiii=e.asm.I).apply(null,arguments)};
e.dynCall_viiiiii=function(){return(e.dynCall_viiiiii=e.asm.J).apply(null,arguments)};e.asm=Lb;var Mb;e.then=function(a){if(Mb)a(e);else{var b=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){b&&b();a(e)}}return e};N=function Nb(){Mb||Ob();Mb||(N=Nb)};
function Ob(){function a(){if(!Mb&&(Mb=!0,e.calledRun=!0,!ka)){Aa(Ca);Aa(Da);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();Ea.unshift(b)}Aa(Ea)}}if(!(0<M)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)Fa();Aa(Ba);0<M||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1);a()},1)):a())}}
e.run=Ob;if(e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();noExitRuntime=!0;Ob();
return webp_dec
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = webp_dec;
else if (typeof define === 'function' && define['amd'])
define([], function() { return webp_dec; });
else if (typeof exports === 'object')
exports["webp_dec"] = webp_dec;