7 lines
334 KiB
JavaScript
7 lines
334 KiB
JavaScript
|
/*
|
||
|
gifsicle-wasm-browser
|
||
|
version: v1.5.16
|
||
|
authors: https://github.com/renzhezhilu/gifsicle-wasm-browser
|
||
|
license: MIT
|
||
|
*/
|
||
|
let gifsicle={tool:{workerLocalUrl:'var gifsicle=function(){Me="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Me=Me||__filename);var Me,c=function(e){var j,r,h=void 0!==(e=e||{})?e:{},t=(h.ready=new Promise(function(e,r){j=e}),h.preRun=h.preRun||[],h.preRun.push(function(){if(h.folder&&h.folder.length)for(let e=0;e<h.folder.length;e++){var r=h.folder[e];T.mkdir(r)}T.mkdir("/tem"),T.mkdir("/out");var t=h.input;for(let e=0;e<t.length;e++){var n=t[e];T.writeFile("/"+n.name,new Uint8Array(n.file))}}),h.postRun=h.postRun||[],h.postRun.push(function(){let r=[],t=T.readdir("/out");t.splice(0,2);for(let e=0;e<t.length;e++){var n=t[e],o=T.readFile("/out/"+n);r.push({file:o,name:n})}h.output(r)}),{});for(r in h)h.hasOwnProperty(r)&&(t[r]=h[r]);var n,o,i,O,a=[],C="./this.program",u=function(e,r){throw r},L=!1,c=!1,L="object"==typeof window,c="function"==typeof importScripts,s="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,I=!L&&!s&&!c,f="";s?(f=c?require("path").dirname(f)+"/":__dirname+"/",n=function(e,r){return i=i||require("fs"),e=(O=O||require("path")).normalize(e),i.readFileSync(e,r?null:"utf8")},o=function(e){e=n(e,!0);return H((e=e.buffer?e:new Uint8Array(e)).buffer),e},1<process.argv.length&&(C=process.argv[1].replace(/\\\\/g,"/")),a=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof Fe))throw e}),process.on("unhandledRejection",D),u=function(e){process.exit(e)},h.inspect=function(){return"[Emscripten Module object]"}):I?("undefined"!=typeof read&&(n=function(e){return read(e)}),o=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(H("object"==typeof(e=read(e,"binary"))),e)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(u=function(e){quit(e)}),"undefined"!=typeof print&&((console="undefined"==typeof console?{}:console).log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(L||c)&&(c?f=self.location.href:document.currentScript&&(f=document.currentScript.src),f=0!==(f=Me?Me:f).indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",n=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},c&&(o=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}));var l,d,p,m=h.print||console.log.bind(console),w=h.printErr||console.warn.bind(console);for(r in t)t.hasOwnProperty(r)&&(h[r]=t[r]);t=null,h.arguments&&(a=h.arguments),h.thisProgram&&(C=h.thisProgram),h.quit&&(u=h.quit),h.wasmBinary&&(l=h.wasmBinary),h.noExitRuntime&&(d=h.noExitRuntime),"object"!=typeof WebAssembly&&w("no native wasm support detected");var I=new WebAssembly.Table({initial:64,maximum:64,element:"anyfunc"}),U=!1;function H(e,r){e||D("Assertion failed: "+r)}var q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(e,r,t){for(var n=r+t,o=r;e[o]&&!(n<=o);)++o;if(16<o-r&&e.subarray&&q)return q.decode(e.subarray(r,o));for(var i="";r<o;){var a,s,u=e[r++];128&u?(s=63&e[r++],192==(224&u)?i+=String.fromCharCode((31&u)<<6|s):(a=63&e[r++],(u=224==(240&u)?(15&u)<<12|s<<6|a:(7&u)<<18|s<<12|a<<6|63&e[r++])<65536?i+=String.fromCharCode(u):(s=u-65536,i+=String.fromCharCode(55296|s>>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function W(e,r){return e?g(E,e,r):""}function X(e,r,t,n){if(!(0<n))return 0;for(var o=t,i=t+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if((s=55296<=s&&s<=57343?65536+((1023&s)<<10)|1023&e.charCodeAt(++a):s)<=127){if(i<=t)break;r[t++]=s}else if(s<=2047){if(i<=t+1)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function G(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);(n=55296<=n&&n<=57343?65536+((1023&n)<<10)|1023&e.charCodeAt(++t):n)<=127?++r:r+=n<=2047?
|