diff --git "a/js/download-project.efef1c6a61576f035d6e.worker.js" "b/js/download-project.efef1c6a61576f035d6e.worker.js" new file mode 100644--- /dev/null +++ "b/js/download-project.efef1c6a61576f035d6e.worker.js" @@ -0,0 +1,18 @@ + +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,f=[],h=!1,c=-1;function l(){h&&u&&(h=!1,u.length?f=u.concat(f):c=-1,f.length&&d())}function d(){if(!h){var t=o(l);h=!0;for(var e=f.length;e;){for(u=f,f=[];++c1)for(var r=1;rt.replace(/\?token=[^&#]+/,"?token=x"))(t)}`),this.name="HTTPError",this.url=t,this.status=e}}class l extends Error{constructor(t){super(t),this.name="CanNotAccessProjectError"}}class d extends Error{constructor(t){super(t||"The operation was aborted."),this.name="AbortError"}}let p=0;const m=[],g=()=>{p--,y()},y=()=>{if(p<100){const t=(()=>{for(;;){if(0===m.length)return null;const t=m.shift(),e=t[2];if(!(e&&e.signal&&e.signal.aborted))return t}})();t&&(p++,(([t,e,r])=>{let n,i=0;const s=()=>f.default(e,r).then(t=>{if(t.ok)return t.arrayBuffer();throw new c(e,t.status)}).then(t=>(g(),t)).catch(t=>{if(t&&"AbortError"===t.name)throw g(),t;if(console.warn(`Attempt to fetch ${e} failed`,t),n||(n=t),i<3)return i++,new Promise(t=>setTimeout(t,5e3*(i+Math.random()-1))).then(s);throw g(),new Error(`Failed to fetch ${e}: ${n}`)});t(s())})(t))}},_=(t,e)=>new Promise(r=>{m.push([r,t,e]),y()}),b=t=>Object.assign({assetHost:"https://assets.scratch.mit.edu/internalapi/asset/$id/get/"},t||{}),w=t=>{if(t.signal&&t.signal.aborted)throw new d},v=async(t,e,r)=>{if(r.processJSON){const n=await r.processJSON(t,e);n&&(e=n),w(r)}return h.stringify(e)},k=t=>{const e=[];for(const r of t)if(Array.isArray(r))for(const t of r)e.push(t);else e.push(r);return e},E=async(t,e,r)=>{const n=["svg","png","jpg","gif","bmp"],i=["wav","mp3"],s=new u.default;let a=0,o=0;const f=t=>t.split(".")[1]||"",h=[t,...t.children.filter(t=>!t.listName&&!t.target)],c=k(h.map(t=>t.costumes||[])),l=k(h.map(t=>t.sounds||[])),d=await(t=>{const s=new Map,u=t=>(s.has(t)||s.set(t,(t=>{const e=f(t);return n.includes(e)?o++:i.includes(e)?a++:(console.warn("unknown extension: "+e),o++)})(t)),s.get(t));for(const e of t)e.md5&&(e.soundID=u(e.md5)),e.baseLayerMD5&&(e.baseLayerID=u(e.baseLayerMD5)),e.textLayerMD5&&(e.textLayerID=u(e.textLayerMD5));return Promise.all(Array.from(s.entries()).map(([t,n])=>(async(t,n)=>{r.fetching(t);const i=await _(e.assetHost.replace("$id",t)),s=`${n}.${f(t)}`;return r.fetched(t),{path:s,data:i}})(t,n)))})([...c,...l]);s.file("project.json",await v("sb2",t,e));for(const{path:t,data:e}of d)s.file(t,e);return s},x=t=>Object.prototype.hasOwnProperty.call(t,"targets")?"sb3":Object.prototype.hasOwnProperty.call(t,"objName")?"sb2":null,A=(t,e)=>{const r=e.date||new Date("Fri, 31 Dec 2021 00:00:00 GMT");for(const e of Object.values(t.files))e.date=r;return t.generateAsync({type:"arraybuffer",compression:!1!==e.compress?"DEFLATE":"STORE"},t=>{e.onProgress&&e.onProgress("compress",t.percent/100,1)})},S=async(t,e)=>{e=b(e),"string"==typeof t&&(t=h.parse(t));let r=!1,n=null,i=0,s=0;const a=()=>{n||(n=setTimeout(()=>{w(e),n=null,!r&&e.onProgress&&e.onProgress("assets",i,s)}))},o={fetching:()=>{w(e),s++,a()},fetched:()=>{w(e),i++,a()}},f=x(t);let c;if("sb3"===f)c=await(async(t,e,r)=>{const n=new u.default,i=t.targets,s=(t=>{const e=[],r=new Set;for(const n of t){n.md5ext||(n.md5ext=`${n.assetId}.${n.dataFormat}`);const t=n.md5ext;r.has(t)||(r.add(t),e.push(n))}return e})([...k(i.map(t=>t.costumes||[])),...k(i.map(t=>t.sounds||[]))]),a=await Promise.all(s.map(async t=>{const n=t.md5ext;r.fetching(n);const i=await _(e.assetHost.replace("$id",n),{signal:e.signal});return r.fetched(n),{path:n,data:i}}));n.file("project.json",await v("sb3",t,e));for(const{path:t,data:e}of a)n.file(t,e);return n})(t,e,o);else{if("sb2"!==f)throw new Error("Unknown project type: "+f);c=await E(t,e,o)}w(e),e.onProgress&&e.onProgress("assets",s,s),r=!0;const l=await A(c,e);return w(e),{title:"",type:f,arrayBuffer:l}},T=async(t,e)=>{e=b(e),w(e),ArrayBuffer.isView(t)&&(t=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));const r=new Uint8Array(t);if((t=>t[0]==="{".charCodeAt(0))(r)){const r=(new TextDecoder).decode(t);return S(r,e)}if((t=>{for(let e=0;e<"ScratchV".length;e++)if(t[e]!=="ScratchV".charCodeAt(e))return!1;return!0})(r))return{title:"",type:"sb",arrayBuffer:t};let n;try{n=await u.default.loadAsync(t)}catch(t){throw new Error("Cannot parse project: not a zip or sb")}w(e);const i=n.file(/^([^/]*\/)?project\.json$/)[0];if(!i)throw new Error("project.json is missing");const s=await i.async("text"),a=h.parse(s),o=x(a);w(e);let f=!!e.date;if(e.processJSON){const t=await e.processJSON(o,a);t&&(f=!0,n.file(i.name,h.stringify(t)))}return f&&(t=await A(n,e),w(e)),{title:"",type:o,arrayBuffer:t}},C=async(t,e)=>{e=b(e);const r=["https://trampoline.turbowarp.org/api/projects/"+t,"https://trampoline.turbowarp.xyz/api/projects/"+t];let n=null;for(const s of r)try{const r=await f.default(s,{signal:e.signal});if(404===r.status)throw new l(t+" is unshared or does not exist");if(!r.ok)throw new c(s,r.status);return await r.json()}catch(t){if(t instanceof l||(i=t)&&"AbortError"===i.name)throw t;n=t}var i;throw n},O=async(t,e)=>{let r;e=b(e);try{r=await(async(t,e,r)=>{if(e(0),"function"==typeof XMLHttpRequest)return new Promise((n,i)=>{const s=new XMLHttpRequest;s.onload=()=>{200===s.status?(e(1),n(s.response)):i(new c(t,s.status))},s.onerror=()=>{i(new Error(`Failed to fetch ${t}: xhr error`))},s.onabort=()=>{i(new d(`Failed to fetch ${t}: aborted`))},s.onprogress=t=>{t.lengthComputable&&e(t.loaded/t.total)},r&&r.addEventListener("abort",()=>{s.abort()}),s.responseType="arraybuffer",s.open("GET",t),s.send()});const n=await f.default(t);if(200!==n.status)throw new c(t,n.status);const i=+n.headers.get("content-length");if(i){let t=0;n.body.on("data",r=>{"number"==typeof n.body.bytesWritten?e(n.body.bytesWritten/i):(t+=r.length,e(t/i))})}const s=await n.arrayBuffer();return e(1),s})(t,t=>{e.onProgress&&e.onProgress("project",t,1)},e.signal)}catch(t){if(t instanceof c&&404===t.status)throw new l(t.message);throw t}const n=await T(r,e);return n.title=(t=>{const e=t.match(/\/([^\/]+)\.sb[2|3]?$/);return e?e[1]:""})(t),n};e.downloadProjectFromBuffer=T,e.downloadProjectFromID=(t,e)=>(async(t,e,r)=>{(r=b(r)).onProgress&&r.onProgress("metadata",0,1);const n=await C(t,r);r.onProgress&&r.onProgress("metadata",1,1),w(r);const i=n.project_token,s=n.title,a=e+(i?"?token="+i:""),o=await O(a,r);return s&&(o.title=s),o})(t,"https://projects.scratch.mit.edu/"+t,e),e.downloadProjectFromJSON=S,e.downloadProjectFromURL=O,e.getProjectMetadata=C},function(t,e,r){(function(e,r,n,i){t.exports=function t(e,r,n){function i(a,o){if(!r[a]){if(!e[a]){if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[a]={exports:{}};e[a][0].call(f.exports,(function(t){return i(e[a][1][t]||t)}),f,f.exports,t,e,r,n)}return r[a].exports}for(var s=!1,a=0;a>2,o=(3&e)<<4|r>>4,u=1>6:64,f=2>4,r=(15&a)<<4|(o=s.indexOf(t.charAt(f++)))>>2,n=(3&o)<<6|(u=s.indexOf(t.charAt(f++))),l[h++]=e,64!==o&&(l[h++]=r),64!==u&&(l[h++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var s=i,a=0+r;t^=-1;for(var o=0;o>>8^s[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,r,n){var s=i,a=0+r;t^=-1;for(var o=0;o>>8^s[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),a=t("./stream/GenericWorker"),o=n?"uint8array":"array";function u(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(u,a),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,a,h){var c,l,d=t.file,p=t.compression,m=h!==o.utf8encode,g=s.transformTo("string",h(d.name)),y=s.transformTo("string",o.utf8encode(d.name)),_=d.comment,b=s.transformTo("string",h(_)),w=s.transformTo("string",o.utf8encode(_)),v=y.length!==d.name.length,k=w.length!==_.length,E="",x="",A="",S=d.dir,T=d.date,C={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var O=0;e&&(O|=8),m||!v&&!k||(O|=2048);var I=0,R=0;S&&(I|=16),"UNIX"===a?(R=798,I|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(d.unixPermissions,S)):(R=20,I|=function(t){return 63&(t||0)}(d.dosPermissions)),c=T.getUTCHours(),c<<=6,c|=T.getUTCMinutes(),c<<=5,c|=T.getUTCSeconds()/2,l=T.getUTCFullYear()-1980,l<<=4,l|=T.getUTCMonth()+1,l<<=5,l|=T.getUTCDate(),v&&(x=n(1,1)+n(u(g),4)+y,E+="up"+n(x.length,2)+x),k&&(A=n(1,1)+n(u(b),4)+w,E+="uc"+n(A.length,2)+A);var z="";return z+="\n\0",z+=n(O,2),z+=p.magic,z+=n(c,2),z+=n(l,2),z+=n(C.crc32,4),z+=n(C.compressedSize,4),z+=n(C.uncompressedSize,4),z+=n(g.length,2),z+=n(E.length,2),{fileRecord:f.LOCAL_FILE_HEADER+z+g+E,dirRecord:f.CENTRAL_FILE_HEADER+n(R,2)+z+n(b.length,2)+"\0\0\0\0"+n(I,4)+n(i,4)+g+E+b}}var s=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),u=t("../crc32"),f=t("../signature");function h(t,e,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,a),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=i(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return f.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){"use strict";var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new o(t):i.uint8array?new u(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,r,n){"use strict";var i=t("../utils"),s=t("./ConvertWorker"),a=t("./GenericWorker"),o=t("../base64"),u=t("../support"),f=t("../external"),h=null;if(u.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=r,i.checkSupport(n),this._worker=t.pipe(new s(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return function(t,r){return new f.Promise((function(n,s){var a=[],u=t._internalType,f=t._outputType,h=t._mimeType;t.on("data",(function(t,e){a.push(t),r&&r(e)})).on("error",(function(t){a=[],s(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return i.transformTo(t,e)}}(f,function(t,r){var n,i=0,s=null,a=0;for(n=0;n>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,a=t.length,u=new Array(2*a);for(e=r=0;e>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(f,a),f.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}(e),u=e;a!==e.length&&(i.uint8array?(u=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(u=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(u),meta:t.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=f,n.inherits(h,a),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,n){"use strict";var i=t("./support"),s=t("./base64"),a=t("./nodejsUtils"),o=t("./external");function u(t){return t}function f(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,f[n++]=56320|1023&i)}return u(f,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){for(var i=65535&t|0,s=t>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,a=i+r;t^=-1;for(var o=i;o>>8^s[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,r){"use strict";var n,i=t("../utils/common"),s=t("./trees"),a=t("./adler32"),o=t("./crc32"),u=t("./messages"),f=-2,h=258,c=262,l=113;function d(t,e){return t.msg=u[e],e}function p(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function y(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function _(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,u=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,f=t.window,l=t.w_mask,d=t.prev,p=t.strstart+h,m=f[s+a-1],g=f[s+a];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(f[(r=e)+a]===g&&f[r+a-1]===m&&f[r]===f[s]&&f[++r]===f[s+1]){s+=2,r++;do{}while(f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&f[++s]===f[++r]&&su&&0!=--i);return a<=t.lookahead?a:t.lookahead}function v(t){var e,r,n,s,u,f,h,l,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-c)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(f=t.strm,h=t.window,l=t.strstart+t.lookahead,p=void 0,(d=s)<(p=f.avail_in)&&(p=d),r=0===p?0:(f.avail_in-=p,i.arraySet(h,f.input,f.next_in,p,l),1===f.state.wrap?f.adler=a(f.adler,h,p,l):2===f.state.wrap&&(f.adler=o(f.adler,h,p,l)),f.next_in+=p,f.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(v(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)})),new x(4,4,8,4,k),new x(4,5,16,8,k),new x(4,6,32,32,k),new x(4,4,16,16,E),new x(8,16,32,32,E),new x(8,16,128,128,E),new x(8,32,128,256,E),new x(32,128,258,1024,E),new x(32,258,258,4096,E)],r.deflateInit=function(t,e){return C(t,e,8,15,8,0)},r.deflateInit2=C,r.deflateReset=T,r.deflateResetKeep=S,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?f:(t.state.gzhead=e,0):f},r.deflate=function(t,e){var r,i,a,u;if(!t||!t.state||5>8&255),_(i,i.gzhead.time>>16&255),_(i,i.gzhead.time>>24&255),_(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),_(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(_(i,255&i.gzhead.extra.length),_(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=o(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(_(i,0),_(i,0),_(i,0),_(i,0),_(i,0),_(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),_(i,3),i.status=l);else{var c=8+(i.w_bits-8<<4)<<8;c|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(c|=32),c+=31-c%31,i.status=l,b(i,c),0!==i.strstart&&(b(i,t.adler>>>16),b(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending!==i.pending_buf_size));)_(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=o(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(_(i,255&t.adler),_(i,t.adler>>8&255),t.adler=0,i.status=l)):i.status=l),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return d(t,-5);if(666===i.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(v(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,o=t.window;;){if(t.lookahead<=h){if(v(t),t.lookahead<=h&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(_(i,255&t.adler),_(i,t.adler>>8&255),_(i,t.adler>>16&255),_(i,t.adler>>24&255),_(i,255&t.total_in),_(i,t.total_in>>8&255),_(i,t.total_in>>16&255),_(i,t.total_in>>24&255)):(b(i,t.adler>>>16),b(i,65535&t.adler)),g(t),0=r.w_size&&(0===o&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,e,d-r.w_size,r.w_size,0),e=l,d=r.w_size),u=t.avail_in,h=t.next_in,c=t.input,t.avail_in=d,t.next_in=0,t.input=e,v(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))S[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=A[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<>>=w,p-=w,(w=s-a)>3,d&=(1<<(p-=v<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):u}function l(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,c(t)):u}function d(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(s=a.wsize-a.wnext)&&(s=i),n.arraySet(a.window,e,r-i,s,a.wnext),(i-=s)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,U,2,0),y=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(y-=4,R=8+(15&(g>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,r.check=s(r.check,U,2,0)),y=g=0,r.mode=3;case 3:for(;y<32;){if(0===p)break t;p--,g+=h[l++]<>>8&255,U[2]=g>>>16&255,U[3]=g>>>24&255,r.check=s(r.check,U,4,0)),y=g=0,r.mode=4;case 4:for(;y<16;){if(0===p)break t;p--,g+=h[l++]<>8),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,r.check=s(r.check,U,2,0)),y=g=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===p)break t;p--,g+=h[l++]<>>8&255,r.check=s(r.check,U,2,0)),y=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(k=r.length)&&(k=p),k&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,l,k,R)),512&r.flags&&(r.check=s(r.check,h,k,l)),p-=k,l+=k,r.length-=k),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(k=0;R=h[l+k++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R)),R&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;y<32;){if(0===p)break t;p--,g+=h[l++]<>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===p)break t;p--,g+=h[l++]<>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6!==e)break;g>>>=2,y-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,y-=2;break;case 14:for(g>>>=7&y,y-=7&y;y<32;){if(0===p)break t;p--,g+=h[l++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,y=g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(k=r.length){if(p>>=5,y-=5,r.ndist=1+(31&g),g>>>=5,y-=5,r.ncode=4+(15&g),g>>>=4,y-=4,286>>=3,y-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},z=o(0,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,z){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,T=65535&D,!((A=D>>>24)<=y);){if(0===p)break t;p--,g+=h[l++]<>>=A,y-=A,r.lens[r.have++]=T;else{if(16===T){for(P=A+2;y>>=A,y-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}R=r.lens[r.have-1],k=3+(3&g),g>>>=2,y-=2}else if(17===T){for(P=A+3;y>>=A)),g>>>=3,y-=3}else{for(P=A+7;y>>=A)),g>>>=7,y-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=R}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,B={bits:r.lenbits},z=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,z){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},z=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,z){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=l,t.avail_in=p,r.hold=g,r.bits=y,a(t,v),d=t.next_out,c=t.output,m=t.avail_out,l=t.next_in,h=t.input,p=t.avail_in,g=r.hold,y=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;S=(D=r.lencode[g&(1<>>16&255,T=65535&D,!((A=D>>>24)<=y);){if(0===p)break t;p--,g+=h[l++]<>C)])>>>16&255,T=65535&D,!(C+(A=D>>>24)<=y);){if(0===p)break t;p--,g+=h[l++]<>>=C,y-=C,r.back+=C}if(g>>>=A,y-=A,r.back+=A,r.length=T,0===S){r.mode=26;break}if(32&S){r.back=-1,r.mode=12;break}if(64&S){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&S,r.mode=22;case 22:if(r.extra){for(P=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;S=(D=r.distcode[g&(1<>>16&255,T=65535&D,!((A=D>>>24)<=y);){if(0===p)break t;p--,g+=h[l++]<>C)])>>>16&255,T=65535&D,!(C+(A=D>>>24)<=y);){if(0===p)break t;p--,g+=h[l++]<>>=C,y-=C,r.back+=C}if(g>>>=A,y-=A,r.back+=A,64&S){t.msg="invalid distance code",r.mode=30;break}r.offset=T,r.extra=15&S,r.mode=24;case 24:if(r.extra){for(P=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(k=v-m,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}E=k>r.wnext?(k-=r.wnext,r.wsize-k):r.wnext-k,k>r.length&&(k=r.length),x=r.window}else x=c,E=d-r.offset,k=r.length;for(m_?(w=j[L+c[x]],B[P+c[x]]):(w=96,0),d=1<>O)+(p-=d)]=b<<24|w<<16|v|0,0!==p;);for(d=1<>=1;if(0!==d?(z&=d-1,z+=d):z=0,x++,0==--D[E]){if(E===S)break;E=e[r+c[x]]}if(T>>7)]}function A(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function S(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function O(t,e,r){var n,i,s=new Array(16),a=0;for(n=1;n<=u;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var o=t[2*i+1];0!==o&&(t[2*i]=C(s[o]++,o))}}function I(t){var e;for(e=0;e>1;1<=r;r--)B(t,s,r);for(i=f;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],B(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,s[2*i]=s[2*r]+s[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,s[2*r+1]=s[2*n+1]=i,t.heap[1]=i++,B(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,s,a,o,f=e.dyn_tree,h=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(s=0;s<=u;s++)t.bl_count[s]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(s=f[2*f[2*(n=t.heap[r])+1]+1]+1)&&(s=m,g++),f[2*n+1]=s,h>=7;n>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(a=t.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==e?N(t,e,r,n):4===t.strategy||a===i?(S(t,2+(n?1:0),3),P(t,d,p)):(S(t,4+(n?1:0),3),function(t,e,r,n){var i;for(S(t,e-257,5),S(t,r-1,5),S(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(g[r]+s+1)]++,t.dyn_dtree[2*x(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){S(t,2,3),T(t,256,d),function(t){16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,r){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,n,s,a,o=1,u={},f=!1,h=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,r="[object process]"==={}.toString.call(t.process)?function(t){i.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(a="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(a+e,"*")}):t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){s.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(n=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):function(t){setTimeout(d,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n + * @license MIT + */ +var n=r(5),i=r(6),s=r(7);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){var s,a=1,o=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,o/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var h=-1;for(s=r;so&&(r=o-u),s=r;s>=0;s--){for(var c=!0,l=0;li&&(n=i):n=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var a=0;a>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&f)<<6|63&s)>127&&(h=u);break;case 3:s=t[i+1],a=t[i+2],128==(192&s)&&128==(192&a)&&(u=(15&f)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:s=t[i+1],a=t[i+2],o=t[i+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(u=(15&f)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),o=Math.min(s,a),f=this.slice(n,i),h=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,r,n,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function P(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function D(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,s){return s||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,s){return s||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],i=1,s=0;++s=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||z(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+i]=t/s&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var s=0,a=1,o=0;for(this[e]=255&t;++s>0)-o&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function M(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(0))},function(t,e,r){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=f(t),a=n[0],o=n[1],u=new s(function(t,e,r){return 3*(e+r)/4-r}(0,a,o)),h=0,c=o>0?a-4:a;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===o&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===o&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],a=0,o=r-i;ao?o:a+16383));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,s,a=[],o=e;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +e.read=function(t,e,r,n,i){var s,a,o=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,s=d&(1<<-h)-1,d>>=-h,h+=o;h>0;s=256*s+t[e+c],c+=l,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=l,h-=8);if(0===s)s=1-f;else{if(s===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),s-=f}return(d?-1:1)*a*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var a,o,u,f=8*s-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(o=0,a=h):a+c>=1?(o=(e*u-1)*Math.pow(2,i),a+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&o,d+=p,o/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function s(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new s(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new s(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(9),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(0))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,s,a,o,u=1,f={},h=!1,c=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){s.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),n=function(e){t.postMessage(a+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r-1};function f(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function v(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];v.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,r){return new Promise((function(n,s){var a=new b(t,r);if(a.signal&&a.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var t,e,r={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;n(new v(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&i&&(o.responseType="blob"),a.headers.forEach((function(t,e){o.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",u)}),o.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=l,t.Request=b,t.Response=v),e.Headers=l,e.Request=b,e.Response=v,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){"use strict";r.r(e),r.d(e,"_parse",(function(){return n})),r.d(e,"parse",(function(){return i})),r.d(e,"stringify",(function(){return s}));const n=t=>{let e=0;const r=r=>{const{line:n,column:i}=(()=>{let r=0,n=0;for(let i=0;i(e>=t.length&&r("Unexpected end of input"),t[e]),i=()=>n(e),s=()=>{e++},a=t=>{i()!==t&&r(`Expected '${t}' but found '${i()}'`),s()},o=(r=1,i=1)=>{if(e+i+r>t.length)return"";if(1===r)return n(e+i);let s="";for(let t=0;t{for(;;)if(/\s/.test(i()))s();else{const t=o(2,0);if("//"===t)for(s(),s();"\n"!==i();)s();else{if("/*"!==t)break;for(s(),s();"*/"!==o(2,0);)s();s(),s()}}},f=()=>{u();switch(i()){case'"':return l();case"{":return p();case"[":return d();case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":return c();default:return h()}},h=()=>{if("null"===o(4,0)){for(let t=0;t<4;t++)s();return null}if("true"===o(4,0)){for(let t=0;t<4;t++)s();return!0}if("false"===o(5,0)){for(let t=0;t<5;t++)s();return!1}if("Infinity"===o(8,0)){for(let t=0;t<8;t++)s();return 1/0}if("NaN"===o(3,0)){for(let t=0;t<3;t++)s();return NaN}r(`Unexpected character '${i()}'`)},c=()=>{if("-Infinity"===o(9,0)){for(let t=0;t<9;t++)s();return-1/0}let t="";for(;t+=i(),/[\d.e+-]/i.test(o());)s();s();const e=+t;return Number.isNaN(e)&&r("Not a number: "+t),e},l=()=>{a('"');let t="";for(;;){const e=i();if('"'===e)break;if("\\"===e)switch(s(),i()){case'"':t+='"';break;case"/":t+="/";break;case"\\":t+="\\";break;case"b":t+="\b";break;case"f":t+="\f";break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":{let e="";for(let t=0;t<4;t++){s();const t=i();/[0-9a-f]/i.test(t)||r("Invalid hex code: "+t),e+=t}const n=Number.parseInt(e,16);t+=String.fromCharCode(n);break}default:r("Invalid escape code: \\"+i())}else t+=e;s()}return a('"'),t},d=()=>{a("["),u();const t=[];for(;u(),"]"!==i();){const e=f();if(t.push(e),u(),","!==i())break;s()}return a("]"),t},p=()=>{a("{"),u();const t={};for(;u(),"}"!==i();){const e=l();u(),a(":");const r=f();if(t[e]=r,u(),","!==i())break;s()}return a("}"),t};return f()},i=t=>{try{return JSON.parse(t)}catch(e){try{return n(t)}catch(t){throw e}}},s=t=>{if("string"==typeof t)return JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return t.toString();if(null==t||"symbol"==typeof t)return"null";if(Array.isArray(t))return`[${t.map(t=>s(t)).join(",")}]`;if("object"==typeof t){let e="{",r=!0;const n=Object.keys(t);for(let i=0;i"object"==typeof t&&null!==t||"function"==typeof t,h={canHandle:t=>f(t)&&t[i],serialize(t){const{port1:e,port2:r}=new MessageChannel;return l(t,e),[r,[r]]},deserialize:t=>(t.start(),function(t,e){const r=new Map;return t.addEventListener("message",(function(t){const{data:e}=t;if(!e||!e.id)return;const n=r.get(e.id);if(n)try{n(e)}finally{r.delete(e.id)}})),function t(e,r,n=[],i=function(){}){let o=!1;const u=new Proxy(i,{get(i,s){if(p(o),s===a)return()=>{!function(t){y&&y.unregister(t)}(u),m(e),r.clear(),o=!0};if("then"===s){if(0===n.length)return{then:()=>u};const t=k(e,r,{type:"GET",path:n.map(t=>t.toString())}).then(v);return t.then.bind(t)}return t(e,r,[...n,s])},set(t,i,s){p(o);const[a,u]=w(s);return k(e,r,{type:"SET",path:[...n,i].map(t=>t.toString()),value:a},u).then(v)},apply(i,a,u){p(o);const f=n[n.length-1];if(f===s)return k(e,r,{type:"ENDPOINT"}).then(v);if("bind"===f)return t(e,r,n.slice(0,-1));const[h,c]=_(u);return k(e,r,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:h},c).then(v)},construct(t,i){p(o);const[s,a]=_(i);return k(e,r,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},a).then(v)}});return function(t,e){const r=(g.get(e)||0)+1;g.set(e,r),y&&y.register(t,e,t)}(u,e),u}(t,r,[],e)}(t))},c=new Map([["proxy",h],["throw",{canHandle:t=>f(t)&&u in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function l(t,e=globalThis,r=["*"]){e.addEventListener("message",(function n(s){if(!s||!s.data)return;if(!function(t,e){for(const r of t){if(e===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(e))return!0}return!1}(r,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:a,type:f,path:h}=Object.assign({path:[]},s.data),c=(s.data.argumentList||[]).map(v);let p;try{const e=h.slice(0,-1).reduce((t,e)=>t[e],t),r=h.reduce((t,e)=>t[e],t);switch(f){case"GET":p=r;break;case"SET":e[h.slice(-1)[0]]=v(s.data.value),p=!0;break;case"APPLY":p=r.apply(e,c);break;case"CONSTRUCT":p=function(t){return Object.assign(t,{[i]:!0})}(new r(...c));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;l(t,r),p=function(t,e){return b.set(t,e),t}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[u]:0}}Promise.resolve(p).catch(t=>({value:t,[u]:0})).then(r=>{const[i,s]=w(r);e.postMessage(Object.assign(Object.assign({},i),{id:a}),s),"RELEASE"===f&&(e.removeEventListener("message",n),d(e),o in t&&"function"==typeof t[o]&&t[o]())}).catch(t=>{const[r,n]=w({value:new TypeError("Unserializable return value"),[u]:0});e.postMessage(Object.assign(Object.assign({},r),{id:a}),n)})})),e.start&&e.start()}function d(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function p(t){if(t)throw new Error("Proxy has been released and is not useable")}function m(t){return k(t,new Map,{type:"RELEASE"}).then(()=>{d(t)})}const g=new WeakMap,y="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(g.get(t)||0)-1;g.set(t,e),0===e&&m(t)});function _(t){const e=t.map(w);return[e.map(t=>t[0]),(r=e.map(t=>t[1]),Array.prototype.concat.apply([],r))];var r}const b=new WeakMap;function w(t){for(const[e,r]of c)if(r.canHandle(t)){const[n,i]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:t},b.get(t)||[]]}function v(t){switch(t.type){case"HANDLER":return c.get(t.name).deserialize(t.value);case"RAW":return t.value}}function k(t,e,r,n){return new Promise(i=>{const s=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(s,i),t.start&&t.start(),t.postMessage(Object.assign({id:s},r),n)})}const E="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#%()*+,-./:;=?@[]^_`{|}~",x=t=>{let e="";for(;t>=0;)e=E[t%E.length]+e,t=Math.floor(t/E.length)-1;return e};class A{constructor(){this.generatedIds=new Map,this.references=new Map,this.skippedIds=new Set,this.skippedIds.add("of")}skip(t){this.skippedIds.add(t)}addReference(t){const e=this.references.get(t)||0;this.references.set(t,e+1)}generateNewIds(){const t=Array.from(this.references.entries());t.sort((t,e)=>e[1]-t[1]);let e=0;for(const r of t){const t=r[0];let n=x(e);for(;this.skippedIds.has(n);)e++,n=x(e);this.generatedIds.set(t,n),e++}}getNewId(t){return this.generatedIds.has(t)?this.generatedIds.get(t):t}}var S=t=>{const e=new A;for(const r of t.targets)for(const[t,n]of Object.entries(r.blocks))if(e.addReference(t),!Array.isArray(n)){n.parent&&e.addReference(n.parent),n.next&&e.addReference(n.next);for(const t of Object.values(n.inputs))for(let r=1;r{}))=>{let r={stageVariables:[],stageComments:[],usesMusic:!0,extensions:[]};const n={onProgress(t,r,n){e(t,r,n)},processJSON(t,e){if("sb3"===t||"pm"===t||"pmp"===t)return(t=>{(t=>{const e=t.targets.find(t=>t.isStage);if(e)for(const t of Object.values(e.variables)){t[0].startsWith("☁")&&(t[2]=!0)}})(t),S(t)})(e),r=(t=>{const e=t.targets[0];if(!e||!e.isStage)throw new Error("Project does not have stage");return{stageVariables:[],stageComments:[],usesMusic:!0,extensions:[],stageVariables:Object.values(e.variables).map(([t,e,r])=>({name:t,isCloud:!!r})),stageComments:Object.values(e.comments).map(t=>t.text),usesMusic:t.extensions.includes("music"),extensions:t.extensionURLs?Object.values(t.extensionURLs):[]}})(e),e;"sb2"===t&&(r=(t=>{const e=(t.variables||[]).map(({name:t,isPersistent:e})=>({name:t,isCloud:e})),r=JSON.stringify(t);return{stageVariables:[],stageComments:[],usesMusic:!0,extensions:[],stageVariables:e,usesMusic:r.includes("drum:duration:elapsed:from:")||r.includes("playDrum")||r.includes("noteOn:duration:elapsed:from:")}})(e))}},i=await Object(T.downloadProjectFromBuffer)(t,n);return"sb3"===i.type&&"pm"!==i.type||(i.type="blob"),i.analysis=r,i};postMessage("ready"),l(n)}]); +//# sourceMappingURL=download-project.efef1c6a61576f035d6e.worker.js.map \ No newline at end of file