!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NDSAnimation=t():e.NDSAnimation=t()}(window,function(){return i=[function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(m,y,e){!function(e){var t,g,a,o,s,l,c,d,u,i,r,n,h;function f(){this.init()}function p(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")}f.prototype={init:function(){var e=this||g;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||g;if(e=parseFloat(e),t.ctx||u(),void 0!==e&&0<=e&&e<=1){if(t._volume=e,!t._muted){t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,g.ctx.currentTime);for(var i=0;i>4,a=1>6:64,o=2>2)+h.charAt(n)+h.charAt(a)+h.charAt(o));return s.join("")},i.decode=function(e){var t,i,r,n,a,o=0,s=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var l,c=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===h.charAt(64)&&c--,e.charAt(e.length-2)===h.charAt(64)&&c--,c%1!=0)throw new Error("Invalid base64 input, bad content length.");for(l=new(d.uint8array?Uint8Array:Array)(0|c);o>4,i=(15&n)<<4|(n=h.indexOf(e.charAt(o++)))>>2,r=(3&n)<<6|(a=h.indexOf(e.charAt(o++))),l[s++]=t,64!==n&&(l[s++]=i),64!==a&&(l[s++]=r);return l}},{"./support":30,"./utils":32}],2:[function(e,t,i){var r=e("./external"),n=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function s(e,t,i,r,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=r,this.compressedContent=n}s.prototype={getContentWorker:function(){var e=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,i){return e.pipe(new a).pipe(new o("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,i){var r=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,i){var r=e("./utils"),o=function(){for(var e=[],t=0;t<256;t++){for(var i=t,r=0;r<8;r++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t){return void 0!==e&&e.length?("string"!==r.getTypeOf(e)?function(e,t,i){var r=o,n=0+i;e^=-1;for(var a=0;a>>8^r[255&(e^t[a])];return-1^e}:function(e,t,i){var r=o,n=0+i;e^=-1;for(var a=0;a>>8^r[255&(e^t.charCodeAt(a))];return-1^e})(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,t,i){e="undefined"!=typeof Promise?Promise:e("lie");t.exports={Promise:e}},{lie:37}],7:[function(e,t,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=e("pako"),a=e("./utils"),o=e("./stream/GenericWorker"),s=r?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}i.magic="\b\0",a.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(e){return new l("Deflate",e)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,i){function g(e,t){for(var i="",r=0;r>>=8;return i}function r(e,t,i,r,n,a){var o=e.file,s=e.compression,l=a!==w.utf8encode,c=_.transformTo("string",a(o.name)),d=_.transformTo("string",w.utf8encode(o.name)),u=o.comment,a=_.transformTo("string",a(u)),h=_.transformTo("string",w.utf8encode(u)),f=d.length!==o.name.length,u=h.length!==u.length,p="",m=o.dir,y=o.date,v={crc32:0,compressedSize:0,uncompressedSize:0},i=(t&&!i||(v.crc32=e.crc32,v.compressedSize=e.compressedSize,v.uncompressedSize=e.uncompressedSize),0),e=(t&&(i|=8),l||!f&&!u||(i|=2048),0),t=0,y=(m&&(e|=16),"UNIX"===n?(t=798,e|=(65535&((l=o.unixPermissions)?l:m?16893:33204))<<16):(t=20,e|=63&(o.dosPermissions||0)),n=y.getUTCHours(),n=(n=((n<<=6)|y.getUTCMinutes())<<5)|y.getUTCSeconds()/2,l=y.getUTCFullYear()-1980,l=(l=((l<<=4)|y.getUTCMonth()+1)<<5)|y.getUTCDate(),f&&(m=g(1,1)+g(x(c),4)+d,p+="up"+g(m.length,2)+m),u&&(o=g(1,1)+g(x(a),4)+h,p+="uc"+g(o.length,2)+o),""),y=(y=(y=(y=(y=(y=(y=(y=(y=(y+="\n\0")+g(i,2))+s.magic)+g(n,2))+g(l,2))+g(v.crc32,4))+g(v.compressedSize,4))+g(v.uncompressedSize,4))+g(c.length,2))+g(p.length,2);return{fileRecord:I.LOCAL_FILE_HEADER+y+c+p,dirRecord:I.CENTRAL_FILE_HEADER+g(t,2)+y+g(a.length,2)+"\0\0\0\0"+g(e,4)+g(r,4)+c+p+a}}var _=e("../utils"),n=e("../stream/GenericWorker"),w=e("../utf8"),x=e("../crc32"),I=e("../signature");function a(e,t,i,r){n.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}_.inherits(a,n),a.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,n.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-r-1))/i:100}}))},a.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;t?(e=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},a.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=r(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:(t=e,I.DATA_DESCRIPTOR+g(t.crc32,4)+g(t.compressedSize,4)+g(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},a.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)i=(i<<8)+this.byteAt(t);return this.index+=e,i},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t,i){var r=e("./Uint8ArrayReader");function n(e){r.call(this,e)}e("../utils").inherits(n,r),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,i){var r=e("./DataReader");function n(e){r.call(this,e)}e("../utils").inherits(n,r),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],21:[function(e,t,i){var r=e("./ArrayReader");function n(e){r.call(this,e)}e("../utils").inherits(n,r),n.prototype.readData=function(e){var t;return this.checkOffset(e),0===e?new Uint8Array(0):(t=this.data.subarray(this.zero+this.index,this.zero+this.index+e),this.index+=e,t)},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,i){var r=e("../utils"),n=e("../support"),a=e("./ArrayReader"),o=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||n.uint8array?"nodebuffer"===t?new s(e):n.uint8array?new l(r.transformTo("uint8array",e)):new a(r.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,i){var r=e("./GenericWorker"),n=e("../utils");function a(e){r.call(this,"ConvertWorker to "+e),this.destType=e}n.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:n.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,i){var r=e("./GenericWorker"),n=e("../crc32");function a(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=n(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,i){var r=e("../utils"),n=e("./GenericWorker");function a(e){n.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,n),a.prototype.processChunk=function(e){var t;e&&(t=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=t+e.data.length),n.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,i){var r=e("../utils"),n=e("./GenericWorker");function a(e){n.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,n),a.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished)||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0)},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,i){function r(e){this.name=e||"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}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i "+e:e}},t.exports=r},{}],29:[function(e,t,i){var c=e("../utils"),n=e("./ConvertWorker"),a=e("./GenericWorker"),d=e("../base64"),r=e("../support"),o=e("../external"),s=null;if(r.nodestream)try{s=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t,i){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=i,c.checkSupport(r),this._worker=e.pipe(new n(r)),e.lock()}catch(e){this._worker=new a("error"),this._worker.error(e)}}l.prototype={accumulate:function(e){return s=this,l=e,new o.Promise(function(t,i){var r=[],n=s._internalType,a=s._outputType,o=s._mimeType;s.on("data",function(e,t){r.push(e),l&&l(t)}).on("error",function(e){r=[],i(e)}).on("end",function(){try{var e=function(e,t,i){switch(e){case"blob":return c.newBlob(c.transformTo("arraybuffer",t),i);case"base64":return d.encode(t);default:return c.transformTo(e,t)}}(a,function(e,t){for(var i=0,r=null,n=0,a=0;a>>6:(i<65536?t[n++]=224|i>>>12:(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63),t[n++]=128|i>>>6&63),t[n++]=128|63&i);return t},n.utf8decode=function(e){if(c.nodebuffer)return l.transformTo("nodebuffer",e).toString("utf-8");for(var t,i,r,n=e=l.transformTo(c.uint8array?"uint8array":"array",e),a=n.length,o=new Array(2*a),s=t=0;s>10&1023,o[t++]=56320|1023&i)}return o.length!==t&&(o.subarray?o=o.subarray(0,t):o.length=t),l.applyFromCharCode(o)},l.inherits(a,i),a.prototype.processChunk=function(e){var t=l.transformTo(c.uint8array?"uint8array":"array",e.data),i=(this.leftOver&&this.leftOver.length&&(c.uint8array?(i=t,(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)):t=this.leftOver.concat(t),this.leftOver=null),function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+u[e[i]]>t?i:t}(t)),r=t;i!==t.length&&(c.uint8array?(r=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(r=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:n.utf8decode(r),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=a,l.inherits(o,i),o.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=o},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,o){var s=e("./support"),l=e("./base64"),i=e("./nodejsUtils"),c=e("./external");function r(e){return e}function d(e,t){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){var e;this.extraFields[1]&&(e=r(this.extraFields[1].value),this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS)&&(this.diskNumberStart=e.readInt(4))},readExtraFields:function(e){var t,i,r,n=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(i<65536?t[n++]=224|i>>>12:(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63),t[n++]=128|i>>>6&63),t[n++]=128|63&i);return t},i.buf2binstring=function(e){return d(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,r=t.length;i>10&1023,o[i++]=56320|1023&r)}return d(o,i)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+c[e[i]]>t?i:t}},{"./common":41}],43:[function(e,t,i){t.exports=function(e,t,i,r){for(var n=65535&e|0,a=e>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,r){var n=s,a=r+i;e^=-1;for(var o=r;o>>8^n[255&(e^t[o])];return-1^e}},{}],46:[function(e,R,t){var s,u=e("../utils/common"),l=e("./trees"),h=e("./adler32"),f=e("./crc32"),i=e("./messages"),c=0,d=0,p=-2,r=2,m=8,n=286,a=30,o=19,U=2*n+1,F=15,y=3,v=258,g=v+y+1,_=42,w=113;function x(e,t){return e.msg=i[t],t}function I(e){return(e<<1)-(4e.avail_out?e.avail_out:i)&&(u.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending)&&(t.pending_out=0)}function A(e,t){l._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,M(e.strm)}function k(e,t){e.pending_buf[e.pending++]=t}function T(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var i,r,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-g?e.strstart-(e.w_size-g):0,c=e.window,d=e.w_mask,u=e.prev,h=e.strstart+v,f=c[a+o-1],p=c[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(i=t)+o]===p&&c[i+o-1]===f&&c[i]===c[a]&&c[++i]===c[a+1]){for(a+=2,i++;c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&al&&0!=--n);return o<=e.lookahead?o:e.lookahead}function E(e){var t,i,r,n,a,o,s,l,c,d=e.w_size;do{if(l=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-g)){for(u.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=i=e.hash_size;r=e.head[--t],e.head[t]=d<=r?r-d:0,--i;);for(t=i=d;r=e.prev[--t],e.prev[t]=d<=r?r-d:0,--i;);l+=d}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,s=e.strstart+e.lookahead,c=void 0,i=0===(c=(l=l)<(c=a.avail_in)?l:c)?0:(a.avail_in-=c,u.arraySet(o,a.input,a.next_in,c,s),1===a.state.wrap?a.adler=h(a.adler,o,c,s):2===a.state.wrap&&(a.adler=f(a.adler,o,c,s)),a.next_in+=c,a.total_in+=c,c),e.lookahead+=i,e.lookahead+e.insert>=y)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=(e.ins_h<=y&&(e.ins_h=(e.ins_h<=y)if(r=l._tr_tally(e,e.strstart-e.match_start,e.match_length-y),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=y){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=y&&(e.ins_h=(e.ins_h<=y&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-y,r=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-y),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(E(e),0===e.lookahead&&t===c)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-g&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new B(4,4,8,4,S),new B(4,5,16,8,S),new B(4,6,32,32,S),new B(4,4,16,16,O),new B(8,16,32,32,O),new B(8,16,128,128,O),new B(8,32,128,256,O),new B(32,128,258,1024,O),new B(32,258,258,4096,O)],t.deflateInit=function(e,t){return L(e,t,m,15,8,0)},t.deflateInit2=L,t.deflateReset=P,t.deflateResetKeep=C,t.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?p:(e.state.gzhead=t,d)},t.deflate=function(e,t){var i,r,n,a;if(!e||!e.state||5>8&255),k(r,r.gzhead.time>>16&255),k(r,r.gzhead.time>>24&255),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(k(r,255&r.gzhead.extra.length),k(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=f(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(k(r,0),k(r,0),k(r,0),k(r,0),k(r,0),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,3),r.status=w)):(o=m+(r.w_bits-8<<4)<<8,o|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=32),o+=31-o%31,r.status=w,T(r,o),0!==r.strstart&&(T(r,e.adler>>>16),T(r,65535&e.adler)),e.adler=1)),69===r.status)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),M(e),n=r.pending,r.pending!==r.pending_buf_size));)k(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),M(e),n=r.pending,r.pending===r.pending_buf_size)){a=1;break}}while(a=r.gzindexn&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),0===a&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),M(e),n=r.pending,r.pending===r.pending_buf_size)){a=1;break}}while(a=r.gzindexn&&(e.adler=f(e.adler,r.pending_buf,r.pending-n,n)),0===a&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&M(e),r.pending+2<=r.pending_buf_size&&(k(r,255&e.adler),k(r,e.adler>>8&255),e.adler=0,r.status=w)):r.status=w),0!==r.pending){if(M(e),0===e.avail_out)return r.last_flush=-1,d}else if(0===e.avail_in&&I(t)<=I(i)&&4!==t)return x(e,-5);if(666===r.status&&0!==e.avail_in)return x(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==c&&666!==r.status){var o=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(E(e),0===e.lookahead)){if(t===c)return 1;break}if(e.match_length=0,i=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var i,r,n,a,o=e.window;;){if(e.lookahead<=v){if(E(e),e.lookahead<=v&&t===c)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=y&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=y?(i=l._tr_tally(e,1,e.match_length-y),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(r,t):s[r.level].func(r,t);if(3!==o&&4!==o||(r.status=666),1===o||3===o)return 0===e.avail_out&&(r.last_flush=-1),d;if(2===o&&(1===t?l._tr_align(r):5!==t&&(l._tr_stored_block(r,0,0,!1),3===t)&&(b(r.head),0===r.lookahead)&&(r.strstart=0,r.block_start=0,r.insert=0),M(e),0===e.avail_out))return r.last_flush=-1,d}return 4!==t||!(r.wrap<=0)&&(2===r.wrap?(k(r,255&e.adler),k(r,e.adler>>8&255),k(r,e.adler>>16&255),k(r,e.adler>>24&255),k(r,255&e.total_in),k(r,e.total_in>>8&255),k(r,e.total_in>>16&255),k(r,e.total_in>>24&255)):(T(r,e.adler>>>16),T(r,65535&e.adler)),M(e),0=i.w_size&&(0===a&&(b(i.head),i.strstart=0,i.block_start=0,i.insert=0),l=new u.Buf8(i.w_size),u.arraySet(l,t,c-i.w_size,i.w_size,0),t=l,c=i.w_size),l=e.avail_in,o=e.next_in,s=e.input,e.avail_in=c,e.next_in=0,e.input=t,E(i);i.lookahead>=y;){for(r=i.strstart,n=i.lookahead-(y-1);i.ins_h=(i.ins_h<>>=r=i>>>24,I-=r,0==(r=i>>>16&255))f[h++]=65535&i;else{if(!(16&r)){if(0==(64&r)){i=b[(65535&i)+(x&(1<>>=r,I-=r),I<15&&(x+=d[c++]<>>=r=i>>>24,I-=r,!(16&(r=i>>>16&255))){if(0==(64&r)){i=M[(65535&i)+(x&(1<>>=r,I-=r,(r=h-p)>3,x&=(1<<(I-=n<<3))-1,e.next_in=c,e.next_out=h,e.avail_in=c>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){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 O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(r),t.distcode=t.distdyn=new O.Buf32(n),t.sane=1,t.back=-1,R):U}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):U}function l(e,t){var i,r;return!e||!e.state||(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(O.arraySet(e.window,t,i-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(r<(n=e.wsize-e.wnext)&&(n=r),O.arraySet(e.window,t,i-r,n,e.wnext),(r-=n)?(O.arraySet(e.window,t,i-r,r,0),e.wnext=r,e.whave=e.wsize):(e.wnext+=n,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,i.check=C(i.check,T,2,0),d=c=0,i.mode=2;else if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31)e.msg="incorrect header check",i.mode=30;else if(8!=(15&c))e.msg="unknown compression method",i.mode=30;else{if(d-=4,I=8+(15&(c>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(T[0]=255&c,T[1]=c>>>8&255,i.check=C(i.check,T,2,0)),d=c=0,i.mode=3;case 3:for(;d<32;){if(0===s)break e;s--,c+=r[a++]<>>8&255,T[2]=c>>>16&255,T[3]=c>>>24&255,i.check=C(i.check,T,4,0)),d=c=0,i.mode=4;case 4:for(;d<16;){if(0===s)break e;s--,c+=r[a++]<>8),512&i.flags&&(T[0]=255&c,T[1]=c>>>8&255,i.check=C(i.check,T,2,0)),d=c=0,i.mode=5;case 5:if(1024&i.flags){for(;d<16;){if(0===s)break e;s--,c+=r[a++]<>>8&255,i.check=C(i.check,T,2,0)),d=c=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((f=s<(f=i.length)?s:f)&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),O.arraySet(i.head.extra,r,a,f,I)),512&i.flags&&(i.check=C(i.check,r,f,a)),s-=f,a+=f,i.length-=f),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(f=0;I=r[a+f++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I)),I&&f>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;d<32;){if(0===s)break e;s--,c+=r[a++]<>>=7&d,d-=7&d,i.mode=27;else{for(;d<3;){if(0===s)break e;s--,c+=r[a++]<>>=1)){case 0:i.mode=14;break;case 1:E=S=void 0;var E,S=i;if(j){for(z=new O.Buf32(512),H=new O.Buf32(32),E=0;E<144;)S.lens[E++]=8;for(;E<256;)S.lens[E++]=9;for(;E<280;)S.lens[E++]=7;for(;E<288;)S.lens[E++]=8;for(L(1,S.lens,0,288,z,0,S.work,{bits:9}),E=0;E<32;)S.lens[E++]=5;L(2,S.lens,0,32,H,0,S.work,{bits:5}),j=!1}if(S.lencode=z,S.lenbits=9,S.distcode=H,S.distbits=5,i.mode=20,6!==t)break;c>>>=2,d-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}c>>>=2,d-=2}break;case 14:for(c>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,c+=r[a++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&c,d=c=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(f=i.length){if(0===(f=l<(f=s>>=5,d-=5,i.ndist=1+(31&c),c>>>=5,d-=5,i.ncode=4+(15&c),c>>>=4,d-=4,286>>=3,d-=3}for(;i.have<19;)i.lens[D[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,M={bits:i.lenbits},b=L(0,i.lens,0,19,i.lencode,0,i.work,M),i.lenbits=M.bits,b){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,g=65535&k,!((y=k>>>24)<=d);){if(0===s)break e;s--,c+=r[a++]<>>=y,d-=y,i.lens[i.have++]=g;else{if(16===g){for(A=y+2;d>>=y,d-=y,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],f=3+(3&c),c>>>=2,d-=2}else if(17===g){for(A=y+3;d>>=y)),c>>>=3,d=d-y-3}else{for(A=y+7;d>>=y)),c>>>=7,d=d-y-7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;f--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,M={bits:i.lenbits},b=L(1,i.lens,0,i.nlen,i.lencode,0,i.work,M),i.lenbits=M.bits,b){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,M={bits:i.distbits},b=L(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M),i.distbits=M.bits,b){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=l){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,i.hold=c,i.bits=d,P(e,h),o=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,c=i.hold,d=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;v=(k=i.lencode[c&(1<>>16&255,g=65535&k,!((y=k>>>24)<=d);){if(0===s)break e;s--,c+=r[a++]<>_)])>>>16&255,g=65535&k,!(_+(y=k>>>24)<=d);){if(0===s)break e;s--,c+=r[a++]<>>=_,d-=_,i.back+=_}if(c>>>=y,d-=y,i.back+=y,i.length=g,0===v){i.mode=26;break}if(32&v){i.back=-1,i.mode=12;break}if(64&v){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&v,i.mode=22;case 22:if(i.extra){for(A=i.extra;d>>=i.extra,d-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;v=(k=i.distcode[c&(1<>>16&255,g=65535&k,!((y=k>>>24)<=d);){if(0===s)break e;s--,c+=r[a++]<>_)])>>>16&255,g=65535&k,!(_+(y=k>>>24)<=d);){if(0===s)break e;s--,c+=r[a++]<>>=_,d-=_,i.back+=_}if(c>>>=y,d-=y,i.back+=y,64&v){e.msg="invalid distance code",i.mode=30;break}i.offset=g,i.extra=15&v,i.mode=24;case 24:if(i.extra){for(A=i.extra;d>>=i.extra,d-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break e;if(i.offset>(f=h-l)){if((f=i.offset-f)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}p=f>i.wnext?(f-=i.wnext,i.wsize-f):i.wnext-f,f>i.length&&(f=i.length),m=i.window}else m=n,p=o-i.offset,f=i.length;for(l-=f=lf?(m=B[C+o[_]],D[E+o[_]]):(m=96,0),l=1<<(p=g-M),w=c=1<>M)+(c-=l)]=p<<24|m<<16|y|0,0!==c;);for(l=1<>=1;if(0!==l?T=(T&l-1)+l:T=0,_++,0==--S[g]){if(g===x)break;g=t[i+o[_]]}if(I>>7)]}function a(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function b(e,t,i){e.bi_valid>r-i?(e.bi_buf|=t<>r-e.bi_valid,e.bi_valid+=i-r):(e.bi_buf|=t<>>=1,i<<=1,0<--t;);return i>>>1}function k(e,t,i){for(var r,n=new Array(16),a=0,o=1;o<=15;o++)n[o]=a=a+i[o-1]<<1;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=A(n[s]++,s))}}function T(e){for(var t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function D(e){8>1;1<=i;i--)E(e,a,i);for(n=l;i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],E(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,a[2*n]=a[2*i]+a[2*r],e.depth[n]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,a[2*i+1]=a[2*r+1]=n,e.heap[1]=n++,E(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var d,u,h,f,p,m=e,y=t.dyn_tree,v=t.max_code,g=t.stat_desc.static_tree,_=t.stat_desc.has_stree,w=t.stat_desc.extra_bits,x=t.stat_desc.extra_base,I=t.stat_desc.max_length,b=0,M=0;M<=15;M++)m.bl_count[M]=0;for(y[2*m.heap[m.heap_max]+1]=0,d=m.heap_max+1;d<573;d++)I<(M=y[2*y[2*(u=m.heap[d])+1]+1]+1)&&(M=I,b++),y[2*u+1]=M,v>=7;o<30;o++)for(_[o]=n<<7,t=0;t<1<>>=1)if(1&t&&0!==e.dyn_ltree[2*i])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(i=32;i<256;i++)if(0!==e.dyn_ltree[2*i])return 1;return 0}(e)),O(e,e.l_desc),O(e,e.d_desc),s=function(e){var t;for(B(e,e.dyn_ltree,e.l_desc.max_code),B(e,e.dyn_dtree,e.d_desc.max_code),O(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=i+5,i+4<=n&&-1!==t)L(e,t,i,r);else if(4===e.strategy||a===n)b(e,2+(r?1:0),3),S(e,u,h);else{b(e,4+(r?1:0),3);var l=e,c=(t=e.l_desc.max_code+1,i=e.d_desc.max_code+1,s+1);for(b(l,t-257,5),b(l,i-1,5),b(l,c-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(p[i]+256+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){b(e,2,3),M(e,256,u),16===(e=e).bi_valid?(a(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,i){t.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(e,t,i){!function(e){function n(e){delete d[e]}function a(e){if(u)setTimeout(a,0,e);else{var t=d[e];if(t){u=!0;try{var i=t.callback,r=t.args;switch(r.length){case 0:i();break;case 1:i(r[0]);break;case 2:i(r[0],r[1]);break;case 3:i(r[0],r[1],r[2]);break;default:i.apply(o,r)}}finally{n(e),u=!1}}}}function t(e){e.source===i&&"string"==typeof e.data&&0===e.data.indexOf(l)&&a(+e.data.slice(l.length))}var i,o,r,s,l,c,d,u,h,f;(i="undefined"==typeof self?void 0===e?this:e:self).setImmediate||(c=1,u=!(d={}),h=i.document,e=(e=Object.getPrototypeOf&&Object.getPrototypeOf(i))&&e.setTimeout?e:i,f="[object process]"==={}.toString.call(i.process)?function(e){p.nextTick(function(){a(e)})}:function(){var e,t;if(i.postMessage&&!i.importScripts)return e=!0,t=i.onmessage,i.onmessage=function(){e=!1},i.postMessage("","*"),i.onmessage=t,e}()?(l="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",t,!1):i.attachEvent("onmessage",t),function(e){i.postMessage(l+e,"*")}):i.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){a(e.data)},function(e){s.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,function(e){var t=h.createElement("script");t.onreadystatechange=function(){a(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(a,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return S(e).length;default:if(r)return E(e).length;t=(""+t).toLowerCase(),r=!0}}function t(e,t,i){var r,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var a=this,o=t,s=i,l=a.length;(!s||s<0||l=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:m(e,t,i,r,n);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):m(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,i,r,n){var a=1,o=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o/=a=2,s/=2,i/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n)for(var c=-1,d=i;d>8,n.push(i%256),n.push(r);return n}(t,e.length-i),e,i,r)}function A(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n>>10&1023|55296),d=56320|1023&d),r.push(d),n+=u}var h=r,f=h.length;if(f<=g)return String.fromCharCode.apply(String,h);for(var p="",m=0;mt)&&(e+=" ... "),""},u.prototype.compare=function(e,t,i,r,n){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(n<=r&&i<=t)return 0;if(n<=r)return-1;if(i<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(r>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,n),c=e.slice(t,i),d=0;dthis.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var a,o,s,l=!1;;)switch(r){case"hex":var c=this,d=e,u=t,h=i,f=(u=Number(u)||0,c.length-u);if((!h||f<(h=Number(h)))&&(h=f),(f=d.length)%2!=0)throw new TypeError("Invalid hex string");f/2e.length)throw new RangeError("Index out of range")}function x(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n>>8*(r?n:1-n)}function I(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n>>8*(r?n:3-n)&255}function b(e,t,i,r){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function k(e,t,i,r,n){return n||b(e,0,i,4),a.write(e,t,i,r,23,4),i+4}function T(e,t,i,r,n){return n||b(e,0,i,8),a.write(e,t,i,r,52,8),i+8}u.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):x(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,r){e=+e,t|=0,r||w(this,e,t,i,(r=Math.pow(2,8*i-1))-1,-r);var n=0,a=1,o=0;for(this[t]=255&e;++n>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,r){e=+e,t|=0,r||w(this,e,t,i,(r=Math.pow(2,8*i-1))-1,-r);var n=i-1,a=1,o=0;for(this[t+n]=255&e;0<=--n&&(a*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return k(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return k(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return T(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return T(this,e,t,!1,i)},u.prototype.copy=function(e,t,i,r){if(i=i||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),(r=0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var n,a=(r=e.length-t>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function S(e){return M.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,i,r){for(var n=0;n=t.length||n>=e.length);++n)t[n+i]=e[n];return n}}.call(this,C(0))},function(e,t,i){t.byteLength=function(e){var e=d(e),t=e[0],e=e[1];return 3*(t+e)/4-e},t.toByteArray=function(e){var t,i,r=d(e),n=r[0],r=r[1],a=new c(function(e,t){return 3*(e+t)/4-t}(n,r)),o=0,s=0>16&255,a[o++]=t>>8&255,a[o++]=255&t;2===r&&(t=l[e.charCodeAt(i)]<<2|l[e.charCodeAt(i+1)]>>4,a[o++]=255&t);1===r&&(t=l[e.charCodeAt(i)]<<10|l[e.charCodeAt(i+1)]<<4|l[e.charCodeAt(i+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,n=[],a=0,o=i-r;a>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}(r));return n.join("")}(e,a,o>2]+s[t<<4&63]+"==")):2==r&&(t=(e[i-2]<<8)+e[i-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=r.length;n>1,d=-7,u=i?n-1:0,h=i?-1:1,n=e[t+u];for(u+=h,a=n&(1<<-d)-1,n>>=-d,d+=s;0>=-d,d+=r;0>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,f=r?1:-1,a=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-o))<1&&(o--,r*=2),2<=(t+=1<=o+d?u/r:u*Math.pow(2,1-d))*r&&(o++,r/=2),c<=o+d?(s=0,o=c):1<=o+d?(s=(t*r-1)*Math.pow(2,n),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));8<=n;e[i+h]=255&s,h+=f,s/=256,n-=8);for(o=o<=e.length?{done:!0}:{done:!1,value:e[i++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);it&&(t=e.times[e.times.length-1],r=e),e.times[e.times.length-1]==t&&8==e.trackType&&(r=e),e.times[0]e.times[e.times.length-1]&&o.push(e)}),0==a&&o.length?(t=(e=W(o)).max,e.min,b(o,t)):n/=a}function P(e,t,i){var r=(n=W(t)).max,n=n.min;return Y(e,t,re.times[e.times.length-1]&&s.push(e)}),0==o&&s.length?(t=(e=W(s)).max,e.min,Y(r,s,t)):(Array.isArray(a)&&a.forEach(function(e){e.value=e.mixOpacity/o}),a)}function L(e,t,i){var r,n,a;if(e&&e[t]&&e[t].length)return r=e.times[e.times.length-1],n=e.times[0],a=[],r=r.times[0]&&t<=r.times[r.times.length-1])return 1}}(t,i)||8==n.trackType&&i>n.times[n.times.length-1]?o(t,i):J([e[0]],e[1],e[2],i)):null}function o(e,t){var i,r,n=W(e),a=n.max,o=n.min,s=n.maxTrack,n=n.minTrack,l=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,u=new THREE.Matrix4,h=[],f=[],p=[];return p=(a<=t?(h=V([s],!1).currentTranslation,f=s.rotations,s):t<=o?(h=V([n],!0).currentTranslation,f=n.rotations,n):(a=X(e,t),i=a.times[0],r=a.times[a.times.length-1]-i,s=t-i,o=a.times.map(function(e){return(e-i)/r}),new THREE.LinearInterpolant(o,a.translations,3,h).evaluate(s/r),f=a.rotations,a)).scales,u.compose(c.fromArray(h),l.fromArray(f),d.fromArray(p)),u}function J(e,t,i,r){var n,R,U,F,a,o,s,l,c,d,u,h,N,f,z,p,H,m,y,j,v,g,_,w,x,I,b,M,A,k,T,D,E,S,O,B=W(e),C=B.max,P=B.min,L=B.maxTrack,B=B.minTrack;if(t.worldMatrixFrame&&t.worldMatrixFrame.length&&t.centers&&t.centers.length)return n=new THREE.Quaternion,R=new THREE.Vector3,U=new THREE.Quaternion,F=new THREE.Vector3,a=new THREE.Matrix4,o=new THREE.Matrix4,y=t.centers,c=[],d=[],u=[],s=[],l=null,C<=r?(c=(C=V([l=l||L,t,i],!1)).currentTranslation,d=C.currentRotation,u=C.currentScale,1==l.trackType&&(s=y.slice(-3))):r<=P?(c=(L=V([l=l||B,t,i],!0)).currentTranslation,d=L.currentRotation,u=L.currentScale,1==l.trackType&&(s=y.slice(0,3))):1==(l=X(e,r)).trackType?(C=t,P=i,B=c,L=d,y=u,e=s,j=r,(E=(m=l).times.findIndex(function(e){return j=e.times[0]&&t<=e.times[e.times.length-1]&&(r=e),t>e.times[e.times.length-1]&&i.push(e)}),r=r||W(i).maxTrack)}function U(e,t,i){if(e&&0!=e.times.length&&null!=e.devices){var r=e.times[0],n=e.times[e.times.length-1],a=n-r,o=t-r,s=new THREE.Vector3,l=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3,u=new THREE.Vector3,h=new THREE.Vector3,f=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,y=new THREE.Matrix4,v=-1;if(t<=r)s.fromArray(e.cameras.slice(3*(v=0),3*v+3)),c.fromArray(e.targets.slice(3*v,3*v+3)),f.fromArray(e.ups.slice(3*v,3*v+3));else if(n<=t)v=e.times.length-1,s.fromArray(e.cameras.slice(3*v,3*v+3)),c.fromArray(e.targets.slice(3*v,3*v+3)),f.fromArray(e.ups.slice(3*v,3*v+3));else{if(-1==(n=e.times.findIndex(function(e){return t<=e})))return;s.fromArray(e.cameras.slice(3*(v=0==n?0:n-1),3*v+3)),l.fromArray(e.cameras.slice(3*n,3*n+3)),c.fromArray(e.targets.slice(3*v,3*v+3)),d.fromArray(e.targets.slice(3*n,3*n+3)),u.fromArray(e.orbitCenters.slice(3*v,3*v+3)),h.fromArray(e.orbitCenters.slice(3*n,3*n+3)),p.fromArray(e.ups.slice(3*v,3*v+3)),m.fromArray(e.devices.slice(3*n,3*n+3)),y.fromArray(e.projectionMatrixInverses.slice(16*n,16*n+16));var g=e.times.map(function(e){return(e-r)/a}),_=[],_=(new THREE.LinearInterpolant(g,e.cameras,3,_).evaluate(o/a),(new THREE.Vector3).fromArray(_)),w=[],w=(new THREE.LinearInterpolant(g,e.ups,3,w).evaluate(o/a),f.fromArray(w),[]),g=(new THREE.LinearInterpolant(g,e.targets,3,w).evaluate(o/a),(new THREE.Vector3).fromArray(w)),o=new THREE.Vector3,w=s.distanceToSquared(c).toFixed(2),x=l.distanceToSquared(d).toFixed(2),I=(new THREE.Vector3).subVectors(c,u),b=(new THREE.Vector3).subVectors(d,h),M=(new THREE.Vector3).subVectors(s,c),d=(new THREE.Vector3).subVectors(l,d);if(1e-4=n.startTime&&t<=n.endTime)return n}return null}function f(e,t,i){var r=i.renderer.getPixelRatio(),i=i.renderer.domElement;return{x:e*r/i.width*2-1,y:2*-(t*r/i.height)+1}}function N(e,t,i){var r=i.renderer.getPixelRatio(),i=i.renderer.domElement,n=i.width/2,i=i.height/2;return{x:Math.round((n*e+n)/r),y:Math.round((-i*t+i)/r)}}function z(e,t){var i=e.times[e.times.length-1],r=e.times[0],n=[],a={};return i=e.length?{done:!0}:{done:!1,value:e[i++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);in.length-1||(T=!0,w&&(A&&a&&(a.uncacheAction(A),A=null),(r=n[e]).resetDuration(),a=new THREE.AnimationMixer(b),(A=a.clipAction(r)).loop=o,A.timeScale=E,w=!1,a.addEventListener("finished",function(e){D.dispatchEvent({type:"animationfinished",event:e}),D.animationFinish=!0,s=1}),a.addEventListener("loop",function(e){D.dispatchEvent({type:"animationloop",event:e}),2202==A.loop&&s++,D.activeAudio&&(D.activeAudio.howl.stop(),D.activeAudio=null)})),A.time=S,S=0,A.play(),I.start(),k=0,M.animationFinish=!1,M.viewer.AnimationEdit||M.changeBodyByTime(0),M.viewer.controls.staticAnnotation&&M.viewer.controls.staticAnnotation.SetEnableMove(!1),M.viewer.removeEventListener("updateProgress",M.viewer.onUpdateProgress),M.viewer.render())},M.getAnimations=function(){var i=[];return x.forEach(function(e,t){i[t]=e.name}),i},M.clearAnimations=function(){a.stopAllAction(),n.forEach(function(e){a.uncacheClip(e)}),b&&a.uncacheRoot(b),x=[],n=[],w=!(b=A=null),this._animationData={},_=[],this.node_animations.clear(),l.clear(),this.cameraTrackMap.clear(),this.activeAudio=null},M.AnimationStop=function(e){if((void 0===e&&(e=!0),I.stop(),T=!1,b)&&(M.activeAudio&&(M.activeAudio.howl.stop(),M.activeAudio=null),A&&(t=F(M.playlistMap,A.time,b.animationID))&&t.howl.stop(),S=0,!M.resetState)){if(e){var t={uuids:M._defaultRootUUID||[],imageLabelsMap:M.imageLabelsMap,textLabelsMap:M.textLabelsMap,textIdLabelsMap:M.textIdLabelsMap,id2showHideStatusMap:M.id2showHideStatusMap,id2showHideTrackMap:M.id2showHideTrackMap,time:0,selectedHideTreeBody:M.selectedHideTreeBody};Q(M.viewer,t,b.animationID);for(var i=0,r=b.children.length;in.length-1?-1:x[e].loopTime},M.addLablels=function(e){var i,r,n,t,a,o,s,l,c,d,u;this.initLables||(this.initLables=!0,NDSWebViewer.SETTING.HideLeafBody&&this.viewer.ndsModel.unmergeNode(),!this.viewer.AnimationEdit&&e.textLabels&&e.textLabels.length&&(t=e.textLabels,t=t,i=this.textLabelsMap,r=this.viewer,n=!1,Array.isArray(t))&&t.length&&t.forEach(function(e){var t;i.has(e.id)||(t=v({},e,{interPnt:(new THREE.Vector3).fromArray(e.interPnt),projPt:(new THREE.Vector3).fromArray(e.projPt)}),i.set(e.id,t),t=i.get(e.id),r.setNoteAnnotation(t),r.setPicTextVisible(e.id,!!n))}),!this.viewer.AnimationEdit&&e.imageLabels&&e.imageLabels.length&&(t=e.imageLabels,l=t,a=this.imageLabelsMap,o=this.viewer,s=!1,Array.isArray(l))&&l.length&&l.forEach(function(e){a.has(e.id)||(a.set(e.id,e),o.setPicAnnotation(e),o.setPicTextVisible(e.id,!!s))}),!this.viewer.AnimationEdit&&e.textIdLabels&&e.textIdLabels.length&&(l=e.textIdLabels,e=l,c=this.textIdLabelsMap,d=this.viewer,u=!1,Array.isArray(e))&&e.length&&(d.textAnimationOp("init",d),d.textAnimationOp("setData",e),e.forEach(function(e){c.has(e.id)||c.set(e.id,e),d.textAnimationOp("setTextPointShow",e.id,!!u),u&&d.textAnimationOp("setFontHeight",e.id,e.style.height)})),NDSWebViewer.SETTING.HideLeafBody&&this.viewer.ndsModel.mergeNode())},M.switchAnnimation=function(){var i=h(H().mark(function e(t,i){var r,n,a,o,s,l,c,d,u,h;return H().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.resetAnimationState(),e.next=3,this.resetAnimationModel(t,i);case 3:for(r=0;r=e.length?{done:!0}:{done:!1,value:e[i++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);ie.length-1?-1:e[r].id:-1},r.getTargetIncludeNdsModelIds=function(e,t){var i=[],r=this.viewer.ndsModel.getModelsByAnimationId(e);if(r&&0=t&&l.times[c]<=i&&o.push({trackID:l.trackID,time:l.times[c]});if(o&&0t.x||e.y>t.y||e.z>t.z||(this.viewer.controls.setBoundingBox(e,t),this.viewer.switchRotateCenterBySelection()))},r.getImageLabels=function(){var e=[],t=this.viewer.getallPicContent();if(Array.isArray(t))for(var i=0;i