From c6bf3a8d50e00f30ad046df65a533b4dedde3dc0 Mon Sep 17 00:00:00 2001 From: amandaghassaei Date: Fri, 1 Jul 2022 16:43:43 -0700 Subject: [PATCH] attempting to fix #10 by defining remaining in a compiled dep --- demo/dist/index.js | 20 ++++++++++---------- demo/dist/index.js.map | 2 +- dist/canvas-capture.js | 2 +- dist/canvas-capture.js.map | 2 +- dist/canvas-capture.min.js | 2 +- dist/canvas-capture.min.js.map | 2 +- src/CCapture.js/gif.js | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demo/dist/index.js b/demo/dist/index.js index c3e55a2..dc8181b 100644 --- a/demo/dist/index.js +++ b/demo/dist/index.js @@ -3403,7 +3403,7 @@ if ( true && typeof module.exports !== 'undefined') { /***/ ((module) => { // gif.js 0.2.0 - https://github.com/jnordberg/gif.js -(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":3,"./TypedNeuQuant.js":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit("start");return this.emit("progress",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log("killing active worker");worker.terminate()}this.running=false;return this.emit("abort")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log("spawning worker "+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log("frame "+frame.index+" finished - "+this.activeWorkers.length+" active");this.finishedFrames++;this.emit("progress",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log("global palette analyzed");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log("starting frame "+(task.index+1)+" of "+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement("canvas");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext("2d");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name==="chrome"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error("Invalid frame")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{"./GIFEncoder.js":2,"./browser.coffee":5,"./gif.worker.coffee":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":3,"./TypedNeuQuant.js":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit("start");return this.emit("progress",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log("killing active worker");worker.terminate()}this.running=false;return this.emit("abort")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log("spawning worker "+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log("frame "+frame.index+" finished - "+this.activeWorkers.length+" active");this.finishedFrames++;this.emit("progress",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log("global palette analyzed");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log("starting frame "+(task.index+1)+" of "+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement("canvas");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext("2d");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name==="chrome"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error("Invalid frame")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{"./GIFEncoder.js":2,"./browser.coffee":5,"./gif.worker.coffee":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i { /******/ // define getter functions for harmony exports -/******/ __nested_webpack_require_301774__.d = (exports, definition) => { +/******/ __nested_webpack_require_301778__.d = (exports, definition) => { /******/ for(var key in definition) { -/******/ if(__nested_webpack_require_301774__.o(definition, key) && !__nested_webpack_require_301774__.o(exports, key)) { +/******/ if(__nested_webpack_require_301778__.o(definition, key) && !__nested_webpack_require_301778__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } @@ -4913,7 +4913,7 @@ module.exports = JSON.parse('{"_from":"@ffmpeg/ffmpeg","_id":"@ffmpeg/ffmpeg@0.1 /******/ /******/ /* webpack/runtime/global */ /******/ (() => { -/******/ __nested_webpack_require_301774__.g = (function() { +/******/ __nested_webpack_require_301778__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); @@ -4925,13 +4925,13 @@ module.exports = JSON.parse('{"_from":"@ffmpeg/ffmpeg","_id":"@ffmpeg/ffmpeg@0.1 /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __nested_webpack_require_301774__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ __nested_webpack_require_301778__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports -/******/ __nested_webpack_require_301774__.r = (exports) => { +/******/ __nested_webpack_require_301778__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } @@ -4941,7 +4941,7 @@ module.exports = JSON.parse('{"_from":"@ffmpeg/ffmpeg","_id":"@ffmpeg/ffmpeg@0.1 /******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { -/******/ __nested_webpack_require_301774__.nmd = (module) => { +/******/ __nested_webpack_require_301778__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; @@ -4958,7 +4958,7 @@ var exports = __webpack_exports__; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CanvasCapture = void 0; // Default export. -var CanvasCapture = __nested_webpack_require_301774__(914); +var CanvasCapture = __nested_webpack_require_301778__(914); exports.CanvasCapture = CanvasCapture; exports["default"] = CanvasCapture; diff --git a/demo/dist/index.js.map b/demo/dist/index.js.map index 1505861..e994794 100644 --- a/demo/dist/index.js.map +++ b/demo/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;AAAA;AACA,IAAI,IAAyD;AAC7D;AACA,MAAM,EAK8B;AACpC,CAAC;AACD,yBAAyB;AACzB;;AAEA;AACA,0CAA0C,8BAAmB;;AAE7D,mBAAmB,8BAAmB;AACtC,QAAQ,kBAAkB,EAAE,8BAAmB;;AAE/C;AACA;AACA;AACA;AACA,aAAa,MAAK;AAClB,MAAM,CAAC;AACP,wCAAwC,6CAA6C;AACrF;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,8BAAmB;;AAE7D,mBAAmB,8BAAmB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,UAAU,SAAS,UAAU;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D;AACA,mBAAmB,+BAAmB;AACtC,QAAQ,MAAM,EAAE,+BAAmB;;AAEnC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,KAAK,cAAc,gBAAgB;AACpD,iCAAiC,gBAAgB;AACjD;AACA,iBAAiB,KAAK,aAAa,QAAQ;AAC3C;AACA;;AAEA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D,uBAAuB,+BAAmB;AAC1C,4BAA4B,+BAAmB;AAC/C,kBAAkB,+BAAmB;;AAErC;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D,QAAQ,2BAA2B,EAAE,+BAAmB;AACxD,QAAQ,mCAAmC,EAAE,+BAAmB;AAChE,sBAAsB,+BAAmB;AACzC,kBAAkB,+BAAmB;AACrC,QAAQ,sCAAsC,EAAE,+BAAmB;AACnE,QAAQ,UAAU,EAAE,+BAAmB;;AAEvC;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,QAAQ,EAAE,uDAAuD,YAAY,gCAAgC;AACvI;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA,+CAA+C,QAAQ;AACvD,UAAU;AACV,gDAAgD,QAAQ;AACxD,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,eAAe;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC,MAAM;AACN,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;;;AAGA;AACA;AACA,CAAC;AACD;AACA;;AAEA,mCAAmC,0BAA0B,0CAA0C,gBAAgB,OAAO,oBAAoB,eAAe,OAAO;;AAExK;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,8BAA8B;AAC9B,gCAAgC;AAChC,8BAA8B;AAC9B,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B,8BAA8B;AAC9B,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAiC;AACjC,kCAAkC;AAClC,kCAAkC;AAClC,uBAAuB;;AAEvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO;;AAEP;AACA,iCAAiC,gCAAmB;;AAEpD,gGAAgG,eAAe,GAAG,IAAI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AAEP;AACA,sDAAsD,iCAAmB;;AAEzE;AACA,iCAAmB;AACnB,qBAAqB,iCAAmB;AACxC;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAyC,SAAS;;AAElD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,gGAAgG;;AAEhG;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,gBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;;AAEA,gFAAgF,aAAa;AAC7F;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,iDAAiD;;AAEjD;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,0DAA0D;;AAE1D,0DAA0D;AAC1D;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA,uDAAuD;;AAEvD,iDAAiD;AACjD;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,GAAG;;AAEZ;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc;AACd;;;AAGA;AACA;AACA,kHAAkH,eAAe,kBAAkB;AACnJ,4DAA4D,eAAe,kBAAkB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;;;AAGA;AACA;AACA,sHAAsH,eAAe,kBAAkB;AACvJ,4DAA4D,eAAe,kBAAkB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;;;AAGA;AACA;AACA,kCAAkC;AAClC;AACA,KAAK,WAAW;;AAEhB,wGAAwG;;;AAGxG,wEAAwE;;AAExE,4FAA4F;;AAE5F;AACA;AACA;AACA;AACA,wCAAw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C,YAAY,iCAAmB;AAC/B;AACA;AACA;AACA;AACA,eAAe,iCAAmB;AAClC,gDAAgD,qCAAqC,+BAA+B;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wGAAwG;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2JAA2J,sBAAsB;AACjL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2JAA2J,sBAAsB;AACjL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iKAAiK,sBAAsB;AACvL,kEAAkE,cAAc;AAChF;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iCAAmB;AAC1D;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,6CAA6C;AACvG;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,mBAAmB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;;AAEA,gDAAgD,aAAa;AAC7D;AACA,yGAAyG,2IAA2I,GAAG,qBAAqB,oBAAoB,WAAW,YAAY,aAAa,cAAc,gCAAgC,kBAAkB,4BAA4B,wBAAwB,GAAG,uBAAuB,2BAA2B,kBAAkB,qBAAqB,sBAAsB,qBAAqB,2BAA2B,GAAG,oBAAoB,kBAAkB,mCAAmC,wBAAwB,GAAG,mBAAmB,kBAAkB,qBAAqB,qBAAqB,uBAAuB,sBAAsB,gBAAgB,2BAA2B,GAAG,oBAAoB,sBAAsB,GAAG,gCAAgC,sBAAsB,GAAG,mBAAmB,4BAA4B,cAAc,GAAG,0CAA0C,sBAAsB,qBAAqB,qBAAqB,wBAAwB,qBAAqB,0BAA0B,GAAG,iBAAiB,uBAAuB,uBAAu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DAAgD,aAAa;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA,yBAAyB,iCAAmB;;AAE5C,gCAAgC,iCAAmB;AACnD,mCAAmC;AACnC;AACA,KAAK,KAAI;AACT,YAAY,iCAAmB;AAC/B,iBAAiB,iCAAmB;AACpC,YAAY,iCAAmB;AAC/B,mBAAmB,iCAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iCAAmB,kBAAkB,iCAAmB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB;AACzD,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uBAAuB;AAC7D;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wCAAwC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,uBAAuB;AAC9F,uEAAuE,uBAAuB;AAC9F,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA,KAAK,gBAAgB,iCAAmB;AACxC;AACA;AACA;AACA,OAAO,EAAE;AACT;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;;;AAGpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC,4BAA4B;AAC5B;AACA;AACA;AACA;;;;AAIA;AACA,iDAAiD;AACjD;AACA;AACA,cAAc;AACd,EAAE;;AAEF;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,EAAE;AACF;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA;;;;AAIA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,KAAK;;AAEb,uBAAuB,QAAQ;AAC/B;;AAEA;;;AAGA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uBAAuB,kCAAkC;AAChF,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;;AAGA;AACA,yBAAyB,wBAAwB;;AAEjD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ACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,YAAY;AAChD;AACA;AACA;;AAEA,+BAA+B;AAC/B,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,YAAY;AAClD;AACA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA,sBAAsB,wFAAwF;;AAE9G;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,iBAAiB,gCAAgC;;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,IAAI;;AAEJ;;AAEA,8BAA8B,uBAAuB;;AAErD;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,KAAI;AACX;AACA,IAAI;AACJ;AACA;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU,8BAA8B;AACxC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI,IAAI;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR,OAAO;AACP,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP,OAAO;AACP;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;;AAEA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA,+BAA+B,mBAAmB;AAClD,MAAM;AACN;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;;AAEA,+DAA+D;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,mBAAmB;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wDAAwD,iBAAiB;;AAEzE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;;AAEA,oDAAoD;;AAEpD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,mEAAmE;;AAEnE;AACA;AACA,kBAAkB;AAClB,8DAA8D;AAC9D;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,kEAAkE;AAClE;AACA;AACA,kBAAkB;AAClB;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA,2BAA2B,iEAAiE;AAC5F,kCAAkC,iEAAiE;AACnG,6BAA6B,iEAAiE;AAC9F,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oEAAoE;AACpE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB,mFAAmF;;AAEnF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,yBAAyB;;AAE1E;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0DAA0D;AAC1D;AACA;AACA;;AAEA,SAAS,KAAI;AACb;AACA;AACA,MAAM;AACN;AACA;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA;AACA,8BAA8B,2OAA2O,eAAe,iLAAiL,0PAA0P,iDAAiD,YAAY,+CAA+C,SAAS,yDAAyD,4CAA4C,+FAA+F,kFAAkF,2bAA2b,gBAAgB,qBAAqB,YAAY,mBAAmB,uLAAuL,uEAAuE,YAAY,ywBAAywB,6CAA6C;;AAE7oF,OAAO;;AAEP,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mBAAmB,iCAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,iCAAmB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA,gBAAgB,iCAAmB,wBAAwB,iCAAmB;AAC9E,oDAAoD,wCAAwC;AAC5F;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,YAAY;AACZ,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA,kEAAkE,iBAAiB;AACnF;AACA,2DAA2D,aAAa;AACxE;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,aAAa;AAC7D;AACA;AACA,oBAAoB,iCAAmB;AACvC;AACA;;AAEA,CAAC;;AAED;AACA,UAAU;AACV;AACA,CAAC;AACD;;;;;;UCt2JA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;;ACtBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,UAAU,mBAAO,CAAC,wCAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+DAA+D;AAC3G,kCAAkC,6CAA6C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gEAAgE;AAC5G,kCAAkC,8CAA8C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+DAA+D;AAC3G,kCAAkC,6CAA6C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sEAAsE;AAClH,kCAAkC,iDAAiD;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uEAAuE;AACnH,kCAAkC,kDAAkD;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA","sources":["webpack://canvas-capture/./dist/canvas-capture.js","webpack://canvas-capture/webpack/bootstrap","webpack://canvas-capture/./demo/src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CanvasCapture\"] = factory();\n\telse\n\t\troot[\"CanvasCapture\"] = factory();\n})(self, function() {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 76:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst resolveURL = __webpack_require__(72);\nconst { devDependencies } = __webpack_require__(681);\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: false\n ? 0\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n\n\n/***/ }),\n\n/***/ 339:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst resolveURL = __webpack_require__(72);\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n\n\n/***/ }),\n\n/***/ 440:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n/* eslint-disable no-undef */\nconst resolveURL = __webpack_require__(72);\nconst { log } = __webpack_require__(888);\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n\n\n/***/ }),\n\n/***/ 451:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst defaultOptions = __webpack_require__(76);\nconst getCreateFFmpegCore = __webpack_require__(440);\nconst fetchFile = __webpack_require__(339);\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n\n\n/***/ }),\n\n/***/ 617:\n/***/ ((module) => {\n\nmodule.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n\n\n/***/ }),\n\n/***/ 648:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst { defaultArgs, baseOptions } = __webpack_require__(617);\nconst { setLogging, setCustomLogger, log } = __webpack_require__(888);\nconst parseProgress = __webpack_require__(405);\nconst parseArgs = __webpack_require__(10);\nconst { defaultOptions, getCreateFFmpegCore } = __webpack_require__(451);\nconst { version } = __webpack_require__(681);\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n\n\n/***/ }),\n\n/***/ 888:\n/***/ ((module) => {\n\nlet logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n\n\n/***/ }),\n\n/***/ 10:\n/***/ ((module) => {\n\nmodule.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n\n\n/***/ }),\n\n/***/ 405:\n/***/ ((module) => {\n\nlet duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n\n\n/***/ }),\n\n/***/ 809:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.changeDpiBlob = changeDpiBlob;\nexports.changeDpiDataUrl = changeDpiDataUrl;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction createPngDataTable() {\n /* Table of CRCs of all 8-bit messages. */\n var crcTable = new Int32Array(256);\n for (var n = 0; n < 256; n++) {\n var c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1;\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nfunction calcCrc(buf) {\n var c = -1;\n if (!pngDataTable) pngDataTable = createPngDataTable();\n for (var n = 0; n < buf.length; n++) {\n c = pngDataTable[(c ^ buf[n]) & 0xFF] ^ c >>> 8;\n }\n return c ^ -1;\n}\n\nvar pngDataTable = void 0;\n\nvar PNG = 'image/png';\nvar JPEG = 'image/jpeg';\n\n// those are 3 possible signature of the physBlock in base64.\n// the pHYs signature block is preceed by the 4 bytes of lenght. The length of\n// the block is always 9 bytes. So a phys block has always this signature:\n// 0 0 0 9 p H Y s.\n// However the data64 encoding aligns we will always find one of those 3 strings.\n// this allow us to find this particular occurence of the pHYs block without\n// converting from b64 back to string\nvar b64PhysSignature1 = 'AAlwSFlz';\nvar b64PhysSignature2 = 'AAAJcEhZ';\nvar b64PhysSignature3 = 'AAAACXBI';\n\nvar _P = 'p'.charCodeAt(0);\nvar _H = 'H'.charCodeAt(0);\nvar _Y = 'Y'.charCodeAt(0);\nvar _S = 's'.charCodeAt(0);\n\nfunction changeDpiBlob(blob, dpi) {\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var headerChunk = blob.slice(0, 33);\n return new Promise(function (resolve, reject) {\n var fileReader = new FileReader();\n fileReader.onload = function () {\n var dataArray = new Uint8Array(fileReader.result);\n var tail = blob.slice(33);\n var changedArray = changeDpiOnArray(dataArray, dpi, blob.type);\n resolve(new Blob([changedArray, tail], { type: blob.type }));\n };\n fileReader.readAsArrayBuffer(headerChunk);\n });\n}\n\nfunction changeDpiDataUrl(base64Image, dpi) {\n var dataSplitted = base64Image.split(',');\n var format = dataSplitted[0];\n var body = dataSplitted[1];\n var type = void 0;\n var headerLength = void 0;\n var overwritepHYs = false;\n if (format.indexOf(PNG) !== -1) {\n type = PNG;\n var b64Index = detectPhysChunkFromDataUrl(body);\n // 28 bytes in dataUrl are 21bytes, length of phys chunk with everything inside.\n if (b64Index >= 0) {\n headerLength = Math.ceil((b64Index + 28) / 3) * 4;\n overwritepHYs = true;\n } else {\n headerLength = 33 / 3 * 4;\n }\n }\n if (format.indexOf(JPEG) !== -1) {\n type = JPEG;\n headerLength = 18 / 3 * 4;\n }\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var stringHeader = body.substring(0, headerLength);\n var restOfData = body.substring(headerLength);\n var headerBytes = atob(stringHeader);\n var dataArray = new Uint8Array(headerBytes.length);\n for (var i = 0; i < dataArray.length; i++) {\n dataArray[i] = headerBytes.charCodeAt(i);\n }\n var finalArray = changeDpiOnArray(dataArray, dpi, type, overwritepHYs);\n var base64Header = btoa(String.fromCharCode.apply(String, _toConsumableArray(finalArray)));\n return [format, ',', base64Header, restOfData].join('');\n}\n\nfunction detectPhysChunkFromDataUrl(data) {\n var b64index = data.indexOf(b64PhysSignature1);\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature2);\n }\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature3);\n }\n // if b64index === -1 chunk is not found\n return b64index;\n}\n\nfunction searchStartOfPhys(data) {\n var length = data.length - 1;\n // we check from the end since we cut the string in proximity of the header\n // the header is within 21 bytes from the end.\n for (var i = length; i >= 4; i--) {\n if (data[i - 4] === 9 && data[i - 3] === _P && data[i - 2] === _H && data[i - 1] === _Y && data[i] === _S) {\n return i - 3;\n }\n }\n}\n\nfunction changeDpiOnArray(dataArray, dpi, format, overwritepHYs) {\n if (format === JPEG) {\n dataArray[13] = 1; // 1 pixel per inch or 2 pixel per cm\n dataArray[14] = dpi >> 8; // dpiX high byte\n dataArray[15] = dpi & 0xff; // dpiX low byte\n dataArray[16] = dpi >> 8; // dpiY high byte\n dataArray[17] = dpi & 0xff; // dpiY low byte\n return dataArray;\n }\n if (format === PNG) {\n var physChunk = new Uint8Array(13);\n // chunk header pHYs\n // 9 bytes of data\n // 4 bytes of crc\n // this multiplication is because the standard is dpi per meter.\n dpi *= 39.3701;\n physChunk[0] = _P;\n physChunk[1] = _H;\n physChunk[2] = _Y;\n physChunk[3] = _S;\n physChunk[4] = dpi >>> 24; // dpiX highest byte\n physChunk[5] = dpi >>> 16; // dpiX veryhigh byte\n physChunk[6] = dpi >>> 8; // dpiX high byte\n physChunk[7] = dpi & 0xff; // dpiX low byte\n physChunk[8] = physChunk[4]; // dpiY highest byte\n physChunk[9] = physChunk[5]; // dpiY veryhigh byte\n physChunk[10] = physChunk[6]; // dpiY high byte\n physChunk[11] = physChunk[7]; // dpiY low byte\n physChunk[12] = 1; // dot per meter....\n\n var crc = calcCrc(physChunk);\n\n var crcChunk = new Uint8Array(4);\n crcChunk[0] = crc >>> 24;\n crcChunk[1] = crc >>> 16;\n crcChunk[2] = crc >>> 8;\n crcChunk[3] = crc & 0xff;\n\n if (overwritepHYs) {\n var startingIndex = searchStartOfPhys(dataArray);\n dataArray.set(physChunk, startingIndex);\n dataArray.set(crcChunk, startingIndex + 13);\n return dataArray;\n } else {\n // i need to give back an array of data that is divisible by 3 so that\n // dataurl encoding gives me integers, for luck this chunk is 17 + 4 = 21\n // if it was we could add a text chunk contaning some info, untill desired\n // length is met.\n\n // chunk structur 4 bytes for length is 9\n var chunkLength = new Uint8Array(4);\n chunkLength[0] = 0;\n chunkLength[1] = 0;\n chunkLength[2] = 0;\n chunkLength[3] = 9;\n\n var finalHeader = new Uint8Array(54);\n finalHeader.set(dataArray, 0);\n finalHeader.set(chunkLength, 33);\n finalHeader.set(physChunk, 37);\n finalHeader.set(crcChunk, 50);\n return finalHeader;\n }\n }\n}\n\n/***/ }),\n\n/***/ 162:\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open(\"GET\",a),d.responseType=\"blob\",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error(\"could not download file\")},d.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof __webpack_require__.g&&__webpack_require__.g.global===__webpack_require__.g?__webpack_require__.g:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open(\"\",\"_blank\"),g&&(g.document.title=g.document.body.innerText=\"downloading...\"),\"string\"==typeof b)return c(b,d,e);var h=\"application/octet-stream\"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&\"undefined\"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g, true&&(module.exports=g)});\n\n//# sourceMappingURL=FileSaver.min.js.map\n\n/***/ }),\n\n/***/ 733:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n/*!\n\nJSZip v3.7.1 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(t){if(true)module.exports=t();else {}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e=undefined;if(!t&&e)return require(r,!0);if(l)return l(r,!0);var i=new Error(\"Cannot find module '\"+r+\"'\");throw i.code=\"MODULE_NOT_FOUND\",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l=undefined,t=0;t>2,s=(3&e)<<4|r>>4,a=1>6:64,o=2>4,r=(15&n)<<4|(s=p.indexOf(t.charAt(o++)))>>2,i=(3&s)<<6|(a=p.indexOf(t.charAt(o++))),l[h++]=e,64!==s&&(l[h++]=r),64!==a&&(l[h++]=i);return l}},{\"./support\":30,\"./utils\":32}],2:[function(t,e,r){\"use strict\";var i=t(\"./external\"),n=t(\"./stream/DataWorker\"),s=t(\"./stream/Crc32Probe\"),a=t(\"./stream/DataLengthProbe\");function o(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(i.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 n(i.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 i=t(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(t){return new i(\"STORE compression\")},uncompressWorker:function(){return new i(\"STORE decompression\")}},r.DEFLATE=t(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(t,e,r){\"use strict\";var i=t(\"./utils\");var o=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)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\"!==i.getTypeOf(t)?function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):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 i=null;i=\"undefined\"!=typeof Promise?Promise:t(\"lie\"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){\"use strict\";var i=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,n=t(\"pako\"),s=t(\"./utils\"),a=t(\"./stream/GenericWorker\"),o=i?\"uint8array\":\"array\";function h(t,e){a.call(this,\"FlateWorker/\"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic=\"\\b\\0\",s.inherits(h,a),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(t){return new h(\"Deflate\",t)},r.uncompressWorker=function(){return new h(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(t,e,r){\"use strict\";function A(t,e){var r,i=\"\";for(r=0;r>>=8;return i}function i(t,e,r,i,n,s){var a,o,h=t.file,u=t.compression,l=s!==O.utf8encode,f=I.transformTo(\"string\",s(h.name)),d=I.transformTo(\"string\",O.utf8encode(h.name)),c=h.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",O.utf8encode(c)),_=d.length!==h.name.length,g=m.length!==c.length,b=\"\",v=\"\",y=\"\",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(x.crc32=t.crc32,x.compressedSize=t.compressedSize,x.uncompressedSize=t.uncompressedSize);var S=0;e&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),\"UNIX\"===n?(C=798,z|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(t){return 63&(t||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+d,b+=\"up\"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+=\"uc\"+A(y.length,2)+y);var E=\"\";return E+=\"\\n\\0\",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+\"\\0\\0\\0\\0\"+A(z,4)+A(i,4)+f+b+p}}var I=t(\"../utils\"),n=t(\"../stream/GenericWorker\"),O=t(\"../utf8\"),B=t(\"../crc32\"),R=t(\"../signature\");function s(t,e,r,i){n.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,n),s.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,n.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},s.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},s.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 R.DATA_DESCRIPTOR+A(t.crc32,4)+A(t.compressedSize,4)+A(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},s.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 i.transformTo(\"string\",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},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=n},{\"../utils\":32}],19:[function(t,e,r){\"use strict\";var i=t(\"./Uint8ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(t,e,r){\"use strict\";var i=t(\"./DataReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.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=n},{\"../utils\":32,\"./DataReader\":18}],21:[function(t,e,r){\"use strict\";var i=t(\"./ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"../support\"),s=t(\"./ArrayReader\"),a=t(\"./StringReader\"),o=t(\"./NodeBufferReader\"),h=t(\"./Uint8ArrayReader\");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),\"string\"!==e||n.uint8array?\"nodebuffer\"===e?new o(t):n.uint8array?new h(i.transformTo(\"uint8array\",t)):new s(i.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\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../utils\");function s(t){i.call(this,\"ConvertWorker to \"+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../crc32\");function s(){i.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}t(\"../utils\").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(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 i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.call(this,\"DataLengthProbe for \"+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.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=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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 i(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}i.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=i},{}],29:[function(t,e,r){\"use strict\";var h=t(\"../utils\"),n=t(\"./ConvertWorker\"),s=t(\"./GenericWorker\"),u=t(\"../base64\"),i=t(\"../support\"),a=t(\"../external\"),o=null;if(i.nodestream)try{o=t(\"../nodejs/NodejsStreamOutputAdapter\")}catch(t){}function l(t,o){return new a.Promise(function(e,r){var i=[],n=t._internalType,s=t._outputType,a=t._mimeType;t.on(\"data\",function(t,e){i.push(t),o&&o(e)}).on(\"error\",function(t){i=[],r(t)}).on(\"end\",function(){try{var t=function(t,e,r){switch(t){case\"blob\":return h.newBlob(h.transformTo(\"arraybuffer\",e),r);case\"base64\":return u.encode(e);default:return h.transformTo(t,e)}}(s,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},s.utf8decode=function(t){return h.nodebuffer?o.transformTo(\"nodebuffer\",t).toString(\"utf-8\"):function(t){var e,r,i,n,s=t.length,a=new Array(2*s);for(e=r=0;e>10&1023,a[r++]=56320|1023&i)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(t=o.transformTo(h.uint8array?\"uint8array\":\"array\",t))},o.inherits(a,i),a.prototype.processChunk=function(t){var e=o.transformTo(h.uint8array?\"uint8array\":\"array\",t.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var i=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?e:0===r?e:r+u[t[r]]>e?r:e}(e),n=e;i!==e.length&&(h.uint8array?(n=e.subarray(0,i),this.leftOver=e.subarray(i,e.length)):(n=e.slice(0,i),this.leftOver=e.slice(i,e.length))),this.push({data:s.utf8decode(n),meta:t.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,i),l.prototype.processChunk=function(t){this.push({data:s.utf8encode(t.data),meta:t.meta})},s.Utf8EncodeWorker=l},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(t,e,a){\"use strict\";var o=t(\"./support\"),h=t(\"./base64\"),r=t(\"./nodejsUtils\"),i=t(\"set-immediate-shim\"),u=t(\"./external\");function n(t){return t}function l(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(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new h.Buf8(t.length),r=0,i=e.length;r>10&1023,o[i++]=56320|1023&n)}return l(o,i)},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?e:0===r?e:r+u[t[r]]>e?r:e}},{\"./common\":41}],43:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var n=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 n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){\"use strict\";var h,d=t(\"../utils/common\"),u=t(\"./trees\"),c=t(\"./adler32\"),p=t(\"./crc32\"),i=t(\"./messages\"),l=0,f=4,m=0,_=-2,g=-1,b=4,n=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(t,e){return t.msg=i[e],e}function T(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(d.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 N(t,e){u._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,F(t.strm)}function U(t,e){t.pending_buf[t.pending++]=e}function P(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function L(t,e){var r,i,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-z?t.strstart-(t.w_size-z):0,u=t.window,l=t.w_mask,f=t.prev,d=t.strstart+S,c=u[s+a-1],p=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--n);return a<=t.lookahead?a:t.lookahead}function j(t){var e,r,i,n,s,a,o,h,u,l,f=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-z)){for(d.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);n+=f}if(0===t.strm.avail_in)break;if(a=t.strm,o=t.window,h=t.strstart+t.lookahead,u=n,l=void 0,l=a.avail_in,u=x)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x)if(i=u._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,i=u._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(j(t),0===t.lookahead&&e===l)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-z&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(t,e){return Y(t,e,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?_:(t.state.gzhead=e,m):_},r.deflate=function(t,e){var r,i,n,s;if(!t||!t.state||5>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=p(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=E);else{var a=v+(i.w_bits-8<<4)<<8;a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=E,P(i,a),0!==i.strstart&&(P(i,t.adler>>>16),P(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(t),i.pending+2<=i.pending_buf_size&&(U(i,255&t.adler),U(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(F(t),0===t.avail_out)return i.last_flush=-1,m}else if(0===t.avail_in&&T(e)<=T(r)&&e!==f)return R(t,-5);if(666===i.status&&0!==t.avail_in)return R(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==l&&666!==i.status){var o=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(j(t),0===t.lookahead)){if(e===l)return A;break}if(t.match_length=0,r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):3===i.strategy?function(t,e){for(var r,i,n,s,a=t.window;;){if(t.lookahead<=S){if(j(t),t.lookahead<=S&&e===l)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(r=u._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):h[i.level].func(i,e);if(o!==O&&o!==B||(i.status=666),o===A||o===O)return 0===t.avail_out&&(i.last_flush=-1),m;if(o===I&&(1===e?u._tr_align(i):5!==e&&(u._tr_stored_block(i,0,0,!1),3===e&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),F(t),0===t.avail_out))return i.last_flush=-1,m}return e!==f?m:i.wrap<=0?1:(2===i.wrap?(U(i,255&t.adler),U(i,t.adler>>8&255),U(i,t.adler>>16&255),U(i,t.adler>>24&255),U(i,255&t.total_in),U(i,t.total_in>>8&255),U(i,t.total_in>>16&255),U(i,t.total_in>>24&255)):(P(i,t.adler>>>16),P(i,65535&t.adler)),F(t),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new d.Buf8(r.w_size),d.arraySet(u,e,l-r.w_size,r.w_size,0),e=u,l=r.w_size),a=t.avail_in,o=t.next_in,h=t.input,t.avail_in=l,t.next_in=0,t.input=e,j(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(c&(1<>>=y,p-=y),p<15&&(c+=z[i++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(c&(1<>>=y,p-=y,(y=s-a)>3,c&=(1<<(p-=w<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){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 I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=P,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new I.Buf32(i),e.distcode=e.distdyn=new I.Buf32(n),e.sane=1,e.back=-1,N):U}function o(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,a(t)):U}function h(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(I.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(n=s.wsize-s.wnext)&&(n=i),I.arraySet(s.window,e,r-i,n,s.wnext),(i-=n)?(I.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){t.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(c=r.length)&&(c=o),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,i,s,c,k)),512&r.flags&&(r.check=B(r.check,i,c,s)),o-=c,s+=c,r.length-=c),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break t;for(c=0;k=i[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break t;o--,u+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==e)break;u>>>=2,l-=2;break t;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break t;o--,u+=i[s++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(c=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+c>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}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,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){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<=o&&258<=h){t.next_out=a,t.avail_out=h,t.next_in=s,t.avail_in=o,r.hold=u,r.bits=l,R(t,d),a=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=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===h)break t;if(c=d-h,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=n,p=a-r.offset,c=r.length;for(hc?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=e[r+a[v]]}if(k>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function P(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function Z(t,e,r){var i,n,s=new Array(g+1),a=0;for(i=1;i<=g;i++)s[i]=a=a+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=j(s[o]++,o))}}function W(t){var e;for(e=0;e>1;1<=r;r--)G(t,s,r);for(n=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,G(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,a,o,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=g;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<_;r++)p<(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)&&(s=p,m++),h[2*i+1]=s,u>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return h;for(e=32;e>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?J(t,e,r,i):4===t.strategy||s===n?(P(t,2+(i?1:0),3),K(t,z,C)):(P(t,4+(i?1:0),3),function(t,e,r,i){var n;for(P(t,e-257,5),P(t,r-1,5),P(t,i-4,4),n=0;n>>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*(A[r]+u+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){P(t,2,3),L(t,m,z),function(t){16===t.bi_valid?(U(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){\"use strict\";e.exports=\"function\"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)});\n\n/***/ }),\n\n/***/ 560:\n/***/ (() => {\n\nHTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(a,r,t){var i=this.toDataURL(r,t).split(\",\")[1];setTimeout(function(){for(var t=atob(i),o=t.length,e=new Uint8Array(o),n=0;n {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar MicroModal = function () {\n\n var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n var Modal = /*#__PURE__*/function () {\n function Modal(_ref) {\n var targetModal = _ref.targetModal,\n _ref$triggers = _ref.triggers,\n triggers = _ref$triggers === void 0 ? [] : _ref$triggers,\n _ref$onShow = _ref.onShow,\n onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$openTrigger = _ref.openTrigger,\n openTrigger = _ref$openTrigger === void 0 ? 'data-micromodal-trigger' : _ref$openTrigger,\n _ref$closeTrigger = _ref.closeTrigger,\n closeTrigger = _ref$closeTrigger === void 0 ? 'data-micromodal-close' : _ref$closeTrigger,\n _ref$openClass = _ref.openClass,\n openClass = _ref$openClass === void 0 ? 'is-open' : _ref$openClass,\n _ref$disableScroll = _ref.disableScroll,\n disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,\n _ref$disableFocus = _ref.disableFocus,\n disableFocus = _ref$disableFocus === void 0 ? false : _ref$disableFocus,\n _ref$awaitCloseAnimat = _ref.awaitCloseAnimation,\n awaitCloseAnimation = _ref$awaitCloseAnimat === void 0 ? false : _ref$awaitCloseAnimat,\n _ref$awaitOpenAnimati = _ref.awaitOpenAnimation,\n awaitOpenAnimation = _ref$awaitOpenAnimati === void 0 ? false : _ref$awaitOpenAnimati,\n _ref$debugMode = _ref.debugMode,\n debugMode = _ref$debugMode === void 0 ? false : _ref$debugMode;\n\n _classCallCheck(this, Modal);\n\n // Save a reference of the modal\n this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n this.config = {\n debugMode: debugMode,\n disableScroll: disableScroll,\n openTrigger: openTrigger,\n closeTrigger: closeTrigger,\n openClass: openClass,\n onShow: onShow,\n onClose: onClose,\n awaitCloseAnimation: awaitCloseAnimation,\n awaitOpenAnimation: awaitOpenAnimation,\n disableFocus: disableFocus\n }; // Register click events only if pre binding eventListeners\n\n if (triggers.length > 0) this.registerTriggers.apply(this, _toConsumableArray(triggers)); // pre bind functions for event listeners\n\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n }\n /**\n * Loops through all openTriggers and binds click event\n * @param {array} triggers [Array of node elements]\n * @return {void}\n */\n\n\n _createClass(Modal, [{\n key: \"registerTriggers\",\n value: function registerTriggers() {\n var _this = this;\n\n for (var _len = arguments.length, triggers = new Array(_len), _key = 0; _key < _len; _key++) {\n triggers[_key] = arguments[_key];\n }\n\n triggers.filter(Boolean).forEach(function (trigger) {\n trigger.addEventListener('click', function (event) {\n return _this.showModal(event);\n });\n });\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n var _this2 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n this.activeElement = document.activeElement;\n this.modal.setAttribute('aria-hidden', 'false');\n this.modal.classList.add(this.config.openClass);\n this.scrollBehaviour('disable');\n this.addEventListeners();\n\n if (this.config.awaitOpenAnimation) {\n var handler = function handler() {\n _this2.modal.removeEventListener('animationend', handler, false);\n\n _this2.setFocusToFirstNode();\n };\n\n this.modal.addEventListener('animationend', handler, false);\n } else {\n this.setFocusToFirstNode();\n }\n\n this.config.onShow(this.modal, this.activeElement, event);\n }\n }, {\n key: \"closeModal\",\n value: function closeModal() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var modal = this.modal;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.scrollBehaviour('enable');\n\n if (this.activeElement && this.activeElement.focus) {\n this.activeElement.focus();\n }\n\n this.config.onClose(this.modal, this.activeElement, event);\n\n if (this.config.awaitCloseAnimation) {\n var openClass = this.config.openClass; // <- old school ftw\n\n this.modal.addEventListener('animationend', function handler() {\n modal.classList.remove(openClass);\n modal.removeEventListener('animationend', handler, false);\n }, false);\n } else {\n modal.classList.remove(this.config.openClass);\n }\n }\n }, {\n key: \"closeModalById\",\n value: function closeModalById(targetModal) {\n this.modal = document.getElementById(targetModal);\n if (this.modal) this.closeModal();\n }\n }, {\n key: \"scrollBehaviour\",\n value: function scrollBehaviour(toggle) {\n if (!this.config.disableScroll) return;\n var body = document.querySelector('body');\n\n switch (toggle) {\n case 'enable':\n Object.assign(body.style, {\n overflow: ''\n });\n break;\n\n case 'disable':\n Object.assign(body.style, {\n overflow: 'hidden'\n });\n break;\n }\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners() {\n this.modal.addEventListener('touchstart', this.onClick);\n this.modal.addEventListener('click', this.onClick);\n document.addEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n this.modal.removeEventListener('touchstart', this.onClick);\n this.modal.removeEventListener('click', this.onClick);\n document.removeEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"onClick\",\n value: function onClick(event) {\n if (event.target.hasAttribute(this.config.closeTrigger)) {\n this.closeModal(event);\n }\n }\n }, {\n key: \"onKeydown\",\n value: function onKeydown(event) {\n if (event.keyCode === 27) this.closeModal(event); // esc\n\n if (event.keyCode === 9) this.retainFocus(event); // tab\n }\n }, {\n key: \"getFocusableNodes\",\n value: function getFocusableNodes() {\n var nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Array.apply(void 0, _toConsumableArray(nodes));\n }\n /**\n * Tries to set focus on a node which is not a close trigger\n * if no other nodes exist then focuses on first close trigger\n */\n\n }, {\n key: \"setFocusToFirstNode\",\n value: function setFocusToFirstNode() {\n var _this3 = this;\n\n if (this.config.disableFocus) return;\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes\n // could not think of a better name :(\n\n var nodesWhichAreNotCloseTargets = focusableNodes.filter(function (node) {\n return !node.hasAttribute(_this3.config.closeTrigger);\n });\n if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus();\n if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus();\n }\n }, {\n key: \"retainFocus\",\n value: function retainFocus(event) {\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return;\n /**\n * Filters nodes which are hidden to prevent\n * focus leak outside modal\n */\n\n focusableNodes = focusableNodes.filter(function (node) {\n return node.offsetParent !== null;\n }); // if disableFocus is true\n\n if (!this.modal.contains(document.activeElement)) {\n focusableNodes[0].focus();\n } else {\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus();\n event.preventDefault();\n }\n\n if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus();\n event.preventDefault();\n }\n }\n }\n }]);\n\n return Modal;\n }();\n /**\n * Modal prototype ends.\n * Here on code is responsible for detecting and\n * auto binding event handlers on modal triggers\n */\n // Keep a reference to the opened modal\n\n\n var activeModal = null;\n /**\n * Generates an associative array of modals and it's\n * respective triggers\n * @param {array} triggers An array of all triggers\n * @param {string} triggerAttr The data-attribute which triggers the module\n * @return {array}\n */\n\n var generateTriggerMap = function generateTriggerMap(triggers, triggerAttr) {\n var triggerMap = [];\n triggers.forEach(function (trigger) {\n var targetModal = trigger.attributes[triggerAttr].value;\n if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n triggerMap[targetModal].push(trigger);\n });\n return triggerMap;\n };\n /**\n * Validates whether a modal of the given id exists\n * in the DOM\n * @param {number} id The id of the modal\n * @return {boolean}\n */\n\n\n var validateModalPresence = function validateModalPresence(id) {\n if (!document.getElementById(id)) {\n console.warn(\"MicroModal: \\u2757Seems like you have missed %c'\".concat(id, \"'\"), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"
\"));\n return false;\n }\n };\n /**\n * Validates if there are modal triggers present\n * in the DOM\n * @param {array} triggers An array of data-triggers\n * @return {boolean}\n */\n\n\n var validateTriggerPresence = function validateTriggerPresence(triggers) {\n if (triggers.length <= 0) {\n console.warn(\"MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"\");\n return false;\n }\n };\n /**\n * Checks if triggers and their corresponding modals\n * are present in the DOM\n * @param {array} triggers Array of DOM nodes which have data-triggers\n * @param {array} triggerMap Associative array of modals and their triggers\n * @return {boolean}\n */\n\n\n var validateArgs = function validateArgs(triggers, triggerMap) {\n validateTriggerPresence(triggers);\n if (!triggerMap) return true;\n\n for (var id in triggerMap) {\n validateModalPresence(id);\n }\n\n return true;\n };\n /**\n * Binds click handlers to all modal triggers\n * @param {object} config [description]\n * @return void\n */\n\n\n var init = function init(config) {\n // Create an config object with default openTrigger\n var options = Object.assign({}, {\n openTrigger: 'data-micromodal-trigger'\n }, config); // Collects all the nodes with the trigger\n\n var triggers = _toConsumableArray(document.querySelectorAll(\"[\".concat(options.openTrigger, \"]\"))); // Makes a mappings of modals with their trigger nodes\n\n\n var triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n for (var key in triggerMap) {\n var value = triggerMap[key];\n options.targetModal = key;\n options.triggers = _toConsumableArray(value);\n activeModal = new Modal(options); // eslint-disable-line no-new\n }\n };\n /**\n * Shows a particular modal\n * @param {string} targetModal [The id of the modal to display]\n * @param {object} config [The configuration object to pass]\n * @return {void}\n */\n\n\n var show = function show(targetModal, config) {\n var options = config || {};\n options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // clear events in case previous modal wasn't close\n\n if (activeModal) activeModal.removeEventListeners(); // stores reference to active modal\n\n activeModal = new Modal(options); // eslint-disable-line no-new\n\n activeModal.showModal();\n };\n /**\n * Closes the active modal\n * @param {string} targetModal [The id of the modal to close]\n * @return {void}\n */\n\n\n var close = function close(targetModal) {\n targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n };\n\n return {\n init: init,\n show: show,\n close: close\n };\n}();\nwindow.MicroModal = MicroModal;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MicroModal);\n\n\n/***/ }),\n\n/***/ 57:\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c},a.define('/gif.worker.coffee',function(d,e,f,g){var b,c;b=a('/GIFEncoder.js',d),c=function(a){var c,e,d,f;return c=new b(a.width,a.height),a.index===0?c.writeHeader():c.firstFrame=!1,c.setTransparent(a.transparent),c.setRepeat(a.repeat),c.setDelay(a.delay),c.setQuality(a.quality),c.addFrame(a.data),a.last&&c.finish(),d=c.stream(),a.data=d.pages,a.cursor=d.cursor,a.pageSize=d.constructor.pageSize,a.canTransfer?(f=function(c){for(var b=0,d=a.data.length;b=c.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=a},c.prototype.writeUTFBytes=function(b){for(var c=b.length,a=0;a=0&&(this.dispose=a)},b.prototype.setRepeat=function(a){this.repeat=a},b.prototype.setTransparent=function(a){this.transparent=a},b.prototype.addFrame=function(a){this.image=a,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1},b.prototype.finish=function(){this.out.writeByte(59)},b.prototype.setQuality=function(a){a<1&&(a=1),this.sample=a},b.prototype.writeHeader=function(){this.out.writeUTFBytes('GIF89a')},b.prototype.analyzePixels=function(){var g=this.pixels.length,d=g/3;this.indexedPixels=new Uint8Array(d);var a=new f(this.pixels,this.sample);a.buildColormap(),this.colorTab=a.getColormap();var b=0;for(var c=0;c>16,l=(e&65280)>>8,m=e&255,c=0,d=16777216,j=this.colorTab.length;for(var a=0;a=0&&(a=dispose&7),a<<=2,this.out.writeByte(0|a|0|b),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},b.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},b.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},b.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes('NETSCAPE2.0'),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},b.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var b=768-this.colorTab.length;for(var a=0;a>8&255)},b.prototype.writePixels=function(){var a=new g(this.width,this.height,this.indexedPixels,this.colorDepth);a.encode(this.out)},b.prototype.stream=function(){return this.out},e.exports=b}),a.define('/LZWEncoder.js',function(e,g,h,i){function f(y,D,C,B){function w(a,b){r[f++]=a,f>=254&&t(b)}function x(b){u(a),k=i+2,j=!0,l(i,b)}function u(b){for(var a=0;a=0){y=w-d,d===0&&(y=1);do if((d-=y)<0&&(d+=w),h[d]===g){e=n[d];continue a}while(h[d]>=0)}l(e,r),e=t,k<1<0&&(a.writeByte(f),a.writeBytes(r,0,f),f=0)}function p(a){return(1<0?g|=a<=8)w(g&255,c),g>>=8,e-=8;if((k>m||j)&&(j?(m=p(n_bits=q),j=!1):(++n_bits,n_bits==b?m=1<0)w(g&255,c),g>>=8,e-=8;t(c)}}var s=Math.max(2,B),r=new Uint8Array(256),h=new Int32Array(a),n=new Int32Array(a),g,e=0,f,k=0,m,j=!1,q,i,o;this.encode=z}var c=-1,b=12,a=5003,d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=f}),a.define('/TypedNeuQuant.js',function(A,F,E,D){function C(A,B){function I(){o=[],q=new Int32Array(256),t=new Int32Array(a),y=new Int32Array(a),z=new Int32Array(a>>3);var c,d;for(c=0;c>=b,o[c][1]>>=b,o[c][2]>>=b,o[c][3]=c}function K(b,a,c,e,f){o[a][0]-=b*(o[a][0]-c)/d,o[a][1]-=b*(o[a][1]-e)/d,o[a][2]-=b*(o[a][2]-f)/d}function L(j,e,n,l,k){var h=Math.abs(e-j),i=Math.min(e+j,a),g=e+1,f=e-1,m=1,b,d;while(gh)d=z[m++],gh&&(b=o[f--],b[0]-=d*(b[0]-n)/c,b[1]-=d*(b[1]-l)/c,b[2]-=d*(b[2]-k)/c)}function C(p,s,q){var h=2147483647,k=h,d=-1,m=d,c,j,e,n,l;for(c=0;c>i-b),n>g,y[c]-=l,t[c]+=l<>1,b=f+1;b>1,b=f+1;b<256;b++)q[b]=n}function E(j,i,k){var b,d,c,e=1e3,h=-1,f=q[i],g=f-1;while(f=0)f=e?f=a:(f++,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c=0&&(d=o[g],c=i-d[1],c>=e?g=-1:(g--,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c>h;for(a<=1&&(a=0),c=0;c=f&&(g-=f),c++,q===0&&(q=1),c%q===0)for(n-=n/D,o-=o/v,a=o>>h,a<=1&&(a=0),e=0;e>g,r=e<>3,h=6,t=1< 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.browserSupportsGIF = exports.browserSupportsMP4 = exports.browserSupportsWEBM = exports.isRecording = exports.stopRecord = exports.recordFrame = exports.takeJPEGSnapshot = exports.takePNGSnapshot = exports.beginJPEGFramesRecord = exports.beginPNGFramesRecord = exports.beginGIFRecord = exports.beginVideoRecord = exports.bindKeyToJPEGSnapshot = exports.bindKeyToPNGSnapshot = exports.bindKeyToJPEGFramesRecord = exports.bindKeyToPNGFramesRecord = exports.bindKeyToGIFRecord = exports.bindKeyToVideoRecord = exports.setVerbose = exports.init = exports.MP4 = exports.WEBM = exports.showDialog = void 0;\nvar CCapture_1 = __webpack_require__(886);\nvar file_saver_1 = __webpack_require__(162);\n// Polyfill for canvas.toBlob needed for some browsers.\n__webpack_require__(560);\n// @ts-ignore\nvar changedpi_1 = __webpack_require__(809);\nvar params_1 = __webpack_require__(848);\nvar modals_1 = __webpack_require__(330);\n// Make it so we don't have to specify workersPath for CCapture gif recorder.\n// This is not a large file, so no need to separate from lib.\n// @ts-ignore\nvar gif_worker_js_1 = __webpack_require__(57);\nvar JSZip = __webpack_require__(733);\nvar gifWorkersPath = URL.createObjectURL(new Blob([gif_worker_js_1.default]));\nvar ffmpegPath;\nvar ffmpeg = undefined;\n// Export showDialog method in case it is useful.\nvar modals_2 = __webpack_require__(330);\nObject.defineProperty(exports, \"showDialog\", ({ enumerable: true, get: function () { return modals_2.showDialog; } }));\nvar GIF = 'gif';\nexports.WEBM = 'webm';\nexports.MP4 = 'mp4';\nvar JPEGZIP = 'jpegzip';\nvar PNGZIP = 'pngzip';\nvar JPEG = 'jpeg';\nvar PNG = 'png';\nvar activeCaptures = [];\n// This is an unused variable,\n// but needed for proper import of CCapture at the moment.\n// See https://github.com/spite/ccapture.js/issues/78\nvar temp = CCapture_1.default;\nvar hotkeyOptions = {};\nvar hotkeys = {};\nvar canvas = null;\nfunction init(_canvas, options) {\n canvas = _canvas;\n // Use public address if you don't want to host your own.\n ffmpegPath = (options === null || options === void 0 ? void 0 : options.ffmpegCorePath) || 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js';\n if (options && options.verbose !== undefined)\n setVerbose(options.verbose);\n if (options && options.showAlerts !== undefined)\n params_1.PARAMS.SHOW_ALERTS = options.showAlerts;\n if (options && options.showDialogs !== undefined)\n params_1.PARAMS.SHOW_DIALOGS = options.showDialogs;\n if (options && options.showRecDot !== undefined)\n params_1.PARAMS.SHOW_REC_DOT = options.showRecDot;\n if (params_1.PARAMS.SHOW_REC_DOT) {\n modals_1.initDotWithCSS(options === null || options === void 0 ? void 0 : options.recDotCSS);\n }\n canvas.addEventListener('resize', function () {\n if (activeCaptures.length) {\n var warningMsg = \"Don't resize while recording canvas!\";\n modals_1.showWarning(warningMsg);\n }\n });\n}\nexports.init = init;\nfunction setVerbose(state) {\n params_1.PARAMS.VERBOSE = !!state;\n if (ffmpeg)\n ffmpeg.setLogging(params_1.PARAMS.VERBOSE);\n}\nexports.setVerbose = setVerbose;\nfunction checkCanvas() {\n if (canvas === null) {\n throw new Error('No canvas supplied, please call CanvasCapture.init() and pass in canvas element.');\n }\n}\nfunction setHotkey(key, type) {\n // Unbind other hotkeys attached to same key.\n Object.keys(hotkeys).forEach(function (keyName) {\n if (hotkeys[keyName] === key) {\n delete hotkeys[keyName];\n }\n });\n hotkeys[type] = key;\n}\n// Pressing key once will start record, press again to stop.\nfunction bindKeyToVideoRecord(key, options) {\n if ((options === null || options === void 0 ? void 0 : options.format) === exports.WEBM) {\n hotkeyOptions.webm = options;\n setHotkey(key, exports.WEBM);\n }\n else {\n // Default to MP4.\n hotkeyOptions.mp4 = options;\n setHotkey(key, exports.MP4);\n }\n}\nexports.bindKeyToVideoRecord = bindKeyToVideoRecord;\nfunction bindKeyToGIFRecord(key, options) {\n hotkeyOptions.gif = options;\n setHotkey(key, GIF);\n}\nexports.bindKeyToGIFRecord = bindKeyToGIFRecord;\nfunction bindKeyToPNGFramesRecord(key, options) {\n hotkeyOptions.pngzip = options;\n setHotkey(key, PNGZIP);\n}\nexports.bindKeyToPNGFramesRecord = bindKeyToPNGFramesRecord;\nfunction bindKeyToJPEGFramesRecord(key, options) {\n hotkeyOptions.jpegzip = options;\n setHotkey(key, JPEGZIP);\n}\nexports.bindKeyToJPEGFramesRecord = bindKeyToJPEGFramesRecord;\n// Snapshots just take a single shot.\nfunction bindKeyToPNGSnapshot(key, options) {\n hotkeyOptions.png = options;\n setHotkey(key, PNG);\n}\nexports.bindKeyToPNGSnapshot = bindKeyToPNGSnapshot;\nfunction bindKeyToJPEGSnapshot(key, options) {\n hotkeyOptions.jpeg = options;\n setHotkey(key, JPEG);\n}\nexports.bindKeyToJPEGSnapshot = bindKeyToJPEGSnapshot;\nwindow.addEventListener('keydown', function (e) {\n var _a, _b;\n if (hotkeys.mp4 && e.key === hotkeys[exports.MP4]) {\n var MP4s = activeCapturesOfType(exports.MP4);\n if (MP4s.length)\n stopRecord(MP4s);\n else {\n if (!browserSupportsMP4()) {\n var errorMsg = \"This browser does not support MP4 video recording, please try again in Chrome.\";\n var onError = (_a = hotkeyOptions[exports.MP4]) === null || _a === void 0 ? void 0 : _a.onError;\n if (onError)\n onError(new Error(errorMsg));\n modals_1.showWarning(errorMsg);\n }\n beginVideoRecord(hotkeyOptions[exports.MP4]);\n }\n }\n if (hotkeys.webm && e.key === hotkeys[exports.WEBM]) {\n var WEBMs = activeCapturesOfType(exports.WEBM);\n if (WEBMs.length)\n stopRecord(WEBMs);\n else {\n if (!browserSupportsWEBM()) {\n var errorMsg = \"This browser does not support WEBM video recording, please try again in Chrome.\";\n var onError = (_b = hotkeyOptions[exports.WEBM]) === null || _b === void 0 ? void 0 : _b.onError;\n if (onError)\n onError(new Error(errorMsg));\n modals_1.showWarning(errorMsg);\n }\n beginVideoRecord(hotkeyOptions[exports.WEBM]);\n }\n }\n if (hotkeys.gif && e.key === hotkeys[GIF]) {\n var GIFs = activeCapturesOfType(GIF);\n if (GIFs.length)\n stopRecord(GIFs);\n else\n beginGIFRecord(hotkeyOptions[GIF]);\n }\n if (hotkeys.pngzip && e.key === hotkeys[PNGZIP]) {\n var pngzips = activeCapturesOfType(PNGZIP);\n if (pngzips.length)\n stopRecord(pngzips);\n else\n beginPNGFramesRecord(hotkeyOptions[PNGZIP]);\n }\n if (hotkeys.jpegzip && e.key === hotkeys[JPEGZIP]) {\n var jpgzips = activeCapturesOfType(JPEGZIP);\n if (jpgzips.length)\n stopRecord(jpgzips);\n else\n beginJPEGFramesRecord(hotkeyOptions[JPEGZIP]);\n }\n if (hotkeys.png && e.key === hotkeys[PNG]) {\n takePNGSnapshot(hotkeyOptions[PNG]);\n }\n if (hotkeys.jpeg && e.key === hotkeys[JPEG]) {\n takeJPEGSnapshot(hotkeyOptions[JPEG]);\n }\n});\nfunction startCapture(capture) {\n activeCaptures.push(capture);\n if (capture.type !== PNGZIP && capture.type !== JPEGZIP)\n capture.capturer.start();\n // For multi-frame records, we should also throw up an indicator to show that we're in record mode.\n modals_1.showDot(isRecording());\n}\nfunction beginVideoRecord(options) {\n var _a;\n try {\n var format = (options === null || options === void 0 ? void 0 : options.format) || exports.MP4; // Default to MP4 record.\n if (format === exports.MP4) {\n if (!browserSupportsMP4()) {\n var errorMsg = \"This browser does not support MP4 video recording, please try again in Chrome.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n }\n else if (format === exports.WEBM) {\n if (!browserSupportsWEBM()) {\n var errorMsg = \"This browser does not support WEBM video recording, please try again in Chrome.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n }\n else {\n throw new Error(\"invalid video format \" + format + \".\");\n }\n if (activeVideoGifCaptures().length) {\n var errorMsg = \"CCapture.js only supports one video/gif capture at a time.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n var quality = 1;\n if (options && options.quality) {\n quality = options.quality;\n }\n var name_1 = (options === null || options === void 0 ? void 0 : options.name) || 'Video_Capture';\n // Create a capturer that exports a WebM video.\n // @ts-ignore\n var capturer = new window.CCapture({\n format: exports.WEBM,\n name: name_1,\n framerate: (options === null || options === void 0 ? void 0 : options.fps) || 60,\n quality: quality * 100,\n verbose: params_1.PARAMS.VERBOSE,\n });\n var capture = {\n name: name_1,\n capturer: capturer,\n numFrames: 0,\n type: format,\n ffmpegOptions: (_a = options) === null || _a === void 0 ? void 0 : _a.ffmpegOptions,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginVideoRecord = beginVideoRecord;\nfunction beginGIFRecord(options) {\n try {\n if (activeVideoGifCaptures().length) {\n var errorMsg = \"CCapture.js only supports one video/gif capture at a time.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n // CCapture seems to expect a quality between 0 and 100.\n var quality = 100;\n if (options && options.quality) {\n quality = options.quality * 100;\n }\n var name_2 = (options === null || options === void 0 ? void 0 : options.name) || 'GIF_Capture';\n // Create a capturer that exports a GIF.\n // @ts-ignore\n var capturer = new window.CCapture({\n format: GIF,\n name: name_2,\n framerate: (options === null || options === void 0 ? void 0 : options.fps) || 60,\n workersPath: gifWorkersPath,\n quality: quality,\n verbose: params_1.PARAMS.VERBOSE,\n onProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n });\n var capture = {\n name: name_2,\n capturer: capturer,\n numFrames: 0,\n type: GIF,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginGIFRecord = beginGIFRecord;\nfunction beginPNGFramesRecord(options) {\n try {\n var name_3 = (options === null || options === void 0 ? void 0 : options.name) || 'PNG_Frames_Capture';\n var zipOptions = { dpi: options === null || options === void 0 ? void 0 : options.dpi };\n var capture = {\n name: name_3,\n zipOptions: zipOptions,\n zipPromises: [],\n capturer: new JSZip(),\n numFrames: 0,\n type: PNGZIP,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginPNGFramesRecord = beginPNGFramesRecord;\nfunction beginJPEGFramesRecord(options) {\n try {\n var name_4 = (options === null || options === void 0 ? void 0 : options.name) || 'JPEG_Frames_Capture';\n var zipOptions = { dpi: options === null || options === void 0 ? void 0 : options.dpi, quality: options === null || options === void 0 ? void 0 : options.quality };\n var capture = {\n name: name_4,\n zipOptions: zipOptions,\n zipPromises: [],\n capturer: new JSZip(),\n numFrames: 0,\n type: JPEGZIP,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginJPEGFramesRecord = beginJPEGFramesRecord;\nfunction canvasToBlobAsync(canvas, type, quality) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n canvas.toBlob(function (blob) {\n resolve(blob);\n }, \"image/\" + type, quality);\n })];\n });\n });\n}\nfunction takeImageSnapshot(filename, type, quality, options) {\n return __awaiter(this, void 0, void 0, function () {\n var onExportFinish, blob, errorMsg, onExport;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n checkCanvas();\n onExportFinish = options === null || options === void 0 ? void 0 : options.onExportFinish;\n return [4 /*yield*/, canvasToBlobAsync(canvas, type, quality)];\n case 1:\n blob = _a.sent();\n if (!blob) {\n errorMsg = \"Problem saving \" + type.toUpperCase() + \", please try again!\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n onExport = (options === null || options === void 0 ? void 0 : options.onExport) || file_saver_1.saveAs;\n if (!(options === null || options === void 0 ? void 0 : options.dpi)) return [3 /*break*/, 3];\n return [4 /*yield*/, changedpi_1.changeDpiBlob(blob, options === null || options === void 0 ? void 0 : options.dpi).then(function (blob) {\n onExport(blob, filename);\n if (onExportFinish)\n onExportFinish();\n })];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n onExport(blob, filename);\n if (onExportFinish)\n onExportFinish();\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nfunction takePNGSnapshot(options) {\n return __awaiter(this, void 0, void 0, function () {\n var name_5, filename, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n name_5 = (options === null || options === void 0 ? void 0 : options.name) || 'PNG_Capture';\n filename = name_5 + \".png\";\n return [4 /*yield*/, takeImageSnapshot(filename, PNG, undefined, options)];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_1 = _a.sent();\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error_1);\n else\n throw error_1;\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}\nexports.takePNGSnapshot = takePNGSnapshot;\nfunction takeJPEGSnapshot(options) {\n return __awaiter(this, void 0, void 0, function () {\n var name_6, filename, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n name_6 = (options === null || options === void 0 ? void 0 : options.name) || 'JPEG_Capture';\n filename = name_6 + \".jpg\";\n // Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return [4 /*yield*/, takeImageSnapshot(filename, JPEG, (options === null || options === void 0 ? void 0 : options.quality) || 1, options)];\n case 1:\n // Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_2 = _a.sent();\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error_2);\n else\n throw error_2;\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}\nexports.takeJPEGSnapshot = takeJPEGSnapshot;\nfunction recordFrame(capture) {\n var captures = activeCaptures;\n if (capture) {\n if (!Array.isArray(capture)) {\n captures = [capture];\n }\n else {\n captures = capture;\n }\n }\n try {\n checkCanvas();\n if (captures.length === 0) {\n var errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n var _loop_1 = function (i) {\n var _a = captures[i], capturer = _a.capturer, type = _a.type, zipOptions = _a.zipOptions, zipPromises = _a.zipPromises, numFrames = _a.numFrames;\n if (type === JPEGZIP || type === PNGZIP) {\n // Name should correspond to current frame.\n var frameName_1 = \"frame_\" + (numFrames + 1);\n var promise = new Promise(function (resolve, reject) {\n var options = {\n dpi: zipOptions === null || zipOptions === void 0 ? void 0 : zipOptions.dpi,\n quality: zipOptions.quality,\n name: frameName_1,\n onExport: function (blob, filename) {\n capturer.file(filename, blob);\n },\n onExportFinish: resolve,\n onError: reject,\n };\n if (type === JPEGZIP) {\n takeJPEGSnapshot(options);\n }\n else {\n takePNGSnapshot(options);\n }\n });\n zipPromises.push(promise);\n }\n else {\n capturer.capture(canvas);\n }\n captures[i].numFrames = numFrames + 1;\n };\n for (var i = 0; i < captures.length; i++) {\n _loop_1(i);\n }\n }\n catch (error) {\n var handled = true;\n for (var i = 0; i < captures.length; i++) {\n var capture_1 = captures[i];\n if (capture_1.onError)\n capture_1.onError(error);\n else\n handled = false;\n }\n if (!captures.length || !handled) {\n throw error;\n }\n }\n}\nexports.recordFrame = recordFrame;\nfunction CCaptureSaveAsync(capturer) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n capturer.save(function (blob) {\n resolve(blob);\n });\n })];\n });\n });\n}\nfunction stopRecordAtIndex(index) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, name, capturer, numFrames, type, zipPromises, onExportProgress, onExport, onExportFinish, onError, ffmpegOptions, errorMsg, _b, blob, blob, filename, blob, filename;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = activeCaptures[index], name = _a.name, capturer = _a.capturer, numFrames = _a.numFrames, type = _a.type, zipPromises = _a.zipPromises, onExportProgress = _a.onExportProgress, onExport = _a.onExport, onExportFinish = _a.onExportFinish, onError = _a.onError, ffmpegOptions = _a.ffmpegOptions;\n // Remove ref to capturer.\n activeCaptures.splice(index, 1);\n if (type !== PNGZIP && type !== JPEGZIP)\n capturer.stop();\n if (numFrames === 0) {\n errorMsg = 'No frames recorded, call CanvasCapture.recordFrame().';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n _b = type;\n switch (_b) {\n case exports.MP4: return [3 /*break*/, 1];\n case exports.WEBM: return [3 /*break*/, 4];\n case GIF: return [3 /*break*/, 6];\n case PNGZIP: return [3 /*break*/, 8];\n case JPEGZIP: return [3 /*break*/, 8];\n }\n return [3 /*break*/, 11];\n case 1: return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 2:\n blob = _c.sent();\n // Tell the user that mp4s take a sec to process.\n modals_1.showDialog('Processing...', 'MP4 is processing and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, convertWEBMtoMP4({\n name: name,\n blob: blob,\n onExportProgress: onExportProgress,\n onExport: onExport,\n onExportFinish: onExportFinish,\n ffmpegOptions: ffmpegOptions,\n })];\n case 3:\n _c.sent();\n return [3 /*break*/, 12];\n case 4:\n if (onExportProgress)\n onExportProgress(0);\n return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 5:\n blob = _c.sent();\n if (onExportProgress)\n onExportProgress(1); // Save is nearly immediate.\n filename = name + \".webm\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n return [3 /*break*/, 12];\n case 6:\n // Tell the user that gifs take a sec to process.\n modals_1.showDialog('Processing...', 'GIF is processing and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 7:\n blob = _c.sent();\n filename = name + \".gif\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n return [3 /*break*/, 12];\n case 8: \n // Wait for all frames to finish saving.\n return [4 /*yield*/, Promise.all(zipPromises)];\n case 9:\n // Wait for all frames to finish saving.\n _c.sent();\n // Tell the user that frames take a sec to zip.\n modals_1.showDialog('Processing...', 'Frames are being zipped and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, capturer.generateAsync({ type: 'blob' }, function (metadata) {\n if (onExportProgress)\n onExportProgress(metadata.percent / 100);\n }).then(function (blob) {\n var filename = name + \".zip\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n })];\n case 10:\n _c.sent();\n return [3 /*break*/, 12];\n case 11: throw new Error(\"Need to handle saving type \" + type + \".\");\n case 12: return [2 /*return*/];\n }\n });\n });\n}\nfunction stopRecord(capture) {\n return __awaiter(this, void 0, void 0, function () {\n var captures, errorMsg, promises, i, index, error_3, handled, i, capture_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (capture && !Array.isArray(capture)) {\n capture = [capture];\n }\n captures = capture || activeCaptures;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n if (activeCaptures.length === 0) {\n errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n promises = [];\n for (i = 0; i < captures.length; i++) {\n index = activeCaptures.indexOf(captures[i]);\n if (index < 0)\n throw new Error(\"Invalid capture \" + captures[i] + \" \\u2013 may have already been stopped.\");\n promises.push(stopRecordAtIndex(index));\n }\n modals_1.showDot(isRecording());\n return [4 /*yield*/, Promise.all(promises)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_3 = _a.sent();\n handled = true;\n for (i = 0; i < captures.length; i++) {\n capture_2 = captures[i];\n if (capture_2.onError)\n capture_2.onError(error_3);\n else\n handled = false;\n }\n if (!captures.length || !handled) {\n throw error_3;\n }\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nexports.stopRecord = stopRecord;\nfunction activeCapturesOfType(type) {\n var captures = [];\n for (var i = 0; i < activeCaptures.length; i++) {\n if (activeCaptures[i].type === type) {\n captures.push(activeCaptures[i]);\n }\n }\n return captures;\n}\nfunction activeVideoGifCaptures() {\n return activeCapturesOfType(exports.WEBM).concat(activeCapturesOfType(exports.MP4)).concat(activeCapturesOfType(GIF));\n}\nfunction isRecording() {\n return activeCaptures.length > 0;\n}\nexports.isRecording = isRecording;\nvar ffmpegLoaded = false;\nfunction convertWEBMtoMP4(options) {\n return __awaiter(this, void 0, void 0, function () {\n var createFFmpeg, name, blob, onExportProgress, onExport, onExportFinish, ffmpegOptions, _data, data, defaultFFMPEGOptions, combinedOptions, _ffmpegOptions, filename, output, outputBlob;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!ffmpeg) {\n createFFmpeg = __webpack_require__(648);\n ffmpeg = createFFmpeg({\n corePath: ffmpegPath,\n });\n }\n if (!!ffmpegLoaded) return [3 /*break*/, 2];\n return [4 /*yield*/, ffmpeg.load().catch(function () {\n var errorMsg = 'MP4 export not supported in this browser, try again in the latest version of Chrome.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n })];\n case 1:\n _b.sent();\n ffmpegLoaded = true;\n _b.label = 2;\n case 2:\n name = options.name, blob = options.blob, onExportProgress = options.onExportProgress, onExport = options.onExport, onExportFinish = options.onExportFinish, ffmpegOptions = options.ffmpegOptions;\n return [4 /*yield*/, blob.arrayBuffer()];\n case 3:\n _data = _b.sent();\n data = new Uint8Array(_data);\n // Write data to MEMFS, need to use Uint8Array for binary data.\n ffmpeg.FS('writeFile', name + \".webm\", data);\n // Convert to MP4.\n // TODO: onProgress callback is not working quite right yet.\n // https://github.com/ffmpegwasm/ffmpeg.wasm/issues/112\n if (onExportProgress)\n ffmpeg.setProgress(function (_a) {\n var ratio = _a.ratio;\n onExportProgress(Math.max(0, Math.min(ratio, 1)));\n });\n defaultFFMPEGOptions = {\n '-c:v': 'libx264',\n '-preset': 'slow',\n '-crf': '22',\n '-pix_fmt': 'yuv420p',\n };\n combinedOptions = __assign(__assign({}, defaultFFMPEGOptions), (ffmpegOptions || {}));\n _ffmpegOptions = [];\n Object.keys(combinedOptions).forEach(function (key) {\n _ffmpegOptions.push(key, combinedOptions[key]);\n });\n filename = name + \".mp4\";\n return [4 /*yield*/, (_a = ffmpeg).run.apply(_a, __spreadArrays(['-i', name + \".webm\"], _ffmpegOptions, ['-vf', 'crop=trunc(iw/2)*2:trunc(ih/2)*2',\n '-an',\n filename]))];\n case 4:\n _b.sent();\n return [4 /*yield*/, ffmpeg.FS('readFile', filename)];\n case 5:\n output = _b.sent();\n outputBlob = new Blob([output], { type: 'video/mp4' });\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(outputBlob, filename);\n }\n // Delete files in MEMFS.\n ffmpeg.FS('unlink', name + \".webm\");\n ffmpeg.FS('unlink', filename);\n if (onExportFinish)\n onExportFinish();\n return [2 /*return*/];\n }\n });\n });\n}\nfunction browserSupportsWEBP() {\n var _canvas = document.createElement('canvas');\n var url = _canvas.toDataURL('image/webp', { quality: 1 });\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n return true;\n}\nfunction browserSupportsSharedArrayBuffer() {\n try {\n var test = new SharedArrayBuffer(1024);\n }\n catch (_a) {\n return false;\n }\n return true;\n}\nfunction browserSupportsWebWorkers() {\n return !!window.Worker;\n}\nfunction browserSupportsWEBM() {\n return browserSupportsWEBP();\n}\nexports.browserSupportsWEBM = browserSupportsWEBM;\nfunction browserSupportsMP4() {\n // Also web workers?\n // && browserSupportsWebWorkers()\n return browserSupportsWEBP() && browserSupportsSharedArrayBuffer();\n}\nexports.browserSupportsMP4 = browserSupportsMP4;\nfunction browserSupportsGIF() {\n return browserSupportsWebWorkers();\n}\nexports.browserSupportsGIF = browserSupportsGIF;\n\n\n/***/ }),\n\n/***/ 713:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.css = void 0;\nexports.css = \"\\n/************************** Basic Modal Styles\\n**************************/\\n\\n.modal {\\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\\n}\\n\\n.modal__overlay {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n background: rgba(0,0,0,0.6);\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n}\\n\\n.modal__container {\\n background-color: #fff;\\n padding: 30px;\\n max-width: 500px;\\n max-height: 100vh;\\n overflow-y: auto;\\n box-sizing: border-box;\\n}\\n\\n.modal__header {\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n}\\n\\n.modal__title {\\n margin-top: 0;\\n margin-bottom: 0;\\n font-weight: 600;\\n font-size: 1.25rem;\\n line-height: 1.25;\\n color: #222;\\n box-sizing: border-box;\\n}\\n\\n.modal__footer {\\n text-align: right;\\n}\\n\\n.modal__footer>.modal__btn {\\n margin-right: 8px;\\n}\\n\\n.modal__close {\\n background: transparent;\\n border: 0;\\n}\\n\\n.modal__header .modal__close:before { content: \\\"\\u2715\\\"; }\\n\\n.modal__content {\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n line-height: 1.5;\\n color: rgba(0,0,0,.8);\\n}\\n\\n.modal__btn {\\n font-size: .875rem;\\n padding-left: 1rem;\\n padding-right: 1rem;\\n padding-top: .5rem;\\n padding-bottom: .5rem;\\n background-color: #e6e6e6;\\n color: rgba(0,0,0,.8);\\n border-radius: .25rem;\\n border-style: none;\\n border-width: 0;\\n cursor: pointer;\\n -webkit-appearance: button;\\n text-transform: none;\\n overflow: visible;\\n line-height: 1.15;\\n margin: 0;\\n will-change: transform;\\n -moz-osx-font-smoothing: grayscale;\\n -webkit-backface-visibility: hidden;\\n backface-visibility: hidden;\\n -webkit-transform: translateZ(0);\\n transform: translateZ(0);\\n transition: -webkit-transform .25s ease-out;\\n transition: transform .25s ease-out;\\n transition: transform .25s ease-out,-webkit-transform .25s ease-out;\\n}\\n\\n.modal__btn:focus, .modal__btn:hover {\\n -webkit-transform: scale(1.05);\\n transform: scale(1.05);\\n}\\n\\n.modal__btn-primary {\\n background-color: #333;\\n color: #fff;\\n}\\n\\n\\n\\n/************************** Demo Animation Style\\n**************************/\\n@keyframes mmfadeIn {\\n from { opacity: 0; }\\n to { opacity: 1; }\\n}\\n\\n@keyframes mmfadeOut {\\n from { opacity: 1; }\\n to { opacity: 0; }\\n}\\n\\n@keyframes mmslideIn {\\n from { transform: translateY(15%); }\\n to { transform: translateY(0); }\\n}\\n\\n@keyframes mmslideOut {\\n from { transform: translateY(0); }\\n to { transform: translateY(-10%); }\\n}\\n\\n.micromodal-slide {\\n display: none;\\n}\\n\\n.micromodal-slide.is-open {\\n display: block;\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"false\\\"] .modal__overlay {\\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"false\\\"] .modal__container {\\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"true\\\"] .modal__overlay {\\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"true\\\"] .modal__container {\\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\\n}\\n\\n.micromodal-slide .modal__container,\\n.micromodal-slide .modal__overlay {\\n will-change: transform;\\n}\\n\";\n\n\n/***/ }),\n\n/***/ 330:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.showDot = exports.initDotWithCSS = exports.showDialog = exports.showWarning = void 0;\nvar micromodal_1 = __webpack_require__(650);\nvar micromodal_css_1 = __webpack_require__(713);\nvar params_1 = __webpack_require__(848);\n// Add modal styling.\nvar style = document.createElement('style');\nstyle.textContent = micromodal_css_1.css;\ndocument.head.append(style);\nfunction initModalHTML(modalID, title, content) {\n if (content === void 0) { content = ''; }\n var modalString = \"
\\n\\t\\t
\\n\\t\\t
\\n\\t\\t\\t
\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\t\" + title + \"\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\n\\t\\t\\t
\\n\\t\\t\\t
\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\t\" + content + \"\\n\\t\\t\\t\\t

\\n\\t\\t\\t
\\n\\t\\t
\\n\\t\\t
\\n\\t
\";\n // This is a trick to create an element from string.\n var temp = document.createElement('div');\n temp.innerHTML = modalString;\n return temp.firstChild;\n}\n;\nvar alertModalInited = false;\nvar dialogModalInited = false;\nvar ALERT_MODAL_ID = 'alert';\nvar alertModal = initModalHTML(ALERT_MODAL_ID, 'Warning');\nvar DIALOG_MODAL_ID = 'dialog';\nvar dialogModal = initModalHTML(DIALOG_MODAL_ID, 'Saving...');\nfunction showWarning(message) {\n console.warn(message);\n if (!params_1.PARAMS.SHOW_ALERTS) {\n return;\n }\n if (!alertModalInited) {\n alertModalInited = true;\n document.getElementsByTagName('body')[0].appendChild(alertModal);\n }\n document.getElementById(\"modal-\" + ALERT_MODAL_ID + \"-content\").innerHTML = message;\n micromodal_1.default.show(\"modal-\" + ALERT_MODAL_ID);\n}\nexports.showWarning = showWarning;\nfunction showDialog(title, message, options) {\n if (params_1.PARAMS.VERBOSE)\n console.log(title, message);\n if (!params_1.PARAMS.SHOW_DIALOGS) {\n return;\n }\n if (!dialogModalInited) {\n dialogModalInited = true;\n document.getElementsByTagName('body')[0].appendChild(dialogModal);\n }\n document.getElementById(\"modal-\" + DIALOG_MODAL_ID + \"-title\").innerHTML = title;\n document.getElementById(\"modal-\" + DIALOG_MODAL_ID + \"-content\").innerHTML = message;\n micromodal_1.default.show(\"modal-\" + DIALOG_MODAL_ID);\n var autoCloseDelay = (options === null || options === void 0 ? void 0 : options.autoCloseDelay) !== undefined ? options.autoCloseDelay : -1;\n if (autoCloseDelay > 0) {\n setTimeout(function () {\n micromodal_1.default.close(\"modal-\" + DIALOG_MODAL_ID);\n }, autoCloseDelay);\n }\n}\nexports.showDialog = showDialog;\n// Create record red dot vis to overlay when recording is happening.\nvar dot = document.createElement('div');\nfunction initDotWithCSS(css) {\n dot.id = 'recordingDot';\n var dotCSS = __assign({ background: \"red\", width: \"20px\", height: \"20px\", \"border-radius\": \"50%\", display: \"none\", position: \"absolute\", top: \"0\", right: \"0\", \"z-index\": \"10\", margin: \"20px\" }, css);\n Object.assign(dot.style, dotCSS);\n document.getElementsByTagName('body')[0].appendChild(dot);\n}\nexports.initDotWithCSS = initDotWithCSS;\nfunction showDot(visible) {\n if (!params_1.PARAMS.SHOW_REC_DOT)\n return;\n if (visible) {\n dot.style.display = \"inline-block\";\n }\n else {\n dot.style.display = \"none\";\n }\n}\nexports.showDot = showDot;\n\n\n/***/ }),\n\n/***/ 848:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PARAMS = void 0;\n// Params.\nexports.PARAMS = {\n VERBOSE: false,\n SHOW_ALERTS: false,\n SHOW_DIALOGS: false,\n SHOW_REC_DOT: false,\n};\n\n\n/***/ }),\n\n/***/ 886:\n/***/ ((module, exports, __webpack_require__) => {\n\n/* module decorator */ module = __webpack_require__.nmd(module);\nvar __WEBPACK_AMD_DEFINE_RESULT__;;(function() {\r\n\r\nif ( true && typeof module.exports !== 'undefined') {\r\n var Tar = __webpack_require__(846);\r\n var download = __webpack_require__(173);\r\n var GIF = __webpack_require__(769);\r\n var WebMWriter = __webpack_require__(166);\r\n}\r\n\r\n\"use strict\";\r\n\r\nvar objectTypes = {\r\n'function': true,\r\n'object': true\r\n};\r\n\r\nfunction checkGlobal(value) {\r\n return (value && value.Object === Object) ? value : null;\r\n }\r\n\r\n/** Built-in method references without a dependency on `root`. */\r\nvar freeParseFloat = parseFloat,\r\n freeParseInt = parseInt;\r\n\r\n/** Detect free variable `exports`. */\r\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\r\n? exports\r\n: undefined;\r\n\r\n/** Detect free variable `module`. */\r\nvar freeModule = (objectTypes[\"object\"] && module && !module.nodeType)\r\n? module\r\n: undefined;\r\n\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = (freeModule && freeModule.exports === freeExports)\r\n? freeExports\r\n: undefined;\r\n\r\n/** Detect free variable `global` from Node.js. */\r\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof __webpack_require__.g == 'object' && __webpack_require__.g);\r\n\r\n/** Detect free variable `self`. */\r\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\r\n\r\n/** Detect free variable `window`. */\r\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\r\n\r\n/** Detect `this` as the global object. */\r\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\r\n\r\n/**\r\n* Used as a reference to the global object.\r\n*\r\n* The `this` value is used if it's the global object to avoid Greasemonkey's\r\n* restricted `window` object, otherwise the `window` object is used.\r\n*/\r\nvar root = freeGlobal ||\r\n((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\r\n freeSelf || thisGlobal || Function('return this')();\r\n\r\nif( !('gc' in window ) ) {\r\n\twindow.gc = function(){}\r\n}\r\n\r\nif (!HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\r\n\t\tthis.count++;\r\n\t\tthis.step();\r\n\t}.bind( this );\r\n\tfileReader.readAsArrayBuffer(blob);\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.save = function( callback ) {\r\n\r\n\tcallback( this.tape.save() );\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.dispose = function() {\r\n\r\n\tthis.tape = new Tar();\r\n\tthis.count = 0;\r\n\r\n}\r\n\r\nfunction CCPNGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/png';\r\n\tthis.fileExtension = '.png';\r\n\r\n}\r\n\r\nCCPNGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCPNGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type )\r\n\r\n}\r\n\r\nfunction CCJPEGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/jpeg';\r\n\tthis.fileExtension = '.jpg';\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n}\r\n\r\nCCJPEGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCJPEGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type, this.quality )\r\n\r\n}\r\n\r\n/*\r\n\r\n\tWebM Encoder\r\n\r\n*/\r\n\r\nfunction CCWebMEncoder( settings ) {\r\n\r\n\tvar canvas = document.createElement( 'canvas' );\r\n\tif( canvas.toDataURL( 'image/webp' ).substr(5,10) !== 'image/webp' ){\r\n\t\tconsole.log( \"WebP not supported - try another export format\" )\r\n\t}\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.extension = '.webm'\r\n\tthis.mimeType = 'video/webm'\r\n\tthis.baseFilename = this.filename;\r\n\r\n\tthis.frames = [];\r\n\tthis.part = 1;\r\n\r\n this.videoWriter = new WebMWriter({\r\n quality: this.quality,\r\n fileWriter: null,\r\n fd: null,\r\n frameRate: settings.framerate\r\n});\r\n\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCWebMEncoder.prototype.start = function( canvas ) {\r\n\r\n\tthis.dispose();\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.add = function( canvas ) {\r\n\r\n this.videoWriter.addFrame(canvas);\r\n\r\n\t//this.frames.push( canvas.toDataURL('image/webp', this.quality) );\r\n\r\n\tif( this.settings.autoSaveTime > 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\t\tthis.save( function( blob ) {\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tdownload( blob, this.filename + this.extension, this.mimeType );\r\n\t\t\tthis.dispose();\r\n\t\t\tthis.part++;\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tthis.step();\r\n\t\t}.bind( this ) )\r\n\t} else {\r\n\t\tthis.step();\r\n\t}\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.save = function( callback ) {\r\n\r\n//\tif( !this.frames.length ) return;\r\n\r\n this.videoWriter.complete().then(callback);\r\n\r\n\t/*var webm = Whammy.fromImageArray( this.frames, this.settings.framerate )\r\n\tvar blob = new Blob( [ webm ], { type: \"octet/stream\" } );\r\n\tcallback( blob );*/\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.dispose = function( canvas ) {\r\n\r\n\tthis.frames = [];\r\n\r\n}\r\n\r\nfunction CCFFMpegServerEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.encoder = new FFMpegServer.Video( settings );\r\n this.encoder.on( 'process', function() {\r\n this.emit( 'process' )\r\n }.bind( this ) );\r\n this.encoder.on('finished', function( url, size ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( url, size );\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'error', function( data ) {\r\n alert(JSON.stringify(data, null, 2));\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCFFMpegServerEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start( this.settings );\r\n\r\n};\r\n\r\nCCFFMpegServerEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.encoder.add( canvas );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n this.encoder.end();\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.safeToProceed = function() {\r\n return this.encoder.safeToProceed();\r\n};\r\n\r\n/*\r\n\tHTMLCanvasElement.captureStream()\r\n*/\r\n\r\nfunction CCStreamEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.framerate = this.settings.framerate;\r\n\tthis.type = 'video/webm';\r\n\tthis.extension = '.webm';\r\n\tthis.stream = null;\r\n\tthis.mediaRecorder = null;\r\n\tthis.chunks = [];\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCStreamEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.stream ) {\r\n\t\tthis.stream = canvas.captureStream( this.framerate );\r\n\t\tthis.mediaRecorder = new MediaRecorder( this.stream );\r\n\t\tthis.mediaRecorder.start();\r\n\r\n\t\tthis.mediaRecorder.ondataavailable = function(e) {\r\n\t\t\tthis.chunks.push(e.data);\r\n\t\t}.bind( this );\r\n\r\n\t}\r\n\tthis.step();\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype.save = function( callback ) {\r\n\r\n\tthis.mediaRecorder.onstop = function( e ) {\r\n\t\tvar blob = new Blob( this.chunks, { 'type' : 'video/webm' });\r\n\t\tthis.chunks = [];\r\n\t\tcallback( blob );\r\n\r\n\t}.bind( this );\r\n\r\n\tthis.mediaRecorder.stop();\r\n\r\n}\r\n\r\n/*function CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this );\r\n\r\n\tsettings.quality = settings.quality || 6;\r\n\tthis.settings = settings;\r\n\r\n\tthis.encoder = new GIFEncoder();\r\n\tthis.encoder.setRepeat( 1 );\r\n \tthis.encoder.setDelay( settings.step );\r\n \tthis.encoder.setQuality( 6 );\r\n \tthis.encoder.setTransparent( null );\r\n \tthis.encoder.setSize( 150, 150 );\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder );\r\n\r\nCCGIFEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\tthis.encoder.addFrame( this.ctx );\r\n\r\n\tthis.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.stop = function() {\r\n\r\n\tthis.encoder.finish();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n\tvar binary_gif = this.encoder.stream().getData();\r\n\r\n\tvar data_url = 'data:image/gif;base64,'+encode64(binary_gif);\r\n\twindow.location = data_url;\r\n\treturn;\r\n\r\n\tvar blob = new Blob( [ binary_gif ], { type: \"octet/stream\" } );\r\n\tvar url = window.URL.createObjectURL( blob );\r\n\tcallback( url );\r\n\r\n}*/\r\n\r\nfunction CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = 31 - ( ( settings.quality * 30 / 100 ) || 10 );\r\n\tsettings.workers = settings.workers || 4;\r\n\r\n\tthis.extension = '.gif'\r\n\tthis.mimeType = 'image/gif'\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n \tthis.sizeSet = false;\r\n\r\n \tthis.encoder = new GIF({\r\n\t\tworkers: settings.workers,\r\n\t\tquality: settings.quality,\r\n\t\tworkerScript: settings.workersPath,\r\n\t} );\r\n\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n\r\n this.encoder.on('finished', function( blob ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( blob );\r\n }\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.sizeSet ) {\r\n\t\tthis.encoder.setOption( 'width',canvas.width );\r\n\t\tthis.encoder.setOption( 'height',canvas.height );\r\n\t\tthis.sizeSet = true;\r\n\t}\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\r\n\tthis.encoder.addFrame( this.ctx, { copy: true, delay: this.settings.step } );\r\n\tthis.step();\r\n\r\n\t/*this.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );*/\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n\r\n\tthis.encoder.render();\r\n\r\n}\r\n\r\nfunction CCapture( settings ) {\r\n\r\n\tvar _settings = settings || {},\r\n\t\t_date = new Date(),\r\n\t\t_verbose,\r\n\t\t_display,\r\n\t\t_time,\r\n\t\t_startTime,\r\n\t\t_performanceTime,\r\n\t\t_performanceStartTime,\r\n\t\t_step,\r\n _encoder,\r\n\t\t_timeouts = [],\r\n\t\t_intervals = [],\r\n\t\t_frameCount = 0,\r\n\t\t_intermediateFrameCount = 0,\r\n\t\t_lastFrame = null,\r\n\t\t_requestAnimationFrameCallbacks = [],\r\n\t\t_capturing = false,\r\n _handlers = {};\r\n\r\n\t_settings.framerate = _settings.framerate || 60;\r\n\t_settings.motionBlurFrames = 2 * ( _settings.motionBlurFrames || 1 );\r\n\t_verbose = _settings.verbose || false;\r\n\t_display = _settings.display || false;\r\n\t_settings.step = 1000.0 / _settings.framerate ;\r\n\t_settings.timeLimit = _settings.timeLimit || 0;\r\n\t_settings.frameLimit = _settings.frameLimit || 0;\r\n\t_settings.startTime = _settings.startTime || 0;\r\n\r\n\tvar _timeDisplay = document.createElement( 'div' );\r\n\t_timeDisplay.style.position = 'absolute';\r\n\t_timeDisplay.style.left = _timeDisplay.style.top = 0\r\n\t_timeDisplay.style.backgroundColor = 'black';\r\n\t_timeDisplay.style.fontFamily = 'monospace'\r\n\t_timeDisplay.style.fontSize = '11px'\r\n\t_timeDisplay.style.padding = '5px'\r\n\t_timeDisplay.style.color = 'red';\r\n\t_timeDisplay.style.zIndex = 100000\r\n\tif( _settings.display ) document.body.appendChild( _timeDisplay );\r\n\r\n\tvar canvasMotionBlur = document.createElement( 'canvas' );\r\n\tvar ctxMotionBlur = canvasMotionBlur.getContext( '2d' );\r\n\tvar bufferMotionBlur;\r\n\tvar imageData;\r\n\r\n\t_log( 'Step is set to ' + _settings.step + 'ms' );\r\n\r\n var _encoders = {\r\n\t\tgif: CCGIFEncoder,\r\n\t\twebm: CCWebMEncoder,\r\n\t\tffmpegserver: CCFFMpegServerEncoder,\r\n\t\tpng: CCPNGEncoder,\r\n\t\tjpg: CCJPEGEncoder,\r\n\t\t'webm-mediarecorder': CCStreamEncoder\r\n };\r\n\r\n var ctor = _encoders[ _settings.format ];\r\n if ( !ctor ) {\r\n\t\tthrow \"Error: Incorrect or missing format: Valid formats are \" + Object.keys(_encoders).join(\", \");\r\n }\r\n _encoder = new ctor( _settings );\r\n _encoder.step = _step\r\n\r\n\t_encoder.on('process', _process);\r\n _encoder.on('progress', _progress);\r\n\r\n if (\"performance\" in window == false) {\r\n \twindow.performance = {};\r\n }\r\n\r\n\tDate.now = (Date.now || function () { // thanks IE8\r\n\t\treturn new Date().getTime();\r\n\t});\r\n\r\n\tif (\"now\" in window.performance == false){\r\n\r\n\t\tvar nowOffset = Date.now();\r\n\r\n\t\tif (performance.timing && performance.timing.navigationStart){\r\n\t\t\tnowOffset = performance.timing.navigationStart\r\n\t\t}\r\n\r\n\t\twindow.performance.now = function now(){\r\n\t\t\treturn Date.now() - nowOffset;\r\n\t\t}\r\n\t}\r\n\r\n\tvar _oldSetTimeout = window.setTimeout,\r\n\t\t_oldSetInterval = window.setInterval,\r\n\t \t_oldClearInterval = window.clearInterval,\r\n\t\t_oldClearTimeout = window.clearTimeout,\r\n\t\t_oldRequestAnimationFrame = window.requestAnimationFrame,\r\n\t\t_oldNow = window.Date.now,\r\n\t\t_oldPerformanceNow = window.performance.now,\r\n\t\t_oldGetTime = window.Date.prototype.getTime;\r\n\t// Date.prototype._oldGetTime = Date.prototype.getTime;\r\n\r\n\tvar media = [];\r\n\r\n\tfunction _init() {\r\n\r\n\t\t_log( 'Capturer start' );\r\n\r\n\t\t_startTime = window.Date.now();\r\n\t\t_time = _startTime + _settings.startTime;\r\n\t\t_performanceStartTime = window.performance.now();\r\n\t\t_performanceTime = _performanceStartTime + _settings.startTime;\r\n\r\n\t\twindow.Date.prototype.getTime = function(){\r\n\t\t\treturn _time;\r\n\t\t};\r\n\t\twindow.Date.now = function() {\r\n\t\t\treturn _time;\r\n\t\t};\r\n\r\n\t\twindow.setTimeout = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_timeouts.push( t );\r\n\t\t\t_log( 'Timeout set to ' + t.time );\r\n return t;\r\n\t\t};\r\n\t\twindow.clearTimeout = function( id ) {\r\n\t\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\t\tif( _timeouts[ j ] == id ) {\r\n\t\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\t\t_log( 'Timeout cleared' );\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\twindow.setInterval = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_intervals.push( t );\r\n\t\t\t_log( 'Interval set to ' + t.time );\r\n\t\t\treturn t;\r\n\t\t};\r\n\t\twindow.clearInterval = function( id ) {\r\n\t\t\t_log( 'clear Interval' );\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\twindow.requestAnimationFrame = function( callback ) {\r\n\t\t\t_requestAnimationFrameCallbacks.push( callback );\r\n\t\t};\r\n\t\twindow.performance.now = function(){\r\n\t\t\treturn _performanceTime;\r\n\t\t};\r\n\r\n\t\tfunction hookCurrentTime() {\r\n\t\t\tif( !this._hooked ) {\r\n\t\t\t\tthis._hooked = true;\r\n\t\t\t\tthis._hookedTime = this.currentTime || 0;\r\n\t\t\t\tthis.pause();\r\n\t\t\t\tmedia.push( this );\r\n\t\t\t}\r\n\t\t\treturn this._hookedTime + _settings.startTime;\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tObject.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t\tObject.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t} catch (err) {\r\n\t\t\t_log(err);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _start() {\r\n\t\t_init();\r\n\t\t_encoder.start();\r\n\t\t_capturing = true;\r\n\t}\r\n\r\n\tfunction _stop() {\r\n\t\t_capturing = false;\r\n\t\t_encoder.stop();\r\n\t\t_destroy();\r\n\t}\r\n\r\n\tfunction _call( fn, p ) {\r\n\t\t_oldSetTimeout( fn, 0, p );\r\n\t}\r\n\r\n\tfunction _step() {\r\n\t\t//_oldRequestAnimationFrame( _process );\r\n\t\t_call( _process );\r\n\t}\r\n\r\n\tfunction _destroy() {\r\n\t\t_log( 'Capturer stop' );\r\n\t\twindow.setTimeout = _oldSetTimeout;\r\n\t\twindow.setInterval = _oldSetInterval;\r\n\t\twindow.clearInterval = _oldClearInterval;\r\n\t\twindow.clearTimeout = _oldClearTimeout;\r\n\t\twindow.requestAnimationFrame = _oldRequestAnimationFrame;\r\n\t\twindow.Date.prototype.getTime = _oldGetTime;\r\n\t\twindow.Date.now = _oldNow;\r\n\t\twindow.performance.now = _oldPerformanceNow;\r\n\t}\r\n\r\n\tfunction _updateTime() {\r\n\t\tvar seconds = _frameCount / _settings.framerate;\r\n\t\tif( ( _settings.frameLimit && _frameCount >= _settings.frameLimit ) || ( _settings.timeLimit && seconds >= _settings.timeLimit ) ) {\r\n\t\t\t_stop();\r\n\t\t\t_save();\r\n\t\t}\r\n\t\tvar d = new Date( null );\r\n\t\td.setSeconds( seconds );\r\n\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames (' + _intermediateFrameCount + ' inter) | ' + d.toISOString().substr( 11, 8 );\r\n\t\t} else {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames | ' + d.toISOString().substr( 11, 8 );\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _checkFrame( canvas ) {\r\n\r\n\t\tif( canvasMotionBlur.width !== canvas.width || canvasMotionBlur.height !== canvas.height ) {\r\n\t\t\tcanvasMotionBlur.width = canvas.width;\r\n\t\t\tcanvasMotionBlur.height = canvas.height;\r\n\t\t\tbufferMotionBlur = new Uint16Array( canvasMotionBlur.height * canvasMotionBlur.width * 4 );\r\n\t\t\tctxMotionBlur.fillStyle = '#0'\r\n\t\t\tctxMotionBlur.fillRect( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _blendFrame( canvas ) {\r\n\r\n\t\t//_log( 'Intermediate Frame: ' + _intermediateFrameCount );\r\n\r\n\t\tctxMotionBlur.drawImage( canvas, 0, 0 );\r\n\t\timageData = ctxMotionBlur.getImageData( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] += imageData.data[ j ];\r\n\t\t\tbufferMotionBlur[ j + 1 ] += imageData.data[ j + 1 ];\r\n\t\t\tbufferMotionBlur[ j + 2 ] += imageData.data[ j + 2 ];\r\n\t\t}\r\n\t\t_intermediateFrameCount++;\r\n\r\n\t}\r\n\r\n\tfunction _saveFrame(){\r\n\r\n\t\tvar data = imageData.data;\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tdata[ j ] = bufferMotionBlur[ j ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 1 ] = bufferMotionBlur[ j + 1 ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 2 ] = bufferMotionBlur[ j + 2 ] * 2 / _settings.motionBlurFrames;\r\n\t\t}\r\n\t\tctxMotionBlur.putImageData( imageData, 0, 0 );\r\n\t\t_encoder.add( canvasMotionBlur );\r\n\t\t_frameCount++;\r\n\t\t_intermediateFrameCount = 0;\r\n\t\t_log( 'Full MB Frame! ' + _frameCount + ' ' + _time );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 1 ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 2 ] = 0;\r\n\t\t}\r\n\t\tgc();\r\n\r\n\t}\r\n\r\n\tfunction _capture( canvas ) {\r\n\r\n\t\tif( _capturing ) {\r\n\r\n\t\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\r\n\t\t\t\t_checkFrame( canvas );\r\n\t\t\t\t_blendFrame( canvas );\r\n\r\n\t\t\t\tif( _intermediateFrameCount >= .5 * _settings.motionBlurFrames ) {\r\n\t\t\t\t\t_saveFrame();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_step();\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t_encoder.add( canvas );\r\n\t\t\t\t_frameCount++;\r\n\t\t\t\t_log( 'Full Frame! ' + _frameCount );\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _process() {\r\n\r\n\t\tvar step = 1000 / _settings.framerate;\r\n\t\tvar dt = ( _frameCount + _intermediateFrameCount / _settings.motionBlurFrames ) * step;\r\n\r\n\t\t_time = _startTime + dt;\r\n\t\t_performanceTime = _performanceStartTime + dt;\r\n\r\n\t\tmedia.forEach( function( v ) {\r\n\t\t\tv._hookedTime = dt / 1000;\r\n\t\t} );\r\n\r\n\t\t_updateTime();\r\n\t\t_log( 'Frame: ' + _frameCount + ' ' + _intermediateFrameCount );\r\n\r\n\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\tif( _time >= _timeouts[ j ].triggerTime ) {\r\n\t\t\t\t_call( _timeouts[ j ].callback )\r\n\t\t\t\t//console.log( 'timeout!' );\r\n\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor( var j = 0; j < _intervals.length; j++ ) {\r\n\t\t\tif( _time >= _intervals[ j ].triggerTime ) {\r\n\t\t\t\t_call( _intervals[ j ].callback );\r\n\t\t\t\t_intervals[ j ].triggerTime += _intervals[ j ].time;\r\n\t\t\t\t//console.log( 'interval!' );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_requestAnimationFrameCallbacks.forEach( function( cb ) {\r\n \t\t_call( cb, _time - g_startTime );\r\n } );\r\n _requestAnimationFrameCallbacks = [];\r\n\r\n\t}\r\n\r\n\tfunction _save( callback ) {\r\n\r\n\t\tif( !callback ) {\r\n\t\t\tcallback = function( blob ) {\r\n\t\t\t\tdownload( blob, _encoder.filename + _encoder.extension, _encoder.mimeType );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t_encoder.save( callback );\r\n\r\n\t}\r\n\r\n\tfunction _log( message ) {\r\n\t\tif( _verbose ) console.log( message );\r\n\t}\r\n\r\n function _on( event, handler ) {\r\n\r\n _handlers[event] = handler;\r\n\r\n }\r\n\r\n function _emit( event ) {\r\n\r\n var handler = _handlers[event];\r\n if ( handler ) {\r\n\r\n handler.apply( null, Array.prototype.slice.call( arguments, 1 ) );\r\n\r\n }\r\n\r\n }\r\n\r\n function _progress( progress ) {\r\n\r\n _emit( 'progress', progress );\r\n\r\n }\r\n\r\n\treturn {\r\n\t\tstart: _start,\r\n\t\tcapture: _capture,\r\n\t\tstop: _stop,\r\n\t\tsave: _save,\r\n on: _on\r\n\t}\r\n}\r\n\r\n(freeWindow || freeSelf || {}).CCapture = CCapture;\r\n\r\n // Some AMD build optimizers like r.js check for condition patterns like the following:\r\n if (true) {\r\n // Define as an anonymous module so, through path mapping, it can be\r\n // referenced as the \"underscore\" module.\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\r\n \treturn CCapture;\r\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n}\r\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\r\n else {}\r\n\r\n}());\r\n\n\n/***/ }),\n\n/***/ 173:\n/***/ ((module) => {\n\n//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime\n// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs\n// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support\n\n// data can be a string, Blob, File, or dataURL\n\n\n\n\nfunction download(data, strFileName, strMimeType) {\n\n\tvar self = window, // this script is only for browsers anyway...\n\t\tu = \"application/octet-stream\", // this default mime also triggers iframe downloads\n\t\tm = strMimeType || u,\n\t\tx = data,\n\t\tD = document,\n\t\ta = D.createElement(\"a\"),\n\t\tz = function(a){return String(a);},\n\n\n\t\tB = self.Blob || self.MozBlob || self.WebKitBlob || z,\n\t\tBB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,\n\t\tfn = strFileName || \"download\",\n\t\tblob,\n\t\tb,\n\t\tua,\n\t\tfr;\n\n\t//if(typeof B.bind === 'function' ){ B=B.bind(self); }\n\n\tif(String(this)===\"true\"){ //reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n\t\tx=[x, m];\n\t\tm=x[0];\n\t\tx=x[1];\n\t}\n\n\n\n\t//go ahead and download dataURLs right away\n\tif(String(x).match(/^data\\:[\\w+\\-]+\\/[\\w+\\-]+[,;]/)){\n\t\treturn navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:\n\t\t\tnavigator.msSaveBlob(d2b(x), fn) :\n\t\t\tsaver(x) ; // everyone else can save dataURLs un-processed\n\t}//end if dataURL passed?\n\n\ttry{\n\n\t\tblob = x instanceof B ?\n\t\t\tx :\n\t\t\tnew B([x], {type: m}) ;\n\t}catch(y){\n\t\tif(BB){\n\t\t\tb = new BB();\n\t\t\tb.append([x]);\n\t\t\tblob = b.getBlob(m); // the blob\n\t\t}\n\n\t}\n\n\n\n\tfunction d2b(u) {\n\t\tvar p= u.split(/[:;,]/),\n\t\tt= p[1],\n\t\tdec= p[2] == \"base64\" ? atob : decodeURIComponent,\n\t\tbin= dec(p.pop()),\n\t\tmx= bin.length,\n\t\ti= 0,\n\t\tuia= new Uint8Array(mx);\n\n\t\tfor(i;i {\n\n// gif.js 0.2.0 - https://github.com/jnordberg/gif.js\r\n(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o0&&this._events[type].length>m){this._events[type].warned=true;console.error(\"(node) warning: possible EventEmitter memory \"+\"leak detected. %d listeners added. \"+\"Use emitter.setMaxListeners() to increase limit.\",this._events[type].length);if(typeof console.trace===\"function\"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key===\"removeListener\")continue;this.removeAllListeners(key)}this.removeAllListeners(\"removeListener\");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg===\"function\"}function isNumber(arg){return typeof arg===\"number\"}function isObject(arg){return typeof arg===\"object\"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require(\"./TypedNeuQuant.js\");var LZWEncoder=require(\"./LZWEncoder.js\");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv=\"\";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither=\"FloydSteinberg\";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes(\"GIF89a\")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace(\"-serpentine\",\"\"),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes(\"NETSCAPE2.0\");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{\"./LZWEncoder.js\":3,\"./TypedNeuQuant.js\":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit(\"start\");return this.emit(\"progress\",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log(\"killing active worker\");worker.terminate()}this.running=false;return this.emit(\"abort\")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log(\"spawning worker \"+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log(\"frame \"+frame.index+\" finished - \"+this.activeWorkers.length+\" active\");this.finishedFrames++;this.emit(\"progress\",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log(\"global palette analyzed\");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log(\"starting frame \"+(task.index+1)+\" of \"+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement(\"canvas\");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext(\"2d\");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name===\"chrome\"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error(\"Invalid frame\")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{\"./GIFEncoder.js\":2,\"./browser.coffee\":5,\"./gif.worker.coffee\":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require(\"./GIFEncoder.js\");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i {\n\n(function () {\n\t\"use strict\";\n\n\tvar lookup = [\n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',\n\t\t\t'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n\t\t\t'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n\t\t\t'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',\n\t\t\t'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n\t\t\t'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n\t\t\t'w', 'x', 'y', 'z', '0', '1', '2', '3',\n\t\t\t'4', '5', '6', '7', '8', '9', '+', '/'\n\t\t];\n\tfunction clean(length) {\n\t\tvar i, buffer = new Uint8Array(length);\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tbuffer[i] = 0;\n\t\t}\n\t\treturn buffer;\n\t}\n\n\tfunction extend(orig, length, addLength, multipleOf) {\n\t\tvar newSize = length + addLength,\n\t\t\tbuffer = clean((parseInt(newSize / multipleOf) + 1) * multipleOf);\n\n\t\tbuffer.set(orig);\n\n\t\treturn buffer;\n\t}\n\n\tfunction pad(num, bytes, base) {\n\t\tnum = num.toString(base || 8);\n\t\treturn \"000000000000\".substr(num.length + 12 - bytes) + num;\n\t}\n\n\tfunction stringToUint8 (input, out, offset) {\n\t\tvar i, length;\n\n\t\tout = out || clean(input.length);\n\n\t\toffset = offset || 0;\n\t\tfor (i = 0, length = input.length; i < length; i += 1) {\n\t\t\tout[offset] = input.charCodeAt(i);\n\t\t\toffset += 1;\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tfunction uint8ToBase64(uint8) {\n\t\tvar i,\n\t\t\textraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes\n\t\t\toutput = \"\",\n\t\t\ttemp, length;\n\n\t\tfunction tripletToBase64 (num) {\n\t\t\treturn lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n\t\t};\n\n\t\t// go through the array every three bytes, we'll deal with trailing stuff later\n\t\tfor (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n\t\t\ttemp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);\n\t\t\toutput += tripletToBase64(temp);\n\t\t}\n\n\t\t// this prevents an ERR_INVALID_URL in Chrome (Firefox okay)\n\t\tswitch (output.length % 4) {\n\t\t\tcase 1:\n\t\t\t\toutput += '=';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\toutput += '==';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\twindow.utils = {}\n\twindow.utils.clean = clean;\n\twindow.utils.pad = pad;\n\twindow.utils.extend = extend;\n\twindow.utils.stringToUint8 = stringToUint8;\n\twindow.utils.uint8ToBase64 = uint8ToBase64;\n}());\n\n(function () {\n\t\"use strict\";\n\n/*\nstruct posix_header { // byte offset\n\tchar name[100]; // 0\n\tchar mode[8]; // 100\n\tchar uid[8]; // 108\n\tchar gid[8]; // 116\n\tchar size[12]; // 124\n\tchar mtime[12]; // 136\n\tchar chksum[8]; // 148\n\tchar typeflag; // 156\n\tchar linkname[100]; // 157\n\tchar magic[6]; // 257\n\tchar version[2]; // 263\n\tchar uname[32]; // 265\n\tchar gname[32]; // 297\n\tchar devmajor[8]; // 329\n\tchar devminor[8]; // 337\n\tchar prefix[155]; // 345\n // 500\n};\n*/\n\n\tvar utils = window.utils,\n\t\theaderFormat;\n\n\theaderFormat = [\n\t\t{\n\t\t\t'field': 'fileName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'fileMode',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'uid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'gid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'fileSize',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'mtime',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'checksum',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'type',\n\t\t\t'length': 1\n\t\t},\n\t\t{\n\t\t\t'field': 'linkName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'ustar',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'owner',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'group',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'majorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'minorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'filenamePrefix',\n\t\t\t'length': 155\n\t\t},\n\t\t{\n\t\t\t'field': 'padding',\n\t\t\t'length': 12\n\t\t}\n\t];\n\n\tfunction formatHeader(data, cb) {\n\t\tvar buffer = utils.clean(512),\n\t\t\toffset = 0;\n\n\t\theaderFormat.forEach(function (value) {\n\t\t\tvar str = data[value.field] || \"\",\n\t\t\t\ti, length;\n\n\t\t\tfor (i = 0, length = str.length; i < length; i += 1) {\n\t\t\t\tbuffer[offset] = str.charCodeAt(i);\n\t\t\t\toffset += 1;\n\t\t\t}\n\n\t\t\toffset += value.length - i; // space it out with nulls\n\t\t});\n\n\t\tif (typeof cb === 'function') {\n\t\t\treturn cb(buffer, offset);\n\t\t}\n\t\treturn buffer;\n\t}\n\n\twindow.header = {}\n\twindow.header.structure = headerFormat;\n\twindow.header.format = formatHeader;\n}());\n\n(function () {\n\t\"use strict\";\n\n\tvar header = window.header,\n\t\tutils = window.utils,\n\t\trecordSize = 512,\n\t\tblockSize;\n\n\tfunction Tar(recordsPerBlock) {\n\t\tthis.written = 0;\n\t\tblockSize = (recordsPerBlock || 20) * recordSize;\n\t\tthis.out = utils.clean(blockSize);\n\t\tthis.blocks = [];\n\t\tthis.length = 0;\n\t}\n\n\tTar.prototype.append = function (filepath, input, opts, callback) {\n\t\tvar data,\n\t\t\tchecksum,\n\t\t\tmode,\n\t\t\tmtime,\n\t\t\tuid,\n\t\t\tgid,\n\t\t\theaderArr;\n\n\t\tif (typeof input === 'string') {\n\t\t\tinput = utils.stringToUint8(input);\n\t\t} else if (input.constructor !== Uint8Array.prototype.constructor) {\n\t\t\tthrow 'Invalid input type. You gave me: ' + input.constructor.toString().match(/function\\s*([$A-Za-z_][0-9A-Za-z_]*)\\s*\\(/)[1];\n\t\t}\n\n\t\tif (typeof opts === 'function') {\n\t\t\tcallback = opts;\n\t\t\topts = {};\n\t\t}\n\n\t\topts = opts || {};\n\n\t\tmode = opts.mode || parseInt('777', 8) & 0xfff;\n\t\tmtime = opts.mtime || Math.floor(+new Date() / 1000);\n\t\tuid = opts.uid || 0;\n\t\tgid = opts.gid || 0;\n\n\t\tdata = {\n\t\t\tfileName: filepath,\n\t\t\tfileMode: utils.pad(mode, 7),\n\t\t\tuid: utils.pad(uid, 7),\n\t\t\tgid: utils.pad(gid, 7),\n\t\t\tfileSize: utils.pad(input.length, 11),\n\t\t\tmtime: utils.pad(mtime, 11),\n\t\t\tchecksum: ' ',\n\t\t\ttype: '0', // just a file\n\t\t\tustar: 'ustar ',\n\t\t\towner: opts.owner || '',\n\t\t\tgroup: opts.group || ''\n\t\t};\n\n\t\t// calculate the checksum\n\t\tchecksum = 0;\n\t\tObject.keys(data).forEach(function (key) {\n\t\t\tvar i, value = data[key], length;\n\n\t\t\tfor (i = 0, length = value.length; i < length; i += 1) {\n\t\t\t\tchecksum += value.charCodeAt(i);\n\t\t\t}\n\t\t});\n\n\t\tdata.checksum = utils.pad(checksum, 6) + \"\\u0000 \";\n\n\t\theaderArr = header.format(data);\n\n\t\tvar headerLength = Math.ceil( headerArr.length / recordSize ) * recordSize;\n\t\tvar inputLength = Math.ceil( input.length / recordSize ) * recordSize;\n\n\t\tthis.blocks.push( { header: headerArr, input: input, headerLength: headerLength, inputLength: inputLength } );\n\n\t};\n\n\tTar.prototype.save = function() {\n\n\t\tvar buffers = [];\n\t\tvar chunks = [];\n\t\tvar length = 0;\n\t\tvar max = Math.pow( 2, 20 );\n\n\t\tvar chunk = [];\n\t\tthis.blocks.forEach( function( b ) {\n\t\t\tif( length + b.headerLength + b.inputLength > max ) {\n\t\t\t\tchunks.push( { blocks: chunk, length: length } );\n\t\t\t\tchunk = [];\n\t\t\t\tlength = 0;\n\t\t\t}\n\t\t\tchunk.push( b );\n\t\t\tlength += b.headerLength + b.inputLength;\n\t\t} );\n\t\tchunks.push( { blocks: chunk, length: length } );\n\n\t\tchunks.forEach( function( c ) {\n\n\t\t\tvar buffer = new Uint8Array( c.length );\n\t\t\tvar written = 0;\n\t\t\tc.blocks.forEach( function( b ) {\n\t\t\t\tbuffer.set( b.header, written );\n\t\t\t\twritten += b.headerLength;\n\t\t\t\tbuffer.set( b.input, written );\n\t\t\t\twritten += b.inputLength;\n\t\t\t} );\n\t\t\tbuffers.push( buffer );\n\n\t\t} );\n\n\t\tbuffers.push( new Uint8Array( 2 * recordSize ) );\n\n\t\treturn new Blob( buffers, { type: 'octet/stream' } );\n\n\t};\n\n\tTar.prototype.clear = function () {\n\t\tthis.written = 0;\n\t\tthis.out = utils.clean(blockSize);\n\t};\n\n if ( true && typeof module.exports !== 'undefined') {\n module.exports = Tar;\n } else {\n window.Tar = Tar;\n }\n}());\n\n\n/***/ }),\n\n/***/ 166:\n/***/ ((module) => {\n\n\"use strict\";\n/**\n * A tool for presenting an ArrayBuffer as a stream for writing some simple data types.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\n\n// (function(){\n /*\n * Create an ArrayBuffer of the given length and present it as a writable stream with methods\n * for writing data in different formats.\n */\n var ArrayBufferDataStream = function(length) {\n this.data = new Uint8Array(length);\n this.pos = 0;\n };\n\n ArrayBufferDataStream.prototype.seek = function(offset) {\n this.pos = offset;\n };\n\n ArrayBufferDataStream.prototype.writeBytes = function(arr) {\n for (var i = 0; i < arr.length; i++) {\n this.data[this.pos++] = arr[i];\n }\n };\n\n ArrayBufferDataStream.prototype.writeByte = function(b) {\n this.data[this.pos++] = b;\n };\n\n //Synonym:\n ArrayBufferDataStream.prototype.writeU8 = ArrayBufferDataStream.prototype.writeByte;\n\n ArrayBufferDataStream.prototype.writeU16BE = function(u) {\n this.data[this.pos++] = u >> 8;\n this.data[this.pos++] = u;\n };\n\n ArrayBufferDataStream.prototype.writeDoubleBE = function(d) {\n var\n bytes = new Uint8Array(new Float64Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n ArrayBufferDataStream.prototype.writeFloatBE = function(d) {\n var\n bytes = new Uint8Array(new Float32Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n /**\n * Write an ASCII string to the stream\n */\n ArrayBufferDataStream.prototype.writeString = function(s) {\n for (var i = 0; i < s.length; i++) {\n this.data[this.pos++] = s.charCodeAt(i);\n }\n };\n\n /**\n * Write the given 32-bit integer to the stream as an EBML variable-length integer using the given byte width\n * (use measureEBMLVarInt).\n *\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * @param i Integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeEBMLVarIntWidth = function(i, width) {\n switch (width) {\n case 1:\n this.writeU8((1 << 7) | i);\n break;\n case 2:\n this.writeU8((1 << 6) | (i >> 8));\n this.writeU8(i);\n break;\n case 3:\n this.writeU8((1 << 5) | (i >> 16));\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 4:\n this.writeU8((1 << 4) | (i >> 24));\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 5:\n /*\n * JavaScript converts its doubles to 32-bit integers for bitwise operations, so we need to do a\n * division by 2^32 instead of a right-shift of 32 to retain those top 3 bits\n */\n this.writeU8((1 << 3) | ((i / 4294967296) & 0x7));\n this.writeU8(i >> 24);\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n default:\n throw new RuntimeException(\"Bad EBML VINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to encode the given integer as an EBML VINT.\n */\n ArrayBufferDataStream.prototype.measureEBMLVarInt = function(val) {\n if (val < (1 << 7) - 1) {\n /* Top bit is set, leaving 7 bits to hold the integer, but we can't store 127 because\n * \"all bits set to one\" is a reserved value. Same thing for the other cases below:\n */\n return 1;\n } else if (val < (1 << 14) - 1) {\n return 2;\n } else if (val < (1 << 21) - 1) {\n return 3;\n } else if (val < (1 << 28) - 1) {\n return 4;\n } else if (val < 34359738367) { // 2 ^ 35 - 1 (can address 32GB)\n return 5;\n } else {\n throw new RuntimeException(\"EBML VINT size not supported \" + val);\n }\n };\n\n ArrayBufferDataStream.prototype.writeEBMLVarInt = function(i) {\n this.writeEBMLVarIntWidth(i, this.measureEBMLVarInt(i));\n };\n\n /**\n * Write the given unsigned 32-bit integer to the stream in big-endian order using the given byte width.\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * Omit the width parameter to have it determined automatically for you.\n *\n * @param u Unsigned integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeUnsignedIntBE = function(u, width) {\n if (width === undefined) {\n width = this.measureUnsignedInt(u);\n }\n\n // Each case falls through:\n switch (width) {\n case 5:\n this.writeU8(Math.floor(u / 4294967296)); // Need to use division to access >32 bits of floating point var\n case 4:\n this.writeU8(u >> 24);\n case 3:\n this.writeU8(u >> 16);\n case 2:\n this.writeU8(u >> 8);\n case 1:\n this.writeU8(u);\n break;\n default:\n throw new RuntimeException(\"Bad UINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to hold the non-zero bits of the given unsigned integer.\n */\n ArrayBufferDataStream.prototype.measureUnsignedInt = function(val) {\n // Force to 32-bit unsigned integer\n if (val < (1 << 8)) {\n return 1;\n } else if (val < (1 << 16)) {\n return 2;\n } else if (val < (1 << 24)) {\n return 3;\n } else if (val < 4294967296) {\n return 4;\n } else {\n return 5;\n }\n };\n\n /**\n * Return a view on the portion of the buffer from the beginning to the current seek position as a Uint8Array.\n */\n ArrayBufferDataStream.prototype.getAsDataArray = function() {\n if (this.pos < this.data.byteLength) {\n return this.data.subarray(0, this.pos);\n } else if (this.pos == this.data.byteLength) {\n return this.data;\n } else {\n throw \"ArrayBufferDataStream's pos lies beyond end of buffer\";\n }\n };\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = ArrayBufferDataStream;\n// \t} else {\n// \t\twindow.ArrayBufferDataStream = ArrayBufferDataStream;\n// \t}\n// }());\"use strict\";\n\n/**\n * Allows a series of Blob-convertible objects (ArrayBuffer, Blob, String, etc) to be added to a buffer. Seeking and\n * overwriting of blobs is allowed.\n *\n * You can supply a FileWriter, in which case the BlobBuffer is just used as temporary storage before it writes it\n * through to the disk.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n// (function() {\n\tvar BlobBuffer = function(fs) {\n\t\treturn function(destination) {\n\t\t\tvar\n\t\t\t\tbuffer = [],\n\t\t\t\twritePromise = Promise.resolve(),\n\t\t\t\tfileWriter = null,\n\t\t\t\tfd = null;\n\n\t\t\tif (typeof FileWriter !== \"undefined\" && destination instanceof FileWriter) {\n\t\t\t\tfileWriter = destination;\n\t\t\t} else if (fs && destination) {\n\t\t\t\tfd = destination;\n\t\t\t}\n\n\t\t\t// Current seek offset\n\t\t\tthis.pos = 0;\n\n\t\t\t// One more than the index of the highest byte ever written\n\t\t\tthis.length = 0;\n\n\t\t\t// Returns a promise that converts the blob to an ArrayBuffer\n\t\t\tfunction readBlobAsBuffer(blob) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tvar\n\t\t\t\t\t\treader = new FileReader();\n\n\t\t\t\t\treader.addEventListener(\"loadend\", function () {\n\t\t\t\t\t\tresolve(reader.result);\n\t\t\t\t\t});\n\n\t\t\t\t\treader.readAsArrayBuffer(blob);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction convertToUint8Array(thing) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tif (thing instanceof Uint8Array) {\n\t\t\t\t\t\tresolve(thing);\n\t\t\t\t\t} else if (thing instanceof ArrayBuffer || ArrayBuffer.isView(thing)) {\n\t\t\t\t\t\tresolve(new Uint8Array(thing));\n\t\t\t\t\t} else if (thing instanceof Blob) {\n\t\t\t\t\t\tresolve(readBlobAsBuffer(thing).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Assume that Blob will know how to read this thing\n\t\t\t\t\t\tresolve(readBlobAsBuffer(new Blob([thing])).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction measureData(data) {\n\t\t\t\tvar\n\t\t\t\t\tresult = data.byteLength || data.length || data.size;\n\n\t\t\t\tif (!Number.isInteger(result)) {\n\t\t\t\t\tthrow \"Failed to determine size of element\";\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Seek to the given absolute offset.\n\t\t\t *\n\t\t\t * You may not seek beyond the end of the file (this would create a hole and/or allow blocks to be written in non-\n\t\t\t * sequential order, which isn't currently supported by the memory buffer backend).\n\t\t\t */\n\t\t\tthis.seek = function (offset) {\n\t\t\t\tif (offset < 0) {\n\t\t\t\t\tthrow \"Offset may not be negative\";\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(offset)) {\n\t\t\t\t\tthrow \"Offset may not be NaN\";\n\t\t\t\t}\n\n\t\t\t\tif (offset > this.length) {\n\t\t\t\t\tthrow \"Seeking beyond the end of file is not allowed\";\n\t\t\t\t}\n\n\t\t\t\tthis.pos = offset;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Write the Blob-convertible data to the buffer at the current seek position.\n\t\t\t *\n\t\t\t * Note: If overwriting existing data, the write must not cross preexisting block boundaries (written data must\n\t\t\t * be fully contained by the extent of a previous write).\n\t\t\t */\n\t\t\tthis.write = function (data) {\n\t\t\t\tvar\n\t\t\t\t\tnewEntry = {\n\t\t\t\t\t\toffset: this.pos,\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tlength: measureData(data)\n\t\t\t\t\t},\n\t\t\t\t\tisAppend = newEntry.offset >= this.length;\n\n\t\t\t\tthis.pos += newEntry.length;\n\t\t\t\tthis.length = Math.max(this.length, this.pos);\n\n\t\t\t\t// After previous writes complete, perform our write\n\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\tif (fd) {\n\t\t\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\t\t\tconvertToUint8Array(newEntry.data).then(function(dataArray) {\n\t\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\t\ttotalWritten = 0,\n\t\t\t\t\t\t\t\t\tbuffer = Buffer.from(dataArray.buffer),\n\n\t\t\t\t\t\t\t\t\thandleWriteComplete = function(err, written, buffer) {\n\t\t\t\t\t\t\t\t\t\ttotalWritten += written;\n\n\t\t\t\t\t\t\t\t\t\tif (totalWritten >= buffer.length) {\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// We still have more to write...\n\t\t\t\t\t\t\t\t\t\t\tfs.write(fd, buffer, totalWritten, buffer.length - totalWritten, newEntry.offset + totalWritten, handleWriteComplete);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tfs.write(fd, buffer, 0, buffer.length, newEntry.offset, handleWriteComplete);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (fileWriter) {\n\t\t\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\t\tfileWriter.onwriteend = resolve;\n\n\t\t\t\t\t\t\tfileWriter.seek(newEntry.offset);\n\t\t\t\t\t\t\tfileWriter.write(new Blob([newEntry.data]));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!isAppend) {\n\t\t\t\t\t\t// We might be modifying a write that was already buffered in memory.\n\n\t\t\t\t\t\t// Slow linear search to find a block we might be overwriting\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\tentry = buffer[i];\n\n\t\t\t\t\t\t\t// If our new entry overlaps the old one in any way...\n\t\t\t\t\t\t\tif (!(newEntry.offset + newEntry.length <= entry.offset || newEntry.offset >= entry.offset + entry.length)) {\n\t\t\t\t\t\t\t\tif (newEntry.offset < entry.offset || newEntry.offset + newEntry.length > entry.offset + entry.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Overwrite crosses blob boundaries\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (newEntry.offset == entry.offset && newEntry.length == entry.length) {\n\t\t\t\t\t\t\t\t\t// We overwrote the entire block\n\t\t\t\t\t\t\t\t\tentry.data = newEntry.data;\n\n\t\t\t\t\t\t\t\t\t// We're done\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn convertToUint8Array(entry.data)\n\t\t\t\t\t\t\t\t\t\t.then(function (entryArray) {\n\t\t\t\t\t\t\t\t\t\t\tentry.data = entryArray;\n\n\t\t\t\t\t\t\t\t\t\t\treturn convertToUint8Array(newEntry.data);\n\t\t\t\t\t\t\t\t\t\t}).then(function (newEntryArray) {\n\t\t\t\t\t\t\t\t\t\t\tnewEntry.data = newEntryArray;\n\n\t\t\t\t\t\t\t\t\t\t\tentry.data.set(newEntry.data, newEntry.offset - entry.offset);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Else fall through to do a simple append, as we didn't overwrite any pre-existing blocks\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.push(newEntry);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Finish all writes to the buffer, returning a promise that signals when that is complete.\n\t\t\t *\n\t\t\t * If a FileWriter was not provided, the promise is resolved with a Blob that represents the completed BlobBuffer\n\t\t\t * contents. You can optionally pass in a mimeType to be used for this blob.\n\t\t\t *\n\t\t\t * If a FileWriter was provided, the promise is resolved with null as the first argument.\n\t\t\t */\n\t\t\tthis.complete = function (mimeType) {\n\t\t\t\tif (fd || fileWriter) {\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// After writes complete we need to merge the buffer to give to the caller\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\tvar\n\t\t\t\t\t\t\tresult = [];\n\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tresult.push(buffer[i].data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Blob(result, {mimeType: mimeType});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn writePromise;\n\t\t\t};\n\t\t};\n\t}(null);\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = BlobBuffer(require('fs'));\n// \t} else {\n// \t\twindow.BlobBuffer = BlobBuffer(null);\n// \t}\n// })();\n/**\n * WebM video encoder for Google Chrome. This implementation is suitable for creating very large video files, because\n * it can stream Blobs directly to a FileWriter without buffering the entire video in memory.\n *\n * When FileWriter is not available or not desired, it can buffer the video in memory as a series of Blobs which are\n * eventually returned as one composite Blob.\n *\n * By Nicholas Sherlock.\n *\n * Based on the ideas from Whammy: https://github.com/antimatter15/whammy\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n(function() {\n var WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {\n function extend(base, top) {\n var\n target = {};\n\n [base, top].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n });\n\n return target;\n }\n\n /**\n * Decode a Base64 data URL into a binary string.\n *\n * Returns the binary string, or false if the URL could not be decoded.\n */\n function decodeBase64WebPDataURL(url) {\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n\n return window.atob(url.substring(\"data:image\\/webp;base64,\".length));\n }\n\n /**\n * Convert a raw binary string (one character = one output byte) to an ArrayBuffer\n */\n function stringToArrayBuffer(string) {\n var\n buffer = new ArrayBuffer(string.length),\n int8Array = new Uint8Array(buffer);\n\n for (var i = 0; i < string.length; i++) {\n int8Array[i] = string.charCodeAt(i);\n }\n\n return buffer;\n }\n\n /**\n * Convert the given canvas to a WebP encoded image and return the image data as a string.\n */\n function renderAsWebP(canvas, quality) {\n var\n frame = canvas.toDataURL('image/webp', {quality: quality});\n\n return decodeBase64WebPDataURL(frame);\n }\n\n function extractKeyframeFromWebP(webP) {\n // Assume that Chrome will generate a Simple Lossy WebP which has this header:\n var\n keyframeStartIndex = webP.indexOf('VP8 ');\n\n if (keyframeStartIndex == -1) {\n throw \"Failed to identify beginning of keyframe in WebP image\";\n }\n\n // Skip the header and the 4 bytes that encode the length of the VP8 chunk\n keyframeStartIndex += 'VP8 '.length + 4;\n\n return webP.substring(keyframeStartIndex);\n }\n\n // Just a little utility so we can tag values as floats for the EBML encoder's benefit\n function EBMLFloat32(value) {\n this.value = value;\n }\n\n function EBMLFloat64(value) {\n this.value = value;\n }\n\n /**\n * Write the given EBML object to the provided ArrayBufferStream.\n *\n * The buffer's first byte is at bufferFileOffset inside the video file. This is used to complete offset and\n * dataOffset fields in each EBML structure, indicating the file offset of the first byte of the EBML element and\n * its data payload.\n */\n function writeEBML(buffer, bufferFileOffset, ebml) {\n // Is the ebml an array of sibling elements?\n if (Array.isArray(ebml)) {\n for (var i = 0; i < ebml.length; i++) {\n writeEBML(buffer, bufferFileOffset, ebml[i]);\n }\n // Is this some sort of raw data that we want to write directly?\n } else if (typeof ebml === \"string\") {\n buffer.writeString(ebml);\n } else if (ebml instanceof Uint8Array) {\n buffer.writeBytes(ebml);\n } else if (ebml.id){\n // We're writing an EBML element\n ebml.offset = buffer.pos + bufferFileOffset;\n\n buffer.writeUnsignedIntBE(ebml.id); // ID field\n\n // Now we need to write the size field, so we must know the payload size:\n\n if (Array.isArray(ebml.data)) {\n // Writing an array of child elements. We won't try to measure the size of the children up-front\n\n var\n sizePos, dataBegin, dataEnd;\n\n if (ebml.size === -1) {\n // Write the reserved all-one-bits marker to note that the size of this element is unknown/unbounded\n buffer.writeByte(0xFF);\n } else {\n sizePos = buffer.pos;\n\n /* Write a dummy size field to overwrite later. 4 bytes allows an element maximum size of 256MB,\n * which should be plenty (we don't want to have to buffer that much data in memory at one time\n * anyway!)\n */\n buffer.writeBytes([0, 0, 0, 0]);\n }\n\n dataBegin = buffer.pos;\n\n ebml.dataOffset = dataBegin + bufferFileOffset;\n writeEBML(buffer, bufferFileOffset, ebml.data);\n\n if (ebml.size !== -1) {\n dataEnd = buffer.pos;\n\n ebml.size = dataEnd - dataBegin;\n\n buffer.seek(sizePos);\n buffer.writeEBMLVarIntWidth(ebml.size, 4); // Size field\n\n buffer.seek(dataEnd);\n }\n } else if (typeof ebml.data === \"string\") {\n buffer.writeEBMLVarInt(ebml.data.length); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeString(ebml.data);\n } else if (typeof ebml.data === \"number\") {\n // Allow the caller to explicitly choose the size if they wish by supplying a size field\n if (!ebml.size) {\n ebml.size = buffer.measureUnsignedInt(ebml.data);\n }\n\n buffer.writeEBMLVarInt(ebml.size); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeUnsignedIntBE(ebml.data, ebml.size);\n } else if (ebml.data instanceof EBMLFloat64) {\n buffer.writeEBMLVarInt(8); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeDoubleBE(ebml.data.value);\n } else if (ebml.data instanceof EBMLFloat32) {\n buffer.writeEBMLVarInt(4); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeFloatBE(ebml.data.value);\n } else if (ebml.data instanceof Uint8Array) {\n buffer.writeEBMLVarInt(ebml.data.byteLength); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeBytes(ebml.data);\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n }\n\n return function(options) {\n var\n MAX_CLUSTER_DURATION_MSEC = 5000,\n DEFAULT_TRACK_NUMBER = 1,\n\n writtenHeader = false,\n videoWidth, videoHeight,\n\n clusterFrameBuffer = [],\n clusterStartTime = 0,\n clusterDuration = 0,\n\n optionDefaults = {\n quality: 0.95, // WebM image quality from 0.0 (worst) to 1.0 (best)\n fileWriter: null, // Chrome FileWriter in order to stream to a file instead of buffering to memory (optional)\n fd: null, // Node.JS file descriptor to write to instead of buffering (optional)\n\n // You must supply one of:\n frameDuration: null, // Duration of frames in milliseconds\n frameRate: null, // Number of frames per second\n },\n\n seekPoints = {\n Cues: {id: new Uint8Array([0x1C, 0x53, 0xBB, 0x6B]), positionEBML: null},\n SegmentInfo: {id: new Uint8Array([0x15, 0x49, 0xA9, 0x66]), positionEBML: null},\n Tracks: {id: new Uint8Array([0x16, 0x54, 0xAE, 0x6B]), positionEBML: null},\n },\n\n ebmlSegment,\n segmentDuration = {\n \"id\": 0x4489, // Duration\n \"data\": new EBMLFloat64(0)\n },\n\n seekHead,\n\n cues = [],\n\n blobBuffer = new BlobBuffer(options.fileWriter || options.fd);\n\n function fileOffsetToSegmentRelative(fileOffset) {\n return fileOffset - ebmlSegment.dataOffset;\n }\n\n /**\n * Create a SeekHead element with descriptors for the points in the global seekPoints array.\n *\n * 5 bytes of position values are reserved for each node, which lie at the offset point.positionEBML.dataOffset,\n * to be overwritten later.\n */\n function createSeekHead() {\n var\n seekPositionEBMLTemplate = {\n \"id\": 0x53AC, // SeekPosition\n \"size\": 5, // Allows for 32GB video files\n \"data\": 0 // We'll overwrite this when the file is complete\n },\n\n result = {\n \"id\": 0x114D9B74, // SeekHead\n \"data\": []\n };\n\n for (var name in seekPoints) {\n var\n seekPoint = seekPoints[name];\n\n seekPoint.positionEBML = Object.create(seekPositionEBMLTemplate);\n\n result.data.push({\n \"id\": 0x4DBB, // Seek\n \"data\": [\n {\n \"id\": 0x53AB, // SeekID\n \"data\": seekPoint.id\n },\n seekPoint.positionEBML\n ]\n });\n }\n\n return result;\n }\n\n /**\n * Write the WebM file header to the stream.\n */\n function writeHeader() {\n seekHead = createSeekHead();\n\n var\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n\n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ]\n }\n ]\n }\n ]\n };\n\n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n\n var\n bufferStream = new ArrayBufferDataStream(256);\n\n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n\n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n };\n\n /**\n * Create a SimpleBlock keyframe header using these fields:\n * timecode - Time of this keyframe\n * trackNumber - Track number from 1 to 126 (inclusive)\n * frame - Raw frame data payload string\n *\n * Returns an EBML element.\n */\n function createKeyframeBlock(keyframe) {\n var\n bufferStream = new ArrayBufferDataStream(1 + 2 + 1);\n\n if (!(keyframe.trackNumber > 0 && keyframe.trackNumber < 127)) {\n throw \"TrackNumber must be > 0 and < 127\";\n }\n\n bufferStream.writeEBMLVarInt(keyframe.trackNumber); // Always 1 byte since we limit the range of trackNumber\n bufferStream.writeU16BE(keyframe.timecode);\n\n // Flags byte\n bufferStream.writeByte(\n 1 << 7 // Keyframe\n );\n\n return {\n \"id\": 0xA3, // SimpleBlock\n \"data\": [\n bufferStream.getAsDataArray(),\n keyframe.frame\n ]\n };\n }\n\n /**\n * Create a Cluster node using these fields:\n *\n * timecode - Start time for the cluster\n *\n * Returns an EBML element.\n */\n function createCluster(cluster) {\n return {\n \"id\": 0x1f43b675,\n \"data\": [\n {\n \"id\": 0xe7, // Timecode\n \"data\": Math.round(cluster.timecode)\n }\n ]\n };\n }\n\n function addCuePoint(trackIndex, clusterTime, clusterFileOffset) {\n cues.push({\n \"id\": 0xBB, // Cue\n \"data\": [\n {\n \"id\": 0xB3, // CueTime\n \"data\": clusterTime\n },\n {\n \"id\": 0xB7, // CueTrackPositions\n \"data\": [\n {\n \"id\": 0xF7, // CueTrack\n \"data\": trackIndex\n },\n {\n \"id\": 0xF1, // CueClusterPosition\n \"data\": fileOffsetToSegmentRelative(clusterFileOffset)\n }\n ]\n }\n ]\n });\n }\n\n /**\n * Write a Cues element to the blobStream using the global `cues` array of CuePoints (use addCuePoint()).\n * The seek entry for the Cues in the SeekHead is updated.\n */\n function writeCues() {\n var\n ebml = {\n \"id\": 0x1C53BB6B,\n \"data\": cues\n },\n\n cuesBuffer = new ArrayBufferDataStream(16 + cues.length * 32); // Pretty crude estimate of the buffer size we'll need\n\n writeEBML(cuesBuffer, blobBuffer.pos, ebml);\n blobBuffer.write(cuesBuffer.getAsDataArray());\n\n // Now we know where the Cues element has ended up, we can update the SeekHead\n seekPoints.Cues.positionEBML.data = fileOffsetToSegmentRelative(ebml.offset);\n }\n\n /**\n * Flush the frames in the current clusterFrameBuffer out to the stream as a Cluster.\n */\n function flushClusterFrameBuffer() {\n if (clusterFrameBuffer.length == 0) {\n return;\n }\n\n // First work out how large of a buffer we need to hold the cluster data\n var\n rawImageSize = 0;\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n rawImageSize += clusterFrameBuffer[i].frame.length;\n }\n\n var\n buffer = new ArrayBufferDataStream(rawImageSize + clusterFrameBuffer.length * 32), // Estimate 32 bytes per SimpleBlock header\n\n cluster = createCluster({\n timecode: Math.round(clusterStartTime),\n });\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n cluster.data.push(createKeyframeBlock(clusterFrameBuffer[i]));\n }\n\n writeEBML(buffer, blobBuffer.pos, cluster);\n blobBuffer.write(buffer.getAsDataArray());\n\n addCuePoint(DEFAULT_TRACK_NUMBER, Math.round(clusterStartTime), cluster.offset);\n\n clusterFrameBuffer = [];\n clusterStartTime += clusterDuration;\n clusterDuration = 0;\n }\n\n function validateOptions() {\n // Derive frameDuration setting if not already supplied\n if (!options.frameDuration) {\n if (options.frameRate) {\n options.frameDuration = 1000 / options.frameRate;\n } else {\n throw \"Missing required frameDuration or frameRate setting\";\n }\n }\n }\n\n function addFrameToCluster(frame) {\n frame.trackNumber = DEFAULT_TRACK_NUMBER;\n\n // Frame timecodes are relative to the start of their cluster:\n frame.timecode = Math.round(clusterDuration);\n\n clusterFrameBuffer.push(frame);\n\n clusterDuration += frame.duration;\n\n if (clusterDuration >= MAX_CLUSTER_DURATION_MSEC) {\n flushClusterFrameBuffer();\n }\n }\n\n /**\n * Rewrites the SeekHead element that was initially written to the stream with the offsets of top level elements.\n *\n * Call once writing is complete (so the offset of all top level elements is known).\n */\n function rewriteSeekHead() {\n var\n seekHeadBuffer = new ArrayBufferDataStream(seekHead.size),\n oldPos = blobBuffer.pos;\n\n // Write the rewritten SeekHead element's data payload to the stream (don't need to update the id or size)\n writeEBML(seekHeadBuffer, seekHead.dataOffset, seekHead.data);\n\n // And write that through to the file\n blobBuffer.seek(seekHead.dataOffset);\n blobBuffer.write(seekHeadBuffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Rewrite the Duration field of the Segment with the newly-discovered video duration.\n */\n function rewriteDuration() {\n var\n buffer = new ArrayBufferDataStream(8),\n oldPos = blobBuffer.pos;\n\n // Rewrite the data payload (don't need to update the id or size)\n buffer.writeDoubleBE(clusterStartTime);\n\n // And write that through to the file\n blobBuffer.seek(segmentDuration.dataOffset);\n blobBuffer.write(buffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Add a frame to the video. Currently the frame must be a Canvas element.\n */\n this.addFrame = function(canvas) {\n if (writtenHeader) {\n if (canvas.width != videoWidth || canvas.height != videoHeight) {\n throw \"Frame size differs from previous frames\";\n }\n } else {\n videoWidth = canvas.width;\n videoHeight = canvas.height;\n\n writeHeader();\n writtenHeader = true;\n }\n\n var\n webP = renderAsWebP(canvas, {quality: options.quality});\n\n if (!webP) {\n throw \"Couldn't decode WebP frame, does the browser support WebP?\";\n }\n\n addFrameToCluster({\n frame: extractKeyframeFromWebP(webP),\n duration: options.frameDuration\n });\n };\n\n /**\n * Finish writing the video and return a Promise to signal completion.\n *\n * If the destination device was memory (i.e. options.fileWriter was not supplied), the Promise is resolved with\n * a Blob with the contents of the entire video.\n */\n this.complete = function() {\n flushClusterFrameBuffer();\n\n writeCues();\n rewriteSeekHead();\n rewriteDuration();\n\n return blobBuffer.complete('video/webm');\n };\n\n this.getWrittenSize = function() {\n return blobBuffer.length;\n };\n\n options = extend(optionDefaults, options || {});\n validateOptions();\n };\n };\n\n if ( true && typeof module.exports !== 'undefined') {\n\t // module.exports = WebMWriter(require(\"./ArrayBufferDataStream\"), require(\"./BlobBuffer\"));\n module.exports = WebMWriter(ArrayBufferDataStream,BlobBuffer);\n } else {\n\t window.WebMWriter = WebMWriter(ArrayBufferDataStream, BlobBuffer);\n }\n})();\n\n\n/***/ }),\n\n/***/ 681:\n/***/ ((module) => {\n\n\"use strict\";\nmodule.exports = JSON.parse('{\"_from\":\"@ffmpeg/ffmpeg\",\"_id\":\"@ffmpeg/ffmpeg@0.10.1\",\"_inBundle\":false,\"_integrity\":\"sha512-ChQkH7Rh57hmVo1LhfQFibWX/xqneolJKSwItwZdKPcLZuKigtYAYDIvB55pDfP17VtR1R77SxgkB2/UApB+Og==\",\"_location\":\"/@ffmpeg/ffmpeg\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"@ffmpeg/ffmpeg\",\"name\":\"@ffmpeg/ffmpeg\",\"escapedName\":\"@ffmpeg%2fffmpeg\",\"scope\":\"@ffmpeg\",\"rawSpec\":\"\",\"saveSpec\":null,\"fetchSpec\":\"latest\"},\"_requiredBy\":[\"#USER\",\"/\"],\"_resolved\":\"https://registry.npmjs.org/@ffmpeg/ffmpeg/-/ffmpeg-0.10.1.tgz\",\"_shasum\":\"3dacf3985de9c83a95fbf79fe709920cc009b00a\",\"_spec\":\"@ffmpeg/ffmpeg\",\"_where\":\"/Users/amandaghassaei/Projects/canvas-capture\",\"author\":{\"name\":\"Jerome Wu\",\"email\":\"jeromewus@gmail.com\"},\"browser\":{\"./src/node/index.js\":\"./src/browser/index.js\"},\"bugs\":{\"url\":\"https://github.com/ffmpegwasm/ffmpeg.wasm/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"is-url\":\"^1.2.4\",\"node-fetch\":\"^2.6.1\",\"regenerator-runtime\":\"^0.13.7\",\"resolve-url\":\"^0.2.1\"},\"deprecated\":false,\"description\":\"FFmpeg WebAssembly version\",\"devDependencies\":{\"@babel/core\":\"^7.12.3\",\"@babel/preset-env\":\"^7.12.1\",\"@ffmpeg/core\":\"^0.10.0\",\"@types/emscripten\":\"^1.39.4\",\"babel-loader\":\"^8.1.0\",\"chai\":\"^4.2.0\",\"cors\":\"^2.8.5\",\"eslint\":\"^7.12.1\",\"eslint-config-airbnb-base\":\"^14.1.0\",\"eslint-plugin-import\":\"^2.22.1\",\"express\":\"^4.17.1\",\"mocha\":\"^8.2.1\",\"mocha-headless-chrome\":\"^2.0.3\",\"npm-run-all\":\"^4.1.5\",\"wait-on\":\"^5.3.0\",\"webpack\":\"^5.3.2\",\"webpack-cli\":\"^4.1.0\",\"webpack-dev-middleware\":\"^4.0.0\"},\"directories\":{\"example\":\"examples\"},\"engines\":{\"node\":\">=12.16.1\"},\"homepage\":\"https://github.com/ffmpegwasm/ffmpeg.wasm#readme\",\"keywords\":[\"ffmpeg\",\"WebAssembly\",\"video\"],\"license\":\"MIT\",\"main\":\"src/index.js\",\"name\":\"@ffmpeg/ffmpeg\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git\"},\"scripts\":{\"build\":\"rimraf dist && webpack --config scripts/webpack.config.prod.js\",\"lint\":\"eslint src\",\"prepublishOnly\":\"npm run build\",\"start\":\"node scripts/server.js\",\"test\":\"npm-run-all -p -r start test:all\",\"test:all\":\"npm-run-all wait test:browser:ffmpeg test:node:all\",\"test:browser\":\"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000\",\"test:browser:ffmpeg\":\"npm run test:browser -- -f ./tests/ffmpeg.test.html\",\"test:node\":\"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js\",\"test:node:all\":\"npm run test:node -- ./tests/*.test.js\",\"wait\":\"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js\"},\"types\":\"src/index.d.ts\",\"version\":\"0.10.1\"}');\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/node module decorator */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.nmd = (module) => {\n/******/ \t\t\tmodule.paths = [];\n/******/ \t\t\tif (!module.children) module.children = [];\n/******/ \t\t\treturn module;\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be in strict mode.\n(() => {\n\"use strict\";\nvar exports = __webpack_exports__;\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CanvasCapture = void 0;\n// Default export.\nvar CanvasCapture = __webpack_require__(914);\nexports.CanvasCapture = CanvasCapture;\nexports[\"default\"] = CanvasCapture;\n\n})();\n\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=canvas-capture.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar __1 = require(\"../../\");\n// Initialize and pass in canvas.\nvar canvas = document.getElementById('my-canvas');\n__1.CanvasCapture.init(canvas, {\n showRecDot: true,\n showAlerts: true,\n showDialogs: true,\n verbose: false,\n ffmpegCorePath: './dist/ffmpeg-core.js',\n});\n// Bind key presses to begin/end recordings.\nvar MP4_OPTIONS = {\n name: 'demo-mp4',\n format: __1.CanvasCapture.MP4,\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"MP4 export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished MP4 export.\"); },\n};\n__1.CanvasCapture.bindKeyToVideoRecord('v', MP4_OPTIONS);\nvar WEBM_OPTIONS = {\n name: 'demo-webm',\n format: __1.CanvasCapture.WEBM,\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"WEBM export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished WEBM export.\"); },\n};\n__1.CanvasCapture.bindKeyToVideoRecord('w', WEBM_OPTIONS);\nvar GIF_OPTIONS = {\n name: 'demo-gif',\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"GIF export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished GIF export.\"); },\n};\n__1.CanvasCapture.bindKeyToGIFRecord('g', GIF_OPTIONS);\n// These take a single snapshot.\nvar PNG_OPTIONS = {\n name: 'demo-png',\n dpi: 72,\n onExportProgress: function (progress) { return console.log(\"PNG frames export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished PNG frames zip.\"); },\n};\n__1.CanvasCapture.bindKeyToPNGSnapshot('p', PNG_OPTIONS);\n__1.CanvasCapture.bindKeyToPNGFramesRecord('o', PNG_OPTIONS);\nvar JPEG_OPTIONS = {\n name: 'demo-jpg',\n quality: 1,\n dpi: 72,\n onExportProgress: function (progress) { return console.log(\"JPEG frames export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished JPEG frames zip.\"); },\n};\n__1.CanvasCapture.bindKeyToJPEGSnapshot('j', JPEG_OPTIONS);\n__1.CanvasCapture.bindKeyToJPEGFramesRecord('h', JPEG_OPTIONS);\n// Simple canvas draw setup.\nvar context = canvas.getContext(\"2d\");\nvar angle = 0;\nvar image = document.createElement(\"img\");\nimage.src = 'monalisa.png';\nfunction loop() {\n requestAnimationFrame(loop);\n // Wait until is loaded.\n if (image.width) {\n // Draw black background\n context.beginPath();\n context.fillStyle = 'black';\n context.fillRect(0, 0, canvas.width, canvas.height);\n // Renter rotated image.\n context.save();\n context.translate(canvas.width / 2, canvas.height / 2);\n context.rotate(angle);\n context.drawImage(image, -image.width / 2, -image.height / 2);\n context.restore();\n // Increase rotation.\n angle += 0.02;\n }\n // You need to do this only if you are recording a video or gif.\n if (__1.CanvasCapture.isRecording())\n __1.CanvasCapture.recordFrame();\n}\n// Start animation loop.\nloop();\n// Wire up ui.\ndocument.getElementById(\"savePNG\").addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.takePNGSnapshot(PNG_OPTIONS);\n});\nvar startRecordPNGFrames = document.getElementById('startPNG');\nvar pngFramesCapture;\nstartRecordPNGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n pngFramesCapture = __1.CanvasCapture.beginPNGFramesRecord(PNG_OPTIONS);\n startRecordPNGFrames.style.display = pngFramesCapture ? 'none' : 'inline';\n stopRecordPNGFrames.style.display = pngFramesCapture ? 'inline' : 'none';\n});\nvar stopRecordPNGFrames = document.getElementById('stopPNG');\nstopRecordPNGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(pngFramesCapture);\n pngFramesCapture = undefined;\n stopRecordPNGFrames.style.display = 'none';\n startRecordPNGFrames.style.display = 'inline';\n});\nstopRecordPNGFrames.style.display = 'none';\ndocument.getElementById(\"saveJPG\").addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.takeJPEGSnapshot(JPEG_OPTIONS);\n});\nvar startRecordJPGFrames = document.getElementById('startJPG');\nvar jpgFramesCapture;\nstartRecordJPGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n jpgFramesCapture = __1.CanvasCapture.beginJPEGFramesRecord(JPEG_OPTIONS);\n startRecordJPGFrames.style.display = jpgFramesCapture ? 'none' : 'inline';\n stopRecordJPGFrames.style.display = jpgFramesCapture ? 'inline' : 'none';\n});\nvar stopRecordJPGFrames = document.getElementById('stopJPG');\nstopRecordJPGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(jpgFramesCapture);\n pngFramesCapture = undefined;\n stopRecordJPGFrames.style.display = 'none';\n startRecordJPGFrames.style.display = 'inline';\n});\nstopRecordJPGFrames.style.display = 'none';\nvar startRecordMP4 = document.getElementById('startMP4');\nvar mp4Capture;\nstartRecordMP4.addEventListener('click', function (e) {\n e.preventDefault();\n mp4Capture = __1.CanvasCapture.beginVideoRecord(MP4_OPTIONS);\n startRecordMP4.style.display = mp4Capture ? 'none' : 'inline';\n stopRecordMP4.style.display = mp4Capture ? 'inline' : 'none';\n});\nvar stopRecordMP4 = document.getElementById('stopMP4');\nstopRecordMP4.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(mp4Capture);\n mp4Capture = undefined;\n stopRecordMP4.style.display = 'none';\n startRecordMP4.style.display = 'inline';\n});\nstopRecordMP4.style.display = 'none';\nvar startRecordWEBM = document.getElementById('startWEBM');\nvar webmCapture;\nstartRecordWEBM.addEventListener('click', function (e) {\n e.preventDefault();\n webmCapture = __1.CanvasCapture.beginVideoRecord(WEBM_OPTIONS);\n startRecordWEBM.style.display = webmCapture ? 'none' : 'inline';\n stopRecordWEBM.style.display = webmCapture ? 'inline' : 'none';\n});\nvar stopRecordWEBM = document.getElementById('stopWEBM');\nstopRecordWEBM.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(webmCapture);\n webmCapture = undefined;\n stopRecordWEBM.style.display = 'none';\n startRecordWEBM.style.display = 'inline';\n});\nstopRecordWEBM.style.display = 'none';\nvar startRecordGIF = document.getElementById('startGIF');\nvar gifCapture;\nstartRecordGIF.addEventListener('click', function (e) {\n e.preventDefault();\n gifCapture = __1.CanvasCapture.beginGIFRecord(GIF_OPTIONS);\n startRecordGIF.style.display = gifCapture ? 'none' : 'inline';\n stopRecordGIF.style.display = gifCapture ? 'inline' : 'none';\n});\nvar stopRecordGIF = document.getElementById('stopGIF');\nstopRecordGIF.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(gifCapture);\n gifCapture = undefined;\n stopRecordGIF.style.display = 'none';\n startRecordGIF.style.display = 'inline';\n});\nstopRecordGIF.style.display = 'none';\ndocument.getElementById('WEBM-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsWEBM() + \")\";\ndocument.getElementById('MP4-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsMP4() + \")\";\ndocument.getElementById('GIF-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsGIF() + \")\";\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;AAAA;AACA,IAAI,IAAyD;AAC7D;AACA,MAAM,EAK8B;AACpC,CAAC;AACD,yBAAyB;AACzB;;AAEA;AACA,0CAA0C,8BAAmB;;AAE7D,mBAAmB,8BAAmB;AACtC,QAAQ,kBAAkB,EAAE,8BAAmB;;AAE/C;AACA;AACA;AACA;AACA,aAAa,MAAK;AAClB,MAAM,CAAC;AACP,wCAAwC,6CAA6C;AACrF;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,8BAAmB;;AAE7D,mBAAmB,8BAAmB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,UAAU,SAAS,UAAU;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D;AACA,mBAAmB,+BAAmB;AACtC,QAAQ,MAAM,EAAE,+BAAmB;;AAEnC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,KAAK,cAAc,gBAAgB;AACpD,iCAAiC,gBAAgB;AACjD;AACA,iBAAiB,KAAK,aAAa,QAAQ;AAC3C;AACA;;AAEA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D,uBAAuB,+BAAmB;AAC1C,4BAA4B,+BAAmB;AAC/C,kBAAkB,+BAAmB;;AAErC;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA,OAAO;;AAEP;AACA,0CAA0C,+BAAmB;;AAE7D,QAAQ,2BAA2B,EAAE,+BAAmB;AACxD,QAAQ,mCAAmC,EAAE,+BAAmB;AAChE,sBAAsB,+BAAmB;AACzC,kBAAkB,+BAAmB;AACrC,QAAQ,sCAAsC,EAAE,+BAAmB;AACnE,QAAQ,UAAU,EAAE,+BAAmB;;AAEvC;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,QAAQ,EAAE,uDAAuD,YAAY,gCAAgC;AACvI;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA,+CAA+C,QAAQ;AACvD,UAAU;AACV,gDAAgD,QAAQ;AACxD,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,eAAe;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC,MAAM;AACN,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;;;AAGA;AACA;AACA,CAAC;AACD;AACA;;AAEA,mCAAmC,0BAA0B,0CAA0C,gBAAgB,OAAO,oBAAoB,eAAe,OAAO;;AAExK;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,8BAA8B;AAC9B,gCAAgC;AAChC,8BAA8B;AAC9B,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B,8BAA8B;AAC9B,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAiC;AACjC,kCAAkC;AAClC,kCAAkC;AAClC,uBAAuB;;AAEvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA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AAwF,wCAAwC,sBAAsB,qDAAqD,IAAI,yBAAyB,gBAAgB,oBAAoB,GAAG,EAAE;;;AAGjR,OAAO;;AAEP;AACA,sDAAsD,iCAAmB;;AAEzE;AACA,iCAAmB;AACnB,qBAAqB,iCAAmB;AACxC;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yCAAyC,SAAS;;AAElD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,gGAAgG;;AAEhG;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,gBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;;AAEA,gFAAgF,aAAa;AAC7F;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,iDAAiD;;AAEjD;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,0DAA0D;;AAE1D,0DAA0D;AAC1D;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA,uDAAuD;;AAEvD,iDAAiD;AACjD;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,GAAG;;AAEZ;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc;AACd;;;AAGA;AACA;AACA,kHAAkH,eAAe,kBAAkB;AACnJ,4DAA4D,eAAe,kBAAkB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;;;AAGA;AACA;AACA,sHAAsH,eAAe,kBAAkB;AACvJ,4DAA4D,eAAe,kBAAkB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;;;AAGA;AACA;AACA,kCAAkC;AAClC;AACA,KAAK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,iCAAmB;AACrC,eAAe,iCAAmB;AAClC,eAAe,iCAAmB;AAClC;AACA;AACA;AACA,sBAAsB,iCAAmB;AACzC,YAAY,iCAAmB;AAC/B;AACA;AACA;AACA;AACA,eAAe,iCAAmB;AAClC,gDAAgD,qCAAqC,+BAA+B;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wGAAwG;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2JAA2J,sBAAsB;AACjL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2JAA2J,sBAAsB;AACjL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iKAAiK,sBAAsB;AACvL,kEAAkE,cAAc;AAChF;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iCAAmB;AAC1D;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,6CAA6C;AACvG;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,mBAAmB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;;AAEA,gDAAgD,aAAa;AAC7D;AACA,yGAAyG,2IAA2I,GAAG,qBAAqB,oBAAoB,WAAW,YAAY,aAAa,cAAc,gCAAgC,kBAAkB,4BAA4B,wBAAwB,GAAG,uBAAuB,2BAA2B,kBAAkB,qBAAqB,sBAAsB,qBAAqB,2BAA2B,GAAG,oBAAoB,kBAAkB,mCAAmC,wBAAwB,GAAG,mBAAmB,kBAAkB,qBAAqB,qBAAqB,uBAAuB,sBAAsB,gBAAgB,2BAA2B,GAAG,oBAAoB,sBAAsB,GAAG,gCAAgC,sBAAsB,GAAG,mBAAmB,4BAA4B,cAAc,GA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA;;AAEA;;AAEA,gDAAgD,aAAa;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,OAAO;;AAEP;AACA,yBAAyB,iCAAmB;;AAE5C,gCAAgC,iCAAmB;AACnD,mCAAmC;AACnC;AACA,KAAK,KAAI;AACT,YAAY,iCAAmB;AAC/B,iBAAiB,iCAAmB;AACpC,YAAY,iCAAmB;AAC/B,mBAAmB,iCAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iCAAmB,kBAAkB,iCAAmB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB;AACzD,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uBAAuB;AAC7D;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wCAAwC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,uBAAuB;AAC9F,uEAAuE,uBAAuB;AAC9F,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,MAAM,IAAI;AACV;AACA;AACA;AACA;AACA,KAAK,gBAAgB,iCAAmB;AACxC;AACA;AACA;AACA,OAAO,EAAE;AACT;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;;;AAGpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC,4BAA4B;AAC5B;AACA;AACA;AACA;;;;AAIA;AACA,iDAAiD;AACjD;AACA;AACA,cAAc;AACd,EAAE;;AAEF;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,EAAE;AACF;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA;;;;AAIA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,KAAK;;AAEb,uBAAuB,QAAQ;AAC/B;;AAEA;;;AAGA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uBAAuB,kCAAkC;AAChF,IAA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G;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,YAAY;AAChD;AACA;AACA;;AAEA,+BAA+B;AAC/B,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,YAAY;AAClD;AACA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA,sBAAsB,wFAAwF;;AAE9G;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,iBAAiB,gCAAgC;;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,IAAI;;AAEJ;;AAEA,8BAA8B,uBAAuB;;AAErD;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,KAAI;AACX;AACA,IAAI;AACJ;AACA;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU,8BAA8B;AACxC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI,IAAI;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR,OAAO;AACP,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP,OAAO;AACP;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;;AAEA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA,+BAA+B,mBAAmB;AAClD,MAAM;AACN;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;;AAEA,+DAA+D;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,mBAAmB;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wDAAwD,iBAAiB;;AAEzE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;;AAEA,oDAAoD;;AAEpD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,mEAAmE;;AAEnE;AACA;AACA,kBAAkB;AAClB,8DAA8D;AAC9D;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,kEAAkE;AAClE;AACA;AACA,kBAAkB;AAClB;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA,2BAA2B,iEAAiE;AAC5F,kCAAkC,iEAAiE;AACnG,6BAA6B,iEAAiE;AAC9F,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oEAAoE;AACpE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB,mFAAmF;;AAEnF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,yBAAyB;;AAE1E;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0DAA0D;AAC1D;AACA;AACA;;AAEA,SAAS,KAAI;AACb;AACA;AACA,MAAM;AACN;AACA;AACA,CAAC;;;AAGD,OAAO;;AAEP;AACA;;AAEA;AACA,8BAA8B,2OAA2O,eAAe,iLAAiL,0PAA0P,iDAAiD,YAAY,+CAA+C,SAAS,yDAAyD,4CAA4C,+FAA+F,kFAAkF,2bAA2b,gBAAgB,qBAAqB,YAAY,mBAAmB,uLAAuL,uEAAuE,YAAY,ywBAAywB,6CAA6C;;AAE7oF,OAAO;;AAEP,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mBAAmB,iCAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,iCAAmB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA,gBAAgB,iCAAmB,wBAAwB,iCAAmB;AAC9E,oDAAoD,wCAAwC;AAC5F;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,YAAY;AACZ,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA,kEAAkE,iBAAiB;AACnF;AACA,2DAA2D,aAAa;AACxE;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,iCAAmB;AAC9B;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,aAAa;AAC7D;AACA;AACA,oBAAoB,iCAAmB;AACvC;AACA;;AAEA,CAAC;;AAED;AACA,UAAU;AACV;AACA,CAAC;AACD;;;;;;UCt2JA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;;ACtBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,UAAU,mBAAO,CAAC,wCAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+DAA+D;AAC3G,kCAAkC,6CAA6C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gEAAgE;AAC5G,kCAAkC,8CAA8C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+DAA+D;AAC3G,kCAAkC,6CAA6C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sEAAsE;AAClH,kCAAkC,iDAAiD;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uEAAuE;AACnH,kCAAkC,kDAAkD;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA","sources":["webpack://canvas-capture/./dist/canvas-capture.js","webpack://canvas-capture/webpack/bootstrap","webpack://canvas-capture/./demo/src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CanvasCapture\"] = factory();\n\telse\n\t\troot[\"CanvasCapture\"] = factory();\n})(self, function() {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 76:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst resolveURL = __webpack_require__(72);\nconst { devDependencies } = __webpack_require__(681);\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: false\n ? 0\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n\n\n/***/ }),\n\n/***/ 339:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst resolveURL = __webpack_require__(72);\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n\n\n/***/ }),\n\n/***/ 440:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n/* eslint-disable no-undef */\nconst resolveURL = __webpack_require__(72);\nconst { log } = __webpack_require__(888);\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n\n\n/***/ }),\n\n/***/ 451:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst defaultOptions = __webpack_require__(76);\nconst getCreateFFmpegCore = __webpack_require__(440);\nconst fetchFile = __webpack_require__(339);\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n\n\n/***/ }),\n\n/***/ 617:\n/***/ ((module) => {\n\nmodule.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n\n\n/***/ }),\n\n/***/ 648:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\nconst { defaultArgs, baseOptions } = __webpack_require__(617);\nconst { setLogging, setCustomLogger, log } = __webpack_require__(888);\nconst parseProgress = __webpack_require__(405);\nconst parseArgs = __webpack_require__(10);\nconst { defaultOptions, getCreateFFmpegCore } = __webpack_require__(451);\nconst { version } = __webpack_require__(681);\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n\n\n/***/ }),\n\n/***/ 888:\n/***/ ((module) => {\n\nlet logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n\n\n/***/ }),\n\n/***/ 10:\n/***/ ((module) => {\n\nmodule.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n\n\n/***/ }),\n\n/***/ 405:\n/***/ ((module) => {\n\nlet duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n\n\n/***/ }),\n\n/***/ 809:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.changeDpiBlob = changeDpiBlob;\nexports.changeDpiDataUrl = changeDpiDataUrl;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction createPngDataTable() {\n /* Table of CRCs of all 8-bit messages. */\n var crcTable = new Int32Array(256);\n for (var n = 0; n < 256; n++) {\n var c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1;\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nfunction calcCrc(buf) {\n var c = -1;\n if (!pngDataTable) pngDataTable = createPngDataTable();\n for (var n = 0; n < buf.length; n++) {\n c = pngDataTable[(c ^ buf[n]) & 0xFF] ^ c >>> 8;\n }\n return c ^ -1;\n}\n\nvar pngDataTable = void 0;\n\nvar PNG = 'image/png';\nvar JPEG = 'image/jpeg';\n\n// those are 3 possible signature of the physBlock in base64.\n// the pHYs signature block is preceed by the 4 bytes of lenght. The length of\n// the block is always 9 bytes. So a phys block has always this signature:\n// 0 0 0 9 p H Y s.\n// However the data64 encoding aligns we will always find one of those 3 strings.\n// this allow us to find this particular occurence of the pHYs block without\n// converting from b64 back to string\nvar b64PhysSignature1 = 'AAlwSFlz';\nvar b64PhysSignature2 = 'AAAJcEhZ';\nvar b64PhysSignature3 = 'AAAACXBI';\n\nvar _P = 'p'.charCodeAt(0);\nvar _H = 'H'.charCodeAt(0);\nvar _Y = 'Y'.charCodeAt(0);\nvar _S = 's'.charCodeAt(0);\n\nfunction changeDpiBlob(blob, dpi) {\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var headerChunk = blob.slice(0, 33);\n return new Promise(function (resolve, reject) {\n var fileReader = new FileReader();\n fileReader.onload = function () {\n var dataArray = new Uint8Array(fileReader.result);\n var tail = blob.slice(33);\n var changedArray = changeDpiOnArray(dataArray, dpi, blob.type);\n resolve(new Blob([changedArray, tail], { type: blob.type }));\n };\n fileReader.readAsArrayBuffer(headerChunk);\n });\n}\n\nfunction changeDpiDataUrl(base64Image, dpi) {\n var dataSplitted = base64Image.split(',');\n var format = dataSplitted[0];\n var body = dataSplitted[1];\n var type = void 0;\n var headerLength = void 0;\n var overwritepHYs = false;\n if (format.indexOf(PNG) !== -1) {\n type = PNG;\n var b64Index = detectPhysChunkFromDataUrl(body);\n // 28 bytes in dataUrl are 21bytes, length of phys chunk with everything inside.\n if (b64Index >= 0) {\n headerLength = Math.ceil((b64Index + 28) / 3) * 4;\n overwritepHYs = true;\n } else {\n headerLength = 33 / 3 * 4;\n }\n }\n if (format.indexOf(JPEG) !== -1) {\n type = JPEG;\n headerLength = 18 / 3 * 4;\n }\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var stringHeader = body.substring(0, headerLength);\n var restOfData = body.substring(headerLength);\n var headerBytes = atob(stringHeader);\n var dataArray = new Uint8Array(headerBytes.length);\n for (var i = 0; i < dataArray.length; i++) {\n dataArray[i] = headerBytes.charCodeAt(i);\n }\n var finalArray = changeDpiOnArray(dataArray, dpi, type, overwritepHYs);\n var base64Header = btoa(String.fromCharCode.apply(String, _toConsumableArray(finalArray)));\n return [format, ',', base64Header, restOfData].join('');\n}\n\nfunction detectPhysChunkFromDataUrl(data) {\n var b64index = data.indexOf(b64PhysSignature1);\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature2);\n }\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature3);\n }\n // if b64index === -1 chunk is not found\n return b64index;\n}\n\nfunction searchStartOfPhys(data) {\n var length = data.length - 1;\n // we check from the end since we cut the string in proximity of the header\n // the header is within 21 bytes from the end.\n for (var i = length; i >= 4; i--) {\n if (data[i - 4] === 9 && data[i - 3] === _P && data[i - 2] === _H && data[i - 1] === _Y && data[i] === _S) {\n return i - 3;\n }\n }\n}\n\nfunction changeDpiOnArray(dataArray, dpi, format, overwritepHYs) {\n if (format === JPEG) {\n dataArray[13] = 1; // 1 pixel per inch or 2 pixel per cm\n dataArray[14] = dpi >> 8; // dpiX high byte\n dataArray[15] = dpi & 0xff; // dpiX low byte\n dataArray[16] = dpi >> 8; // dpiY high byte\n dataArray[17] = dpi & 0xff; // dpiY low byte\n return dataArray;\n }\n if (format === PNG) {\n var physChunk = new Uint8Array(13);\n // chunk header pHYs\n // 9 bytes of data\n // 4 bytes of crc\n // this multiplication is because the standard is dpi per meter.\n dpi *= 39.3701;\n physChunk[0] = _P;\n physChunk[1] = _H;\n physChunk[2] = _Y;\n physChunk[3] = _S;\n physChunk[4] = dpi >>> 24; // dpiX highest byte\n physChunk[5] = dpi >>> 16; // dpiX veryhigh byte\n physChunk[6] = dpi >>> 8; // dpiX high byte\n physChunk[7] = dpi & 0xff; // dpiX low byte\n physChunk[8] = physChunk[4]; // dpiY highest byte\n physChunk[9] = physChunk[5]; // dpiY veryhigh byte\n physChunk[10] = physChunk[6]; // dpiY high byte\n physChunk[11] = physChunk[7]; // dpiY low byte\n physChunk[12] = 1; // dot per meter....\n\n var crc = calcCrc(physChunk);\n\n var crcChunk = new Uint8Array(4);\n crcChunk[0] = crc >>> 24;\n crcChunk[1] = crc >>> 16;\n crcChunk[2] = crc >>> 8;\n crcChunk[3] = crc & 0xff;\n\n if (overwritepHYs) {\n var startingIndex = searchStartOfPhys(dataArray);\n dataArray.set(physChunk, startingIndex);\n dataArray.set(crcChunk, startingIndex + 13);\n return dataArray;\n } else {\n // i need to give back an array of data that is divisible by 3 so that\n // dataurl encoding gives me integers, for luck this chunk is 17 + 4 = 21\n // if it was we could add a text chunk contaning some info, untill desired\n // length is met.\n\n // chunk structur 4 bytes for length is 9\n var chunkLength = new Uint8Array(4);\n chunkLength[0] = 0;\n chunkLength[1] = 0;\n chunkLength[2] = 0;\n chunkLength[3] = 9;\n\n var finalHeader = new Uint8Array(54);\n finalHeader.set(dataArray, 0);\n finalHeader.set(chunkLength, 33);\n finalHeader.set(physChunk, 37);\n finalHeader.set(crcChunk, 50);\n return finalHeader;\n }\n }\n}\n\n/***/ }),\n\n/***/ 162:\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open(\"GET\",a),d.responseType=\"blob\",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error(\"could not download file\")},d.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof __webpack_require__.g&&__webpack_require__.g.global===__webpack_require__.g?__webpack_require__.g:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open(\"\",\"_blank\"),g&&(g.document.title=g.document.body.innerText=\"downloading...\"),\"string\"==typeof b)return c(b,d,e);var h=\"application/octet-stream\"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&\"undefined\"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g, true&&(module.exports=g)});\n\n//# sourceMappingURL=FileSaver.min.js.map\n\n/***/ }),\n\n/***/ 733:\n/***/ ((module, __unused_webpack_exports, __webpack_require__) => {\n\n/*!\n\nJSZip v3.7.1 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(t){if(true)module.exports=t();else {}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e=undefined;if(!t&&e)return require(r,!0);if(l)return l(r,!0);var i=new Error(\"Cannot find module '\"+r+\"'\");throw i.code=\"MODULE_NOT_FOUND\",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l=undefined,t=0;t>2,s=(3&e)<<4|r>>4,a=1>6:64,o=2>4,r=(15&n)<<4|(s=p.indexOf(t.charAt(o++)))>>2,i=(3&s)<<6|(a=p.indexOf(t.charAt(o++))),l[h++]=e,64!==s&&(l[h++]=r),64!==a&&(l[h++]=i);return l}},{\"./support\":30,\"./utils\":32}],2:[function(t,e,r){\"use strict\";var i=t(\"./external\"),n=t(\"./stream/DataWorker\"),s=t(\"./stream/Crc32Probe\"),a=t(\"./stream/DataLengthProbe\");function o(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(i.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 n(i.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 i=t(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(t){return new i(\"STORE compression\")},uncompressWorker:function(){return new i(\"STORE decompression\")}},r.DEFLATE=t(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(t,e,r){\"use strict\";var i=t(\"./utils\");var o=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)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\"!==i.getTypeOf(t)?function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):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 i=null;i=\"undefined\"!=typeof Promise?Promise:t(\"lie\"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){\"use strict\";var i=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,n=t(\"pako\"),s=t(\"./utils\"),a=t(\"./stream/GenericWorker\"),o=i?\"uint8array\":\"array\";function h(t,e){a.call(this,\"FlateWorker/\"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic=\"\\b\\0\",s.inherits(h,a),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(t){return new h(\"Deflate\",t)},r.uncompressWorker=function(){return new h(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(t,e,r){\"use strict\";function A(t,e){var r,i=\"\";for(r=0;r>>=8;return i}function i(t,e,r,i,n,s){var a,o,h=t.file,u=t.compression,l=s!==O.utf8encode,f=I.transformTo(\"string\",s(h.name)),d=I.transformTo(\"string\",O.utf8encode(h.name)),c=h.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",O.utf8encode(c)),_=d.length!==h.name.length,g=m.length!==c.length,b=\"\",v=\"\",y=\"\",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(x.crc32=t.crc32,x.compressedSize=t.compressedSize,x.uncompressedSize=t.uncompressedSize);var S=0;e&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),\"UNIX\"===n?(C=798,z|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(t){return 63&(t||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+d,b+=\"up\"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+=\"uc\"+A(y.length,2)+y);var E=\"\";return E+=\"\\n\\0\",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+\"\\0\\0\\0\\0\"+A(z,4)+A(i,4)+f+b+p}}var I=t(\"../utils\"),n=t(\"../stream/GenericWorker\"),O=t(\"../utf8\"),B=t(\"../crc32\"),R=t(\"../signature\");function s(t,e,r,i){n.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,n),s.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,n.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},s.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},s.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 R.DATA_DESCRIPTOR+A(t.crc32,4)+A(t.compressedSize,4)+A(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},s.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 i.transformTo(\"string\",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},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=n},{\"../utils\":32}],19:[function(t,e,r){\"use strict\";var i=t(\"./Uint8ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(t,e,r){\"use strict\";var i=t(\"./DataReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.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=n},{\"../utils\":32,\"./DataReader\":18}],21:[function(t,e,r){\"use strict\";var i=t(\"./ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"../support\"),s=t(\"./ArrayReader\"),a=t(\"./StringReader\"),o=t(\"./NodeBufferReader\"),h=t(\"./Uint8ArrayReader\");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),\"string\"!==e||n.uint8array?\"nodebuffer\"===e?new o(t):n.uint8array?new h(i.transformTo(\"uint8array\",t)):new s(i.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\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../utils\");function s(t){i.call(this,\"ConvertWorker to \"+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../crc32\");function s(){i.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}t(\"../utils\").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(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 i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.call(this,\"DataLengthProbe for \"+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.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=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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 i(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}i.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=i},{}],29:[function(t,e,r){\"use strict\";var h=t(\"../utils\"),n=t(\"./ConvertWorker\"),s=t(\"./GenericWorker\"),u=t(\"../base64\"),i=t(\"../support\"),a=t(\"../external\"),o=null;if(i.nodestream)try{o=t(\"../nodejs/NodejsStreamOutputAdapter\")}catch(t){}function l(t,o){return new a.Promise(function(e,r){var i=[],n=t._internalType,s=t._outputType,a=t._mimeType;t.on(\"data\",function(t,e){i.push(t),o&&o(e)}).on(\"error\",function(t){i=[],r(t)}).on(\"end\",function(){try{var t=function(t,e,r){switch(t){case\"blob\":return h.newBlob(h.transformTo(\"arraybuffer\",e),r);case\"base64\":return u.encode(e);default:return h.transformTo(t,e)}}(s,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},s.utf8decode=function(t){return h.nodebuffer?o.transformTo(\"nodebuffer\",t).toString(\"utf-8\"):function(t){var e,r,i,n,s=t.length,a=new Array(2*s);for(e=r=0;e>10&1023,a[r++]=56320|1023&i)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(t=o.transformTo(h.uint8array?\"uint8array\":\"array\",t))},o.inherits(a,i),a.prototype.processChunk=function(t){var e=o.transformTo(h.uint8array?\"uint8array\":\"array\",t.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var i=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?e:0===r?e:r+u[t[r]]>e?r:e}(e),n=e;i!==e.length&&(h.uint8array?(n=e.subarray(0,i),this.leftOver=e.subarray(i,e.length)):(n=e.slice(0,i),this.leftOver=e.slice(i,e.length))),this.push({data:s.utf8decode(n),meta:t.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,i),l.prototype.processChunk=function(t){this.push({data:s.utf8encode(t.data),meta:t.meta})},s.Utf8EncodeWorker=l},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(t,e,a){\"use strict\";var o=t(\"./support\"),h=t(\"./base64\"),r=t(\"./nodejsUtils\"),i=t(\"set-immediate-shim\"),u=t(\"./external\");function n(t){return t}function l(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(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new h.Buf8(t.length),r=0,i=e.length;r>10&1023,o[i++]=56320|1023&n)}return l(o,i)},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?e:0===r?e:r+u[t[r]]>e?r:e}},{\"./common\":41}],43:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var n=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 n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){\"use strict\";var h,d=t(\"../utils/common\"),u=t(\"./trees\"),c=t(\"./adler32\"),p=t(\"./crc32\"),i=t(\"./messages\"),l=0,f=4,m=0,_=-2,g=-1,b=4,n=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(t,e){return t.msg=i[e],e}function T(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(d.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 N(t,e){u._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,F(t.strm)}function U(t,e){t.pending_buf[t.pending++]=e}function P(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function L(t,e){var r,i,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-z?t.strstart-(t.w_size-z):0,u=t.window,l=t.w_mask,f=t.prev,d=t.strstart+S,c=u[s+a-1],p=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--n);return a<=t.lookahead?a:t.lookahead}function j(t){var e,r,i,n,s,a,o,h,u,l,f=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-z)){for(d.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);n+=f}if(0===t.strm.avail_in)break;if(a=t.strm,o=t.window,h=t.strstart+t.lookahead,u=n,l=void 0,l=a.avail_in,u=x)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x)if(i=u._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,i=u._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(j(t),0===t.lookahead&&e===l)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-z&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(t,e){return Y(t,e,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?_:(t.state.gzhead=e,m):_},r.deflate=function(t,e){var r,i,n,s;if(!t||!t.state||5>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=p(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=E);else{var a=v+(i.w_bits-8<<4)<<8;a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=E,P(i,a),0!==i.strstart&&(P(i,t.adler>>>16),P(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(t),i.pending+2<=i.pending_buf_size&&(U(i,255&t.adler),U(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(F(t),0===t.avail_out)return i.last_flush=-1,m}else if(0===t.avail_in&&T(e)<=T(r)&&e!==f)return R(t,-5);if(666===i.status&&0!==t.avail_in)return R(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==l&&666!==i.status){var o=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(j(t),0===t.lookahead)){if(e===l)return A;break}if(t.match_length=0,r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):3===i.strategy?function(t,e){for(var r,i,n,s,a=t.window;;){if(t.lookahead<=S){if(j(t),t.lookahead<=S&&e===l)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(r=u._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):h[i.level].func(i,e);if(o!==O&&o!==B||(i.status=666),o===A||o===O)return 0===t.avail_out&&(i.last_flush=-1),m;if(o===I&&(1===e?u._tr_align(i):5!==e&&(u._tr_stored_block(i,0,0,!1),3===e&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),F(t),0===t.avail_out))return i.last_flush=-1,m}return e!==f?m:i.wrap<=0?1:(2===i.wrap?(U(i,255&t.adler),U(i,t.adler>>8&255),U(i,t.adler>>16&255),U(i,t.adler>>24&255),U(i,255&t.total_in),U(i,t.total_in>>8&255),U(i,t.total_in>>16&255),U(i,t.total_in>>24&255)):(P(i,t.adler>>>16),P(i,65535&t.adler)),F(t),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new d.Buf8(r.w_size),d.arraySet(u,e,l-r.w_size,r.w_size,0),e=u,l=r.w_size),a=t.avail_in,o=t.next_in,h=t.input,t.avail_in=l,t.next_in=0,t.input=e,j(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(c&(1<>>=y,p-=y),p<15&&(c+=z[i++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(c&(1<>>=y,p-=y,(y=s-a)>3,c&=(1<<(p-=w<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){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 I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=P,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new I.Buf32(i),e.distcode=e.distdyn=new I.Buf32(n),e.sane=1,e.back=-1,N):U}function o(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,a(t)):U}function h(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(I.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(n=s.wsize-s.wnext)&&(n=i),I.arraySet(s.window,e,r-i,n,s.wnext),(i-=n)?(I.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){t.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(c=r.length)&&(c=o),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,i,s,c,k)),512&r.flags&&(r.check=B(r.check,i,c,s)),o-=c,s+=c,r.length-=c),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break t;for(c=0;k=i[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break t;o--,u+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==e)break;u>>>=2,l-=2;break t;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break t;o--,u+=i[s++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(c=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+c>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}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,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){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<=o&&258<=h){t.next_out=a,t.avail_out=h,t.next_in=s,t.avail_in=o,r.hold=u,r.bits=l,R(t,d),a=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=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===h)break t;if(c=d-h,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=n,p=a-r.offset,c=r.length;for(hc?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=e[r+a[v]]}if(k>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function P(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function Z(t,e,r){var i,n,s=new Array(g+1),a=0;for(i=1;i<=g;i++)s[i]=a=a+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=j(s[o]++,o))}}function W(t){var e;for(e=0;e>1;1<=r;r--)G(t,s,r);for(n=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,G(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,a,o,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=g;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<_;r++)p<(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)&&(s=p,m++),h[2*i+1]=s,u>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return h;for(e=32;e>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?J(t,e,r,i):4===t.strategy||s===n?(P(t,2+(i?1:0),3),K(t,z,C)):(P(t,4+(i?1:0),3),function(t,e,r,i){var n;for(P(t,e-257,5),P(t,r-1,5),P(t,i-4,4),n=0;n>>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*(A[r]+u+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){P(t,2,3),L(t,m,z),function(t){16===t.bi_valid?(U(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){\"use strict\";e.exports=\"function\"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)});\n\n/***/ }),\n\n/***/ 560:\n/***/ (() => {\n\nHTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(a,r,t){var i=this.toDataURL(r,t).split(\",\")[1];setTimeout(function(){for(var t=atob(i),o=t.length,e=new Uint8Array(o),n=0;n {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar MicroModal = function () {\n\n var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n var Modal = /*#__PURE__*/function () {\n function Modal(_ref) {\n var targetModal = _ref.targetModal,\n _ref$triggers = _ref.triggers,\n triggers = _ref$triggers === void 0 ? [] : _ref$triggers,\n _ref$onShow = _ref.onShow,\n onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$openTrigger = _ref.openTrigger,\n openTrigger = _ref$openTrigger === void 0 ? 'data-micromodal-trigger' : _ref$openTrigger,\n _ref$closeTrigger = _ref.closeTrigger,\n closeTrigger = _ref$closeTrigger === void 0 ? 'data-micromodal-close' : _ref$closeTrigger,\n _ref$openClass = _ref.openClass,\n openClass = _ref$openClass === void 0 ? 'is-open' : _ref$openClass,\n _ref$disableScroll = _ref.disableScroll,\n disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,\n _ref$disableFocus = _ref.disableFocus,\n disableFocus = _ref$disableFocus === void 0 ? false : _ref$disableFocus,\n _ref$awaitCloseAnimat = _ref.awaitCloseAnimation,\n awaitCloseAnimation = _ref$awaitCloseAnimat === void 0 ? false : _ref$awaitCloseAnimat,\n _ref$awaitOpenAnimati = _ref.awaitOpenAnimation,\n awaitOpenAnimation = _ref$awaitOpenAnimati === void 0 ? false : _ref$awaitOpenAnimati,\n _ref$debugMode = _ref.debugMode,\n debugMode = _ref$debugMode === void 0 ? false : _ref$debugMode;\n\n _classCallCheck(this, Modal);\n\n // Save a reference of the modal\n this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n this.config = {\n debugMode: debugMode,\n disableScroll: disableScroll,\n openTrigger: openTrigger,\n closeTrigger: closeTrigger,\n openClass: openClass,\n onShow: onShow,\n onClose: onClose,\n awaitCloseAnimation: awaitCloseAnimation,\n awaitOpenAnimation: awaitOpenAnimation,\n disableFocus: disableFocus\n }; // Register click events only if pre binding eventListeners\n\n if (triggers.length > 0) this.registerTriggers.apply(this, _toConsumableArray(triggers)); // pre bind functions for event listeners\n\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n }\n /**\n * Loops through all openTriggers and binds click event\n * @param {array} triggers [Array of node elements]\n * @return {void}\n */\n\n\n _createClass(Modal, [{\n key: \"registerTriggers\",\n value: function registerTriggers() {\n var _this = this;\n\n for (var _len = arguments.length, triggers = new Array(_len), _key = 0; _key < _len; _key++) {\n triggers[_key] = arguments[_key];\n }\n\n triggers.filter(Boolean).forEach(function (trigger) {\n trigger.addEventListener('click', function (event) {\n return _this.showModal(event);\n });\n });\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n var _this2 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n this.activeElement = document.activeElement;\n this.modal.setAttribute('aria-hidden', 'false');\n this.modal.classList.add(this.config.openClass);\n this.scrollBehaviour('disable');\n this.addEventListeners();\n\n if (this.config.awaitOpenAnimation) {\n var handler = function handler() {\n _this2.modal.removeEventListener('animationend', handler, false);\n\n _this2.setFocusToFirstNode();\n };\n\n this.modal.addEventListener('animationend', handler, false);\n } else {\n this.setFocusToFirstNode();\n }\n\n this.config.onShow(this.modal, this.activeElement, event);\n }\n }, {\n key: \"closeModal\",\n value: function closeModal() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var modal = this.modal;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.scrollBehaviour('enable');\n\n if (this.activeElement && this.activeElement.focus) {\n this.activeElement.focus();\n }\n\n this.config.onClose(this.modal, this.activeElement, event);\n\n if (this.config.awaitCloseAnimation) {\n var openClass = this.config.openClass; // <- old school ftw\n\n this.modal.addEventListener('animationend', function handler() {\n modal.classList.remove(openClass);\n modal.removeEventListener('animationend', handler, false);\n }, false);\n } else {\n modal.classList.remove(this.config.openClass);\n }\n }\n }, {\n key: \"closeModalById\",\n value: function closeModalById(targetModal) {\n this.modal = document.getElementById(targetModal);\n if (this.modal) this.closeModal();\n }\n }, {\n key: \"scrollBehaviour\",\n value: function scrollBehaviour(toggle) {\n if (!this.config.disableScroll) return;\n var body = document.querySelector('body');\n\n switch (toggle) {\n case 'enable':\n Object.assign(body.style, {\n overflow: ''\n });\n break;\n\n case 'disable':\n Object.assign(body.style, {\n overflow: 'hidden'\n });\n break;\n }\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners() {\n this.modal.addEventListener('touchstart', this.onClick);\n this.modal.addEventListener('click', this.onClick);\n document.addEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n this.modal.removeEventListener('touchstart', this.onClick);\n this.modal.removeEventListener('click', this.onClick);\n document.removeEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"onClick\",\n value: function onClick(event) {\n if (event.target.hasAttribute(this.config.closeTrigger)) {\n this.closeModal(event);\n }\n }\n }, {\n key: \"onKeydown\",\n value: function onKeydown(event) {\n if (event.keyCode === 27) this.closeModal(event); // esc\n\n if (event.keyCode === 9) this.retainFocus(event); // tab\n }\n }, {\n key: \"getFocusableNodes\",\n value: function getFocusableNodes() {\n var nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Array.apply(void 0, _toConsumableArray(nodes));\n }\n /**\n * Tries to set focus on a node which is not a close trigger\n * if no other nodes exist then focuses on first close trigger\n */\n\n }, {\n key: \"setFocusToFirstNode\",\n value: function setFocusToFirstNode() {\n var _this3 = this;\n\n if (this.config.disableFocus) return;\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes\n // could not think of a better name :(\n\n var nodesWhichAreNotCloseTargets = focusableNodes.filter(function (node) {\n return !node.hasAttribute(_this3.config.closeTrigger);\n });\n if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus();\n if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus();\n }\n }, {\n key: \"retainFocus\",\n value: function retainFocus(event) {\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return;\n /**\n * Filters nodes which are hidden to prevent\n * focus leak outside modal\n */\n\n focusableNodes = focusableNodes.filter(function (node) {\n return node.offsetParent !== null;\n }); // if disableFocus is true\n\n if (!this.modal.contains(document.activeElement)) {\n focusableNodes[0].focus();\n } else {\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus();\n event.preventDefault();\n }\n\n if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus();\n event.preventDefault();\n }\n }\n }\n }]);\n\n return Modal;\n }();\n /**\n * Modal prototype ends.\n * Here on code is responsible for detecting and\n * auto binding event handlers on modal triggers\n */\n // Keep a reference to the opened modal\n\n\n var activeModal = null;\n /**\n * Generates an associative array of modals and it's\n * respective triggers\n * @param {array} triggers An array of all triggers\n * @param {string} triggerAttr The data-attribute which triggers the module\n * @return {array}\n */\n\n var generateTriggerMap = function generateTriggerMap(triggers, triggerAttr) {\n var triggerMap = [];\n triggers.forEach(function (trigger) {\n var targetModal = trigger.attributes[triggerAttr].value;\n if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n triggerMap[targetModal].push(trigger);\n });\n return triggerMap;\n };\n /**\n * Validates whether a modal of the given id exists\n * in the DOM\n * @param {number} id The id of the modal\n * @return {boolean}\n */\n\n\n var validateModalPresence = function validateModalPresence(id) {\n if (!document.getElementById(id)) {\n console.warn(\"MicroModal: \\u2757Seems like you have missed %c'\".concat(id, \"'\"), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"
\"));\n return false;\n }\n };\n /**\n * Validates if there are modal triggers present\n * in the DOM\n * @param {array} triggers An array of data-triggers\n * @return {boolean}\n */\n\n\n var validateTriggerPresence = function validateTriggerPresence(triggers) {\n if (triggers.length <= 0) {\n console.warn(\"MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"\");\n return false;\n }\n };\n /**\n * Checks if triggers and their corresponding modals\n * are present in the DOM\n * @param {array} triggers Array of DOM nodes which have data-triggers\n * @param {array} triggerMap Associative array of modals and their triggers\n * @return {boolean}\n */\n\n\n var validateArgs = function validateArgs(triggers, triggerMap) {\n validateTriggerPresence(triggers);\n if (!triggerMap) return true;\n\n for (var id in triggerMap) {\n validateModalPresence(id);\n }\n\n return true;\n };\n /**\n * Binds click handlers to all modal triggers\n * @param {object} config [description]\n * @return void\n */\n\n\n var init = function init(config) {\n // Create an config object with default openTrigger\n var options = Object.assign({}, {\n openTrigger: 'data-micromodal-trigger'\n }, config); // Collects all the nodes with the trigger\n\n var triggers = _toConsumableArray(document.querySelectorAll(\"[\".concat(options.openTrigger, \"]\"))); // Makes a mappings of modals with their trigger nodes\n\n\n var triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n for (var key in triggerMap) {\n var value = triggerMap[key];\n options.targetModal = key;\n options.triggers = _toConsumableArray(value);\n activeModal = new Modal(options); // eslint-disable-line no-new\n }\n };\n /**\n * Shows a particular modal\n * @param {string} targetModal [The id of the modal to display]\n * @param {object} config [The configuration object to pass]\n * @return {void}\n */\n\n\n var show = function show(targetModal, config) {\n var options = config || {};\n options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // clear events in case previous modal wasn't close\n\n if (activeModal) activeModal.removeEventListeners(); // stores reference to active modal\n\n activeModal = new Modal(options); // eslint-disable-line no-new\n\n activeModal.showModal();\n };\n /**\n * Closes the active modal\n * @param {string} targetModal [The id of the modal to close]\n * @return {void}\n */\n\n\n var close = function close(targetModal) {\n targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n };\n\n return {\n init: init,\n show: show,\n close: close\n };\n}();\nwindow.MicroModal = MicroModal;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MicroModal);\n\n\n/***/ }),\n\n/***/ 57:\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c},a.define('/gif.worker.coffee',function(d,e,f,g){var b,c;b=a('/GIFEncoder.js',d),c=function(a){var c,e,d,f;return c=new b(a.width,a.height),a.index===0?c.writeHeader():c.firstFrame=!1,c.setTransparent(a.transparent),c.setRepeat(a.repeat),c.setDelay(a.delay),c.setQuality(a.quality),c.addFrame(a.data),a.last&&c.finish(),d=c.stream(),a.data=d.pages,a.cursor=d.cursor,a.pageSize=d.constructor.pageSize,a.canTransfer?(f=function(c){for(var b=0,d=a.data.length;b=c.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=a},c.prototype.writeUTFBytes=function(b){for(var c=b.length,a=0;a=0&&(this.dispose=a)},b.prototype.setRepeat=function(a){this.repeat=a},b.prototype.setTransparent=function(a){this.transparent=a},b.prototype.addFrame=function(a){this.image=a,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1},b.prototype.finish=function(){this.out.writeByte(59)},b.prototype.setQuality=function(a){a<1&&(a=1),this.sample=a},b.prototype.writeHeader=function(){this.out.writeUTFBytes('GIF89a')},b.prototype.analyzePixels=function(){var g=this.pixels.length,d=g/3;this.indexedPixels=new Uint8Array(d);var a=new f(this.pixels,this.sample);a.buildColormap(),this.colorTab=a.getColormap();var b=0;for(var c=0;c>16,l=(e&65280)>>8,m=e&255,c=0,d=16777216,j=this.colorTab.length;for(var a=0;a=0&&(a=dispose&7),a<<=2,this.out.writeByte(0|a|0|b),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},b.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},b.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},b.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes('NETSCAPE2.0'),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},b.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var b=768-this.colorTab.length;for(var a=0;a>8&255)},b.prototype.writePixels=function(){var a=new g(this.width,this.height,this.indexedPixels,this.colorDepth);a.encode(this.out)},b.prototype.stream=function(){return this.out},e.exports=b}),a.define('/LZWEncoder.js',function(e,g,h,i){function f(y,D,C,B){function w(a,b){r[f++]=a,f>=254&&t(b)}function x(b){u(a),k=i+2,j=!0,l(i,b)}function u(b){for(var a=0;a=0){y=w-d,d===0&&(y=1);do if((d-=y)<0&&(d+=w),h[d]===g){e=n[d];continue a}while(h[d]>=0)}l(e,r),e=t,k<1<0&&(a.writeByte(f),a.writeBytes(r,0,f),f=0)}function p(a){return(1<0?g|=a<=8)w(g&255,c),g>>=8,e-=8;if((k>m||j)&&(j?(m=p(n_bits=q),j=!1):(++n_bits,n_bits==b?m=1<0)w(g&255,c),g>>=8,e-=8;t(c)}}var s=Math.max(2,B),r=new Uint8Array(256),h=new Int32Array(a),n=new Int32Array(a),g,e=0,f,k=0,m,j=!1,q,i,o;this.encode=z}var c=-1,b=12,a=5003,d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=f}),a.define('/TypedNeuQuant.js',function(A,F,E,D){function C(A,B){function I(){o=[],q=new Int32Array(256),t=new Int32Array(a),y=new Int32Array(a),z=new Int32Array(a>>3);var c,d;for(c=0;c>=b,o[c][1]>>=b,o[c][2]>>=b,o[c][3]=c}function K(b,a,c,e,f){o[a][0]-=b*(o[a][0]-c)/d,o[a][1]-=b*(o[a][1]-e)/d,o[a][2]-=b*(o[a][2]-f)/d}function L(j,e,n,l,k){var h=Math.abs(e-j),i=Math.min(e+j,a),g=e+1,f=e-1,m=1,b,d;while(gh)d=z[m++],gh&&(b=o[f--],b[0]-=d*(b[0]-n)/c,b[1]-=d*(b[1]-l)/c,b[2]-=d*(b[2]-k)/c)}function C(p,s,q){var h=2147483647,k=h,d=-1,m=d,c,j,e,n,l;for(c=0;c>i-b),n>g,y[c]-=l,t[c]+=l<>1,b=f+1;b>1,b=f+1;b<256;b++)q[b]=n}function E(j,i,k){var b,d,c,e=1e3,h=-1,f=q[i],g=f-1;while(f=0)f=e?f=a:(f++,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c=0&&(d=o[g],c=i-d[1],c>=e?g=-1:(g--,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c>h;for(a<=1&&(a=0),c=0;c=f&&(g-=f),c++,q===0&&(q=1),c%q===0)for(n-=n/D,o-=o/v,a=o>>h,a<=1&&(a=0),e=0;e>g,r=e<>3,h=6,t=1< 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.browserSupportsGIF = exports.browserSupportsMP4 = exports.browserSupportsWEBM = exports.isRecording = exports.stopRecord = exports.recordFrame = exports.takeJPEGSnapshot = exports.takePNGSnapshot = exports.beginJPEGFramesRecord = exports.beginPNGFramesRecord = exports.beginGIFRecord = exports.beginVideoRecord = exports.bindKeyToJPEGSnapshot = exports.bindKeyToPNGSnapshot = exports.bindKeyToJPEGFramesRecord = exports.bindKeyToPNGFramesRecord = exports.bindKeyToGIFRecord = exports.bindKeyToVideoRecord = exports.setVerbose = exports.init = exports.MP4 = exports.WEBM = exports.showDialog = void 0;\nvar CCapture_1 = __webpack_require__(886);\nvar file_saver_1 = __webpack_require__(162);\n// Polyfill for canvas.toBlob needed for some browsers.\n__webpack_require__(560);\n// @ts-ignore\nvar changedpi_1 = __webpack_require__(809);\nvar params_1 = __webpack_require__(848);\nvar modals_1 = __webpack_require__(330);\n// Make it so we don't have to specify workersPath for CCapture gif recorder.\n// This is not a large file, so no need to separate from lib.\n// @ts-ignore\nvar gif_worker_js_1 = __webpack_require__(57);\nvar JSZip = __webpack_require__(733);\nvar gifWorkersPath = URL.createObjectURL(new Blob([gif_worker_js_1.default]));\nvar ffmpegPath;\nvar ffmpeg = undefined;\n// Export showDialog method in case it is useful.\nvar modals_2 = __webpack_require__(330);\nObject.defineProperty(exports, \"showDialog\", ({ enumerable: true, get: function () { return modals_2.showDialog; } }));\nvar GIF = 'gif';\nexports.WEBM = 'webm';\nexports.MP4 = 'mp4';\nvar JPEGZIP = 'jpegzip';\nvar PNGZIP = 'pngzip';\nvar JPEG = 'jpeg';\nvar PNG = 'png';\nvar activeCaptures = [];\n// This is an unused variable,\n// but needed for proper import of CCapture at the moment.\n// See https://github.com/spite/ccapture.js/issues/78\nvar temp = CCapture_1.default;\nvar hotkeyOptions = {};\nvar hotkeys = {};\nvar canvas = null;\nfunction init(_canvas, options) {\n canvas = _canvas;\n // Use public address if you don't want to host your own.\n ffmpegPath = (options === null || options === void 0 ? void 0 : options.ffmpegCorePath) || 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js';\n if (options && options.verbose !== undefined)\n setVerbose(options.verbose);\n if (options && options.showAlerts !== undefined)\n params_1.PARAMS.SHOW_ALERTS = options.showAlerts;\n if (options && options.showDialogs !== undefined)\n params_1.PARAMS.SHOW_DIALOGS = options.showDialogs;\n if (options && options.showRecDot !== undefined)\n params_1.PARAMS.SHOW_REC_DOT = options.showRecDot;\n if (params_1.PARAMS.SHOW_REC_DOT) {\n modals_1.initDotWithCSS(options === null || options === void 0 ? void 0 : options.recDotCSS);\n }\n canvas.addEventListener('resize', function () {\n if (activeCaptures.length) {\n var warningMsg = \"Don't resize while recording canvas!\";\n modals_1.showWarning(warningMsg);\n }\n });\n}\nexports.init = init;\nfunction setVerbose(state) {\n params_1.PARAMS.VERBOSE = !!state;\n if (ffmpeg)\n ffmpeg.setLogging(params_1.PARAMS.VERBOSE);\n}\nexports.setVerbose = setVerbose;\nfunction checkCanvas() {\n if (canvas === null) {\n throw new Error('No canvas supplied, please call CanvasCapture.init() and pass in canvas element.');\n }\n}\nfunction setHotkey(key, type) {\n // Unbind other hotkeys attached to same key.\n Object.keys(hotkeys).forEach(function (keyName) {\n if (hotkeys[keyName] === key) {\n delete hotkeys[keyName];\n }\n });\n hotkeys[type] = key;\n}\n// Pressing key once will start record, press again to stop.\nfunction bindKeyToVideoRecord(key, options) {\n if ((options === null || options === void 0 ? void 0 : options.format) === exports.WEBM) {\n hotkeyOptions.webm = options;\n setHotkey(key, exports.WEBM);\n }\n else {\n // Default to MP4.\n hotkeyOptions.mp4 = options;\n setHotkey(key, exports.MP4);\n }\n}\nexports.bindKeyToVideoRecord = bindKeyToVideoRecord;\nfunction bindKeyToGIFRecord(key, options) {\n hotkeyOptions.gif = options;\n setHotkey(key, GIF);\n}\nexports.bindKeyToGIFRecord = bindKeyToGIFRecord;\nfunction bindKeyToPNGFramesRecord(key, options) {\n hotkeyOptions.pngzip = options;\n setHotkey(key, PNGZIP);\n}\nexports.bindKeyToPNGFramesRecord = bindKeyToPNGFramesRecord;\nfunction bindKeyToJPEGFramesRecord(key, options) {\n hotkeyOptions.jpegzip = options;\n setHotkey(key, JPEGZIP);\n}\nexports.bindKeyToJPEGFramesRecord = bindKeyToJPEGFramesRecord;\n// Snapshots just take a single shot.\nfunction bindKeyToPNGSnapshot(key, options) {\n hotkeyOptions.png = options;\n setHotkey(key, PNG);\n}\nexports.bindKeyToPNGSnapshot = bindKeyToPNGSnapshot;\nfunction bindKeyToJPEGSnapshot(key, options) {\n hotkeyOptions.jpeg = options;\n setHotkey(key, JPEG);\n}\nexports.bindKeyToJPEGSnapshot = bindKeyToJPEGSnapshot;\nwindow.addEventListener('keydown', function (e) {\n var _a, _b;\n if (hotkeys.mp4 && e.key === hotkeys[exports.MP4]) {\n var MP4s = activeCapturesOfType(exports.MP4);\n if (MP4s.length)\n stopRecord(MP4s);\n else {\n if (!browserSupportsMP4()) {\n var errorMsg = \"This browser does not support MP4 video recording, please try again in Chrome.\";\n var onError = (_a = hotkeyOptions[exports.MP4]) === null || _a === void 0 ? void 0 : _a.onError;\n if (onError)\n onError(new Error(errorMsg));\n modals_1.showWarning(errorMsg);\n }\n beginVideoRecord(hotkeyOptions[exports.MP4]);\n }\n }\n if (hotkeys.webm && e.key === hotkeys[exports.WEBM]) {\n var WEBMs = activeCapturesOfType(exports.WEBM);\n if (WEBMs.length)\n stopRecord(WEBMs);\n else {\n if (!browserSupportsWEBM()) {\n var errorMsg = \"This browser does not support WEBM video recording, please try again in Chrome.\";\n var onError = (_b = hotkeyOptions[exports.WEBM]) === null || _b === void 0 ? void 0 : _b.onError;\n if (onError)\n onError(new Error(errorMsg));\n modals_1.showWarning(errorMsg);\n }\n beginVideoRecord(hotkeyOptions[exports.WEBM]);\n }\n }\n if (hotkeys.gif && e.key === hotkeys[GIF]) {\n var GIFs = activeCapturesOfType(GIF);\n if (GIFs.length)\n stopRecord(GIFs);\n else\n beginGIFRecord(hotkeyOptions[GIF]);\n }\n if (hotkeys.pngzip && e.key === hotkeys[PNGZIP]) {\n var pngzips = activeCapturesOfType(PNGZIP);\n if (pngzips.length)\n stopRecord(pngzips);\n else\n beginPNGFramesRecord(hotkeyOptions[PNGZIP]);\n }\n if (hotkeys.jpegzip && e.key === hotkeys[JPEGZIP]) {\n var jpgzips = activeCapturesOfType(JPEGZIP);\n if (jpgzips.length)\n stopRecord(jpgzips);\n else\n beginJPEGFramesRecord(hotkeyOptions[JPEGZIP]);\n }\n if (hotkeys.png && e.key === hotkeys[PNG]) {\n takePNGSnapshot(hotkeyOptions[PNG]);\n }\n if (hotkeys.jpeg && e.key === hotkeys[JPEG]) {\n takeJPEGSnapshot(hotkeyOptions[JPEG]);\n }\n});\nfunction startCapture(capture) {\n activeCaptures.push(capture);\n if (capture.type !== PNGZIP && capture.type !== JPEGZIP)\n capture.capturer.start();\n // For multi-frame records, we should also throw up an indicator to show that we're in record mode.\n modals_1.showDot(isRecording());\n}\nfunction beginVideoRecord(options) {\n var _a;\n try {\n var format = (options === null || options === void 0 ? void 0 : options.format) || exports.MP4; // Default to MP4 record.\n if (format === exports.MP4) {\n if (!browserSupportsMP4()) {\n var errorMsg = \"This browser does not support MP4 video recording, please try again in Chrome.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n }\n else if (format === exports.WEBM) {\n if (!browserSupportsWEBM()) {\n var errorMsg = \"This browser does not support WEBM video recording, please try again in Chrome.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n }\n else {\n throw new Error(\"invalid video format \" + format + \".\");\n }\n if (activeVideoGifCaptures().length) {\n var errorMsg = \"CCapture.js only supports one video/gif capture at a time.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n var quality = 1;\n if (options && options.quality) {\n quality = options.quality;\n }\n var name_1 = (options === null || options === void 0 ? void 0 : options.name) || 'Video_Capture';\n // Create a capturer that exports a WebM video.\n // @ts-ignore\n var capturer = new window.CCapture({\n format: exports.WEBM,\n name: name_1,\n framerate: (options === null || options === void 0 ? void 0 : options.fps) || 60,\n quality: quality * 100,\n verbose: params_1.PARAMS.VERBOSE,\n });\n var capture = {\n name: name_1,\n capturer: capturer,\n numFrames: 0,\n type: format,\n ffmpegOptions: (_a = options) === null || _a === void 0 ? void 0 : _a.ffmpegOptions,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginVideoRecord = beginVideoRecord;\nfunction beginGIFRecord(options) {\n try {\n if (activeVideoGifCaptures().length) {\n var errorMsg = \"CCapture.js only supports one video/gif capture at a time.\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n // CCapture seems to expect a quality between 0 and 100.\n var quality = 100;\n if (options && options.quality) {\n quality = options.quality * 100;\n }\n var name_2 = (options === null || options === void 0 ? void 0 : options.name) || 'GIF_Capture';\n // Create a capturer that exports a GIF.\n // @ts-ignore\n var capturer = new window.CCapture({\n format: GIF,\n name: name_2,\n framerate: (options === null || options === void 0 ? void 0 : options.fps) || 60,\n workersPath: gifWorkersPath,\n quality: quality,\n verbose: params_1.PARAMS.VERBOSE,\n onProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n });\n var capture = {\n name: name_2,\n capturer: capturer,\n numFrames: 0,\n type: GIF,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginGIFRecord = beginGIFRecord;\nfunction beginPNGFramesRecord(options) {\n try {\n var name_3 = (options === null || options === void 0 ? void 0 : options.name) || 'PNG_Frames_Capture';\n var zipOptions = { dpi: options === null || options === void 0 ? void 0 : options.dpi };\n var capture = {\n name: name_3,\n zipOptions: zipOptions,\n zipPromises: [],\n capturer: new JSZip(),\n numFrames: 0,\n type: PNGZIP,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginPNGFramesRecord = beginPNGFramesRecord;\nfunction beginJPEGFramesRecord(options) {\n try {\n var name_4 = (options === null || options === void 0 ? void 0 : options.name) || 'JPEG_Frames_Capture';\n var zipOptions = { dpi: options === null || options === void 0 ? void 0 : options.dpi, quality: options === null || options === void 0 ? void 0 : options.quality };\n var capture = {\n name: name_4,\n zipOptions: zipOptions,\n zipPromises: [],\n capturer: new JSZip(),\n numFrames: 0,\n type: JPEGZIP,\n onExportProgress: options === null || options === void 0 ? void 0 : options.onExportProgress,\n onExport: options === null || options === void 0 ? void 0 : options.onExport,\n onExportFinish: options === null || options === void 0 ? void 0 : options.onExportFinish,\n onError: options === null || options === void 0 ? void 0 : options.onError,\n };\n startCapture(capture);\n return capture;\n }\n catch (error) {\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error);\n else\n throw error;\n }\n}\nexports.beginJPEGFramesRecord = beginJPEGFramesRecord;\nfunction canvasToBlobAsync(canvas, type, quality) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n canvas.toBlob(function (blob) {\n resolve(blob);\n }, \"image/\" + type, quality);\n })];\n });\n });\n}\nfunction takeImageSnapshot(filename, type, quality, options) {\n return __awaiter(this, void 0, void 0, function () {\n var onExportFinish, blob, errorMsg, onExport;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n checkCanvas();\n onExportFinish = options === null || options === void 0 ? void 0 : options.onExportFinish;\n return [4 /*yield*/, canvasToBlobAsync(canvas, type, quality)];\n case 1:\n blob = _a.sent();\n if (!blob) {\n errorMsg = \"Problem saving \" + type.toUpperCase() + \", please try again!\";\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n onExport = (options === null || options === void 0 ? void 0 : options.onExport) || file_saver_1.saveAs;\n if (!(options === null || options === void 0 ? void 0 : options.dpi)) return [3 /*break*/, 3];\n return [4 /*yield*/, changedpi_1.changeDpiBlob(blob, options === null || options === void 0 ? void 0 : options.dpi).then(function (blob) {\n onExport(blob, filename);\n if (onExportFinish)\n onExportFinish();\n })];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n onExport(blob, filename);\n if (onExportFinish)\n onExportFinish();\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nfunction takePNGSnapshot(options) {\n return __awaiter(this, void 0, void 0, function () {\n var name_5, filename, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n name_5 = (options === null || options === void 0 ? void 0 : options.name) || 'PNG_Capture';\n filename = name_5 + \".png\";\n return [4 /*yield*/, takeImageSnapshot(filename, PNG, undefined, options)];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_1 = _a.sent();\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error_1);\n else\n throw error_1;\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}\nexports.takePNGSnapshot = takePNGSnapshot;\nfunction takeJPEGSnapshot(options) {\n return __awaiter(this, void 0, void 0, function () {\n var name_6, filename, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n name_6 = (options === null || options === void 0 ? void 0 : options.name) || 'JPEG_Capture';\n filename = name_6 + \".jpg\";\n // Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return [4 /*yield*/, takeImageSnapshot(filename, JPEG, (options === null || options === void 0 ? void 0 : options.quality) || 1, options)];\n case 1:\n // Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_2 = _a.sent();\n if (options === null || options === void 0 ? void 0 : options.onError)\n options.onError(error_2);\n else\n throw error_2;\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}\nexports.takeJPEGSnapshot = takeJPEGSnapshot;\nfunction recordFrame(capture) {\n var captures = activeCaptures;\n if (capture) {\n if (!Array.isArray(capture)) {\n captures = [capture];\n }\n else {\n captures = capture;\n }\n }\n try {\n checkCanvas();\n if (captures.length === 0) {\n var errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n var _loop_1 = function (i) {\n var _a = captures[i], capturer = _a.capturer, type = _a.type, zipOptions = _a.zipOptions, zipPromises = _a.zipPromises, numFrames = _a.numFrames;\n if (type === JPEGZIP || type === PNGZIP) {\n // Name should correspond to current frame.\n var frameName_1 = \"frame_\" + (numFrames + 1);\n var promise = new Promise(function (resolve, reject) {\n var options = {\n dpi: zipOptions === null || zipOptions === void 0 ? void 0 : zipOptions.dpi,\n quality: zipOptions.quality,\n name: frameName_1,\n onExport: function (blob, filename) {\n capturer.file(filename, blob);\n },\n onExportFinish: resolve,\n onError: reject,\n };\n if (type === JPEGZIP) {\n takeJPEGSnapshot(options);\n }\n else {\n takePNGSnapshot(options);\n }\n });\n zipPromises.push(promise);\n }\n else {\n capturer.capture(canvas);\n }\n captures[i].numFrames = numFrames + 1;\n };\n for (var i = 0; i < captures.length; i++) {\n _loop_1(i);\n }\n }\n catch (error) {\n var handled = true;\n for (var i = 0; i < captures.length; i++) {\n var capture_1 = captures[i];\n if (capture_1.onError)\n capture_1.onError(error);\n else\n handled = false;\n }\n if (!captures.length || !handled) {\n throw error;\n }\n }\n}\nexports.recordFrame = recordFrame;\nfunction CCaptureSaveAsync(capturer) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n capturer.save(function (blob) {\n resolve(blob);\n });\n })];\n });\n });\n}\nfunction stopRecordAtIndex(index) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, name, capturer, numFrames, type, zipPromises, onExportProgress, onExport, onExportFinish, onError, ffmpegOptions, errorMsg, _b, blob, blob, filename, blob, filename;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = activeCaptures[index], name = _a.name, capturer = _a.capturer, numFrames = _a.numFrames, type = _a.type, zipPromises = _a.zipPromises, onExportProgress = _a.onExportProgress, onExport = _a.onExport, onExportFinish = _a.onExportFinish, onError = _a.onError, ffmpegOptions = _a.ffmpegOptions;\n // Remove ref to capturer.\n activeCaptures.splice(index, 1);\n if (type !== PNGZIP && type !== JPEGZIP)\n capturer.stop();\n if (numFrames === 0) {\n errorMsg = 'No frames recorded, call CanvasCapture.recordFrame().';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n _b = type;\n switch (_b) {\n case exports.MP4: return [3 /*break*/, 1];\n case exports.WEBM: return [3 /*break*/, 4];\n case GIF: return [3 /*break*/, 6];\n case PNGZIP: return [3 /*break*/, 8];\n case JPEGZIP: return [3 /*break*/, 8];\n }\n return [3 /*break*/, 11];\n case 1: return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 2:\n blob = _c.sent();\n // Tell the user that mp4s take a sec to process.\n modals_1.showDialog('Processing...', 'MP4 is processing and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, convertWEBMtoMP4({\n name: name,\n blob: blob,\n onExportProgress: onExportProgress,\n onExport: onExport,\n onExportFinish: onExportFinish,\n ffmpegOptions: ffmpegOptions,\n })];\n case 3:\n _c.sent();\n return [3 /*break*/, 12];\n case 4:\n if (onExportProgress)\n onExportProgress(0);\n return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 5:\n blob = _c.sent();\n if (onExportProgress)\n onExportProgress(1); // Save is nearly immediate.\n filename = name + \".webm\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n return [3 /*break*/, 12];\n case 6:\n // Tell the user that gifs take a sec to process.\n modals_1.showDialog('Processing...', 'GIF is processing and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, CCaptureSaveAsync(capturer)];\n case 7:\n blob = _c.sent();\n filename = name + \".gif\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n return [3 /*break*/, 12];\n case 8: \n // Wait for all frames to finish saving.\n return [4 /*yield*/, Promise.all(zipPromises)];\n case 9:\n // Wait for all frames to finish saving.\n _c.sent();\n // Tell the user that frames take a sec to zip.\n modals_1.showDialog('Processing...', 'Frames are being zipped and may take a minute to save. You can close this dialog in the meantime.', { autoCloseDelay: 7000 });\n return [4 /*yield*/, capturer.generateAsync({ type: 'blob' }, function (metadata) {\n if (onExportProgress)\n onExportProgress(metadata.percent / 100);\n }).then(function (blob) {\n var filename = name + \".zip\";\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(blob, filename);\n }\n if (onExportFinish)\n onExportFinish();\n })];\n case 10:\n _c.sent();\n return [3 /*break*/, 12];\n case 11: throw new Error(\"Need to handle saving type \" + type + \".\");\n case 12: return [2 /*return*/];\n }\n });\n });\n}\nfunction stopRecord(capture) {\n return __awaiter(this, void 0, void 0, function () {\n var captures, errorMsg, promises, i, index, error_3, handled, i, capture_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (capture && !Array.isArray(capture)) {\n capture = [capture];\n }\n captures = capture || activeCaptures;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n if (activeCaptures.length === 0) {\n errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n }\n promises = [];\n for (i = 0; i < captures.length; i++) {\n index = activeCaptures.indexOf(captures[i]);\n if (index < 0)\n throw new Error(\"Invalid capture \" + captures[i] + \" \\u2013 may have already been stopped.\");\n promises.push(stopRecordAtIndex(index));\n }\n modals_1.showDot(isRecording());\n return [4 /*yield*/, Promise.all(promises)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_3 = _a.sent();\n handled = true;\n for (i = 0; i < captures.length; i++) {\n capture_2 = captures[i];\n if (capture_2.onError)\n capture_2.onError(error_3);\n else\n handled = false;\n }\n if (!captures.length || !handled) {\n throw error_3;\n }\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nexports.stopRecord = stopRecord;\nfunction activeCapturesOfType(type) {\n var captures = [];\n for (var i = 0; i < activeCaptures.length; i++) {\n if (activeCaptures[i].type === type) {\n captures.push(activeCaptures[i]);\n }\n }\n return captures;\n}\nfunction activeVideoGifCaptures() {\n return activeCapturesOfType(exports.WEBM).concat(activeCapturesOfType(exports.MP4)).concat(activeCapturesOfType(GIF));\n}\nfunction isRecording() {\n return activeCaptures.length > 0;\n}\nexports.isRecording = isRecording;\nvar ffmpegLoaded = false;\nfunction convertWEBMtoMP4(options) {\n return __awaiter(this, void 0, void 0, function () {\n var createFFmpeg, name, blob, onExportProgress, onExport, onExportFinish, ffmpegOptions, _data, data, defaultFFMPEGOptions, combinedOptions, _ffmpegOptions, filename, output, outputBlob;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!ffmpeg) {\n createFFmpeg = __webpack_require__(648);\n ffmpeg = createFFmpeg({\n corePath: ffmpegPath,\n });\n }\n if (!!ffmpegLoaded) return [3 /*break*/, 2];\n return [4 /*yield*/, ffmpeg.load().catch(function () {\n var errorMsg = 'MP4 export not supported in this browser, try again in the latest version of Chrome.';\n modals_1.showWarning(errorMsg);\n throw new Error(errorMsg);\n })];\n case 1:\n _b.sent();\n ffmpegLoaded = true;\n _b.label = 2;\n case 2:\n name = options.name, blob = options.blob, onExportProgress = options.onExportProgress, onExport = options.onExport, onExportFinish = options.onExportFinish, ffmpegOptions = options.ffmpegOptions;\n return [4 /*yield*/, blob.arrayBuffer()];\n case 3:\n _data = _b.sent();\n data = new Uint8Array(_data);\n // Write data to MEMFS, need to use Uint8Array for binary data.\n ffmpeg.FS('writeFile', name + \".webm\", data);\n // Convert to MP4.\n // TODO: onProgress callback is not working quite right yet.\n // https://github.com/ffmpegwasm/ffmpeg.wasm/issues/112\n if (onExportProgress)\n ffmpeg.setProgress(function (_a) {\n var ratio = _a.ratio;\n onExportProgress(Math.max(0, Math.min(ratio, 1)));\n });\n defaultFFMPEGOptions = {\n '-c:v': 'libx264',\n '-preset': 'slow',\n '-crf': '22',\n '-pix_fmt': 'yuv420p',\n };\n combinedOptions = __assign(__assign({}, defaultFFMPEGOptions), (ffmpegOptions || {}));\n _ffmpegOptions = [];\n Object.keys(combinedOptions).forEach(function (key) {\n _ffmpegOptions.push(key, combinedOptions[key]);\n });\n filename = name + \".mp4\";\n return [4 /*yield*/, (_a = ffmpeg).run.apply(_a, __spreadArrays(['-i', name + \".webm\"], _ffmpegOptions, ['-vf', 'crop=trunc(iw/2)*2:trunc(ih/2)*2',\n '-an',\n filename]))];\n case 4:\n _b.sent();\n return [4 /*yield*/, ffmpeg.FS('readFile', filename)];\n case 5:\n output = _b.sent();\n outputBlob = new Blob([output], { type: 'video/mp4' });\n if (onExport) {\n onExport(blob, filename);\n }\n else {\n file_saver_1.saveAs(outputBlob, filename);\n }\n // Delete files in MEMFS.\n ffmpeg.FS('unlink', name + \".webm\");\n ffmpeg.FS('unlink', filename);\n if (onExportFinish)\n onExportFinish();\n return [2 /*return*/];\n }\n });\n });\n}\nfunction browserSupportsWEBP() {\n var _canvas = document.createElement('canvas');\n var url = _canvas.toDataURL('image/webp', { quality: 1 });\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n return true;\n}\nfunction browserSupportsSharedArrayBuffer() {\n try {\n var test = new SharedArrayBuffer(1024);\n }\n catch (_a) {\n return false;\n }\n return true;\n}\nfunction browserSupportsWebWorkers() {\n return !!window.Worker;\n}\nfunction browserSupportsWEBM() {\n return browserSupportsWEBP();\n}\nexports.browserSupportsWEBM = browserSupportsWEBM;\nfunction browserSupportsMP4() {\n // Also web workers?\n // && browserSupportsWebWorkers()\n return browserSupportsWEBP() && browserSupportsSharedArrayBuffer();\n}\nexports.browserSupportsMP4 = browserSupportsMP4;\nfunction browserSupportsGIF() {\n return browserSupportsWebWorkers();\n}\nexports.browserSupportsGIF = browserSupportsGIF;\n\n\n/***/ }),\n\n/***/ 713:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.css = void 0;\nexports.css = \"\\n/************************** Basic Modal Styles\\n**************************/\\n\\n.modal {\\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\\n}\\n\\n.modal__overlay {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n background: rgba(0,0,0,0.6);\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n}\\n\\n.modal__container {\\n background-color: #fff;\\n padding: 30px;\\n max-width: 500px;\\n max-height: 100vh;\\n overflow-y: auto;\\n box-sizing: border-box;\\n}\\n\\n.modal__header {\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n}\\n\\n.modal__title {\\n margin-top: 0;\\n margin-bottom: 0;\\n font-weight: 600;\\n font-size: 1.25rem;\\n line-height: 1.25;\\n color: #222;\\n box-sizing: border-box;\\n}\\n\\n.modal__footer {\\n text-align: right;\\n}\\n\\n.modal__footer>.modal__btn {\\n margin-right: 8px;\\n}\\n\\n.modal__close {\\n background: transparent;\\n border: 0;\\n}\\n\\n.modal__header .modal__close:before { content: \\\"\\u2715\\\"; }\\n\\n.modal__content {\\n margin-top: 2rem;\\n margin-bottom: 2rem;\\n line-height: 1.5;\\n color: rgba(0,0,0,.8);\\n}\\n\\n.modal__btn {\\n font-size: .875rem;\\n padding-left: 1rem;\\n padding-right: 1rem;\\n padding-top: .5rem;\\n padding-bottom: .5rem;\\n background-color: #e6e6e6;\\n color: rgba(0,0,0,.8);\\n border-radius: .25rem;\\n border-style: none;\\n border-width: 0;\\n cursor: pointer;\\n -webkit-appearance: button;\\n text-transform: none;\\n overflow: visible;\\n line-height: 1.15;\\n margin: 0;\\n will-change: transform;\\n -moz-osx-font-smoothing: grayscale;\\n -webkit-backface-visibility: hidden;\\n backface-visibility: hidden;\\n -webkit-transform: translateZ(0);\\n transform: translateZ(0);\\n transition: -webkit-transform .25s ease-out;\\n transition: transform .25s ease-out;\\n transition: transform .25s ease-out,-webkit-transform .25s ease-out;\\n}\\n\\n.modal__btn:focus, .modal__btn:hover {\\n -webkit-transform: scale(1.05);\\n transform: scale(1.05);\\n}\\n\\n.modal__btn-primary {\\n background-color: #333;\\n color: #fff;\\n}\\n\\n\\n\\n/************************** Demo Animation Style\\n**************************/\\n@keyframes mmfadeIn {\\n from { opacity: 0; }\\n to { opacity: 1; }\\n}\\n\\n@keyframes mmfadeOut {\\n from { opacity: 1; }\\n to { opacity: 0; }\\n}\\n\\n@keyframes mmslideIn {\\n from { transform: translateY(15%); }\\n to { transform: translateY(0); }\\n}\\n\\n@keyframes mmslideOut {\\n from { transform: translateY(0); }\\n to { transform: translateY(-10%); }\\n}\\n\\n.micromodal-slide {\\n display: none;\\n}\\n\\n.micromodal-slide.is-open {\\n display: block;\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"false\\\"] .modal__overlay {\\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"false\\\"] .modal__container {\\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"true\\\"] .modal__overlay {\\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\\n}\\n\\n.micromodal-slide[aria-hidden=\\\"true\\\"] .modal__container {\\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\\n}\\n\\n.micromodal-slide .modal__container,\\n.micromodal-slide .modal__overlay {\\n will-change: transform;\\n}\\n\";\n\n\n/***/ }),\n\n/***/ 330:\n/***/ (function(__unused_webpack_module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.showDot = exports.initDotWithCSS = exports.showDialog = exports.showWarning = void 0;\nvar micromodal_1 = __webpack_require__(650);\nvar micromodal_css_1 = __webpack_require__(713);\nvar params_1 = __webpack_require__(848);\n// Add modal styling.\nvar style = document.createElement('style');\nstyle.textContent = micromodal_css_1.css;\ndocument.head.append(style);\nfunction initModalHTML(modalID, title, content) {\n if (content === void 0) { content = ''; }\n var modalString = \"
\\n\\t\\t
\\n\\t\\t
\\n\\t\\t\\t
\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\t\" + title + \"\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\n\\t\\t\\t
\\n\\t\\t\\t
\\n\\t\\t\\t\\t

\\n\\t\\t\\t\\t\\t\" + content + \"\\n\\t\\t\\t\\t

\\n\\t\\t\\t
\\n\\t\\t
\\n\\t\\t
\\n\\t
\";\n // This is a trick to create an element from string.\n var temp = document.createElement('div');\n temp.innerHTML = modalString;\n return temp.firstChild;\n}\n;\nvar alertModalInited = false;\nvar dialogModalInited = false;\nvar ALERT_MODAL_ID = 'alert';\nvar alertModal = initModalHTML(ALERT_MODAL_ID, 'Warning');\nvar DIALOG_MODAL_ID = 'dialog';\nvar dialogModal = initModalHTML(DIALOG_MODAL_ID, 'Saving...');\nfunction showWarning(message) {\n console.warn(message);\n if (!params_1.PARAMS.SHOW_ALERTS) {\n return;\n }\n if (!alertModalInited) {\n alertModalInited = true;\n document.getElementsByTagName('body')[0].appendChild(alertModal);\n }\n document.getElementById(\"modal-\" + ALERT_MODAL_ID + \"-content\").innerHTML = message;\n micromodal_1.default.show(\"modal-\" + ALERT_MODAL_ID);\n}\nexports.showWarning = showWarning;\nfunction showDialog(title, message, options) {\n if (params_1.PARAMS.VERBOSE)\n console.log(title, message);\n if (!params_1.PARAMS.SHOW_DIALOGS) {\n return;\n }\n if (!dialogModalInited) {\n dialogModalInited = true;\n document.getElementsByTagName('body')[0].appendChild(dialogModal);\n }\n document.getElementById(\"modal-\" + DIALOG_MODAL_ID + \"-title\").innerHTML = title;\n document.getElementById(\"modal-\" + DIALOG_MODAL_ID + \"-content\").innerHTML = message;\n micromodal_1.default.show(\"modal-\" + DIALOG_MODAL_ID);\n var autoCloseDelay = (options === null || options === void 0 ? void 0 : options.autoCloseDelay) !== undefined ? options.autoCloseDelay : -1;\n if (autoCloseDelay > 0) {\n setTimeout(function () {\n micromodal_1.default.close(\"modal-\" + DIALOG_MODAL_ID);\n }, autoCloseDelay);\n }\n}\nexports.showDialog = showDialog;\n// Create record red dot vis to overlay when recording is happening.\nvar dot = document.createElement('div');\nfunction initDotWithCSS(css) {\n dot.id = 'recordingDot';\n var dotCSS = __assign({ background: \"red\", width: \"20px\", height: \"20px\", \"border-radius\": \"50%\", display: \"none\", position: \"absolute\", top: \"0\", right: \"0\", \"z-index\": \"10\", margin: \"20px\" }, css);\n Object.assign(dot.style, dotCSS);\n document.getElementsByTagName('body')[0].appendChild(dot);\n}\nexports.initDotWithCSS = initDotWithCSS;\nfunction showDot(visible) {\n if (!params_1.PARAMS.SHOW_REC_DOT)\n return;\n if (visible) {\n dot.style.display = \"inline-block\";\n }\n else {\n dot.style.display = \"none\";\n }\n}\nexports.showDot = showDot;\n\n\n/***/ }),\n\n/***/ 848:\n/***/ ((__unused_webpack_module, exports) => {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PARAMS = void 0;\n// Params.\nexports.PARAMS = {\n VERBOSE: false,\n SHOW_ALERTS: false,\n SHOW_DIALOGS: false,\n SHOW_REC_DOT: false,\n};\n\n\n/***/ }),\n\n/***/ 886:\n/***/ ((module, exports, __webpack_require__) => {\n\n/* module decorator */ module = __webpack_require__.nmd(module);\nvar __WEBPACK_AMD_DEFINE_RESULT__;;(function() {\r\n\r\nif ( true && typeof module.exports !== 'undefined') {\r\n var Tar = __webpack_require__(846);\r\n var download = __webpack_require__(173);\r\n var GIF = __webpack_require__(769);\r\n var WebMWriter = __webpack_require__(166);\r\n}\r\n\r\n\"use strict\";\r\n\r\nvar objectTypes = {\r\n'function': true,\r\n'object': true\r\n};\r\n\r\nfunction checkGlobal(value) {\r\n return (value && value.Object === Object) ? value : null;\r\n }\r\n\r\n/** Built-in method references without a dependency on `root`. */\r\nvar freeParseFloat = parseFloat,\r\n freeParseInt = parseInt;\r\n\r\n/** Detect free variable `exports`. */\r\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\r\n? exports\r\n: undefined;\r\n\r\n/** Detect free variable `module`. */\r\nvar freeModule = (objectTypes[\"object\"] && module && !module.nodeType)\r\n? module\r\n: undefined;\r\n\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = (freeModule && freeModule.exports === freeExports)\r\n? freeExports\r\n: undefined;\r\n\r\n/** Detect free variable `global` from Node.js. */\r\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof __webpack_require__.g == 'object' && __webpack_require__.g);\r\n\r\n/** Detect free variable `self`. */\r\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\r\n\r\n/** Detect free variable `window`. */\r\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\r\n\r\n/** Detect `this` as the global object. */\r\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\r\n\r\n/**\r\n* Used as a reference to the global object.\r\n*\r\n* The `this` value is used if it's the global object to avoid Greasemonkey's\r\n* restricted `window` object, otherwise the `window` object is used.\r\n*/\r\nvar root = freeGlobal ||\r\n((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\r\n freeSelf || thisGlobal || Function('return this')();\r\n\r\nif( !('gc' in window ) ) {\r\n\twindow.gc = function(){}\r\n}\r\n\r\nif (!HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\r\n\t\tthis.count++;\r\n\t\tthis.step();\r\n\t}.bind( this );\r\n\tfileReader.readAsArrayBuffer(blob);\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.save = function( callback ) {\r\n\r\n\tcallback( this.tape.save() );\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.dispose = function() {\r\n\r\n\tthis.tape = new Tar();\r\n\tthis.count = 0;\r\n\r\n}\r\n\r\nfunction CCPNGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/png';\r\n\tthis.fileExtension = '.png';\r\n\r\n}\r\n\r\nCCPNGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCPNGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type )\r\n\r\n}\r\n\r\nfunction CCJPEGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/jpeg';\r\n\tthis.fileExtension = '.jpg';\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n}\r\n\r\nCCJPEGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCJPEGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type, this.quality )\r\n\r\n}\r\n\r\n/*\r\n\r\n\tWebM Encoder\r\n\r\n*/\r\n\r\nfunction CCWebMEncoder( settings ) {\r\n\r\n\tvar canvas = document.createElement( 'canvas' );\r\n\tif( canvas.toDataURL( 'image/webp' ).substr(5,10) !== 'image/webp' ){\r\n\t\tconsole.log( \"WebP not supported - try another export format\" )\r\n\t}\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.extension = '.webm'\r\n\tthis.mimeType = 'video/webm'\r\n\tthis.baseFilename = this.filename;\r\n\r\n\tthis.frames = [];\r\n\tthis.part = 1;\r\n\r\n this.videoWriter = new WebMWriter({\r\n quality: this.quality,\r\n fileWriter: null,\r\n fd: null,\r\n frameRate: settings.framerate\r\n});\r\n\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCWebMEncoder.prototype.start = function( canvas ) {\r\n\r\n\tthis.dispose();\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.add = function( canvas ) {\r\n\r\n this.videoWriter.addFrame(canvas);\r\n\r\n\t//this.frames.push( canvas.toDataURL('image/webp', this.quality) );\r\n\r\n\tif( this.settings.autoSaveTime > 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\t\tthis.save( function( blob ) {\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tdownload( blob, this.filename + this.extension, this.mimeType );\r\n\t\t\tthis.dispose();\r\n\t\t\tthis.part++;\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tthis.step();\r\n\t\t}.bind( this ) )\r\n\t} else {\r\n\t\tthis.step();\r\n\t}\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.save = function( callback ) {\r\n\r\n//\tif( !this.frames.length ) return;\r\n\r\n this.videoWriter.complete().then(callback);\r\n\r\n\t/*var webm = Whammy.fromImageArray( this.frames, this.settings.framerate )\r\n\tvar blob = new Blob( [ webm ], { type: \"octet/stream\" } );\r\n\tcallback( blob );*/\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.dispose = function( canvas ) {\r\n\r\n\tthis.frames = [];\r\n\r\n}\r\n\r\nfunction CCFFMpegServerEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.encoder = new FFMpegServer.Video( settings );\r\n this.encoder.on( 'process', function() {\r\n this.emit( 'process' )\r\n }.bind( this ) );\r\n this.encoder.on('finished', function( url, size ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( url, size );\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'error', function( data ) {\r\n alert(JSON.stringify(data, null, 2));\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCFFMpegServerEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start( this.settings );\r\n\r\n};\r\n\r\nCCFFMpegServerEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.encoder.add( canvas );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n this.encoder.end();\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.safeToProceed = function() {\r\n return this.encoder.safeToProceed();\r\n};\r\n\r\n/*\r\n\tHTMLCanvasElement.captureStream()\r\n*/\r\n\r\nfunction CCStreamEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.framerate = this.settings.framerate;\r\n\tthis.type = 'video/webm';\r\n\tthis.extension = '.webm';\r\n\tthis.stream = null;\r\n\tthis.mediaRecorder = null;\r\n\tthis.chunks = [];\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCStreamEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.stream ) {\r\n\t\tthis.stream = canvas.captureStream( this.framerate );\r\n\t\tthis.mediaRecorder = new MediaRecorder( this.stream );\r\n\t\tthis.mediaRecorder.start();\r\n\r\n\t\tthis.mediaRecorder.ondataavailable = function(e) {\r\n\t\t\tthis.chunks.push(e.data);\r\n\t\t}.bind( this );\r\n\r\n\t}\r\n\tthis.step();\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype.save = function( callback ) {\r\n\r\n\tthis.mediaRecorder.onstop = function( e ) {\r\n\t\tvar blob = new Blob( this.chunks, { 'type' : 'video/webm' });\r\n\t\tthis.chunks = [];\r\n\t\tcallback( blob );\r\n\r\n\t}.bind( this );\r\n\r\n\tthis.mediaRecorder.stop();\r\n\r\n}\r\n\r\n/*function CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this );\r\n\r\n\tsettings.quality = settings.quality || 6;\r\n\tthis.settings = settings;\r\n\r\n\tthis.encoder = new GIFEncoder();\r\n\tthis.encoder.setRepeat( 1 );\r\n \tthis.encoder.setDelay( settings.step );\r\n \tthis.encoder.setQuality( 6 );\r\n \tthis.encoder.setTransparent( null );\r\n \tthis.encoder.setSize( 150, 150 );\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder );\r\n\r\nCCGIFEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\tthis.encoder.addFrame( this.ctx );\r\n\r\n\tthis.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.stop = function() {\r\n\r\n\tthis.encoder.finish();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n\tvar binary_gif = this.encoder.stream().getData();\r\n\r\n\tvar data_url = 'data:image/gif;base64,'+encode64(binary_gif);\r\n\twindow.location = data_url;\r\n\treturn;\r\n\r\n\tvar blob = new Blob( [ binary_gif ], { type: \"octet/stream\" } );\r\n\tvar url = window.URL.createObjectURL( blob );\r\n\tcallback( url );\r\n\r\n}*/\r\n\r\nfunction CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = 31 - ( ( settings.quality * 30 / 100 ) || 10 );\r\n\tsettings.workers = settings.workers || 4;\r\n\r\n\tthis.extension = '.gif'\r\n\tthis.mimeType = 'image/gif'\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n \tthis.sizeSet = false;\r\n\r\n \tthis.encoder = new GIF({\r\n\t\tworkers: settings.workers,\r\n\t\tquality: settings.quality,\r\n\t\tworkerScript: settings.workersPath,\r\n\t} );\r\n\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n\r\n this.encoder.on('finished', function( blob ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( blob );\r\n }\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.sizeSet ) {\r\n\t\tthis.encoder.setOption( 'width',canvas.width );\r\n\t\tthis.encoder.setOption( 'height',canvas.height );\r\n\t\tthis.sizeSet = true;\r\n\t}\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\r\n\tthis.encoder.addFrame( this.ctx, { copy: true, delay: this.settings.step } );\r\n\tthis.step();\r\n\r\n\t/*this.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );*/\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n\r\n\tthis.encoder.render();\r\n\r\n}\r\n\r\nfunction CCapture( settings ) {\r\n\r\n\tvar _settings = settings || {},\r\n\t\t_date = new Date(),\r\n\t\t_verbose,\r\n\t\t_display,\r\n\t\t_time,\r\n\t\t_startTime,\r\n\t\t_performanceTime,\r\n\t\t_performanceStartTime,\r\n\t\t_step,\r\n _encoder,\r\n\t\t_timeouts = [],\r\n\t\t_intervals = [],\r\n\t\t_frameCount = 0,\r\n\t\t_intermediateFrameCount = 0,\r\n\t\t_lastFrame = null,\r\n\t\t_requestAnimationFrameCallbacks = [],\r\n\t\t_capturing = false,\r\n _handlers = {};\r\n\r\n\t_settings.framerate = _settings.framerate || 60;\r\n\t_settings.motionBlurFrames = 2 * ( _settings.motionBlurFrames || 1 );\r\n\t_verbose = _settings.verbose || false;\r\n\t_display = _settings.display || false;\r\n\t_settings.step = 1000.0 / _settings.framerate ;\r\n\t_settings.timeLimit = _settings.timeLimit || 0;\r\n\t_settings.frameLimit = _settings.frameLimit || 0;\r\n\t_settings.startTime = _settings.startTime || 0;\r\n\r\n\tvar _timeDisplay = document.createElement( 'div' );\r\n\t_timeDisplay.style.position = 'absolute';\r\n\t_timeDisplay.style.left = _timeDisplay.style.top = 0\r\n\t_timeDisplay.style.backgroundColor = 'black';\r\n\t_timeDisplay.style.fontFamily = 'monospace'\r\n\t_timeDisplay.style.fontSize = '11px'\r\n\t_timeDisplay.style.padding = '5px'\r\n\t_timeDisplay.style.color = 'red';\r\n\t_timeDisplay.style.zIndex = 100000\r\n\tif( _settings.display ) document.body.appendChild( _timeDisplay );\r\n\r\n\tvar canvasMotionBlur = document.createElement( 'canvas' );\r\n\tvar ctxMotionBlur = canvasMotionBlur.getContext( '2d' );\r\n\tvar bufferMotionBlur;\r\n\tvar imageData;\r\n\r\n\t_log( 'Step is set to ' + _settings.step + 'ms' );\r\n\r\n var _encoders = {\r\n\t\tgif: CCGIFEncoder,\r\n\t\twebm: CCWebMEncoder,\r\n\t\tffmpegserver: CCFFMpegServerEncoder,\r\n\t\tpng: CCPNGEncoder,\r\n\t\tjpg: CCJPEGEncoder,\r\n\t\t'webm-mediarecorder': CCStreamEncoder\r\n };\r\n\r\n var ctor = _encoders[ _settings.format ];\r\n if ( !ctor ) {\r\n\t\tthrow \"Error: Incorrect or missing format: Valid formats are \" + Object.keys(_encoders).join(\", \");\r\n }\r\n _encoder = new ctor( _settings );\r\n _encoder.step = _step\r\n\r\n\t_encoder.on('process', _process);\r\n _encoder.on('progress', _progress);\r\n\r\n if (\"performance\" in window == false) {\r\n \twindow.performance = {};\r\n }\r\n\r\n\tDate.now = (Date.now || function () { // thanks IE8\r\n\t\treturn new Date().getTime();\r\n\t});\r\n\r\n\tif (\"now\" in window.performance == false){\r\n\r\n\t\tvar nowOffset = Date.now();\r\n\r\n\t\tif (performance.timing && performance.timing.navigationStart){\r\n\t\t\tnowOffset = performance.timing.navigationStart\r\n\t\t}\r\n\r\n\t\twindow.performance.now = function now(){\r\n\t\t\treturn Date.now() - nowOffset;\r\n\t\t}\r\n\t}\r\n\r\n\tvar _oldSetTimeout = window.setTimeout,\r\n\t\t_oldSetInterval = window.setInterval,\r\n\t \t_oldClearInterval = window.clearInterval,\r\n\t\t_oldClearTimeout = window.clearTimeout,\r\n\t\t_oldRequestAnimationFrame = window.requestAnimationFrame,\r\n\t\t_oldNow = window.Date.now,\r\n\t\t_oldPerformanceNow = window.performance.now,\r\n\t\t_oldGetTime = window.Date.prototype.getTime;\r\n\t// Date.prototype._oldGetTime = Date.prototype.getTime;\r\n\r\n\tvar media = [];\r\n\r\n\tfunction _init() {\r\n\r\n\t\t_log( 'Capturer start' );\r\n\r\n\t\t_startTime = window.Date.now();\r\n\t\t_time = _startTime + _settings.startTime;\r\n\t\t_performanceStartTime = window.performance.now();\r\n\t\t_performanceTime = _performanceStartTime + _settings.startTime;\r\n\r\n\t\twindow.Date.prototype.getTime = function(){\r\n\t\t\treturn _time;\r\n\t\t};\r\n\t\twindow.Date.now = function() {\r\n\t\t\treturn _time;\r\n\t\t};\r\n\r\n\t\twindow.setTimeout = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_timeouts.push( t );\r\n\t\t\t_log( 'Timeout set to ' + t.time );\r\n return t;\r\n\t\t};\r\n\t\twindow.clearTimeout = function( id ) {\r\n\t\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\t\tif( _timeouts[ j ] == id ) {\r\n\t\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\t\t_log( 'Timeout cleared' );\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\twindow.setInterval = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_intervals.push( t );\r\n\t\t\t_log( 'Interval set to ' + t.time );\r\n\t\t\treturn t;\r\n\t\t};\r\n\t\twindow.clearInterval = function( id ) {\r\n\t\t\t_log( 'clear Interval' );\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\twindow.requestAnimationFrame = function( callback ) {\r\n\t\t\t_requestAnimationFrameCallbacks.push( callback );\r\n\t\t};\r\n\t\twindow.performance.now = function(){\r\n\t\t\treturn _performanceTime;\r\n\t\t};\r\n\r\n\t\tfunction hookCurrentTime() {\r\n\t\t\tif( !this._hooked ) {\r\n\t\t\t\tthis._hooked = true;\r\n\t\t\t\tthis._hookedTime = this.currentTime || 0;\r\n\t\t\t\tthis.pause();\r\n\t\t\t\tmedia.push( this );\r\n\t\t\t}\r\n\t\t\treturn this._hookedTime + _settings.startTime;\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tObject.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t\tObject.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t} catch (err) {\r\n\t\t\t_log(err);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _start() {\r\n\t\t_init();\r\n\t\t_encoder.start();\r\n\t\t_capturing = true;\r\n\t}\r\n\r\n\tfunction _stop() {\r\n\t\t_capturing = false;\r\n\t\t_encoder.stop();\r\n\t\t_destroy();\r\n\t}\r\n\r\n\tfunction _call( fn, p ) {\r\n\t\t_oldSetTimeout( fn, 0, p );\r\n\t}\r\n\r\n\tfunction _step() {\r\n\t\t//_oldRequestAnimationFrame( _process );\r\n\t\t_call( _process );\r\n\t}\r\n\r\n\tfunction _destroy() {\r\n\t\t_log( 'Capturer stop' );\r\n\t\twindow.setTimeout = _oldSetTimeout;\r\n\t\twindow.setInterval = _oldSetInterval;\r\n\t\twindow.clearInterval = _oldClearInterval;\r\n\t\twindow.clearTimeout = _oldClearTimeout;\r\n\t\twindow.requestAnimationFrame = _oldRequestAnimationFrame;\r\n\t\twindow.Date.prototype.getTime = _oldGetTime;\r\n\t\twindow.Date.now = _oldNow;\r\n\t\twindow.performance.now = _oldPerformanceNow;\r\n\t}\r\n\r\n\tfunction _updateTime() {\r\n\t\tvar seconds = _frameCount / _settings.framerate;\r\n\t\tif( ( _settings.frameLimit && _frameCount >= _settings.frameLimit ) || ( _settings.timeLimit && seconds >= _settings.timeLimit ) ) {\r\n\t\t\t_stop();\r\n\t\t\t_save();\r\n\t\t}\r\n\t\tvar d = new Date( null );\r\n\t\td.setSeconds( seconds );\r\n\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames (' + _intermediateFrameCount + ' inter) | ' + d.toISOString().substr( 11, 8 );\r\n\t\t} else {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames | ' + d.toISOString().substr( 11, 8 );\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _checkFrame( canvas ) {\r\n\r\n\t\tif( canvasMotionBlur.width !== canvas.width || canvasMotionBlur.height !== canvas.height ) {\r\n\t\t\tcanvasMotionBlur.width = canvas.width;\r\n\t\t\tcanvasMotionBlur.height = canvas.height;\r\n\t\t\tbufferMotionBlur = new Uint16Array( canvasMotionBlur.height * canvasMotionBlur.width * 4 );\r\n\t\t\tctxMotionBlur.fillStyle = '#0'\r\n\t\t\tctxMotionBlur.fillRect( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _blendFrame( canvas ) {\r\n\r\n\t\t//_log( 'Intermediate Frame: ' + _intermediateFrameCount );\r\n\r\n\t\tctxMotionBlur.drawImage( canvas, 0, 0 );\r\n\t\timageData = ctxMotionBlur.getImageData( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] += imageData.data[ j ];\r\n\t\t\tbufferMotionBlur[ j + 1 ] += imageData.data[ j + 1 ];\r\n\t\t\tbufferMotionBlur[ j + 2 ] += imageData.data[ j + 2 ];\r\n\t\t}\r\n\t\t_intermediateFrameCount++;\r\n\r\n\t}\r\n\r\n\tfunction _saveFrame(){\r\n\r\n\t\tvar data = imageData.data;\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tdata[ j ] = bufferMotionBlur[ j ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 1 ] = bufferMotionBlur[ j + 1 ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 2 ] = bufferMotionBlur[ j + 2 ] * 2 / _settings.motionBlurFrames;\r\n\t\t}\r\n\t\tctxMotionBlur.putImageData( imageData, 0, 0 );\r\n\t\t_encoder.add( canvasMotionBlur );\r\n\t\t_frameCount++;\r\n\t\t_intermediateFrameCount = 0;\r\n\t\t_log( 'Full MB Frame! ' + _frameCount + ' ' + _time );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 1 ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 2 ] = 0;\r\n\t\t}\r\n\t\tgc();\r\n\r\n\t}\r\n\r\n\tfunction _capture( canvas ) {\r\n\r\n\t\tif( _capturing ) {\r\n\r\n\t\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\r\n\t\t\t\t_checkFrame( canvas );\r\n\t\t\t\t_blendFrame( canvas );\r\n\r\n\t\t\t\tif( _intermediateFrameCount >= .5 * _settings.motionBlurFrames ) {\r\n\t\t\t\t\t_saveFrame();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_step();\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t_encoder.add( canvas );\r\n\t\t\t\t_frameCount++;\r\n\t\t\t\t_log( 'Full Frame! ' + _frameCount );\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _process() {\r\n\r\n\t\tvar step = 1000 / _settings.framerate;\r\n\t\tvar dt = ( _frameCount + _intermediateFrameCount / _settings.motionBlurFrames ) * step;\r\n\r\n\t\t_time = _startTime + dt;\r\n\t\t_performanceTime = _performanceStartTime + dt;\r\n\r\n\t\tmedia.forEach( function( v ) {\r\n\t\t\tv._hookedTime = dt / 1000;\r\n\t\t} );\r\n\r\n\t\t_updateTime();\r\n\t\t_log( 'Frame: ' + _frameCount + ' ' + _intermediateFrameCount );\r\n\r\n\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\tif( _time >= _timeouts[ j ].triggerTime ) {\r\n\t\t\t\t_call( _timeouts[ j ].callback )\r\n\t\t\t\t//console.log( 'timeout!' );\r\n\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor( var j = 0; j < _intervals.length; j++ ) {\r\n\t\t\tif( _time >= _intervals[ j ].triggerTime ) {\r\n\t\t\t\t_call( _intervals[ j ].callback );\r\n\t\t\t\t_intervals[ j ].triggerTime += _intervals[ j ].time;\r\n\t\t\t\t//console.log( 'interval!' );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_requestAnimationFrameCallbacks.forEach( function( cb ) {\r\n \t\t_call( cb, _time - g_startTime );\r\n } );\r\n _requestAnimationFrameCallbacks = [];\r\n\r\n\t}\r\n\r\n\tfunction _save( callback ) {\r\n\r\n\t\tif( !callback ) {\r\n\t\t\tcallback = function( blob ) {\r\n\t\t\t\tdownload( blob, _encoder.filename + _encoder.extension, _encoder.mimeType );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t_encoder.save( callback );\r\n\r\n\t}\r\n\r\n\tfunction _log( message ) {\r\n\t\tif( _verbose ) console.log( message );\r\n\t}\r\n\r\n function _on( event, handler ) {\r\n\r\n _handlers[event] = handler;\r\n\r\n }\r\n\r\n function _emit( event ) {\r\n\r\n var handler = _handlers[event];\r\n if ( handler ) {\r\n\r\n handler.apply( null, Array.prototype.slice.call( arguments, 1 ) );\r\n\r\n }\r\n\r\n }\r\n\r\n function _progress( progress ) {\r\n\r\n _emit( 'progress', progress );\r\n\r\n }\r\n\r\n\treturn {\r\n\t\tstart: _start,\r\n\t\tcapture: _capture,\r\n\t\tstop: _stop,\r\n\t\tsave: _save,\r\n on: _on\r\n\t}\r\n}\r\n\r\n(freeWindow || freeSelf || {}).CCapture = CCapture;\r\n\r\n // Some AMD build optimizers like r.js check for condition patterns like the following:\r\n if (true) {\r\n // Define as an anonymous module so, through path mapping, it can be\r\n // referenced as the \"underscore\" module.\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\r\n \treturn CCapture;\r\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n}\r\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\r\n else {}\r\n\r\n}());\r\n\n\n/***/ }),\n\n/***/ 173:\n/***/ ((module) => {\n\n//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime\n// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs\n// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support\n\n// data can be a string, Blob, File, or dataURL\n\n\n\n\nfunction download(data, strFileName, strMimeType) {\n\n\tvar self = window, // this script is only for browsers anyway...\n\t\tu = \"application/octet-stream\", // this default mime also triggers iframe downloads\n\t\tm = strMimeType || u,\n\t\tx = data,\n\t\tD = document,\n\t\ta = D.createElement(\"a\"),\n\t\tz = function(a){return String(a);},\n\n\n\t\tB = self.Blob || self.MozBlob || self.WebKitBlob || z,\n\t\tBB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,\n\t\tfn = strFileName || \"download\",\n\t\tblob,\n\t\tb,\n\t\tua,\n\t\tfr;\n\n\t//if(typeof B.bind === 'function' ){ B=B.bind(self); }\n\n\tif(String(this)===\"true\"){ //reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n\t\tx=[x, m];\n\t\tm=x[0];\n\t\tx=x[1];\n\t}\n\n\n\n\t//go ahead and download dataURLs right away\n\tif(String(x).match(/^data\\:[\\w+\\-]+\\/[\\w+\\-]+[,;]/)){\n\t\treturn navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:\n\t\t\tnavigator.msSaveBlob(d2b(x), fn) :\n\t\t\tsaver(x) ; // everyone else can save dataURLs un-processed\n\t}//end if dataURL passed?\n\n\ttry{\n\n\t\tblob = x instanceof B ?\n\t\t\tx :\n\t\t\tnew B([x], {type: m}) ;\n\t}catch(y){\n\t\tif(BB){\n\t\t\tb = new BB();\n\t\t\tb.append([x]);\n\t\t\tblob = b.getBlob(m); // the blob\n\t\t}\n\n\t}\n\n\n\n\tfunction d2b(u) {\n\t\tvar p= u.split(/[:;,]/),\n\t\tt= p[1],\n\t\tdec= p[2] == \"base64\" ? atob : decodeURIComponent,\n\t\tbin= dec(p.pop()),\n\t\tmx= bin.length,\n\t\ti= 0,\n\t\tuia= new Uint8Array(mx);\n\n\t\tfor(i;i {\n\n// gif.js 0.2.0 - https://github.com/jnordberg/gif.js\r\n(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o0&&this._events[type].length>m){this._events[type].warned=true;console.error(\"(node) warning: possible EventEmitter memory \"+\"leak detected. %d listeners added. \"+\"Use emitter.setMaxListeners() to increase limit.\",this._events[type].length);if(typeof console.trace===\"function\"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key===\"removeListener\")continue;this.removeAllListeners(key)}this.removeAllListeners(\"removeListener\");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg===\"function\"}function isNumber(arg){return typeof arg===\"number\"}function isObject(arg){return typeof arg===\"object\"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require(\"./TypedNeuQuant.js\");var LZWEncoder=require(\"./LZWEncoder.js\");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv=\"\";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither=\"FloydSteinberg\";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes(\"GIF89a\")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace(\"-serpentine\",\"\"),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes(\"NETSCAPE2.0\");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{\"./LZWEncoder.js\":3,\"./TypedNeuQuant.js\":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit(\"start\");return this.emit(\"progress\",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log(\"killing active worker\");worker.terminate()}this.running=false;return this.emit(\"abort\")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log(\"spawning worker \"+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log(\"frame \"+frame.index+\" finished - \"+this.activeWorkers.length+\" active\");this.finishedFrames++;this.emit(\"progress\",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log(\"global palette analyzed\");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log(\"starting frame \"+(task.index+1)+\" of \"+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement(\"canvas\");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext(\"2d\");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name===\"chrome\"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error(\"Invalid frame\")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{\"./GIFEncoder.js\":2,\"./browser.coffee\":5,\"./gif.worker.coffee\":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require(\"./GIFEncoder.js\");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i {\n\n(function () {\n\t\"use strict\";\n\n\tvar lookup = [\n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',\n\t\t\t'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n\t\t\t'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n\t\t\t'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',\n\t\t\t'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n\t\t\t'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n\t\t\t'w', 'x', 'y', 'z', '0', '1', '2', '3',\n\t\t\t'4', '5', '6', '7', '8', '9', '+', '/'\n\t\t];\n\tfunction clean(length) {\n\t\tvar i, buffer = new Uint8Array(length);\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tbuffer[i] = 0;\n\t\t}\n\t\treturn buffer;\n\t}\n\n\tfunction extend(orig, length, addLength, multipleOf) {\n\t\tvar newSize = length + addLength,\n\t\t\tbuffer = clean((parseInt(newSize / multipleOf) + 1) * multipleOf);\n\n\t\tbuffer.set(orig);\n\n\t\treturn buffer;\n\t}\n\n\tfunction pad(num, bytes, base) {\n\t\tnum = num.toString(base || 8);\n\t\treturn \"000000000000\".substr(num.length + 12 - bytes) + num;\n\t}\n\n\tfunction stringToUint8 (input, out, offset) {\n\t\tvar i, length;\n\n\t\tout = out || clean(input.length);\n\n\t\toffset = offset || 0;\n\t\tfor (i = 0, length = input.length; i < length; i += 1) {\n\t\t\tout[offset] = input.charCodeAt(i);\n\t\t\toffset += 1;\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tfunction uint8ToBase64(uint8) {\n\t\tvar i,\n\t\t\textraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes\n\t\t\toutput = \"\",\n\t\t\ttemp, length;\n\n\t\tfunction tripletToBase64 (num) {\n\t\t\treturn lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n\t\t};\n\n\t\t// go through the array every three bytes, we'll deal with trailing stuff later\n\t\tfor (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n\t\t\ttemp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);\n\t\t\toutput += tripletToBase64(temp);\n\t\t}\n\n\t\t// this prevents an ERR_INVALID_URL in Chrome (Firefox okay)\n\t\tswitch (output.length % 4) {\n\t\t\tcase 1:\n\t\t\t\toutput += '=';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\toutput += '==';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\twindow.utils = {}\n\twindow.utils.clean = clean;\n\twindow.utils.pad = pad;\n\twindow.utils.extend = extend;\n\twindow.utils.stringToUint8 = stringToUint8;\n\twindow.utils.uint8ToBase64 = uint8ToBase64;\n}());\n\n(function () {\n\t\"use strict\";\n\n/*\nstruct posix_header { // byte offset\n\tchar name[100]; // 0\n\tchar mode[8]; // 100\n\tchar uid[8]; // 108\n\tchar gid[8]; // 116\n\tchar size[12]; // 124\n\tchar mtime[12]; // 136\n\tchar chksum[8]; // 148\n\tchar typeflag; // 156\n\tchar linkname[100]; // 157\n\tchar magic[6]; // 257\n\tchar version[2]; // 263\n\tchar uname[32]; // 265\n\tchar gname[32]; // 297\n\tchar devmajor[8]; // 329\n\tchar devminor[8]; // 337\n\tchar prefix[155]; // 345\n // 500\n};\n*/\n\n\tvar utils = window.utils,\n\t\theaderFormat;\n\n\theaderFormat = [\n\t\t{\n\t\t\t'field': 'fileName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'fileMode',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'uid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'gid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'fileSize',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'mtime',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'checksum',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'type',\n\t\t\t'length': 1\n\t\t},\n\t\t{\n\t\t\t'field': 'linkName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'ustar',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'owner',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'group',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'majorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'minorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'filenamePrefix',\n\t\t\t'length': 155\n\t\t},\n\t\t{\n\t\t\t'field': 'padding',\n\t\t\t'length': 12\n\t\t}\n\t];\n\n\tfunction formatHeader(data, cb) {\n\t\tvar buffer = utils.clean(512),\n\t\t\toffset = 0;\n\n\t\theaderFormat.forEach(function (value) {\n\t\t\tvar str = data[value.field] || \"\",\n\t\t\t\ti, length;\n\n\t\t\tfor (i = 0, length = str.length; i < length; i += 1) {\n\t\t\t\tbuffer[offset] = str.charCodeAt(i);\n\t\t\t\toffset += 1;\n\t\t\t}\n\n\t\t\toffset += value.length - i; // space it out with nulls\n\t\t});\n\n\t\tif (typeof cb === 'function') {\n\t\t\treturn cb(buffer, offset);\n\t\t}\n\t\treturn buffer;\n\t}\n\n\twindow.header = {}\n\twindow.header.structure = headerFormat;\n\twindow.header.format = formatHeader;\n}());\n\n(function () {\n\t\"use strict\";\n\n\tvar header = window.header,\n\t\tutils = window.utils,\n\t\trecordSize = 512,\n\t\tblockSize;\n\n\tfunction Tar(recordsPerBlock) {\n\t\tthis.written = 0;\n\t\tblockSize = (recordsPerBlock || 20) * recordSize;\n\t\tthis.out = utils.clean(blockSize);\n\t\tthis.blocks = [];\n\t\tthis.length = 0;\n\t}\n\n\tTar.prototype.append = function (filepath, input, opts, callback) {\n\t\tvar data,\n\t\t\tchecksum,\n\t\t\tmode,\n\t\t\tmtime,\n\t\t\tuid,\n\t\t\tgid,\n\t\t\theaderArr;\n\n\t\tif (typeof input === 'string') {\n\t\t\tinput = utils.stringToUint8(input);\n\t\t} else if (input.constructor !== Uint8Array.prototype.constructor) {\n\t\t\tthrow 'Invalid input type. You gave me: ' + input.constructor.toString().match(/function\\s*([$A-Za-z_][0-9A-Za-z_]*)\\s*\\(/)[1];\n\t\t}\n\n\t\tif (typeof opts === 'function') {\n\t\t\tcallback = opts;\n\t\t\topts = {};\n\t\t}\n\n\t\topts = opts || {};\n\n\t\tmode = opts.mode || parseInt('777', 8) & 0xfff;\n\t\tmtime = opts.mtime || Math.floor(+new Date() / 1000);\n\t\tuid = opts.uid || 0;\n\t\tgid = opts.gid || 0;\n\n\t\tdata = {\n\t\t\tfileName: filepath,\n\t\t\tfileMode: utils.pad(mode, 7),\n\t\t\tuid: utils.pad(uid, 7),\n\t\t\tgid: utils.pad(gid, 7),\n\t\t\tfileSize: utils.pad(input.length, 11),\n\t\t\tmtime: utils.pad(mtime, 11),\n\t\t\tchecksum: ' ',\n\t\t\ttype: '0', // just a file\n\t\t\tustar: 'ustar ',\n\t\t\towner: opts.owner || '',\n\t\t\tgroup: opts.group || ''\n\t\t};\n\n\t\t// calculate the checksum\n\t\tchecksum = 0;\n\t\tObject.keys(data).forEach(function (key) {\n\t\t\tvar i, value = data[key], length;\n\n\t\t\tfor (i = 0, length = value.length; i < length; i += 1) {\n\t\t\t\tchecksum += value.charCodeAt(i);\n\t\t\t}\n\t\t});\n\n\t\tdata.checksum = utils.pad(checksum, 6) + \"\\u0000 \";\n\n\t\theaderArr = header.format(data);\n\n\t\tvar headerLength = Math.ceil( headerArr.length / recordSize ) * recordSize;\n\t\tvar inputLength = Math.ceil( input.length / recordSize ) * recordSize;\n\n\t\tthis.blocks.push( { header: headerArr, input: input, headerLength: headerLength, inputLength: inputLength } );\n\n\t};\n\n\tTar.prototype.save = function() {\n\n\t\tvar buffers = [];\n\t\tvar chunks = [];\n\t\tvar length = 0;\n\t\tvar max = Math.pow( 2, 20 );\n\n\t\tvar chunk = [];\n\t\tthis.blocks.forEach( function( b ) {\n\t\t\tif( length + b.headerLength + b.inputLength > max ) {\n\t\t\t\tchunks.push( { blocks: chunk, length: length } );\n\t\t\t\tchunk = [];\n\t\t\t\tlength = 0;\n\t\t\t}\n\t\t\tchunk.push( b );\n\t\t\tlength += b.headerLength + b.inputLength;\n\t\t} );\n\t\tchunks.push( { blocks: chunk, length: length } );\n\n\t\tchunks.forEach( function( c ) {\n\n\t\t\tvar buffer = new Uint8Array( c.length );\n\t\t\tvar written = 0;\n\t\t\tc.blocks.forEach( function( b ) {\n\t\t\t\tbuffer.set( b.header, written );\n\t\t\t\twritten += b.headerLength;\n\t\t\t\tbuffer.set( b.input, written );\n\t\t\t\twritten += b.inputLength;\n\t\t\t} );\n\t\t\tbuffers.push( buffer );\n\n\t\t} );\n\n\t\tbuffers.push( new Uint8Array( 2 * recordSize ) );\n\n\t\treturn new Blob( buffers, { type: 'octet/stream' } );\n\n\t};\n\n\tTar.prototype.clear = function () {\n\t\tthis.written = 0;\n\t\tthis.out = utils.clean(blockSize);\n\t};\n\n if ( true && typeof module.exports !== 'undefined') {\n module.exports = Tar;\n } else {\n window.Tar = Tar;\n }\n}());\n\n\n/***/ }),\n\n/***/ 166:\n/***/ ((module) => {\n\n\"use strict\";\n/**\n * A tool for presenting an ArrayBuffer as a stream for writing some simple data types.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\n\n// (function(){\n /*\n * Create an ArrayBuffer of the given length and present it as a writable stream with methods\n * for writing data in different formats.\n */\n var ArrayBufferDataStream = function(length) {\n this.data = new Uint8Array(length);\n this.pos = 0;\n };\n\n ArrayBufferDataStream.prototype.seek = function(offset) {\n this.pos = offset;\n };\n\n ArrayBufferDataStream.prototype.writeBytes = function(arr) {\n for (var i = 0; i < arr.length; i++) {\n this.data[this.pos++] = arr[i];\n }\n };\n\n ArrayBufferDataStream.prototype.writeByte = function(b) {\n this.data[this.pos++] = b;\n };\n\n //Synonym:\n ArrayBufferDataStream.prototype.writeU8 = ArrayBufferDataStream.prototype.writeByte;\n\n ArrayBufferDataStream.prototype.writeU16BE = function(u) {\n this.data[this.pos++] = u >> 8;\n this.data[this.pos++] = u;\n };\n\n ArrayBufferDataStream.prototype.writeDoubleBE = function(d) {\n var\n bytes = new Uint8Array(new Float64Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n ArrayBufferDataStream.prototype.writeFloatBE = function(d) {\n var\n bytes = new Uint8Array(new Float32Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n /**\n * Write an ASCII string to the stream\n */\n ArrayBufferDataStream.prototype.writeString = function(s) {\n for (var i = 0; i < s.length; i++) {\n this.data[this.pos++] = s.charCodeAt(i);\n }\n };\n\n /**\n * Write the given 32-bit integer to the stream as an EBML variable-length integer using the given byte width\n * (use measureEBMLVarInt).\n *\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * @param i Integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeEBMLVarIntWidth = function(i, width) {\n switch (width) {\n case 1:\n this.writeU8((1 << 7) | i);\n break;\n case 2:\n this.writeU8((1 << 6) | (i >> 8));\n this.writeU8(i);\n break;\n case 3:\n this.writeU8((1 << 5) | (i >> 16));\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 4:\n this.writeU8((1 << 4) | (i >> 24));\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 5:\n /*\n * JavaScript converts its doubles to 32-bit integers for bitwise operations, so we need to do a\n * division by 2^32 instead of a right-shift of 32 to retain those top 3 bits\n */\n this.writeU8((1 << 3) | ((i / 4294967296) & 0x7));\n this.writeU8(i >> 24);\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n default:\n throw new RuntimeException(\"Bad EBML VINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to encode the given integer as an EBML VINT.\n */\n ArrayBufferDataStream.prototype.measureEBMLVarInt = function(val) {\n if (val < (1 << 7) - 1) {\n /* Top bit is set, leaving 7 bits to hold the integer, but we can't store 127 because\n * \"all bits set to one\" is a reserved value. Same thing for the other cases below:\n */\n return 1;\n } else if (val < (1 << 14) - 1) {\n return 2;\n } else if (val < (1 << 21) - 1) {\n return 3;\n } else if (val < (1 << 28) - 1) {\n return 4;\n } else if (val < 34359738367) { // 2 ^ 35 - 1 (can address 32GB)\n return 5;\n } else {\n throw new RuntimeException(\"EBML VINT size not supported \" + val);\n }\n };\n\n ArrayBufferDataStream.prototype.writeEBMLVarInt = function(i) {\n this.writeEBMLVarIntWidth(i, this.measureEBMLVarInt(i));\n };\n\n /**\n * Write the given unsigned 32-bit integer to the stream in big-endian order using the given byte width.\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * Omit the width parameter to have it determined automatically for you.\n *\n * @param u Unsigned integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeUnsignedIntBE = function(u, width) {\n if (width === undefined) {\n width = this.measureUnsignedInt(u);\n }\n\n // Each case falls through:\n switch (width) {\n case 5:\n this.writeU8(Math.floor(u / 4294967296)); // Need to use division to access >32 bits of floating point var\n case 4:\n this.writeU8(u >> 24);\n case 3:\n this.writeU8(u >> 16);\n case 2:\n this.writeU8(u >> 8);\n case 1:\n this.writeU8(u);\n break;\n default:\n throw new RuntimeException(\"Bad UINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to hold the non-zero bits of the given unsigned integer.\n */\n ArrayBufferDataStream.prototype.measureUnsignedInt = function(val) {\n // Force to 32-bit unsigned integer\n if (val < (1 << 8)) {\n return 1;\n } else if (val < (1 << 16)) {\n return 2;\n } else if (val < (1 << 24)) {\n return 3;\n } else if (val < 4294967296) {\n return 4;\n } else {\n return 5;\n }\n };\n\n /**\n * Return a view on the portion of the buffer from the beginning to the current seek position as a Uint8Array.\n */\n ArrayBufferDataStream.prototype.getAsDataArray = function() {\n if (this.pos < this.data.byteLength) {\n return this.data.subarray(0, this.pos);\n } else if (this.pos == this.data.byteLength) {\n return this.data;\n } else {\n throw \"ArrayBufferDataStream's pos lies beyond end of buffer\";\n }\n };\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = ArrayBufferDataStream;\n// \t} else {\n// \t\twindow.ArrayBufferDataStream = ArrayBufferDataStream;\n// \t}\n// }());\"use strict\";\n\n/**\n * Allows a series of Blob-convertible objects (ArrayBuffer, Blob, String, etc) to be added to a buffer. Seeking and\n * overwriting of blobs is allowed.\n *\n * You can supply a FileWriter, in which case the BlobBuffer is just used as temporary storage before it writes it\n * through to the disk.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n// (function() {\n\tvar BlobBuffer = function(fs) {\n\t\treturn function(destination) {\n\t\t\tvar\n\t\t\t\tbuffer = [],\n\t\t\t\twritePromise = Promise.resolve(),\n\t\t\t\tfileWriter = null,\n\t\t\t\tfd = null;\n\n\t\t\tif (typeof FileWriter !== \"undefined\" && destination instanceof FileWriter) {\n\t\t\t\tfileWriter = destination;\n\t\t\t} else if (fs && destination) {\n\t\t\t\tfd = destination;\n\t\t\t}\n\n\t\t\t// Current seek offset\n\t\t\tthis.pos = 0;\n\n\t\t\t// One more than the index of the highest byte ever written\n\t\t\tthis.length = 0;\n\n\t\t\t// Returns a promise that converts the blob to an ArrayBuffer\n\t\t\tfunction readBlobAsBuffer(blob) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tvar\n\t\t\t\t\t\treader = new FileReader();\n\n\t\t\t\t\treader.addEventListener(\"loadend\", function () {\n\t\t\t\t\t\tresolve(reader.result);\n\t\t\t\t\t});\n\n\t\t\t\t\treader.readAsArrayBuffer(blob);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction convertToUint8Array(thing) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tif (thing instanceof Uint8Array) {\n\t\t\t\t\t\tresolve(thing);\n\t\t\t\t\t} else if (thing instanceof ArrayBuffer || ArrayBuffer.isView(thing)) {\n\t\t\t\t\t\tresolve(new Uint8Array(thing));\n\t\t\t\t\t} else if (thing instanceof Blob) {\n\t\t\t\t\t\tresolve(readBlobAsBuffer(thing).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Assume that Blob will know how to read this thing\n\t\t\t\t\t\tresolve(readBlobAsBuffer(new Blob([thing])).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction measureData(data) {\n\t\t\t\tvar\n\t\t\t\t\tresult = data.byteLength || data.length || data.size;\n\n\t\t\t\tif (!Number.isInteger(result)) {\n\t\t\t\t\tthrow \"Failed to determine size of element\";\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Seek to the given absolute offset.\n\t\t\t *\n\t\t\t * You may not seek beyond the end of the file (this would create a hole and/or allow blocks to be written in non-\n\t\t\t * sequential order, which isn't currently supported by the memory buffer backend).\n\t\t\t */\n\t\t\tthis.seek = function (offset) {\n\t\t\t\tif (offset < 0) {\n\t\t\t\t\tthrow \"Offset may not be negative\";\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(offset)) {\n\t\t\t\t\tthrow \"Offset may not be NaN\";\n\t\t\t\t}\n\n\t\t\t\tif (offset > this.length) {\n\t\t\t\t\tthrow \"Seeking beyond the end of file is not allowed\";\n\t\t\t\t}\n\n\t\t\t\tthis.pos = offset;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Write the Blob-convertible data to the buffer at the current seek position.\n\t\t\t *\n\t\t\t * Note: If overwriting existing data, the write must not cross preexisting block boundaries (written data must\n\t\t\t * be fully contained by the extent of a previous write).\n\t\t\t */\n\t\t\tthis.write = function (data) {\n\t\t\t\tvar\n\t\t\t\t\tnewEntry = {\n\t\t\t\t\t\toffset: this.pos,\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tlength: measureData(data)\n\t\t\t\t\t},\n\t\t\t\t\tisAppend = newEntry.offset >= this.length;\n\n\t\t\t\tthis.pos += newEntry.length;\n\t\t\t\tthis.length = Math.max(this.length, this.pos);\n\n\t\t\t\t// After previous writes complete, perform our write\n\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\tif (fd) {\n\t\t\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\t\t\tconvertToUint8Array(newEntry.data).then(function(dataArray) {\n\t\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\t\ttotalWritten = 0,\n\t\t\t\t\t\t\t\t\tbuffer = Buffer.from(dataArray.buffer),\n\n\t\t\t\t\t\t\t\t\thandleWriteComplete = function(err, written, buffer) {\n\t\t\t\t\t\t\t\t\t\ttotalWritten += written;\n\n\t\t\t\t\t\t\t\t\t\tif (totalWritten >= buffer.length) {\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// We still have more to write...\n\t\t\t\t\t\t\t\t\t\t\tfs.write(fd, buffer, totalWritten, buffer.length - totalWritten, newEntry.offset + totalWritten, handleWriteComplete);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tfs.write(fd, buffer, 0, buffer.length, newEntry.offset, handleWriteComplete);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (fileWriter) {\n\t\t\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\t\tfileWriter.onwriteend = resolve;\n\n\t\t\t\t\t\t\tfileWriter.seek(newEntry.offset);\n\t\t\t\t\t\t\tfileWriter.write(new Blob([newEntry.data]));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!isAppend) {\n\t\t\t\t\t\t// We might be modifying a write that was already buffered in memory.\n\n\t\t\t\t\t\t// Slow linear search to find a block we might be overwriting\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\tentry = buffer[i];\n\n\t\t\t\t\t\t\t// If our new entry overlaps the old one in any way...\n\t\t\t\t\t\t\tif (!(newEntry.offset + newEntry.length <= entry.offset || newEntry.offset >= entry.offset + entry.length)) {\n\t\t\t\t\t\t\t\tif (newEntry.offset < entry.offset || newEntry.offset + newEntry.length > entry.offset + entry.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Overwrite crosses blob boundaries\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (newEntry.offset == entry.offset && newEntry.length == entry.length) {\n\t\t\t\t\t\t\t\t\t// We overwrote the entire block\n\t\t\t\t\t\t\t\t\tentry.data = newEntry.data;\n\n\t\t\t\t\t\t\t\t\t// We're done\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn convertToUint8Array(entry.data)\n\t\t\t\t\t\t\t\t\t\t.then(function (entryArray) {\n\t\t\t\t\t\t\t\t\t\t\tentry.data = entryArray;\n\n\t\t\t\t\t\t\t\t\t\t\treturn convertToUint8Array(newEntry.data);\n\t\t\t\t\t\t\t\t\t\t}).then(function (newEntryArray) {\n\t\t\t\t\t\t\t\t\t\t\tnewEntry.data = newEntryArray;\n\n\t\t\t\t\t\t\t\t\t\t\tentry.data.set(newEntry.data, newEntry.offset - entry.offset);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Else fall through to do a simple append, as we didn't overwrite any pre-existing blocks\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.push(newEntry);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Finish all writes to the buffer, returning a promise that signals when that is complete.\n\t\t\t *\n\t\t\t * If a FileWriter was not provided, the promise is resolved with a Blob that represents the completed BlobBuffer\n\t\t\t * contents. You can optionally pass in a mimeType to be used for this blob.\n\t\t\t *\n\t\t\t * If a FileWriter was provided, the promise is resolved with null as the first argument.\n\t\t\t */\n\t\t\tthis.complete = function (mimeType) {\n\t\t\t\tif (fd || fileWriter) {\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// After writes complete we need to merge the buffer to give to the caller\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\tvar\n\t\t\t\t\t\t\tresult = [];\n\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tresult.push(buffer[i].data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Blob(result, {mimeType: mimeType});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn writePromise;\n\t\t\t};\n\t\t};\n\t}(null);\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = BlobBuffer(require('fs'));\n// \t} else {\n// \t\twindow.BlobBuffer = BlobBuffer(null);\n// \t}\n// })();\n/**\n * WebM video encoder for Google Chrome. This implementation is suitable for creating very large video files, because\n * it can stream Blobs directly to a FileWriter without buffering the entire video in memory.\n *\n * When FileWriter is not available or not desired, it can buffer the video in memory as a series of Blobs which are\n * eventually returned as one composite Blob.\n *\n * By Nicholas Sherlock.\n *\n * Based on the ideas from Whammy: https://github.com/antimatter15/whammy\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n(function() {\n var WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {\n function extend(base, top) {\n var\n target = {};\n\n [base, top].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n });\n\n return target;\n }\n\n /**\n * Decode a Base64 data URL into a binary string.\n *\n * Returns the binary string, or false if the URL could not be decoded.\n */\n function decodeBase64WebPDataURL(url) {\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n\n return window.atob(url.substring(\"data:image\\/webp;base64,\".length));\n }\n\n /**\n * Convert a raw binary string (one character = one output byte) to an ArrayBuffer\n */\n function stringToArrayBuffer(string) {\n var\n buffer = new ArrayBuffer(string.length),\n int8Array = new Uint8Array(buffer);\n\n for (var i = 0; i < string.length; i++) {\n int8Array[i] = string.charCodeAt(i);\n }\n\n return buffer;\n }\n\n /**\n * Convert the given canvas to a WebP encoded image and return the image data as a string.\n */\n function renderAsWebP(canvas, quality) {\n var\n frame = canvas.toDataURL('image/webp', {quality: quality});\n\n return decodeBase64WebPDataURL(frame);\n }\n\n function extractKeyframeFromWebP(webP) {\n // Assume that Chrome will generate a Simple Lossy WebP which has this header:\n var\n keyframeStartIndex = webP.indexOf('VP8 ');\n\n if (keyframeStartIndex == -1) {\n throw \"Failed to identify beginning of keyframe in WebP image\";\n }\n\n // Skip the header and the 4 bytes that encode the length of the VP8 chunk\n keyframeStartIndex += 'VP8 '.length + 4;\n\n return webP.substring(keyframeStartIndex);\n }\n\n // Just a little utility so we can tag values as floats for the EBML encoder's benefit\n function EBMLFloat32(value) {\n this.value = value;\n }\n\n function EBMLFloat64(value) {\n this.value = value;\n }\n\n /**\n * Write the given EBML object to the provided ArrayBufferStream.\n *\n * The buffer's first byte is at bufferFileOffset inside the video file. This is used to complete offset and\n * dataOffset fields in each EBML structure, indicating the file offset of the first byte of the EBML element and\n * its data payload.\n */\n function writeEBML(buffer, bufferFileOffset, ebml) {\n // Is the ebml an array of sibling elements?\n if (Array.isArray(ebml)) {\n for (var i = 0; i < ebml.length; i++) {\n writeEBML(buffer, bufferFileOffset, ebml[i]);\n }\n // Is this some sort of raw data that we want to write directly?\n } else if (typeof ebml === \"string\") {\n buffer.writeString(ebml);\n } else if (ebml instanceof Uint8Array) {\n buffer.writeBytes(ebml);\n } else if (ebml.id){\n // We're writing an EBML element\n ebml.offset = buffer.pos + bufferFileOffset;\n\n buffer.writeUnsignedIntBE(ebml.id); // ID field\n\n // Now we need to write the size field, so we must know the payload size:\n\n if (Array.isArray(ebml.data)) {\n // Writing an array of child elements. We won't try to measure the size of the children up-front\n\n var\n sizePos, dataBegin, dataEnd;\n\n if (ebml.size === -1) {\n // Write the reserved all-one-bits marker to note that the size of this element is unknown/unbounded\n buffer.writeByte(0xFF);\n } else {\n sizePos = buffer.pos;\n\n /* Write a dummy size field to overwrite later. 4 bytes allows an element maximum size of 256MB,\n * which should be plenty (we don't want to have to buffer that much data in memory at one time\n * anyway!)\n */\n buffer.writeBytes([0, 0, 0, 0]);\n }\n\n dataBegin = buffer.pos;\n\n ebml.dataOffset = dataBegin + bufferFileOffset;\n writeEBML(buffer, bufferFileOffset, ebml.data);\n\n if (ebml.size !== -1) {\n dataEnd = buffer.pos;\n\n ebml.size = dataEnd - dataBegin;\n\n buffer.seek(sizePos);\n buffer.writeEBMLVarIntWidth(ebml.size, 4); // Size field\n\n buffer.seek(dataEnd);\n }\n } else if (typeof ebml.data === \"string\") {\n buffer.writeEBMLVarInt(ebml.data.length); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeString(ebml.data);\n } else if (typeof ebml.data === \"number\") {\n // Allow the caller to explicitly choose the size if they wish by supplying a size field\n if (!ebml.size) {\n ebml.size = buffer.measureUnsignedInt(ebml.data);\n }\n\n buffer.writeEBMLVarInt(ebml.size); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeUnsignedIntBE(ebml.data, ebml.size);\n } else if (ebml.data instanceof EBMLFloat64) {\n buffer.writeEBMLVarInt(8); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeDoubleBE(ebml.data.value);\n } else if (ebml.data instanceof EBMLFloat32) {\n buffer.writeEBMLVarInt(4); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeFloatBE(ebml.data.value);\n } else if (ebml.data instanceof Uint8Array) {\n buffer.writeEBMLVarInt(ebml.data.byteLength); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeBytes(ebml.data);\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n }\n\n return function(options) {\n var\n MAX_CLUSTER_DURATION_MSEC = 5000,\n DEFAULT_TRACK_NUMBER = 1,\n\n writtenHeader = false,\n videoWidth, videoHeight,\n\n clusterFrameBuffer = [],\n clusterStartTime = 0,\n clusterDuration = 0,\n\n optionDefaults = {\n quality: 0.95, // WebM image quality from 0.0 (worst) to 1.0 (best)\n fileWriter: null, // Chrome FileWriter in order to stream to a file instead of buffering to memory (optional)\n fd: null, // Node.JS file descriptor to write to instead of buffering (optional)\n\n // You must supply one of:\n frameDuration: null, // Duration of frames in milliseconds\n frameRate: null, // Number of frames per second\n },\n\n seekPoints = {\n Cues: {id: new Uint8Array([0x1C, 0x53, 0xBB, 0x6B]), positionEBML: null},\n SegmentInfo: {id: new Uint8Array([0x15, 0x49, 0xA9, 0x66]), positionEBML: null},\n Tracks: {id: new Uint8Array([0x16, 0x54, 0xAE, 0x6B]), positionEBML: null},\n },\n\n ebmlSegment,\n segmentDuration = {\n \"id\": 0x4489, // Duration\n \"data\": new EBMLFloat64(0)\n },\n\n seekHead,\n\n cues = [],\n\n blobBuffer = new BlobBuffer(options.fileWriter || options.fd);\n\n function fileOffsetToSegmentRelative(fileOffset) {\n return fileOffset - ebmlSegment.dataOffset;\n }\n\n /**\n * Create a SeekHead element with descriptors for the points in the global seekPoints array.\n *\n * 5 bytes of position values are reserved for each node, which lie at the offset point.positionEBML.dataOffset,\n * to be overwritten later.\n */\n function createSeekHead() {\n var\n seekPositionEBMLTemplate = {\n \"id\": 0x53AC, // SeekPosition\n \"size\": 5, // Allows for 32GB video files\n \"data\": 0 // We'll overwrite this when the file is complete\n },\n\n result = {\n \"id\": 0x114D9B74, // SeekHead\n \"data\": []\n };\n\n for (var name in seekPoints) {\n var\n seekPoint = seekPoints[name];\n\n seekPoint.positionEBML = Object.create(seekPositionEBMLTemplate);\n\n result.data.push({\n \"id\": 0x4DBB, // Seek\n \"data\": [\n {\n \"id\": 0x53AB, // SeekID\n \"data\": seekPoint.id\n },\n seekPoint.positionEBML\n ]\n });\n }\n\n return result;\n }\n\n /**\n * Write the WebM file header to the stream.\n */\n function writeHeader() {\n seekHead = createSeekHead();\n\n var\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n\n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ]\n }\n ]\n }\n ]\n };\n\n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n\n var\n bufferStream = new ArrayBufferDataStream(256);\n\n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n\n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n };\n\n /**\n * Create a SimpleBlock keyframe header using these fields:\n * timecode - Time of this keyframe\n * trackNumber - Track number from 1 to 126 (inclusive)\n * frame - Raw frame data payload string\n *\n * Returns an EBML element.\n */\n function createKeyframeBlock(keyframe) {\n var\n bufferStream = new ArrayBufferDataStream(1 + 2 + 1);\n\n if (!(keyframe.trackNumber > 0 && keyframe.trackNumber < 127)) {\n throw \"TrackNumber must be > 0 and < 127\";\n }\n\n bufferStream.writeEBMLVarInt(keyframe.trackNumber); // Always 1 byte since we limit the range of trackNumber\n bufferStream.writeU16BE(keyframe.timecode);\n\n // Flags byte\n bufferStream.writeByte(\n 1 << 7 // Keyframe\n );\n\n return {\n \"id\": 0xA3, // SimpleBlock\n \"data\": [\n bufferStream.getAsDataArray(),\n keyframe.frame\n ]\n };\n }\n\n /**\n * Create a Cluster node using these fields:\n *\n * timecode - Start time for the cluster\n *\n * Returns an EBML element.\n */\n function createCluster(cluster) {\n return {\n \"id\": 0x1f43b675,\n \"data\": [\n {\n \"id\": 0xe7, // Timecode\n \"data\": Math.round(cluster.timecode)\n }\n ]\n };\n }\n\n function addCuePoint(trackIndex, clusterTime, clusterFileOffset) {\n cues.push({\n \"id\": 0xBB, // Cue\n \"data\": [\n {\n \"id\": 0xB3, // CueTime\n \"data\": clusterTime\n },\n {\n \"id\": 0xB7, // CueTrackPositions\n \"data\": [\n {\n \"id\": 0xF7, // CueTrack\n \"data\": trackIndex\n },\n {\n \"id\": 0xF1, // CueClusterPosition\n \"data\": fileOffsetToSegmentRelative(clusterFileOffset)\n }\n ]\n }\n ]\n });\n }\n\n /**\n * Write a Cues element to the blobStream using the global `cues` array of CuePoints (use addCuePoint()).\n * The seek entry for the Cues in the SeekHead is updated.\n */\n function writeCues() {\n var\n ebml = {\n \"id\": 0x1C53BB6B,\n \"data\": cues\n },\n\n cuesBuffer = new ArrayBufferDataStream(16 + cues.length * 32); // Pretty crude estimate of the buffer size we'll need\n\n writeEBML(cuesBuffer, blobBuffer.pos, ebml);\n blobBuffer.write(cuesBuffer.getAsDataArray());\n\n // Now we know where the Cues element has ended up, we can update the SeekHead\n seekPoints.Cues.positionEBML.data = fileOffsetToSegmentRelative(ebml.offset);\n }\n\n /**\n * Flush the frames in the current clusterFrameBuffer out to the stream as a Cluster.\n */\n function flushClusterFrameBuffer() {\n if (clusterFrameBuffer.length == 0) {\n return;\n }\n\n // First work out how large of a buffer we need to hold the cluster data\n var\n rawImageSize = 0;\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n rawImageSize += clusterFrameBuffer[i].frame.length;\n }\n\n var\n buffer = new ArrayBufferDataStream(rawImageSize + clusterFrameBuffer.length * 32), // Estimate 32 bytes per SimpleBlock header\n\n cluster = createCluster({\n timecode: Math.round(clusterStartTime),\n });\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n cluster.data.push(createKeyframeBlock(clusterFrameBuffer[i]));\n }\n\n writeEBML(buffer, blobBuffer.pos, cluster);\n blobBuffer.write(buffer.getAsDataArray());\n\n addCuePoint(DEFAULT_TRACK_NUMBER, Math.round(clusterStartTime), cluster.offset);\n\n clusterFrameBuffer = [];\n clusterStartTime += clusterDuration;\n clusterDuration = 0;\n }\n\n function validateOptions() {\n // Derive frameDuration setting if not already supplied\n if (!options.frameDuration) {\n if (options.frameRate) {\n options.frameDuration = 1000 / options.frameRate;\n } else {\n throw \"Missing required frameDuration or frameRate setting\";\n }\n }\n }\n\n function addFrameToCluster(frame) {\n frame.trackNumber = DEFAULT_TRACK_NUMBER;\n\n // Frame timecodes are relative to the start of their cluster:\n frame.timecode = Math.round(clusterDuration);\n\n clusterFrameBuffer.push(frame);\n\n clusterDuration += frame.duration;\n\n if (clusterDuration >= MAX_CLUSTER_DURATION_MSEC) {\n flushClusterFrameBuffer();\n }\n }\n\n /**\n * Rewrites the SeekHead element that was initially written to the stream with the offsets of top level elements.\n *\n * Call once writing is complete (so the offset of all top level elements is known).\n */\n function rewriteSeekHead() {\n var\n seekHeadBuffer = new ArrayBufferDataStream(seekHead.size),\n oldPos = blobBuffer.pos;\n\n // Write the rewritten SeekHead element's data payload to the stream (don't need to update the id or size)\n writeEBML(seekHeadBuffer, seekHead.dataOffset, seekHead.data);\n\n // And write that through to the file\n blobBuffer.seek(seekHead.dataOffset);\n blobBuffer.write(seekHeadBuffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Rewrite the Duration field of the Segment with the newly-discovered video duration.\n */\n function rewriteDuration() {\n var\n buffer = new ArrayBufferDataStream(8),\n oldPos = blobBuffer.pos;\n\n // Rewrite the data payload (don't need to update the id or size)\n buffer.writeDoubleBE(clusterStartTime);\n\n // And write that through to the file\n blobBuffer.seek(segmentDuration.dataOffset);\n blobBuffer.write(buffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Add a frame to the video. Currently the frame must be a Canvas element.\n */\n this.addFrame = function(canvas) {\n if (writtenHeader) {\n if (canvas.width != videoWidth || canvas.height != videoHeight) {\n throw \"Frame size differs from previous frames\";\n }\n } else {\n videoWidth = canvas.width;\n videoHeight = canvas.height;\n\n writeHeader();\n writtenHeader = true;\n }\n\n var\n webP = renderAsWebP(canvas, {quality: options.quality});\n\n if (!webP) {\n throw \"Couldn't decode WebP frame, does the browser support WebP?\";\n }\n\n addFrameToCluster({\n frame: extractKeyframeFromWebP(webP),\n duration: options.frameDuration\n });\n };\n\n /**\n * Finish writing the video and return a Promise to signal completion.\n *\n * If the destination device was memory (i.e. options.fileWriter was not supplied), the Promise is resolved with\n * a Blob with the contents of the entire video.\n */\n this.complete = function() {\n flushClusterFrameBuffer();\n\n writeCues();\n rewriteSeekHead();\n rewriteDuration();\n\n return blobBuffer.complete('video/webm');\n };\n\n this.getWrittenSize = function() {\n return blobBuffer.length;\n };\n\n options = extend(optionDefaults, options || {});\n validateOptions();\n };\n };\n\n if ( true && typeof module.exports !== 'undefined') {\n\t // module.exports = WebMWriter(require(\"./ArrayBufferDataStream\"), require(\"./BlobBuffer\"));\n module.exports = WebMWriter(ArrayBufferDataStream,BlobBuffer);\n } else {\n\t window.WebMWriter = WebMWriter(ArrayBufferDataStream, BlobBuffer);\n }\n})();\n\n\n/***/ }),\n\n/***/ 681:\n/***/ ((module) => {\n\n\"use strict\";\nmodule.exports = JSON.parse('{\"_from\":\"@ffmpeg/ffmpeg\",\"_id\":\"@ffmpeg/ffmpeg@0.10.1\",\"_inBundle\":false,\"_integrity\":\"sha512-ChQkH7Rh57hmVo1LhfQFibWX/xqneolJKSwItwZdKPcLZuKigtYAYDIvB55pDfP17VtR1R77SxgkB2/UApB+Og==\",\"_location\":\"/@ffmpeg/ffmpeg\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"@ffmpeg/ffmpeg\",\"name\":\"@ffmpeg/ffmpeg\",\"escapedName\":\"@ffmpeg%2fffmpeg\",\"scope\":\"@ffmpeg\",\"rawSpec\":\"\",\"saveSpec\":null,\"fetchSpec\":\"latest\"},\"_requiredBy\":[\"#USER\",\"/\"],\"_resolved\":\"https://registry.npmjs.org/@ffmpeg/ffmpeg/-/ffmpeg-0.10.1.tgz\",\"_shasum\":\"3dacf3985de9c83a95fbf79fe709920cc009b00a\",\"_spec\":\"@ffmpeg/ffmpeg\",\"_where\":\"/Users/amandaghassaei/Projects/canvas-capture\",\"author\":{\"name\":\"Jerome Wu\",\"email\":\"jeromewus@gmail.com\"},\"browser\":{\"./src/node/index.js\":\"./src/browser/index.js\"},\"bugs\":{\"url\":\"https://github.com/ffmpegwasm/ffmpeg.wasm/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"is-url\":\"^1.2.4\",\"node-fetch\":\"^2.6.1\",\"regenerator-runtime\":\"^0.13.7\",\"resolve-url\":\"^0.2.1\"},\"deprecated\":false,\"description\":\"FFmpeg WebAssembly version\",\"devDependencies\":{\"@babel/core\":\"^7.12.3\",\"@babel/preset-env\":\"^7.12.1\",\"@ffmpeg/core\":\"^0.10.0\",\"@types/emscripten\":\"^1.39.4\",\"babel-loader\":\"^8.1.0\",\"chai\":\"^4.2.0\",\"cors\":\"^2.8.5\",\"eslint\":\"^7.12.1\",\"eslint-config-airbnb-base\":\"^14.1.0\",\"eslint-plugin-import\":\"^2.22.1\",\"express\":\"^4.17.1\",\"mocha\":\"^8.2.1\",\"mocha-headless-chrome\":\"^2.0.3\",\"npm-run-all\":\"^4.1.5\",\"wait-on\":\"^5.3.0\",\"webpack\":\"^5.3.2\",\"webpack-cli\":\"^4.1.0\",\"webpack-dev-middleware\":\"^4.0.0\"},\"directories\":{\"example\":\"examples\"},\"engines\":{\"node\":\">=12.16.1\"},\"homepage\":\"https://github.com/ffmpegwasm/ffmpeg.wasm#readme\",\"keywords\":[\"ffmpeg\",\"WebAssembly\",\"video\"],\"license\":\"MIT\",\"main\":\"src/index.js\",\"name\":\"@ffmpeg/ffmpeg\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git\"},\"scripts\":{\"build\":\"rimraf dist && webpack --config scripts/webpack.config.prod.js\",\"lint\":\"eslint src\",\"prepublishOnly\":\"npm run build\",\"start\":\"node scripts/server.js\",\"test\":\"npm-run-all -p -r start test:all\",\"test:all\":\"npm-run-all wait test:browser:ffmpeg test:node:all\",\"test:browser\":\"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000\",\"test:browser:ffmpeg\":\"npm run test:browser -- -f ./tests/ffmpeg.test.html\",\"test:node\":\"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js\",\"test:node:all\":\"npm run test:node -- ./tests/*.test.js\",\"wait\":\"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js\"},\"types\":\"src/index.d.ts\",\"version\":\"0.10.1\"}');\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/node module decorator */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.nmd = (module) => {\n/******/ \t\t\tmodule.paths = [];\n/******/ \t\t\tif (!module.children) module.children = [];\n/******/ \t\t\treturn module;\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be in strict mode.\n(() => {\n\"use strict\";\nvar exports = __webpack_exports__;\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CanvasCapture = void 0;\n// Default export.\nvar CanvasCapture = __webpack_require__(914);\nexports.CanvasCapture = CanvasCapture;\nexports[\"default\"] = CanvasCapture;\n\n})();\n\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=canvas-capture.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar __1 = require(\"../../\");\n// Initialize and pass in canvas.\nvar canvas = document.getElementById('my-canvas');\n__1.CanvasCapture.init(canvas, {\n showRecDot: true,\n showAlerts: true,\n showDialogs: true,\n verbose: false,\n ffmpegCorePath: './dist/ffmpeg-core.js',\n});\n// Bind key presses to begin/end recordings.\nvar MP4_OPTIONS = {\n name: 'demo-mp4',\n format: __1.CanvasCapture.MP4,\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"MP4 export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished MP4 export.\"); },\n};\n__1.CanvasCapture.bindKeyToVideoRecord('v', MP4_OPTIONS);\nvar WEBM_OPTIONS = {\n name: 'demo-webm',\n format: __1.CanvasCapture.WEBM,\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"WEBM export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished WEBM export.\"); },\n};\n__1.CanvasCapture.bindKeyToVideoRecord('w', WEBM_OPTIONS);\nvar GIF_OPTIONS = {\n name: 'demo-gif',\n quality: 1,\n fps: 60,\n onExportProgress: function (progress) { return console.log(\"GIF export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished GIF export.\"); },\n};\n__1.CanvasCapture.bindKeyToGIFRecord('g', GIF_OPTIONS);\n// These take a single snapshot.\nvar PNG_OPTIONS = {\n name: 'demo-png',\n dpi: 72,\n onExportProgress: function (progress) { return console.log(\"PNG frames export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished PNG frames zip.\"); },\n};\n__1.CanvasCapture.bindKeyToPNGSnapshot('p', PNG_OPTIONS);\n__1.CanvasCapture.bindKeyToPNGFramesRecord('o', PNG_OPTIONS);\nvar JPEG_OPTIONS = {\n name: 'demo-jpg',\n quality: 1,\n dpi: 72,\n onExportProgress: function (progress) { return console.log(\"JPEG frames export progress: \" + progress + \".\"); },\n onExportFinish: function () { return console.log(\"Finished JPEG frames zip.\"); },\n};\n__1.CanvasCapture.bindKeyToJPEGSnapshot('j', JPEG_OPTIONS);\n__1.CanvasCapture.bindKeyToJPEGFramesRecord('h', JPEG_OPTIONS);\n// Simple canvas draw setup.\nvar context = canvas.getContext(\"2d\");\nvar angle = 0;\nvar image = document.createElement(\"img\");\nimage.src = 'monalisa.png';\nfunction loop() {\n requestAnimationFrame(loop);\n // Wait until is loaded.\n if (image.width) {\n // Draw black background\n context.beginPath();\n context.fillStyle = 'black';\n context.fillRect(0, 0, canvas.width, canvas.height);\n // Renter rotated image.\n context.save();\n context.translate(canvas.width / 2, canvas.height / 2);\n context.rotate(angle);\n context.drawImage(image, -image.width / 2, -image.height / 2);\n context.restore();\n // Increase rotation.\n angle += 0.02;\n }\n // You need to do this only if you are recording a video or gif.\n if (__1.CanvasCapture.isRecording())\n __1.CanvasCapture.recordFrame();\n}\n// Start animation loop.\nloop();\n// Wire up ui.\ndocument.getElementById(\"savePNG\").addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.takePNGSnapshot(PNG_OPTIONS);\n});\nvar startRecordPNGFrames = document.getElementById('startPNG');\nvar pngFramesCapture;\nstartRecordPNGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n pngFramesCapture = __1.CanvasCapture.beginPNGFramesRecord(PNG_OPTIONS);\n startRecordPNGFrames.style.display = pngFramesCapture ? 'none' : 'inline';\n stopRecordPNGFrames.style.display = pngFramesCapture ? 'inline' : 'none';\n});\nvar stopRecordPNGFrames = document.getElementById('stopPNG');\nstopRecordPNGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(pngFramesCapture);\n pngFramesCapture = undefined;\n stopRecordPNGFrames.style.display = 'none';\n startRecordPNGFrames.style.display = 'inline';\n});\nstopRecordPNGFrames.style.display = 'none';\ndocument.getElementById(\"saveJPG\").addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.takeJPEGSnapshot(JPEG_OPTIONS);\n});\nvar startRecordJPGFrames = document.getElementById('startJPG');\nvar jpgFramesCapture;\nstartRecordJPGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n jpgFramesCapture = __1.CanvasCapture.beginJPEGFramesRecord(JPEG_OPTIONS);\n startRecordJPGFrames.style.display = jpgFramesCapture ? 'none' : 'inline';\n stopRecordJPGFrames.style.display = jpgFramesCapture ? 'inline' : 'none';\n});\nvar stopRecordJPGFrames = document.getElementById('stopJPG');\nstopRecordJPGFrames.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(jpgFramesCapture);\n pngFramesCapture = undefined;\n stopRecordJPGFrames.style.display = 'none';\n startRecordJPGFrames.style.display = 'inline';\n});\nstopRecordJPGFrames.style.display = 'none';\nvar startRecordMP4 = document.getElementById('startMP4');\nvar mp4Capture;\nstartRecordMP4.addEventListener('click', function (e) {\n e.preventDefault();\n mp4Capture = __1.CanvasCapture.beginVideoRecord(MP4_OPTIONS);\n startRecordMP4.style.display = mp4Capture ? 'none' : 'inline';\n stopRecordMP4.style.display = mp4Capture ? 'inline' : 'none';\n});\nvar stopRecordMP4 = document.getElementById('stopMP4');\nstopRecordMP4.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(mp4Capture);\n mp4Capture = undefined;\n stopRecordMP4.style.display = 'none';\n startRecordMP4.style.display = 'inline';\n});\nstopRecordMP4.style.display = 'none';\nvar startRecordWEBM = document.getElementById('startWEBM');\nvar webmCapture;\nstartRecordWEBM.addEventListener('click', function (e) {\n e.preventDefault();\n webmCapture = __1.CanvasCapture.beginVideoRecord(WEBM_OPTIONS);\n startRecordWEBM.style.display = webmCapture ? 'none' : 'inline';\n stopRecordWEBM.style.display = webmCapture ? 'inline' : 'none';\n});\nvar stopRecordWEBM = document.getElementById('stopWEBM');\nstopRecordWEBM.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(webmCapture);\n webmCapture = undefined;\n stopRecordWEBM.style.display = 'none';\n startRecordWEBM.style.display = 'inline';\n});\nstopRecordWEBM.style.display = 'none';\nvar startRecordGIF = document.getElementById('startGIF');\nvar gifCapture;\nstartRecordGIF.addEventListener('click', function (e) {\n e.preventDefault();\n gifCapture = __1.CanvasCapture.beginGIFRecord(GIF_OPTIONS);\n startRecordGIF.style.display = gifCapture ? 'none' : 'inline';\n stopRecordGIF.style.display = gifCapture ? 'inline' : 'none';\n});\nvar stopRecordGIF = document.getElementById('stopGIF');\nstopRecordGIF.addEventListener('click', function (e) {\n e.preventDefault();\n __1.CanvasCapture.stopRecord(gifCapture);\n gifCapture = undefined;\n stopRecordGIF.style.display = 'none';\n startRecordGIF.style.display = 'inline';\n});\nstopRecordGIF.style.display = 'none';\ndocument.getElementById('WEBM-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsWEBM() + \")\";\ndocument.getElementById('MP4-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsMP4() + \")\";\ndocument.getElementById('GIF-support').innerHTML = \"(supported by this browser: \" + __1.CanvasCapture.browserSupportsGIF() + \")\";\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/canvas-capture.js b/dist/canvas-capture.js index b2759a1..7c36d49 100644 --- a/dist/canvas-capture.js +++ b/dist/canvas-capture.js @@ -3399,7 +3399,7 @@ if ( true && typeof module.exports !== 'undefined') { /***/ ((module) => { // gif.js 0.2.0 - https://github.com/jnordberg/gif.js -(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":3,"./TypedNeuQuant.js":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit("start");return this.emit("progress",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log("killing active worker");worker.terminate()}this.running=false;return this.emit("abort")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log("spawning worker "+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log("frame "+frame.index+" finished - "+this.activeWorkers.length+" active");this.finishedFrames++;this.emit("progress",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log("global palette analyzed");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log("starting frame "+(task.index+1)+" of "+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement("canvas");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext("2d");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name==="chrome"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error("Invalid frame")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{"./GIFEncoder.js":2,"./browser.coffee":5,"./gif.worker.coffee":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":3,"./TypedNeuQuant.js":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit("start");return this.emit("progress",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log("killing active worker");worker.terminate()}this.running=false;return this.emit("abort")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log("spawning worker "+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log("frame "+frame.index+" finished - "+this.activeWorkers.length+" active");this.finishedFrames++;this.emit("progress",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log("global palette analyzed");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log("starting frame "+(task.index+1)+" of "+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement("canvas");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext("2d");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name==="chrome"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error("Invalid frame")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{"./GIFEncoder.js":2,"./browser.coffee":5,"./gif.worker.coffee":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.changeDpiBlob = changeDpiBlob;\nexports.changeDpiDataUrl = changeDpiDataUrl;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction createPngDataTable() {\n /* Table of CRCs of all 8-bit messages. */\n var crcTable = new Int32Array(256);\n for (var n = 0; n < 256; n++) {\n var c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1;\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nfunction calcCrc(buf) {\n var c = -1;\n if (!pngDataTable) pngDataTable = createPngDataTable();\n for (var n = 0; n < buf.length; n++) {\n c = pngDataTable[(c ^ buf[n]) & 0xFF] ^ c >>> 8;\n }\n return c ^ -1;\n}\n\nvar pngDataTable = void 0;\n\nvar PNG = 'image/png';\nvar JPEG = 'image/jpeg';\n\n// those are 3 possible signature of the physBlock in base64.\n// the pHYs signature block is preceed by the 4 bytes of lenght. The length of\n// the block is always 9 bytes. So a phys block has always this signature:\n// 0 0 0 9 p H Y s.\n// However the data64 encoding aligns we will always find one of those 3 strings.\n// this allow us to find this particular occurence of the pHYs block without\n// converting from b64 back to string\nvar b64PhysSignature1 = 'AAlwSFlz';\nvar b64PhysSignature2 = 'AAAJcEhZ';\nvar b64PhysSignature3 = 'AAAACXBI';\n\nvar _P = 'p'.charCodeAt(0);\nvar _H = 'H'.charCodeAt(0);\nvar _Y = 'Y'.charCodeAt(0);\nvar _S = 's'.charCodeAt(0);\n\nfunction changeDpiBlob(blob, dpi) {\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var headerChunk = blob.slice(0, 33);\n return new Promise(function (resolve, reject) {\n var fileReader = new FileReader();\n fileReader.onload = function () {\n var dataArray = new Uint8Array(fileReader.result);\n var tail = blob.slice(33);\n var changedArray = changeDpiOnArray(dataArray, dpi, blob.type);\n resolve(new Blob([changedArray, tail], { type: blob.type }));\n };\n fileReader.readAsArrayBuffer(headerChunk);\n });\n}\n\nfunction changeDpiDataUrl(base64Image, dpi) {\n var dataSplitted = base64Image.split(',');\n var format = dataSplitted[0];\n var body = dataSplitted[1];\n var type = void 0;\n var headerLength = void 0;\n var overwritepHYs = false;\n if (format.indexOf(PNG) !== -1) {\n type = PNG;\n var b64Index = detectPhysChunkFromDataUrl(body);\n // 28 bytes in dataUrl are 21bytes, length of phys chunk with everything inside.\n if (b64Index >= 0) {\n headerLength = Math.ceil((b64Index + 28) / 3) * 4;\n overwritepHYs = true;\n } else {\n headerLength = 33 / 3 * 4;\n }\n }\n if (format.indexOf(JPEG) !== -1) {\n type = JPEG;\n headerLength = 18 / 3 * 4;\n }\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var stringHeader = body.substring(0, headerLength);\n var restOfData = body.substring(headerLength);\n var headerBytes = atob(stringHeader);\n var dataArray = new Uint8Array(headerBytes.length);\n for (var i = 0; i < dataArray.length; i++) {\n dataArray[i] = headerBytes.charCodeAt(i);\n }\n var finalArray = changeDpiOnArray(dataArray, dpi, type, overwritepHYs);\n var base64Header = btoa(String.fromCharCode.apply(String, _toConsumableArray(finalArray)));\n return [format, ',', base64Header, restOfData].join('');\n}\n\nfunction detectPhysChunkFromDataUrl(data) {\n var b64index = data.indexOf(b64PhysSignature1);\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature2);\n }\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature3);\n }\n // if b64index === -1 chunk is not found\n return b64index;\n}\n\nfunction searchStartOfPhys(data) {\n var length = data.length - 1;\n // we check from the end since we cut the string in proximity of the header\n // the header is within 21 bytes from the end.\n for (var i = length; i >= 4; i--) {\n if (data[i - 4] === 9 && data[i - 3] === _P && data[i - 2] === _H && data[i - 1] === _Y && data[i] === _S) {\n return i - 3;\n }\n }\n}\n\nfunction changeDpiOnArray(dataArray, dpi, format, overwritepHYs) {\n if (format === JPEG) {\n dataArray[13] = 1; // 1 pixel per inch or 2 pixel per cm\n dataArray[14] = dpi >> 8; // dpiX high byte\n dataArray[15] = dpi & 0xff; // dpiX low byte\n dataArray[16] = dpi >> 8; // dpiY high byte\n dataArray[17] = dpi & 0xff; // dpiY low byte\n return dataArray;\n }\n if (format === PNG) {\n var physChunk = new Uint8Array(13);\n // chunk header pHYs\n // 9 bytes of data\n // 4 bytes of crc\n // this multiplication is because the standard is dpi per meter.\n dpi *= 39.3701;\n physChunk[0] = _P;\n physChunk[1] = _H;\n physChunk[2] = _Y;\n physChunk[3] = _S;\n physChunk[4] = dpi >>> 24; // dpiX highest byte\n physChunk[5] = dpi >>> 16; // dpiX veryhigh byte\n physChunk[6] = dpi >>> 8; // dpiX high byte\n physChunk[7] = dpi & 0xff; // dpiX low byte\n physChunk[8] = physChunk[4]; // dpiY highest byte\n physChunk[9] = physChunk[5]; // dpiY veryhigh byte\n physChunk[10] = physChunk[6]; // dpiY high byte\n physChunk[11] = physChunk[7]; // dpiY low byte\n physChunk[12] = 1; // dot per meter....\n\n var crc = calcCrc(physChunk);\n\n var crcChunk = new Uint8Array(4);\n crcChunk[0] = crc >>> 24;\n crcChunk[1] = crc >>> 16;\n crcChunk[2] = crc >>> 8;\n crcChunk[3] = crc & 0xff;\n\n if (overwritepHYs) {\n var startingIndex = searchStartOfPhys(dataArray);\n dataArray.set(physChunk, startingIndex);\n dataArray.set(crcChunk, startingIndex + 13);\n return dataArray;\n } else {\n // i need to give back an array of data that is divisible by 3 so that\n // dataurl encoding gives me integers, for luck this chunk is 17 + 4 = 21\n // if it was we could add a text chunk contaning some info, untill desired\n // length is met.\n\n // chunk structur 4 bytes for length is 9\n var chunkLength = new Uint8Array(4);\n chunkLength[0] = 0;\n chunkLength[1] = 0;\n chunkLength[2] = 0;\n chunkLength[3] = 9;\n\n var finalHeader = new Uint8Array(54);\n finalHeader.set(dataArray, 0);\n finalHeader.set(chunkLength, 33);\n finalHeader.set(physChunk, 37);\n finalHeader.set(crcChunk, 50);\n return finalHeader;\n }\n }\n}","(function(a,b){if(\"function\"==typeof define&&define.amd)define([],b);else if(\"undefined\"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open(\"GET\",a),d.responseType=\"blob\",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error(\"could not download file\")},d.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof global&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open(\"\",\"_blank\"),g&&(g.document.title=g.document.body.innerText=\"downloading...\"),\"string\"==typeof b)return c(b,d,e);var h=\"application/octet-stream\"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&\"undefined\"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,\"undefined\"!=typeof module&&(module.exports=g)});\n\n//# sourceMappingURL=FileSaver.min.js.map","/*!\n\nJSZip v3.7.1 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=t()}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e=\"function\"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error(\"Cannot find module '\"+r+\"'\");throw i.code=\"MODULE_NOT_FOUND\",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l=\"function\"==typeof require&&require,t=0;t>2,s=(3&e)<<4|r>>4,a=1>6:64,o=2>4,r=(15&n)<<4|(s=p.indexOf(t.charAt(o++)))>>2,i=(3&s)<<6|(a=p.indexOf(t.charAt(o++))),l[h++]=e,64!==s&&(l[h++]=r),64!==a&&(l[h++]=i);return l}},{\"./support\":30,\"./utils\":32}],2:[function(t,e,r){\"use strict\";var i=t(\"./external\"),n=t(\"./stream/DataWorker\"),s=t(\"./stream/Crc32Probe\"),a=t(\"./stream/DataLengthProbe\");function o(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(i.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 n(i.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 i=t(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(t){return new i(\"STORE compression\")},uncompressWorker:function(){return new i(\"STORE decompression\")}},r.DEFLATE=t(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(t,e,r){\"use strict\";var i=t(\"./utils\");var o=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)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\"!==i.getTypeOf(t)?function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):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 i=null;i=\"undefined\"!=typeof Promise?Promise:t(\"lie\"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){\"use strict\";var i=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,n=t(\"pako\"),s=t(\"./utils\"),a=t(\"./stream/GenericWorker\"),o=i?\"uint8array\":\"array\";function h(t,e){a.call(this,\"FlateWorker/\"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic=\"\\b\\0\",s.inherits(h,a),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(t){return new h(\"Deflate\",t)},r.uncompressWorker=function(){return new h(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(t,e,r){\"use strict\";function A(t,e){var r,i=\"\";for(r=0;r>>=8;return i}function i(t,e,r,i,n,s){var a,o,h=t.file,u=t.compression,l=s!==O.utf8encode,f=I.transformTo(\"string\",s(h.name)),d=I.transformTo(\"string\",O.utf8encode(h.name)),c=h.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",O.utf8encode(c)),_=d.length!==h.name.length,g=m.length!==c.length,b=\"\",v=\"\",y=\"\",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(x.crc32=t.crc32,x.compressedSize=t.compressedSize,x.uncompressedSize=t.uncompressedSize);var S=0;e&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),\"UNIX\"===n?(C=798,z|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(t){return 63&(t||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+d,b+=\"up\"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+=\"uc\"+A(y.length,2)+y);var E=\"\";return E+=\"\\n\\0\",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+\"\\0\\0\\0\\0\"+A(z,4)+A(i,4)+f+b+p}}var I=t(\"../utils\"),n=t(\"../stream/GenericWorker\"),O=t(\"../utf8\"),B=t(\"../crc32\"),R=t(\"../signature\");function s(t,e,r,i){n.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,n),s.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,n.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},s.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},s.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 R.DATA_DESCRIPTOR+A(t.crc32,4)+A(t.compressedSize,4)+A(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},s.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 i.transformTo(\"string\",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},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=n},{\"../utils\":32}],19:[function(t,e,r){\"use strict\";var i=t(\"./Uint8ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(t,e,r){\"use strict\";var i=t(\"./DataReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.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=n},{\"../utils\":32,\"./DataReader\":18}],21:[function(t,e,r){\"use strict\";var i=t(\"./ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"../support\"),s=t(\"./ArrayReader\"),a=t(\"./StringReader\"),o=t(\"./NodeBufferReader\"),h=t(\"./Uint8ArrayReader\");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),\"string\"!==e||n.uint8array?\"nodebuffer\"===e?new o(t):n.uint8array?new h(i.transformTo(\"uint8array\",t)):new s(i.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\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../utils\");function s(t){i.call(this,\"ConvertWorker to \"+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../crc32\");function s(){i.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}t(\"../utils\").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(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 i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.call(this,\"DataLengthProbe for \"+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.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=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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 i(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}i.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=i},{}],29:[function(t,e,r){\"use strict\";var h=t(\"../utils\"),n=t(\"./ConvertWorker\"),s=t(\"./GenericWorker\"),u=t(\"../base64\"),i=t(\"../support\"),a=t(\"../external\"),o=null;if(i.nodestream)try{o=t(\"../nodejs/NodejsStreamOutputAdapter\")}catch(t){}function l(t,o){return new a.Promise(function(e,r){var i=[],n=t._internalType,s=t._outputType,a=t._mimeType;t.on(\"data\",function(t,e){i.push(t),o&&o(e)}).on(\"error\",function(t){i=[],r(t)}).on(\"end\",function(){try{var t=function(t,e,r){switch(t){case\"blob\":return h.newBlob(h.transformTo(\"arraybuffer\",e),r);case\"base64\":return u.encode(e);default:return h.transformTo(t,e)}}(s,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},s.utf8decode=function(t){return h.nodebuffer?o.transformTo(\"nodebuffer\",t).toString(\"utf-8\"):function(t){var e,r,i,n,s=t.length,a=new Array(2*s);for(e=r=0;e>10&1023,a[r++]=56320|1023&i)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(t=o.transformTo(h.uint8array?\"uint8array\":\"array\",t))},o.inherits(a,i),a.prototype.processChunk=function(t){var e=o.transformTo(h.uint8array?\"uint8array\":\"array\",t.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var i=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?e:0===r?e:r+u[t[r]]>e?r:e}(e),n=e;i!==e.length&&(h.uint8array?(n=e.subarray(0,i),this.leftOver=e.subarray(i,e.length)):(n=e.slice(0,i),this.leftOver=e.slice(i,e.length))),this.push({data:s.utf8decode(n),meta:t.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,i),l.prototype.processChunk=function(t){this.push({data:s.utf8encode(t.data),meta:t.meta})},s.Utf8EncodeWorker=l},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(t,e,a){\"use strict\";var o=t(\"./support\"),h=t(\"./base64\"),r=t(\"./nodejsUtils\"),i=t(\"set-immediate-shim\"),u=t(\"./external\");function n(t){return t}function l(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(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new h.Buf8(t.length),r=0,i=e.length;r>10&1023,o[i++]=56320|1023&n)}return l(o,i)},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?e:0===r?e:r+u[t[r]]>e?r:e}},{\"./common\":41}],43:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var n=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 n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){\"use strict\";var h,d=t(\"../utils/common\"),u=t(\"./trees\"),c=t(\"./adler32\"),p=t(\"./crc32\"),i=t(\"./messages\"),l=0,f=4,m=0,_=-2,g=-1,b=4,n=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(t,e){return t.msg=i[e],e}function T(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(d.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 N(t,e){u._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,F(t.strm)}function U(t,e){t.pending_buf[t.pending++]=e}function P(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function L(t,e){var r,i,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-z?t.strstart-(t.w_size-z):0,u=t.window,l=t.w_mask,f=t.prev,d=t.strstart+S,c=u[s+a-1],p=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--n);return a<=t.lookahead?a:t.lookahead}function j(t){var e,r,i,n,s,a,o,h,u,l,f=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-z)){for(d.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);n+=f}if(0===t.strm.avail_in)break;if(a=t.strm,o=t.window,h=t.strstart+t.lookahead,u=n,l=void 0,l=a.avail_in,u=x)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x)if(i=u._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,i=u._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(j(t),0===t.lookahead&&e===l)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-z&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(t,e){return Y(t,e,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?_:(t.state.gzhead=e,m):_},r.deflate=function(t,e){var r,i,n,s;if(!t||!t.state||5>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=p(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=E);else{var a=v+(i.w_bits-8<<4)<<8;a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=E,P(i,a),0!==i.strstart&&(P(i,t.adler>>>16),P(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(t),i.pending+2<=i.pending_buf_size&&(U(i,255&t.adler),U(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(F(t),0===t.avail_out)return i.last_flush=-1,m}else if(0===t.avail_in&&T(e)<=T(r)&&e!==f)return R(t,-5);if(666===i.status&&0!==t.avail_in)return R(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==l&&666!==i.status){var o=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(j(t),0===t.lookahead)){if(e===l)return A;break}if(t.match_length=0,r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):3===i.strategy?function(t,e){for(var r,i,n,s,a=t.window;;){if(t.lookahead<=S){if(j(t),t.lookahead<=S&&e===l)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(r=u._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):h[i.level].func(i,e);if(o!==O&&o!==B||(i.status=666),o===A||o===O)return 0===t.avail_out&&(i.last_flush=-1),m;if(o===I&&(1===e?u._tr_align(i):5!==e&&(u._tr_stored_block(i,0,0,!1),3===e&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),F(t),0===t.avail_out))return i.last_flush=-1,m}return e!==f?m:i.wrap<=0?1:(2===i.wrap?(U(i,255&t.adler),U(i,t.adler>>8&255),U(i,t.adler>>16&255),U(i,t.adler>>24&255),U(i,255&t.total_in),U(i,t.total_in>>8&255),U(i,t.total_in>>16&255),U(i,t.total_in>>24&255)):(P(i,t.adler>>>16),P(i,65535&t.adler)),F(t),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new d.Buf8(r.w_size),d.arraySet(u,e,l-r.w_size,r.w_size,0),e=u,l=r.w_size),a=t.avail_in,o=t.next_in,h=t.input,t.avail_in=l,t.next_in=0,t.input=e,j(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(c&(1<>>=y,p-=y),p<15&&(c+=z[i++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(c&(1<>>=y,p-=y,(y=s-a)>3,c&=(1<<(p-=w<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){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 I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=P,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new I.Buf32(i),e.distcode=e.distdyn=new I.Buf32(n),e.sane=1,e.back=-1,N):U}function o(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,a(t)):U}function h(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(I.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(n=s.wsize-s.wnext)&&(n=i),I.arraySet(s.window,e,r-i,n,s.wnext),(i-=n)?(I.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){t.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(c=r.length)&&(c=o),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,i,s,c,k)),512&r.flags&&(r.check=B(r.check,i,c,s)),o-=c,s+=c,r.length-=c),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break t;for(c=0;k=i[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break t;o--,u+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==e)break;u>>>=2,l-=2;break t;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break t;o--,u+=i[s++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(c=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+c>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}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,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){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<=o&&258<=h){t.next_out=a,t.avail_out=h,t.next_in=s,t.avail_in=o,r.hold=u,r.bits=l,R(t,d),a=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=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===h)break t;if(c=d-h,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=n,p=a-r.offset,c=r.length;for(hc?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=e[r+a[v]]}if(k>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function P(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function Z(t,e,r){var i,n,s=new Array(g+1),a=0;for(i=1;i<=g;i++)s[i]=a=a+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=j(s[o]++,o))}}function W(t){var e;for(e=0;e>1;1<=r;r--)G(t,s,r);for(n=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,G(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,a,o,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=g;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<_;r++)p<(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)&&(s=p,m++),h[2*i+1]=s,u>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return h;for(e=32;e>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?J(t,e,r,i):4===t.strategy||s===n?(P(t,2+(i?1:0),3),K(t,z,C)):(P(t,4+(i?1:0),3),function(t,e,r,i){var n;for(P(t,e-257,5),P(t,r-1,5),P(t,i-4,4),n=0;n>>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*(A[r]+u+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){P(t,2,3),L(t,m,z),function(t){16===t.bi_valid?(U(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){\"use strict\";e.exports=\"function\"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)});","HTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(a,r,t){var i=this.toDataURL(r,t).split(\",\")[1];setTimeout(function(){for(var t=atob(i),o=t.length,e=new Uint8Array(o),n=0;n arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar MicroModal = function () {\n\n var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n var Modal = /*#__PURE__*/function () {\n function Modal(_ref) {\n var targetModal = _ref.targetModal,\n _ref$triggers = _ref.triggers,\n triggers = _ref$triggers === void 0 ? [] : _ref$triggers,\n _ref$onShow = _ref.onShow,\n onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$openTrigger = _ref.openTrigger,\n openTrigger = _ref$openTrigger === void 0 ? 'data-micromodal-trigger' : _ref$openTrigger,\n _ref$closeTrigger = _ref.closeTrigger,\n closeTrigger = _ref$closeTrigger === void 0 ? 'data-micromodal-close' : _ref$closeTrigger,\n _ref$openClass = _ref.openClass,\n openClass = _ref$openClass === void 0 ? 'is-open' : _ref$openClass,\n _ref$disableScroll = _ref.disableScroll,\n disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,\n _ref$disableFocus = _ref.disableFocus,\n disableFocus = _ref$disableFocus === void 0 ? false : _ref$disableFocus,\n _ref$awaitCloseAnimat = _ref.awaitCloseAnimation,\n awaitCloseAnimation = _ref$awaitCloseAnimat === void 0 ? false : _ref$awaitCloseAnimat,\n _ref$awaitOpenAnimati = _ref.awaitOpenAnimation,\n awaitOpenAnimation = _ref$awaitOpenAnimati === void 0 ? false : _ref$awaitOpenAnimati,\n _ref$debugMode = _ref.debugMode,\n debugMode = _ref$debugMode === void 0 ? false : _ref$debugMode;\n\n _classCallCheck(this, Modal);\n\n // Save a reference of the modal\n this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n this.config = {\n debugMode: debugMode,\n disableScroll: disableScroll,\n openTrigger: openTrigger,\n closeTrigger: closeTrigger,\n openClass: openClass,\n onShow: onShow,\n onClose: onClose,\n awaitCloseAnimation: awaitCloseAnimation,\n awaitOpenAnimation: awaitOpenAnimation,\n disableFocus: disableFocus\n }; // Register click events only if pre binding eventListeners\n\n if (triggers.length > 0) this.registerTriggers.apply(this, _toConsumableArray(triggers)); // pre bind functions for event listeners\n\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n }\n /**\n * Loops through all openTriggers and binds click event\n * @param {array} triggers [Array of node elements]\n * @return {void}\n */\n\n\n _createClass(Modal, [{\n key: \"registerTriggers\",\n value: function registerTriggers() {\n var _this = this;\n\n for (var _len = arguments.length, triggers = new Array(_len), _key = 0; _key < _len; _key++) {\n triggers[_key] = arguments[_key];\n }\n\n triggers.filter(Boolean).forEach(function (trigger) {\n trigger.addEventListener('click', function (event) {\n return _this.showModal(event);\n });\n });\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n var _this2 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n this.activeElement = document.activeElement;\n this.modal.setAttribute('aria-hidden', 'false');\n this.modal.classList.add(this.config.openClass);\n this.scrollBehaviour('disable');\n this.addEventListeners();\n\n if (this.config.awaitOpenAnimation) {\n var handler = function handler() {\n _this2.modal.removeEventListener('animationend', handler, false);\n\n _this2.setFocusToFirstNode();\n };\n\n this.modal.addEventListener('animationend', handler, false);\n } else {\n this.setFocusToFirstNode();\n }\n\n this.config.onShow(this.modal, this.activeElement, event);\n }\n }, {\n key: \"closeModal\",\n value: function closeModal() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var modal = this.modal;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.scrollBehaviour('enable');\n\n if (this.activeElement && this.activeElement.focus) {\n this.activeElement.focus();\n }\n\n this.config.onClose(this.modal, this.activeElement, event);\n\n if (this.config.awaitCloseAnimation) {\n var openClass = this.config.openClass; // <- old school ftw\n\n this.modal.addEventListener('animationend', function handler() {\n modal.classList.remove(openClass);\n modal.removeEventListener('animationend', handler, false);\n }, false);\n } else {\n modal.classList.remove(this.config.openClass);\n }\n }\n }, {\n key: \"closeModalById\",\n value: function closeModalById(targetModal) {\n this.modal = document.getElementById(targetModal);\n if (this.modal) this.closeModal();\n }\n }, {\n key: \"scrollBehaviour\",\n value: function scrollBehaviour(toggle) {\n if (!this.config.disableScroll) return;\n var body = document.querySelector('body');\n\n switch (toggle) {\n case 'enable':\n Object.assign(body.style, {\n overflow: ''\n });\n break;\n\n case 'disable':\n Object.assign(body.style, {\n overflow: 'hidden'\n });\n break;\n }\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners() {\n this.modal.addEventListener('touchstart', this.onClick);\n this.modal.addEventListener('click', this.onClick);\n document.addEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n this.modal.removeEventListener('touchstart', this.onClick);\n this.modal.removeEventListener('click', this.onClick);\n document.removeEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"onClick\",\n value: function onClick(event) {\n if (event.target.hasAttribute(this.config.closeTrigger)) {\n this.closeModal(event);\n }\n }\n }, {\n key: \"onKeydown\",\n value: function onKeydown(event) {\n if (event.keyCode === 27) this.closeModal(event); // esc\n\n if (event.keyCode === 9) this.retainFocus(event); // tab\n }\n }, {\n key: \"getFocusableNodes\",\n value: function getFocusableNodes() {\n var nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Array.apply(void 0, _toConsumableArray(nodes));\n }\n /**\n * Tries to set focus on a node which is not a close trigger\n * if no other nodes exist then focuses on first close trigger\n */\n\n }, {\n key: \"setFocusToFirstNode\",\n value: function setFocusToFirstNode() {\n var _this3 = this;\n\n if (this.config.disableFocus) return;\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes\n // could not think of a better name :(\n\n var nodesWhichAreNotCloseTargets = focusableNodes.filter(function (node) {\n return !node.hasAttribute(_this3.config.closeTrigger);\n });\n if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus();\n if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus();\n }\n }, {\n key: \"retainFocus\",\n value: function retainFocus(event) {\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return;\n /**\n * Filters nodes which are hidden to prevent\n * focus leak outside modal\n */\n\n focusableNodes = focusableNodes.filter(function (node) {\n return node.offsetParent !== null;\n }); // if disableFocus is true\n\n if (!this.modal.contains(document.activeElement)) {\n focusableNodes[0].focus();\n } else {\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus();\n event.preventDefault();\n }\n\n if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus();\n event.preventDefault();\n }\n }\n }\n }]);\n\n return Modal;\n }();\n /**\n * Modal prototype ends.\n * Here on code is responsible for detecting and\n * auto binding event handlers on modal triggers\n */\n // Keep a reference to the opened modal\n\n\n var activeModal = null;\n /**\n * Generates an associative array of modals and it's\n * respective triggers\n * @param {array} triggers An array of all triggers\n * @param {string} triggerAttr The data-attribute which triggers the module\n * @return {array}\n */\n\n var generateTriggerMap = function generateTriggerMap(triggers, triggerAttr) {\n var triggerMap = [];\n triggers.forEach(function (trigger) {\n var targetModal = trigger.attributes[triggerAttr].value;\n if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n triggerMap[targetModal].push(trigger);\n });\n return triggerMap;\n };\n /**\n * Validates whether a modal of the given id exists\n * in the DOM\n * @param {number} id The id of the modal\n * @return {boolean}\n */\n\n\n var validateModalPresence = function validateModalPresence(id) {\n if (!document.getElementById(id)) {\n console.warn(\"MicroModal: \\u2757Seems like you have missed %c'\".concat(id, \"'\"), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"
\"));\n return false;\n }\n };\n /**\n * Validates if there are modal triggers present\n * in the DOM\n * @param {array} triggers An array of data-triggers\n * @return {boolean}\n */\n\n\n var validateTriggerPresence = function validateTriggerPresence(triggers) {\n if (triggers.length <= 0) {\n console.warn(\"MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"\");\n return false;\n }\n };\n /**\n * Checks if triggers and their corresponding modals\n * are present in the DOM\n * @param {array} triggers Array of DOM nodes which have data-triggers\n * @param {array} triggerMap Associative array of modals and their triggers\n * @return {boolean}\n */\n\n\n var validateArgs = function validateArgs(triggers, triggerMap) {\n validateTriggerPresence(triggers);\n if (!triggerMap) return true;\n\n for (var id in triggerMap) {\n validateModalPresence(id);\n }\n\n return true;\n };\n /**\n * Binds click handlers to all modal triggers\n * @param {object} config [description]\n * @return void\n */\n\n\n var init = function init(config) {\n // Create an config object with default openTrigger\n var options = Object.assign({}, {\n openTrigger: 'data-micromodal-trigger'\n }, config); // Collects all the nodes with the trigger\n\n var triggers = _toConsumableArray(document.querySelectorAll(\"[\".concat(options.openTrigger, \"]\"))); // Makes a mappings of modals with their trigger nodes\n\n\n var triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n for (var key in triggerMap) {\n var value = triggerMap[key];\n options.targetModal = key;\n options.triggers = _toConsumableArray(value);\n activeModal = new Modal(options); // eslint-disable-line no-new\n }\n };\n /**\n * Shows a particular modal\n * @param {string} targetModal [The id of the modal to display]\n * @param {object} config [The configuration object to pass]\n * @return {void}\n */\n\n\n var show = function show(targetModal, config) {\n var options = config || {};\n options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // clear events in case previous modal wasn't close\n\n if (activeModal) activeModal.removeEventListeners(); // stores reference to active modal\n\n activeModal = new Modal(options); // eslint-disable-line no-new\n\n activeModal.showModal();\n };\n /**\n * Closes the active modal\n * @param {string} targetModal [The id of the modal to close]\n * @return {void}\n */\n\n\n var close = function close(targetModal) {\n targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n };\n\n return {\n init: init,\n show: show,\n close: close\n };\n}();\nwindow.MicroModal = MicroModal;\n\nexport default MicroModal;\n","export default \"(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c},a.define('/gif.worker.coffee',function(d,e,f,g){var b,c;b=a('/GIFEncoder.js',d),c=function(a){var c,e,d,f;return c=new b(a.width,a.height),a.index===0?c.writeHeader():c.firstFrame=!1,c.setTransparent(a.transparent),c.setRepeat(a.repeat),c.setDelay(a.delay),c.setQuality(a.quality),c.addFrame(a.data),a.last&&c.finish(),d=c.stream(),a.data=d.pages,a.cursor=d.cursor,a.pageSize=d.constructor.pageSize,a.canTransfer?(f=function(c){for(var b=0,d=a.data.length;b=c.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=a},c.prototype.writeUTFBytes=function(b){for(var c=b.length,a=0;a=0&&(this.dispose=a)},b.prototype.setRepeat=function(a){this.repeat=a},b.prototype.setTransparent=function(a){this.transparent=a},b.prototype.addFrame=function(a){this.image=a,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1},b.prototype.finish=function(){this.out.writeByte(59)},b.prototype.setQuality=function(a){a<1&&(a=1),this.sample=a},b.prototype.writeHeader=function(){this.out.writeUTFBytes('GIF89a')},b.prototype.analyzePixels=function(){var g=this.pixels.length,d=g/3;this.indexedPixels=new Uint8Array(d);var a=new f(this.pixels,this.sample);a.buildColormap(),this.colorTab=a.getColormap();var b=0;for(var c=0;c>16,l=(e&65280)>>8,m=e&255,c=0,d=16777216,j=this.colorTab.length;for(var a=0;a=0&&(a=dispose&7),a<<=2,this.out.writeByte(0|a|0|b),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},b.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},b.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},b.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes('NETSCAPE2.0'),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},b.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var b=768-this.colorTab.length;for(var a=0;a>8&255)},b.prototype.writePixels=function(){var a=new g(this.width,this.height,this.indexedPixels,this.colorDepth);a.encode(this.out)},b.prototype.stream=function(){return this.out},e.exports=b}),a.define('/LZWEncoder.js',function(e,g,h,i){function f(y,D,C,B){function w(a,b){r[f++]=a,f>=254&&t(b)}function x(b){u(a),k=i+2,j=!0,l(i,b)}function u(b){for(var a=0;a=0){y=w-d,d===0&&(y=1);do if((d-=y)<0&&(d+=w),h[d]===g){e=n[d];continue a}while(h[d]>=0)}l(e,r),e=t,k<1<0&&(a.writeByte(f),a.writeBytes(r,0,f),f=0)}function p(a){return(1<0?g|=a<=8)w(g&255,c),g>>=8,e-=8;if((k>m||j)&&(j?(m=p(n_bits=q),j=!1):(++n_bits,n_bits==b?m=1<0)w(g&255,c),g>>=8,e-=8;t(c)}}var s=Math.max(2,B),r=new Uint8Array(256),h=new Int32Array(a),n=new Int32Array(a),g,e=0,f,k=0,m,j=!1,q,i,o;this.encode=z}var c=-1,b=12,a=5003,d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=f}),a.define('/TypedNeuQuant.js',function(A,F,E,D){function C(A,B){function I(){o=[],q=new Int32Array(256),t=new Int32Array(a),y=new Int32Array(a),z=new Int32Array(a>>3);var c,d;for(c=0;c>=b,o[c][1]>>=b,o[c][2]>>=b,o[c][3]=c}function K(b,a,c,e,f){o[a][0]-=b*(o[a][0]-c)/d,o[a][1]-=b*(o[a][1]-e)/d,o[a][2]-=b*(o[a][2]-f)/d}function L(j,e,n,l,k){var h=Math.abs(e-j),i=Math.min(e+j,a),g=e+1,f=e-1,m=1,b,d;while(gh)d=z[m++],gh&&(b=o[f--],b[0]-=d*(b[0]-n)/c,b[1]-=d*(b[1]-l)/c,b[2]-=d*(b[2]-k)/c)}function C(p,s,q){var h=2147483647,k=h,d=-1,m=d,c,j,e,n,l;for(c=0;c>i-b),n>g,y[c]-=l,t[c]+=l<>1,b=f+1;b>1,b=f+1;b<256;b++)q[b]=n}function E(j,i,k){var b,d,c,e=1e3,h=-1,f=q[i],g=f-1;while(f=0)f=e?f=a:(f++,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c=0&&(d=o[g],c=i-d[1],c>=e?g=-1:(g--,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c>h;for(a<=1&&(a=0),c=0;c=f&&(g-=f),c++,q===0&&(q=1),c%q===0)for(n-=n/D,o-=o/v,a=o>>h,a<=1&&(a=0),e=0;e>g,r=e<>3,h=6,t=1< void;\ntype CAPTURE_TYPE =\n\ttypeof GIF | typeof WEBM | typeof MP4 |\n\ttypeof JPEGZIP | typeof PNGZIP;\n\n// Save options for hotkey controls.\nexport type WEBM_OPTIONS = {\n\tformat?: typeof WEBM,\n\tfps?: number,\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tonExportProgress?: (progress: number) => void, // Download is immediate, so this isn't very informative. progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type MP4_OPTIONS = {\n\tformat?: typeof MP4,\n\tfps?: number,\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tffmpegOptions?: { [key: string]: string },\n\tonExportProgress?: (progress: number) => void, // FFMPEG encoding progress, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type GIF_OPTIONS = {\n\tfps?: number,\n\tname?: string,\n\tquality?: number // A number 0-1.\n\tonExportProgress?: (progress: number) => void, // progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type PNG_OPTIONS = {\n\tname?: string,\n\tdpi?: number, // Default is screen dpi (72).\n\tonExportProgress?: (progress: number) => void, // Zipping progress, only used for recording PNG frames, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type JPEG_OPTIONS = {\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tdpi?: number, // Default is screen dpi (72).\n\tonExportProgress?: (progress: number) => void, // Zipping progress, only used for recording JPEG frames, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\n\nexport type ACTIVE_CAPTURE = {\n\tname: string,\n\tcapturer: CCapture | JSZip,\n\tnumFrames: number,\n\ttype: CAPTURE_TYPE,\n\tzipOptions?: PNG_OPTIONS | JPEG_OPTIONS, // Only used for frame zip record.\n\tzipPromises?: Promise[],\n\tffmpegOptions?: { [key: string]: string }, // Only used for mp4 record.\n\tonExportProgress?: (progress: number) => void,\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nconst activeCaptures: ACTIVE_CAPTURE[] = [];\n\n// This is an unused variable,\n// but needed for proper import of CCapture at the moment.\n// See https://github.com/spite/ccapture.js/issues/78\nconst temp = CCapture;\n\ntype HOTKEY_TYPE =\n\ttypeof GIF | typeof WEBM | typeof MP4 |\n\ttypeof JPEGZIP | typeof PNGZIP |\n\ttypeof JPEG | typeof PNG;\n\nconst hotkeyOptions:\n{\n\t[MP4]?: MP4_OPTIONS,\n\t[WEBM]?: WEBM_OPTIONS,\n\t[GIF]?: GIF_OPTIONS,\n\t[PNGZIP]?: PNG_OPTIONS,\n\t[JPEGZIP]?: JPEG_OPTIONS,\n\t[PNG]?: PNG_OPTIONS,\n\t[JPEG]?: JPEG_OPTIONS,\n} = {};\n\nconst hotkeys: {\n\t[MP4]?: string,\n\t[WEBM]?: string,\n\t[GIF]?: string,\n\t[PNGZIP]?: string,\n\t[JPEGZIP]?: string,\n\t[PNG]?: string,\n\t[JPEG]?: string,\n} = {};\n\nlet canvas: HTMLCanvasElement | null = null;\n\nexport function init(_canvas: HTMLCanvasElement, options?: {\n\tffmpegCorePath?: string,\n\tverbose?: boolean,\n\tshowAlerts?: boolean,\n\tshowDialogs?: boolean,\n\tshowRecDot?: boolean,\n\trecDotCSS?: {[key: string]: string},\n}) {\n\tcanvas = _canvas;\n\t// Use public address if you don't want to host your own.\n\tffmpegPath = options?.ffmpegCorePath || 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n\tif (options && options.verbose !== undefined) setVerbose(options.verbose);\n\tif (options && options.showAlerts !== undefined) PARAMS.SHOW_ALERTS = options.showAlerts;\n\tif (options && options.showDialogs !== undefined) PARAMS.SHOW_DIALOGS = options.showDialogs;\n\tif (options && options.showRecDot !== undefined) PARAMS.SHOW_REC_DOT = options.showRecDot;\n\tif (PARAMS.SHOW_REC_DOT) {\n\t\tinitDotWithCSS(options?.recDotCSS);\n\t}\n\tcanvas.addEventListener('resize', function(){\n\t\tif (activeCaptures.length) {\n\t\t\tconst warningMsg = \"Don't resize while recording canvas!\";\n\t\t\tshowWarning(warningMsg);\n\t\t}\n\t});\n}\n\nexport function setVerbose(state: boolean) {\n\tPARAMS.VERBOSE = !!state;\n\tif (ffmpeg) ffmpeg.setLogging(PARAMS.VERBOSE);\n}\n\nfunction checkCanvas() {\n\tif (canvas === null) {\n\t\tthrow new Error('No canvas supplied, please call CanvasCapture.init() and pass in canvas element.');\n\t}\n}\n\nfunction setHotkey(key: string, type: HOTKEY_TYPE) {\n\t// Unbind other hotkeys attached to same key.\n\tObject.keys(hotkeys).forEach(keyName => {\n\t\tif (hotkeys[keyName as HOTKEY_TYPE] === key) {\n\t\t\tdelete hotkeys[keyName as HOTKEY_TYPE];\n\t\t}\n\t});\n\thotkeys[type] = key;\n}\n\n// Pressing key once will start record, press again to stop.\nexport function bindKeyToVideoRecord(key: string, options?: WEBM_OPTIONS | MP4_OPTIONS) {\n\tif (options?.format === WEBM) {\n\t\thotkeyOptions.webm = options as WEBM_OPTIONS;\n\t\tsetHotkey(key, WEBM);\n\t} else {\n\t\t// Default to MP4.\n\t\thotkeyOptions.mp4 = options as MP4_OPTIONS;\n\t\tsetHotkey(key, MP4);\n\t}\n}\nexport function bindKeyToGIFRecord(key: string, options?: GIF_OPTIONS) {\n\thotkeyOptions.gif = options;\n\tsetHotkey(key, GIF);\n}\nexport function bindKeyToPNGFramesRecord(key: string, options?: PNG_OPTIONS) {\n\thotkeyOptions.pngzip = options;\n\tsetHotkey(key, PNGZIP);\n}\nexport function bindKeyToJPEGFramesRecord(key: string, options?: JPEG_OPTIONS) {\n\thotkeyOptions.jpegzip = options;\n\tsetHotkey(key, JPEGZIP);\n}\n// Snapshots just take a single shot.\nexport function bindKeyToPNGSnapshot(key: string, options?: PNG_OPTIONS) {\n\thotkeyOptions.png = options;\n\tsetHotkey(key, PNG);\n}\nexport function bindKeyToJPEGSnapshot(key: string, options?: JPEG_OPTIONS) {\n\thotkeyOptions.jpeg = options;\n\tsetHotkey(key, JPEG);\n}\n\nwindow.addEventListener('keydown', (e: KeyboardEvent) => {\n\tif (hotkeys.mp4 && e.key === hotkeys[MP4]) {\n\t\tconst MP4s = activeCapturesOfType(MP4);\n\t\tif (MP4s.length) stopRecord(MP4s);\n\t\telse {\n\t\t\tif (!browserSupportsMP4()) {\n\t\t\t\tconst errorMsg = `This browser does not support MP4 video recording, please try again in Chrome.`;\n\t\t\t\tconst onError = hotkeyOptions[MP4]?.onError;\n\t\t\t\tif (onError) onError(new Error(errorMsg));\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t}\n\t\t\tbeginVideoRecord(hotkeyOptions[MP4]);\n\t\t}\n\t}\n\tif (hotkeys.webm && e.key === hotkeys[WEBM]) {\n\t\tconst WEBMs = activeCapturesOfType(WEBM);\n\t\tif (WEBMs.length) stopRecord(WEBMs);\n\t\telse {\n\t\t\tif (!browserSupportsWEBM()) {\n\t\t\t\tconst errorMsg = `This browser does not support WEBM video recording, please try again in Chrome.`;\n\t\t\t\tconst onError = hotkeyOptions[WEBM]?.onError;\n\t\t\t\tif (onError) onError(new Error(errorMsg));\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t}\n\t\t\tbeginVideoRecord(hotkeyOptions[WEBM]);\n\t\t}\n\t}\n\tif (hotkeys.gif && e.key === hotkeys[GIF]) {\n\t\tconst GIFs = activeCapturesOfType(GIF);\n\t\tif (GIFs.length) stopRecord(GIFs);\n\t\telse beginGIFRecord(hotkeyOptions[GIF]);\n\t}\n\tif (hotkeys.pngzip && e.key === hotkeys[PNGZIP]) {\n\t\tconst pngzips = activeCapturesOfType(PNGZIP);\n\t\tif (pngzips.length) stopRecord(pngzips);\n\t\telse beginPNGFramesRecord(hotkeyOptions[PNGZIP]);\n\t}\n\tif (hotkeys.jpegzip && e.key === hotkeys[JPEGZIP]) {\n\t\tconst jpgzips = activeCapturesOfType(JPEGZIP);\n\t\tif (jpgzips.length) stopRecord(jpgzips);\n\t\telse beginJPEGFramesRecord(hotkeyOptions[JPEGZIP]);\n\t}\n\tif (hotkeys.png && e.key === hotkeys[PNG]) {\n\t\ttakePNGSnapshot(hotkeyOptions[PNG]);\n\t}\n\tif (hotkeys.jpeg && e.key === hotkeys[JPEG]) {\n\t\ttakeJPEGSnapshot(hotkeyOptions[JPEG]);\n\t}\n});\n\nfunction startCapture(capture: ACTIVE_CAPTURE) {\n\tactiveCaptures.push(capture);\n\tif (capture.type !== PNGZIP && capture.type !== JPEGZIP) (capture.capturer as CCapture).start();\n\t// For multi-frame records, we should also throw up an indicator to show that we're in record mode.\n\tshowDot(isRecording());\n}\n\nexport function beginVideoRecord(options?: WEBM_OPTIONS | MP4_OPTIONS) {\n\ttry {\n\t\tconst format = options?.format || MP4; // Default to MP4 record.\n\t\tif (format === MP4) {\n\t\t\tif (!browserSupportsMP4()) {\n\t\t\t\tconst errorMsg = `This browser does not support MP4 video recording, please try again in Chrome.`;\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t\tthrow new Error(errorMsg);\n\t\t\t}\n\t\t} else if (format === WEBM) {\n\t\t\tif (!browserSupportsWEBM()) {\n\t\t\t\tconst errorMsg = `This browser does not support WEBM video recording, please try again in Chrome.`;\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t\tthrow new Error(errorMsg);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(`invalid video format ${format}.`);\n\t\t}\n\t\tif (activeVideoGifCaptures().length) {\n\t\t\tconst errorMsg = `CCapture.js only supports one video/gif capture at a time.`;\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\t\n\t\tlet quality = 1;\n\t\tif (options && options.quality) {\n\t\t\tquality = options.quality;\n\t\t}\n\t\tconst name = options?.name || 'Video_Capture';\n\t\t// Create a capturer that exports a WebM video.\n\t\t// @ts-ignore\n\t\tconst capturer = new (window.CCapture as CCapture)({\n\t\t\tformat: WEBM,\n\t\t\tname,\n\t\t\tframerate: options?.fps || 60,\n\t\t\tquality: quality * 100, // CCapture seems to expect a quality between 0 and 100.\n\t\t\tverbose: PARAMS.VERBOSE,\n\t\t});\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tcapturer,\n\t\t\tnumFrames: 0,\n\t\t\ttype: format,\n\t\t\tffmpegOptions: (options as MP4_OPTIONS)?.ffmpegOptions,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginGIFRecord(options?: GIF_OPTIONS) {\n\ttry {\n\t\tif (activeVideoGifCaptures().length) {\n\t\t\tconst errorMsg = `CCapture.js only supports one video/gif capture at a time.`;\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\t// CCapture seems to expect a quality between 0 and 100.\n\t\tlet quality = 100;\n\t\tif (options && options.quality) {\n\t\t\tquality = options.quality * 100;\n\t\t}\n\t\tconst name = options?.name || 'GIF_Capture';\n\t\t// Create a capturer that exports a GIF.\n\t\t// @ts-ignore\n\t\tconst capturer = new (window.CCapture as CCapture)({\n\t\t\tformat: GIF,\n\t\t\tname,\n\t\t\tframerate: options?.fps || 60,\n\t\t\tworkersPath: gifWorkersPath,\n\t\t\tquality,\n\t\t\tverbose: PARAMS.VERBOSE,\n\t\t\tonProgress: options?.onExportProgress,\n\t\t});\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tcapturer,\n\t\t\tnumFrames: 0,\n\t\t\ttype: GIF as CAPTURE_TYPE,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginPNGFramesRecord(options?: PNG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'PNG_Frames_Capture';\n\t\tconst zipOptions = { dpi: options?.dpi };\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tzipOptions,\n\t\t\tzipPromises: [],\n\t\t\tcapturer: new JSZip(),\n\t\t\tnumFrames: 0,\n\t\t\ttype: PNGZIP as CAPTURE_TYPE,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginJPEGFramesRecord(options?: JPEG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'JPEG_Frames_Capture';\n\t\tconst zipOptions = { dpi: options?.dpi, quality: options?.quality };\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tzipOptions,\n\t\t\tzipPromises: [],\n\t\t\tcapturer: new JSZip(),\n\t\t\tnumFrames: 0,\n\t\t\ttype: JPEGZIP as CAPTURE_TYPE,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nasync function canvasToBlobAsync(canvas: HTMLCanvasElement, type: typeof PNG | typeof JPEG, quality?: number) {\n\treturn new Promise((resolve: (blob: Blob | null) => void) => {\n\t\tcanvas.toBlob((blob: Blob | null) => {\n\t\t\tresolve(blob);\n\t\t}, `image/${type}`, quality);\n\t});\n}\n\nasync function takeImageSnapshot(filename: string, type: typeof PNG | typeof JPEG, quality?: number, options?: JPEG_OPTIONS | PNG_OPTIONS) {\n\tcheckCanvas();\n\tconst onExportFinish = options?.onExportFinish;\n\tconst blob = await canvasToBlobAsync(canvas!, type, quality);\n\tif (!blob) {\n\t\tconst errorMsg = `Problem saving ${type.toUpperCase()}, please try again!`;\n\t\tshowWarning(errorMsg);\n\t\tthrow new Error(errorMsg);\n\t}\n\tconst onExport = options?.onExport || saveAs;\n\tif (options?.dpi) {\n\t\tawait changeDpiBlob(blob, options?.dpi).then((blob: Blob) => {\n\t\t\tonExport(blob, filename);\n\t\t\tif (onExportFinish) onExportFinish();\n\t\t});\n\t} else {\n\t\tonExport(blob, filename);\n\t\tif (onExportFinish) onExportFinish();\n\t}\n}\n\nexport async function takePNGSnapshot(options?: PNG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'PNG_Capture';\n\t\tconst filename = `${name}.png`;\n\t\tawait takeImageSnapshot(filename, PNG, undefined, options);\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport async function takeJPEGSnapshot(options?: JPEG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'JPEG_Capture';\n\t\tconst filename = `${name}.jpg`;\n\t\t// Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n\t\tawait takeImageSnapshot(filename, JPEG, options?.quality || 1, options);\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function recordFrame(capture?: ACTIVE_CAPTURE | ACTIVE_CAPTURE[]) {\n\tlet captures = activeCaptures;\n\tif (capture) {\n\t\tif (!Array.isArray(capture)) {\n\t\t\tcaptures = [capture];\n\t\t} else {\n\t\t\tcaptures = capture;\n\t\t}\n\t}\n\ttry {\n\t\tcheckCanvas();\n\t\tif (captures.length === 0) {\n\t\t\tconst errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst { capturer, type, zipOptions, zipPromises, numFrames } = captures[i];\n\t\t\tif (type === JPEGZIP || type === PNGZIP) {\n\t\t\t\t// Name should correspond to current frame.\n\t\t\t\tconst frameName = `frame_${numFrames + 1}`;\n\t\t\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\t\t\tconst options = {\n\t\t\t\t\t\tdpi: zipOptions?.dpi,\n\t\t\t\t\t\tquality: (zipOptions as JPEG_OPTIONS).quality,\n\t\t\t\t\t\tname: frameName,\n\t\t\t\t\t\tonExport: (blob: Blob, filename: string) => {\n\t\t\t\t\t\t\t(capturer as JSZip).file(filename, blob);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonExportFinish: resolve,\n\t\t\t\t\t\tonError: reject,\n\t\t\t\t\t};\n\t\t\t\t\tif (type === JPEGZIP) {\n\t\t\t\t\t\ttakeJPEGSnapshot(options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttakePNGSnapshot(options);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tzipPromises!.push(promise);\n\t\t\t} else {\n\t\t\t\t(capturer as CCapture).capture(canvas!);\n\t\t\t}\n\t\t\tcaptures[i].numFrames = numFrames + 1\n\t\t}\n\t} catch (error) {\n\t\tlet handled = true;\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst capture = captures[i];\n\t\t\tif (capture.onError) capture.onError(error);\n\t\t\telse handled = false;\n\t\t}\n\t\tif (!captures.length || !handled) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nasync function CCaptureSaveAsync(capturer: CCapture) {\n\treturn new Promise((resolve: (blob: Blob) => void) => {\n\t\tcapturer.save((blob: Blob) => {\n\t\t\tresolve(blob);\n\t\t});\n\t});\n}\n\nasync function stopRecordAtIndex(index: number) {\n\tconst {\n\t\tname,\n\t\tcapturer,\n\t\tnumFrames,\n\t\ttype,\n\t\tzipPromises,\n\t\tonExportProgress,\n\t\tonExport,\n\t\tonExportFinish,\n\t\tonError,\n\t\tffmpegOptions,\n\t} = activeCaptures[index];\n\t// Remove ref to capturer.\n\tactiveCaptures.splice(index, 1);\n\n\tif (type !== PNGZIP && type !== JPEGZIP) (capturer as CCapture).stop();\n\n\tif (numFrames === 0) {\n\t\tconst errorMsg = 'No frames recorded, call CanvasCapture.recordFrame().';\n\t\tshowWarning(errorMsg);\n\t\tthrow new Error(errorMsg);\n\t}\n\n\tswitch (type) {\n\t\tcase MP4:\n\t\t\t{\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\t// Tell the user that mp4s take a sec to process.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'MP4 is processing and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\tawait convertWEBMtoMP4({\n\t\t\t\t\tname,\n\t\t\t\t\tblob,\n\t\t\t\t\tonExportProgress: onExportProgress,\n\t\t\t\t\tonExport: onExport,\n\t\t\t\t\tonExportFinish: onExportFinish,\n\t\t\t\t\tffmpegOptions,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase WEBM:\n\t\t\t{\n\t\t\t\tif (onExportProgress) onExportProgress(0);\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\tif (onExportProgress) onExportProgress(1);// Save is nearly immediate.\n\t\t\t\tconst filename = `${name}.webm`;\n\t\t\t\tif (onExport) {\n\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t} else {\n\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t}\n\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase GIF:\n\t\t\t{\n\t\t\t\t// Tell the user that gifs take a sec to process.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'GIF is processing and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\t// onExportProgress callback already passed to CCapture.\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\tconst filename = `${name}.gif`;\n\t\t\t\tif (onExport) {\n\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t} else {\n\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t}\n\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase PNGZIP:\n\t\tcase JPEGZIP:\n\t\t\t{\n\t\t\t\t// Wait for all frames to finish saving.\n\t\t\t\tawait Promise.all(zipPromises!);\n\t\t\t\t// Tell the user that frames take a sec to zip.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'Frames are being zipped and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\tawait (capturer as JSZip).generateAsync({ type: 'blob' }, (metadata) => {\n\t\t\t\t\tif (onExportProgress) onExportProgress(metadata.percent / 100);\n\t\t\t\t}).then((blob) => {\n\t\t\t\t\tconst filename = `${name}.zip`;\n\t\t\t\t\tif (onExport) {\n\t\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t\t}\n\t\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(`Need to handle saving type ${type}.`);\n\t}\n}\n\nexport async function stopRecord(capture?: ACTIVE_CAPTURE | ACTIVE_CAPTURE[]) {\n\tif (capture && !Array.isArray(capture)) {\n\t\tcapture = [capture];\n\t}\n\tconst captures = capture || activeCaptures;\n\ttry {\n\t\tif (activeCaptures.length === 0) {\n\t\t\tconst errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\n\t\tconst promises: Promise[] = [];\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst index = activeCaptures.indexOf(captures[i]);\n\t\t\tif (index < 0) throw new Error(`Invalid capture ${captures[i]} – may have already been stopped.`);\n\t\t\tpromises.push(stopRecordAtIndex(index));\n\t\t}\n\t\tshowDot(isRecording());\n\t\tawait Promise.all(promises);\n\t} catch (error) {\n\t\tlet handled = true;\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst capture = captures[i];\n\t\t\tif (capture.onError) capture.onError(error);\n\t\t\telse handled = false;\n\t\t}\n\t\tif (!captures.length || !handled) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nfunction activeCapturesOfType(type: CAPTURE_TYPE) {\n\tconst captures: ACTIVE_CAPTURE[] = [];\n\tfor (let i = 0; i < activeCaptures.length; i++) {\n\t\tif (activeCaptures[i].type === type) {\n\t\t\tcaptures.push(activeCaptures[i]);\n\t\t}\n\t}\n\treturn captures;\n}\n\nfunction activeVideoGifCaptures() {\n\treturn activeCapturesOfType(WEBM).concat(activeCapturesOfType(MP4)).concat(activeCapturesOfType(GIF));\n}\n\nexport function isRecording() {\n\treturn activeCaptures.length > 0;\n}\n\nlet ffmpegLoaded = false;\nasync function convertWEBMtoMP4(options: {\n\tname: string,\n\tblob: Blob,\n\tonExportProgress?: (progress: number) => void,\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tffmpegOptions?: { [key: string]: string },\n}) {\n\tif (!ffmpeg) {\n\t\tconst createFFmpeg = require('@ffmpeg/ffmpeg/src/createFFmpeg');\n\t\tffmpeg = createFFmpeg({\n\t\t\tcorePath: ffmpegPath,\n\t\t});\n\t}\n\tif (!ffmpegLoaded) {\n\t\tawait ffmpeg!.load().catch(() => {\n\t\t\tconst errorMsg = 'MP4 export not supported in this browser, try again in the latest version of Chrome.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t});\n\t\tffmpegLoaded = true;\n\t}\n\tconst { name, blob, onExportProgress, onExport, onExportFinish, ffmpegOptions } = options;\n\t// Convert blob to Uint8 array.\n\tconst _data = await blob.arrayBuffer();\n\tconst data = new Uint8Array(_data);\n\t// Write data to MEMFS, need to use Uint8Array for binary data.\n\tffmpeg!.FS('writeFile', `${name}.webm`, data);\n\t// Convert to MP4.\n\t// TODO: onProgress callback is not working quite right yet.\n\t// https://github.com/ffmpegwasm/ffmpeg.wasm/issues/112\n\tif (onExportProgress) ffmpeg!.setProgress(({ ratio }) => {\n\t\tonExportProgress(Math.max(0, Math.min(ratio, 1)));\n\t});\n\t// -vf \"crop=trunc(iw/2)*2:trunc(ih/2)*2\" ensures the dimensions of the mp4 are divisible by 2.\n\t// -c:v libx264 -preset slow -crf 22 encodes as h.264 with better compression settings.\n\t// -pix_fmt yuv420p makes it compatible with the web browser.\n\t// -an creates a video with no audio.\n\tconst defaultFFMPEGOptions = {\n\t\t'-c:v': 'libx264',\n\t\t'-preset': 'slow',\n\t\t'-crf': '22',\n\t\t'-pix_fmt': 'yuv420p',\n\t};\n\tconst combinedOptions: { [key: string]: string } = {...defaultFFMPEGOptions, ...(ffmpegOptions || {})};\n\tconst _ffmpegOptions: string[] = [];\n\tObject.keys(combinedOptions).forEach(key => {\n\t\t_ffmpegOptions.push(key, combinedOptions[key]);\n\t});\n\tconst filename = `${name}.mp4`;\n\tawait ffmpeg!.run(\n\t\t'-i', `${name}.webm`,\n\t\t..._ffmpegOptions,\n\t\t'-vf', 'crop=trunc(iw/2)*2:trunc(ih/2)*2',\n\t\t'-an',\n\t\tfilename,\n\t);\n\tconst output = await ffmpeg!.FS('readFile', filename);\n\tconst outputBlob = new Blob([output], { type: 'video/mp4' });\n\tif (onExport) {\n\t\tonExport(blob, filename);\n\t} else {\n\t\tsaveAs(outputBlob, filename);\n\t}\n\t// Delete files in MEMFS.\n\tffmpeg!.FS('unlink', `${name}.webm`);\n\tffmpeg!.FS('unlink', filename);\n\tif (onExportFinish) onExportFinish();\n}\n\nfunction browserSupportsWEBP() {\n\tconst _canvas = document.createElement('canvas');\n\tconst url = _canvas!.toDataURL('image/webp', { quality: 1 });\n\tif (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction browserSupportsSharedArrayBuffer() {\n\ttry {\n\t\tconst test = new SharedArrayBuffer(1024);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction browserSupportsWebWorkers() {\n\treturn !!window.Worker;\n}\n\nexport function browserSupportsWEBM() {\n\treturn browserSupportsWEBP();\n}\n\nexport function browserSupportsMP4() {\n\t// Also web workers?\n\t// && browserSupportsWebWorkers()\n\treturn browserSupportsWEBP() && browserSupportsSharedArrayBuffer();\n}\n\nexport function browserSupportsGIF() {\n\treturn browserSupportsWebWorkers();\n}","export const css = `\n/**************************\\\n Basic Modal Styles\n\\**************************/\n\n.modal {\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\n}\n\n.modal__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0,0,0,0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.modal__container {\n background-color: #fff;\n padding: 30px;\n max-width: 500px;\n max-height: 100vh;\n overflow-y: auto;\n box-sizing: border-box;\n}\n\n.modal__header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.modal__title {\n margin-top: 0;\n margin-bottom: 0;\n font-weight: 600;\n font-size: 1.25rem;\n line-height: 1.25;\n color: #222;\n box-sizing: border-box;\n}\n\n.modal__footer {\n text-align: right;\n}\n\n.modal__footer>.modal__btn {\n margin-right: 8px;\n}\n\n.modal__close {\n background: transparent;\n border: 0;\n}\n\n.modal__header .modal__close:before { content: \"\\u2715\"; }\n\n.modal__content {\n margin-top: 2rem;\n margin-bottom: 2rem;\n line-height: 1.5;\n color: rgba(0,0,0,.8);\n}\n\n.modal__btn {\n font-size: .875rem;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: .5rem;\n padding-bottom: .5rem;\n background-color: #e6e6e6;\n color: rgba(0,0,0,.8);\n border-radius: .25rem;\n border-style: none;\n border-width: 0;\n cursor: pointer;\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n line-height: 1.15;\n margin: 0;\n will-change: transform;\n -moz-osx-font-smoothing: grayscale;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n transition: -webkit-transform .25s ease-out;\n transition: transform .25s ease-out;\n transition: transform .25s ease-out,-webkit-transform .25s ease-out;\n}\n\n.modal__btn:focus, .modal__btn:hover {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n}\n\n.modal__btn-primary {\n background-color: #333;\n color: #fff;\n}\n\n\n\n/**************************\\\n Demo Animation Style\n\\**************************/\n@keyframes mmfadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes mmfadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes mmslideIn {\n from { transform: translateY(15%); }\n to { transform: translateY(0); }\n}\n\n@keyframes mmslideOut {\n from { transform: translateY(0); }\n to { transform: translateY(-10%); }\n}\n\n.micromodal-slide {\n display: none;\n}\n\n.micromodal-slide.is-open {\n display: block;\n}\n\n.micromodal-slide[aria-hidden=\"false\"] .modal__overlay {\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"false\"] .modal__container {\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"true\"] .modal__overlay {\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"true\"] .modal__container {\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide .modal__container,\n.micromodal-slide .modal__overlay {\n will-change: transform;\n}\n`\n","import MicroModal from 'micromodal';\nimport { css } from './micromodal.css';\nimport { PARAMS } from './params';\n\n// Add modal styling.\nconst style = document.createElement('style');\nstyle.textContent = css;\ndocument.head.append(style);\n\nfunction initModalHTML(modalID: string, title: string, content: string = '') {\n\tconst modalString =\n\t`
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t${title}\n\t\t\t\t

\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t${content}\n\t\t\t\t

\n\t\t\t
\n\t\t
\n\t\t
\n\t
`;\n\t// This is a trick to create an element from string.\n\tconst temp = document.createElement('div');\n\ttemp.innerHTML = modalString;\n\treturn temp.firstChild as Node;\n};\n\nlet alertModalInited = false;\nlet dialogModalInited = false;\n\nconst ALERT_MODAL_ID = 'alert';\nconst alertModal = initModalHTML(ALERT_MODAL_ID, 'Warning');\n\nconst DIALOG_MODAL_ID = 'dialog';\nconst dialogModal = initModalHTML(DIALOG_MODAL_ID, 'Saving...');\n\nexport function showWarning(message: string) {\n\tconsole.warn(message);\n\tif (!PARAMS.SHOW_ALERTS) {\n\t\treturn;\n\t}\n\tif (!alertModalInited) {\n\t\talertModalInited = true;\n\t\tdocument.getElementsByTagName('body')[0].appendChild(alertModal);\n\t}\n\t(document.getElementById(`modal-${ALERT_MODAL_ID}-content`) as HTMLElement).innerHTML = message;\n\tMicroModal.show(`modal-${ALERT_MODAL_ID}`);\n}\n\nexport function showDialog(title: string, message: string, options?: {\n\tautoCloseDelay?: number,\n}) {\n\tif (PARAMS.VERBOSE) console.log(title, message);\n\tif (!PARAMS.SHOW_DIALOGS) {\n\t\treturn;\n\t}\n\tif (!dialogModalInited) {\n\t\tdialogModalInited = true;\n\t\tdocument.getElementsByTagName('body')[0].appendChild(dialogModal);\n\t}\n\t(document.getElementById(`modal-${DIALOG_MODAL_ID}-title`) as HTMLElement).innerHTML = title;\n\t(document.getElementById(`modal-${DIALOG_MODAL_ID}-content`) as HTMLElement).innerHTML = message;\n\tMicroModal.show(`modal-${DIALOG_MODAL_ID}`);\n\tconst autoCloseDelay = options?.autoCloseDelay !== undefined ? options.autoCloseDelay : -1;\n\tif (autoCloseDelay > 0) {\n\t\tsetTimeout(() => {\n\t\t\tMicroModal.close(`modal-${DIALOG_MODAL_ID}`);\n\t\t}, autoCloseDelay);\n\t}\n}\n\n// Create record red dot vis to overlay when recording is happening.\nconst dot = document.createElement('div');\nexport function initDotWithCSS(css?: {[key: string]: string}){\n\tdot.id = 'recordingDot';\n\tconst dotCSS = {\n\t\tbackground: \"red\",\n\t\twidth: \"20px\",\n\t\theight: \"20px\",\n\t\t\"border-radius\": \"50%\",\n\t\tdisplay: \"none\",\n\t\tposition: \"absolute\",\n\t\ttop: \"0\",\n\t\tright: \"0\",\n\t\t\"z-index\": \"10\",\n\t\tmargin: \"20px\",\n\t\t...css,\n\t};\n\tObject.assign(dot.style, dotCSS);\n\tdocument.getElementsByTagName('body')[0].appendChild(dot);\n}\n\nexport function showDot(visible: boolean) {\n\tif (!PARAMS.SHOW_REC_DOT) return;\n\tif (visible) {\n\t\tdot.style.display = \"inline-block\";\n\t} else {\n\t\tdot.style.display = \"none\";\n\t}\n}","// Params.\nexport const PARAMS = {\n\tVERBOSE: false,\n\tSHOW_ALERTS: false,\n\tSHOW_DIALOGS: false,\n\tSHOW_REC_DOT: false,\n};",";(function() {\r\n\r\nif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\r\n var Tar = require('./tar.js');\r\n var download = require('./download.js');\r\n var GIF = require('./gif.js');\r\n var WebMWriter = require('./webm-writer-0.2.0');\r\n}\r\n\r\n\"use strict\";\r\n\r\nvar objectTypes = {\r\n'function': true,\r\n'object': true\r\n};\r\n\r\nfunction checkGlobal(value) {\r\n return (value && value.Object === Object) ? value : null;\r\n }\r\n\r\n/** Built-in method references without a dependency on `root`. */\r\nvar freeParseFloat = parseFloat,\r\n freeParseInt = parseInt;\r\n\r\n/** Detect free variable `exports`. */\r\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\r\n? exports\r\n: undefined;\r\n\r\n/** Detect free variable `module`. */\r\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\r\n? module\r\n: undefined;\r\n\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = (freeModule && freeModule.exports === freeExports)\r\n? freeExports\r\n: undefined;\r\n\r\n/** Detect free variable `global` from Node.js. */\r\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\r\n\r\n/** Detect free variable `self`. */\r\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\r\n\r\n/** Detect free variable `window`. */\r\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\r\n\r\n/** Detect `this` as the global object. */\r\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\r\n\r\n/**\r\n* Used as a reference to the global object.\r\n*\r\n* The `this` value is used if it's the global object to avoid Greasemonkey's\r\n* restricted `window` object, otherwise the `window` object is used.\r\n*/\r\nvar root = freeGlobal ||\r\n((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\r\n freeSelf || thisGlobal || Function('return this')();\r\n\r\nif( !('gc' in window ) ) {\r\n\twindow.gc = function(){}\r\n}\r\n\r\nif (!HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\r\n\t\tthis.count++;\r\n\t\tthis.step();\r\n\t}.bind( this );\r\n\tfileReader.readAsArrayBuffer(blob);\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.save = function( callback ) {\r\n\r\n\tcallback( this.tape.save() );\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.dispose = function() {\r\n\r\n\tthis.tape = new Tar();\r\n\tthis.count = 0;\r\n\r\n}\r\n\r\nfunction CCPNGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/png';\r\n\tthis.fileExtension = '.png';\r\n\r\n}\r\n\r\nCCPNGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCPNGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type )\r\n\r\n}\r\n\r\nfunction CCJPEGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/jpeg';\r\n\tthis.fileExtension = '.jpg';\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n}\r\n\r\nCCJPEGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCJPEGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type, this.quality )\r\n\r\n}\r\n\r\n/*\r\n\r\n\tWebM Encoder\r\n\r\n*/\r\n\r\nfunction CCWebMEncoder( settings ) {\r\n\r\n\tvar canvas = document.createElement( 'canvas' );\r\n\tif( canvas.toDataURL( 'image/webp' ).substr(5,10) !== 'image/webp' ){\r\n\t\tconsole.log( \"WebP not supported - try another export format\" )\r\n\t}\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.extension = '.webm'\r\n\tthis.mimeType = 'video/webm'\r\n\tthis.baseFilename = this.filename;\r\n\r\n\tthis.frames = [];\r\n\tthis.part = 1;\r\n\r\n this.videoWriter = new WebMWriter({\r\n quality: this.quality,\r\n fileWriter: null,\r\n fd: null,\r\n frameRate: settings.framerate\r\n});\r\n\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCWebMEncoder.prototype.start = function( canvas ) {\r\n\r\n\tthis.dispose();\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.add = function( canvas ) {\r\n\r\n this.videoWriter.addFrame(canvas);\r\n\r\n\t//this.frames.push( canvas.toDataURL('image/webp', this.quality) );\r\n\r\n\tif( this.settings.autoSaveTime > 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\t\tthis.save( function( blob ) {\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tdownload( blob, this.filename + this.extension, this.mimeType );\r\n\t\t\tthis.dispose();\r\n\t\t\tthis.part++;\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tthis.step();\r\n\t\t}.bind( this ) )\r\n\t} else {\r\n\t\tthis.step();\r\n\t}\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.save = function( callback ) {\r\n\r\n//\tif( !this.frames.length ) return;\r\n\r\n this.videoWriter.complete().then(callback);\r\n\r\n\t/*var webm = Whammy.fromImageArray( this.frames, this.settings.framerate )\r\n\tvar blob = new Blob( [ webm ], { type: \"octet/stream\" } );\r\n\tcallback( blob );*/\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.dispose = function( canvas ) {\r\n\r\n\tthis.frames = [];\r\n\r\n}\r\n\r\nfunction CCFFMpegServerEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.encoder = new FFMpegServer.Video( settings );\r\n this.encoder.on( 'process', function() {\r\n this.emit( 'process' )\r\n }.bind( this ) );\r\n this.encoder.on('finished', function( url, size ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( url, size );\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'error', function( data ) {\r\n alert(JSON.stringify(data, null, 2));\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCFFMpegServerEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start( this.settings );\r\n\r\n};\r\n\r\nCCFFMpegServerEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.encoder.add( canvas );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n this.encoder.end();\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.safeToProceed = function() {\r\n return this.encoder.safeToProceed();\r\n};\r\n\r\n/*\r\n\tHTMLCanvasElement.captureStream()\r\n*/\r\n\r\nfunction CCStreamEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.framerate = this.settings.framerate;\r\n\tthis.type = 'video/webm';\r\n\tthis.extension = '.webm';\r\n\tthis.stream = null;\r\n\tthis.mediaRecorder = null;\r\n\tthis.chunks = [];\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCStreamEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.stream ) {\r\n\t\tthis.stream = canvas.captureStream( this.framerate );\r\n\t\tthis.mediaRecorder = new MediaRecorder( this.stream );\r\n\t\tthis.mediaRecorder.start();\r\n\r\n\t\tthis.mediaRecorder.ondataavailable = function(e) {\r\n\t\t\tthis.chunks.push(e.data);\r\n\t\t}.bind( this );\r\n\r\n\t}\r\n\tthis.step();\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype.save = function( callback ) {\r\n\r\n\tthis.mediaRecorder.onstop = function( e ) {\r\n\t\tvar blob = new Blob( this.chunks, { 'type' : 'video/webm' });\r\n\t\tthis.chunks = [];\r\n\t\tcallback( blob );\r\n\r\n\t}.bind( this );\r\n\r\n\tthis.mediaRecorder.stop();\r\n\r\n}\r\n\r\n/*function CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this );\r\n\r\n\tsettings.quality = settings.quality || 6;\r\n\tthis.settings = settings;\r\n\r\n\tthis.encoder = new GIFEncoder();\r\n\tthis.encoder.setRepeat( 1 );\r\n \tthis.encoder.setDelay( settings.step );\r\n \tthis.encoder.setQuality( 6 );\r\n \tthis.encoder.setTransparent( null );\r\n \tthis.encoder.setSize( 150, 150 );\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder );\r\n\r\nCCGIFEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\tthis.encoder.addFrame( this.ctx );\r\n\r\n\tthis.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.stop = function() {\r\n\r\n\tthis.encoder.finish();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n\tvar binary_gif = this.encoder.stream().getData();\r\n\r\n\tvar data_url = 'data:image/gif;base64,'+encode64(binary_gif);\r\n\twindow.location = data_url;\r\n\treturn;\r\n\r\n\tvar blob = new Blob( [ binary_gif ], { type: \"octet/stream\" } );\r\n\tvar url = window.URL.createObjectURL( blob );\r\n\tcallback( url );\r\n\r\n}*/\r\n\r\nfunction CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = 31 - ( ( settings.quality * 30 / 100 ) || 10 );\r\n\tsettings.workers = settings.workers || 4;\r\n\r\n\tthis.extension = '.gif'\r\n\tthis.mimeType = 'image/gif'\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n \tthis.sizeSet = false;\r\n\r\n \tthis.encoder = new GIF({\r\n\t\tworkers: settings.workers,\r\n\t\tquality: settings.quality,\r\n\t\tworkerScript: settings.workersPath,\r\n\t} );\r\n\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n\r\n this.encoder.on('finished', function( blob ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( blob );\r\n }\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.sizeSet ) {\r\n\t\tthis.encoder.setOption( 'width',canvas.width );\r\n\t\tthis.encoder.setOption( 'height',canvas.height );\r\n\t\tthis.sizeSet = true;\r\n\t}\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\r\n\tthis.encoder.addFrame( this.ctx, { copy: true, delay: this.settings.step } );\r\n\tthis.step();\r\n\r\n\t/*this.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );*/\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n\r\n\tthis.encoder.render();\r\n\r\n}\r\n\r\nfunction CCapture( settings ) {\r\n\r\n\tvar _settings = settings || {},\r\n\t\t_date = new Date(),\r\n\t\t_verbose,\r\n\t\t_display,\r\n\t\t_time,\r\n\t\t_startTime,\r\n\t\t_performanceTime,\r\n\t\t_performanceStartTime,\r\n\t\t_step,\r\n _encoder,\r\n\t\t_timeouts = [],\r\n\t\t_intervals = [],\r\n\t\t_frameCount = 0,\r\n\t\t_intermediateFrameCount = 0,\r\n\t\t_lastFrame = null,\r\n\t\t_requestAnimationFrameCallbacks = [],\r\n\t\t_capturing = false,\r\n _handlers = {};\r\n\r\n\t_settings.framerate = _settings.framerate || 60;\r\n\t_settings.motionBlurFrames = 2 * ( _settings.motionBlurFrames || 1 );\r\n\t_verbose = _settings.verbose || false;\r\n\t_display = _settings.display || false;\r\n\t_settings.step = 1000.0 / _settings.framerate ;\r\n\t_settings.timeLimit = _settings.timeLimit || 0;\r\n\t_settings.frameLimit = _settings.frameLimit || 0;\r\n\t_settings.startTime = _settings.startTime || 0;\r\n\r\n\tvar _timeDisplay = document.createElement( 'div' );\r\n\t_timeDisplay.style.position = 'absolute';\r\n\t_timeDisplay.style.left = _timeDisplay.style.top = 0\r\n\t_timeDisplay.style.backgroundColor = 'black';\r\n\t_timeDisplay.style.fontFamily = 'monospace'\r\n\t_timeDisplay.style.fontSize = '11px'\r\n\t_timeDisplay.style.padding = '5px'\r\n\t_timeDisplay.style.color = 'red';\r\n\t_timeDisplay.style.zIndex = 100000\r\n\tif( _settings.display ) document.body.appendChild( _timeDisplay );\r\n\r\n\tvar canvasMotionBlur = document.createElement( 'canvas' );\r\n\tvar ctxMotionBlur = canvasMotionBlur.getContext( '2d' );\r\n\tvar bufferMotionBlur;\r\n\tvar imageData;\r\n\r\n\t_log( 'Step is set to ' + _settings.step + 'ms' );\r\n\r\n var _encoders = {\r\n\t\tgif: CCGIFEncoder,\r\n\t\twebm: CCWebMEncoder,\r\n\t\tffmpegserver: CCFFMpegServerEncoder,\r\n\t\tpng: CCPNGEncoder,\r\n\t\tjpg: CCJPEGEncoder,\r\n\t\t'webm-mediarecorder': CCStreamEncoder\r\n };\r\n\r\n var ctor = _encoders[ _settings.format ];\r\n if ( !ctor ) {\r\n\t\tthrow \"Error: Incorrect or missing format: Valid formats are \" + Object.keys(_encoders).join(\", \");\r\n }\r\n _encoder = new ctor( _settings );\r\n _encoder.step = _step\r\n\r\n\t_encoder.on('process', _process);\r\n _encoder.on('progress', _progress);\r\n\r\n if (\"performance\" in window == false) {\r\n \twindow.performance = {};\r\n }\r\n\r\n\tDate.now = (Date.now || function () { // thanks IE8\r\n\t\treturn new Date().getTime();\r\n\t});\r\n\r\n\tif (\"now\" in window.performance == false){\r\n\r\n\t\tvar nowOffset = Date.now();\r\n\r\n\t\tif (performance.timing && performance.timing.navigationStart){\r\n\t\t\tnowOffset = performance.timing.navigationStart\r\n\t\t}\r\n\r\n\t\twindow.performance.now = function now(){\r\n\t\t\treturn Date.now() - nowOffset;\r\n\t\t}\r\n\t}\r\n\r\n\tvar _oldSetTimeout = window.setTimeout,\r\n\t\t_oldSetInterval = window.setInterval,\r\n\t \t_oldClearInterval = window.clearInterval,\r\n\t\t_oldClearTimeout = window.clearTimeout,\r\n\t\t_oldRequestAnimationFrame = window.requestAnimationFrame,\r\n\t\t_oldNow = window.Date.now,\r\n\t\t_oldPerformanceNow = window.performance.now,\r\n\t\t_oldGetTime = window.Date.prototype.getTime;\r\n\t// Date.prototype._oldGetTime = Date.prototype.getTime;\r\n\r\n\tvar media = [];\r\n\r\n\tfunction _init() {\r\n\r\n\t\t_log( 'Capturer start' );\r\n\r\n\t\t_startTime = window.Date.now();\r\n\t\t_time = _startTime + _settings.startTime;\r\n\t\t_performanceStartTime = window.performance.now();\r\n\t\t_performanceTime = _performanceStartTime + _settings.startTime;\r\n\r\n\t\twindow.Date.prototype.getTime = function(){\r\n\t\t\treturn _time;\r\n\t\t};\r\n\t\twindow.Date.now = function() {\r\n\t\t\treturn _time;\r\n\t\t};\r\n\r\n\t\twindow.setTimeout = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_timeouts.push( t );\r\n\t\t\t_log( 'Timeout set to ' + t.time );\r\n return t;\r\n\t\t};\r\n\t\twindow.clearTimeout = function( id ) {\r\n\t\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\t\tif( _timeouts[ j ] == id ) {\r\n\t\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\t\t_log( 'Timeout cleared' );\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\twindow.setInterval = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_intervals.push( t );\r\n\t\t\t_log( 'Interval set to ' + t.time );\r\n\t\t\treturn t;\r\n\t\t};\r\n\t\twindow.clearInterval = function( id ) {\r\n\t\t\t_log( 'clear Interval' );\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\twindow.requestAnimationFrame = function( callback ) {\r\n\t\t\t_requestAnimationFrameCallbacks.push( callback );\r\n\t\t};\r\n\t\twindow.performance.now = function(){\r\n\t\t\treturn _performanceTime;\r\n\t\t};\r\n\r\n\t\tfunction hookCurrentTime() {\r\n\t\t\tif( !this._hooked ) {\r\n\t\t\t\tthis._hooked = true;\r\n\t\t\t\tthis._hookedTime = this.currentTime || 0;\r\n\t\t\t\tthis.pause();\r\n\t\t\t\tmedia.push( this );\r\n\t\t\t}\r\n\t\t\treturn this._hookedTime + _settings.startTime;\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tObject.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t\tObject.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t} catch (err) {\r\n\t\t\t_log(err);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _start() {\r\n\t\t_init();\r\n\t\t_encoder.start();\r\n\t\t_capturing = true;\r\n\t}\r\n\r\n\tfunction _stop() {\r\n\t\t_capturing = false;\r\n\t\t_encoder.stop();\r\n\t\t_destroy();\r\n\t}\r\n\r\n\tfunction _call( fn, p ) {\r\n\t\t_oldSetTimeout( fn, 0, p );\r\n\t}\r\n\r\n\tfunction _step() {\r\n\t\t//_oldRequestAnimationFrame( _process );\r\n\t\t_call( _process );\r\n\t}\r\n\r\n\tfunction _destroy() {\r\n\t\t_log( 'Capturer stop' );\r\n\t\twindow.setTimeout = _oldSetTimeout;\r\n\t\twindow.setInterval = _oldSetInterval;\r\n\t\twindow.clearInterval = _oldClearInterval;\r\n\t\twindow.clearTimeout = _oldClearTimeout;\r\n\t\twindow.requestAnimationFrame = _oldRequestAnimationFrame;\r\n\t\twindow.Date.prototype.getTime = _oldGetTime;\r\n\t\twindow.Date.now = _oldNow;\r\n\t\twindow.performance.now = _oldPerformanceNow;\r\n\t}\r\n\r\n\tfunction _updateTime() {\r\n\t\tvar seconds = _frameCount / _settings.framerate;\r\n\t\tif( ( _settings.frameLimit && _frameCount >= _settings.frameLimit ) || ( _settings.timeLimit && seconds >= _settings.timeLimit ) ) {\r\n\t\t\t_stop();\r\n\t\t\t_save();\r\n\t\t}\r\n\t\tvar d = new Date( null );\r\n\t\td.setSeconds( seconds );\r\n\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames (' + _intermediateFrameCount + ' inter) | ' + d.toISOString().substr( 11, 8 );\r\n\t\t} else {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames | ' + d.toISOString().substr( 11, 8 );\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _checkFrame( canvas ) {\r\n\r\n\t\tif( canvasMotionBlur.width !== canvas.width || canvasMotionBlur.height !== canvas.height ) {\r\n\t\t\tcanvasMotionBlur.width = canvas.width;\r\n\t\t\tcanvasMotionBlur.height = canvas.height;\r\n\t\t\tbufferMotionBlur = new Uint16Array( canvasMotionBlur.height * canvasMotionBlur.width * 4 );\r\n\t\t\tctxMotionBlur.fillStyle = '#0'\r\n\t\t\tctxMotionBlur.fillRect( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _blendFrame( canvas ) {\r\n\r\n\t\t//_log( 'Intermediate Frame: ' + _intermediateFrameCount );\r\n\r\n\t\tctxMotionBlur.drawImage( canvas, 0, 0 );\r\n\t\timageData = ctxMotionBlur.getImageData( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] += imageData.data[ j ];\r\n\t\t\tbufferMotionBlur[ j + 1 ] += imageData.data[ j + 1 ];\r\n\t\t\tbufferMotionBlur[ j + 2 ] += imageData.data[ j + 2 ];\r\n\t\t}\r\n\t\t_intermediateFrameCount++;\r\n\r\n\t}\r\n\r\n\tfunction _saveFrame(){\r\n\r\n\t\tvar data = imageData.data;\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tdata[ j ] = bufferMotionBlur[ j ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 1 ] = bufferMotionBlur[ j + 1 ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 2 ] = bufferMotionBlur[ j + 2 ] * 2 / _settings.motionBlurFrames;\r\n\t\t}\r\n\t\tctxMotionBlur.putImageData( imageData, 0, 0 );\r\n\t\t_encoder.add( canvasMotionBlur );\r\n\t\t_frameCount++;\r\n\t\t_intermediateFrameCount = 0;\r\n\t\t_log( 'Full MB Frame! ' + _frameCount + ' ' + _time );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 1 ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 2 ] = 0;\r\n\t\t}\r\n\t\tgc();\r\n\r\n\t}\r\n\r\n\tfunction _capture( canvas ) {\r\n\r\n\t\tif( _capturing ) {\r\n\r\n\t\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\r\n\t\t\t\t_checkFrame( canvas );\r\n\t\t\t\t_blendFrame( canvas );\r\n\r\n\t\t\t\tif( _intermediateFrameCount >= .5 * _settings.motionBlurFrames ) {\r\n\t\t\t\t\t_saveFrame();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_step();\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t_encoder.add( canvas );\r\n\t\t\t\t_frameCount++;\r\n\t\t\t\t_log( 'Full Frame! ' + _frameCount );\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _process() {\r\n\r\n\t\tvar step = 1000 / _settings.framerate;\r\n\t\tvar dt = ( _frameCount + _intermediateFrameCount / _settings.motionBlurFrames ) * step;\r\n\r\n\t\t_time = _startTime + dt;\r\n\t\t_performanceTime = _performanceStartTime + dt;\r\n\r\n\t\tmedia.forEach( function( v ) {\r\n\t\t\tv._hookedTime = dt / 1000;\r\n\t\t} );\r\n\r\n\t\t_updateTime();\r\n\t\t_log( 'Frame: ' + _frameCount + ' ' + _intermediateFrameCount );\r\n\r\n\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\tif( _time >= _timeouts[ j ].triggerTime ) {\r\n\t\t\t\t_call( _timeouts[ j ].callback )\r\n\t\t\t\t//console.log( 'timeout!' );\r\n\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor( var j = 0; j < _intervals.length; j++ ) {\r\n\t\t\tif( _time >= _intervals[ j ].triggerTime ) {\r\n\t\t\t\t_call( _intervals[ j ].callback );\r\n\t\t\t\t_intervals[ j ].triggerTime += _intervals[ j ].time;\r\n\t\t\t\t//console.log( 'interval!' );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_requestAnimationFrameCallbacks.forEach( function( cb ) {\r\n \t\t_call( cb, _time - g_startTime );\r\n } );\r\n _requestAnimationFrameCallbacks = [];\r\n\r\n\t}\r\n\r\n\tfunction _save( callback ) {\r\n\r\n\t\tif( !callback ) {\r\n\t\t\tcallback = function( blob ) {\r\n\t\t\t\tdownload( blob, _encoder.filename + _encoder.extension, _encoder.mimeType );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t_encoder.save( callback );\r\n\r\n\t}\r\n\r\n\tfunction _log( message ) {\r\n\t\tif( _verbose ) console.log( message );\r\n\t}\r\n\r\n function _on( event, handler ) {\r\n\r\n _handlers[event] = handler;\r\n\r\n }\r\n\r\n function _emit( event ) {\r\n\r\n var handler = _handlers[event];\r\n if ( handler ) {\r\n\r\n handler.apply( null, Array.prototype.slice.call( arguments, 1 ) );\r\n\r\n }\r\n\r\n }\r\n\r\n function _progress( progress ) {\r\n\r\n _emit( 'progress', progress );\r\n\r\n }\r\n\r\n\treturn {\r\n\t\tstart: _start,\r\n\t\tcapture: _capture,\r\n\t\tstop: _stop,\r\n\t\tsave: _save,\r\n on: _on\r\n\t}\r\n}\r\n\r\n(freeWindow || freeSelf || {}).CCapture = CCapture;\r\n\r\n // Some AMD build optimizers like r.js check for condition patterns like the following:\r\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\r\n // Define as an anonymous module so, through path mapping, it can be\r\n // referenced as the \"underscore\" module.\r\n define(function() {\r\n \treturn CCapture;\r\n });\r\n}\r\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\r\n else if (freeExports && freeModule) {\r\n // Export for Node.js.\r\n if (moduleExports) {\r\n \t(freeModule.exports = CCapture).CCapture = CCapture;\r\n }\r\n // Export for CommonJS support.\r\n freeExports.CCapture = CCapture;\r\n}\r\nelse {\r\n // Export to the global object.\r\n root.CCapture = CCapture;\r\n}\r\n\r\n}());\r\n","//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime\n// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs\n// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support\n\n// data can be a string, Blob, File, or dataURL\n\n\n\n\nfunction download(data, strFileName, strMimeType) {\n\n\tvar self = window, // this script is only for browsers anyway...\n\t\tu = \"application/octet-stream\", // this default mime also triggers iframe downloads\n\t\tm = strMimeType || u,\n\t\tx = data,\n\t\tD = document,\n\t\ta = D.createElement(\"a\"),\n\t\tz = function(a){return String(a);},\n\n\n\t\tB = self.Blob || self.MozBlob || self.WebKitBlob || z,\n\t\tBB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,\n\t\tfn = strFileName || \"download\",\n\t\tblob,\n\t\tb,\n\t\tua,\n\t\tfr;\n\n\t//if(typeof B.bind === 'function' ){ B=B.bind(self); }\n\n\tif(String(this)===\"true\"){ //reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n\t\tx=[x, m];\n\t\tm=x[0];\n\t\tx=x[1];\n\t}\n\n\n\n\t//go ahead and download dataURLs right away\n\tif(String(x).match(/^data\\:[\\w+\\-]+\\/[\\w+\\-]+[,;]/)){\n\t\treturn navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:\n\t\t\tnavigator.msSaveBlob(d2b(x), fn) :\n\t\t\tsaver(x) ; // everyone else can save dataURLs un-processed\n\t}//end if dataURL passed?\n\n\ttry{\n\n\t\tblob = x instanceof B ?\n\t\t\tx :\n\t\t\tnew B([x], {type: m}) ;\n\t}catch(y){\n\t\tif(BB){\n\t\t\tb = new BB();\n\t\t\tb.append([x]);\n\t\t\tblob = b.getBlob(m); // the blob\n\t\t}\n\n\t}\n\n\n\n\tfunction d2b(u) {\n\t\tvar p= u.split(/[:;,]/),\n\t\tt= p[1],\n\t\tdec= p[2] == \"base64\" ? atob : decodeURIComponent,\n\t\tbin= dec(p.pop()),\n\t\tmx= bin.length,\n\t\ti= 0,\n\t\tuia= new Uint8Array(mx);\n\n\t\tfor(i;i0&&this._events[type].length>m){this._events[type].warned=true;console.error(\"(node) warning: possible EventEmitter memory \"+\"leak detected. %d listeners added. \"+\"Use emitter.setMaxListeners() to increase limit.\",this._events[type].length);if(typeof console.trace===\"function\"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key===\"removeListener\")continue;this.removeAllListeners(key)}this.removeAllListeners(\"removeListener\");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg===\"function\"}function isNumber(arg){return typeof arg===\"number\"}function isObject(arg){return typeof arg===\"object\"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require(\"./TypedNeuQuant.js\");var LZWEncoder=require(\"./LZWEncoder.js\");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv=\"\";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither=\"FloydSteinberg\";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes(\"GIF89a\")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace(\"-serpentine\",\"\"),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes(\"NETSCAPE2.0\");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{\"./LZWEncoder.js\":3,\"./TypedNeuQuant.js\":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit(\"start\");return this.emit(\"progress\",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log(\"killing active worker\");worker.terminate()}this.running=false;return this.emit(\"abort\")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log(\"spawning worker \"+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log(\"frame \"+frame.index+\" finished - \"+this.activeWorkers.length+\" active\");this.finishedFrames++;this.emit(\"progress\",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log(\"global palette analyzed\");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log(\"starting frame \"+(task.index+1)+\" of \"+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement(\"canvas\");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext(\"2d\");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name===\"chrome\"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error(\"Invalid frame\")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{\"./GIFEncoder.js\":2,\"./browser.coffee\":5,\"./gif.worker.coffee\":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require(\"./GIFEncoder.js\");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n\t\t};\n\n\t\t// go through the array every three bytes, we'll deal with trailing stuff later\n\t\tfor (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n\t\t\ttemp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);\n\t\t\toutput += tripletToBase64(temp);\n\t\t}\n\n\t\t// this prevents an ERR_INVALID_URL in Chrome (Firefox okay)\n\t\tswitch (output.length % 4) {\n\t\t\tcase 1:\n\t\t\t\toutput += '=';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\toutput += '==';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\twindow.utils = {}\n\twindow.utils.clean = clean;\n\twindow.utils.pad = pad;\n\twindow.utils.extend = extend;\n\twindow.utils.stringToUint8 = stringToUint8;\n\twindow.utils.uint8ToBase64 = uint8ToBase64;\n}());\n\n(function () {\n\t\"use strict\";\n\n/*\nstruct posix_header { // byte offset\n\tchar name[100]; // 0\n\tchar mode[8]; // 100\n\tchar uid[8]; // 108\n\tchar gid[8]; // 116\n\tchar size[12]; // 124\n\tchar mtime[12]; // 136\n\tchar chksum[8]; // 148\n\tchar typeflag; // 156\n\tchar linkname[100]; // 157\n\tchar magic[6]; // 257\n\tchar version[2]; // 263\n\tchar uname[32]; // 265\n\tchar gname[32]; // 297\n\tchar devmajor[8]; // 329\n\tchar devminor[8]; // 337\n\tchar prefix[155]; // 345\n // 500\n};\n*/\n\n\tvar utils = window.utils,\n\t\theaderFormat;\n\n\theaderFormat = [\n\t\t{\n\t\t\t'field': 'fileName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'fileMode',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'uid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'gid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'fileSize',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'mtime',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'checksum',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'type',\n\t\t\t'length': 1\n\t\t},\n\t\t{\n\t\t\t'field': 'linkName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'ustar',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'owner',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'group',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'majorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'minorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'filenamePrefix',\n\t\t\t'length': 155\n\t\t},\n\t\t{\n\t\t\t'field': 'padding',\n\t\t\t'length': 12\n\t\t}\n\t];\n\n\tfunction formatHeader(data, cb) {\n\t\tvar buffer = utils.clean(512),\n\t\t\toffset = 0;\n\n\t\theaderFormat.forEach(function (value) {\n\t\t\tvar str = data[value.field] || \"\",\n\t\t\t\ti, length;\n\n\t\t\tfor (i = 0, length = str.length; i < length; i += 1) {\n\t\t\t\tbuffer[offset] = str.charCodeAt(i);\n\t\t\t\toffset += 1;\n\t\t\t}\n\n\t\t\toffset += value.length - i; // space it out with nulls\n\t\t});\n\n\t\tif (typeof cb === 'function') {\n\t\t\treturn cb(buffer, offset);\n\t\t}\n\t\treturn buffer;\n\t}\n\n\twindow.header = {}\n\twindow.header.structure = headerFormat;\n\twindow.header.format = formatHeader;\n}());\n\n(function () {\n\t\"use strict\";\n\n\tvar header = window.header,\n\t\tutils = window.utils,\n\t\trecordSize = 512,\n\t\tblockSize;\n\n\tfunction Tar(recordsPerBlock) {\n\t\tthis.written = 0;\n\t\tblockSize = (recordsPerBlock || 20) * recordSize;\n\t\tthis.out = utils.clean(blockSize);\n\t\tthis.blocks = [];\n\t\tthis.length = 0;\n\t}\n\n\tTar.prototype.append = function (filepath, input, opts, callback) {\n\t\tvar data,\n\t\t\tchecksum,\n\t\t\tmode,\n\t\t\tmtime,\n\t\t\tuid,\n\t\t\tgid,\n\t\t\theaderArr;\n\n\t\tif (typeof input === 'string') {\n\t\t\tinput = utils.stringToUint8(input);\n\t\t} else if (input.constructor !== Uint8Array.prototype.constructor) {\n\t\t\tthrow 'Invalid input type. You gave me: ' + input.constructor.toString().match(/function\\s*([$A-Za-z_][0-9A-Za-z_]*)\\s*\\(/)[1];\n\t\t}\n\n\t\tif (typeof opts === 'function') {\n\t\t\tcallback = opts;\n\t\t\topts = {};\n\t\t}\n\n\t\topts = opts || {};\n\n\t\tmode = opts.mode || parseInt('777', 8) & 0xfff;\n\t\tmtime = opts.mtime || Math.floor(+new Date() / 1000);\n\t\tuid = opts.uid || 0;\n\t\tgid = opts.gid || 0;\n\n\t\tdata = {\n\t\t\tfileName: filepath,\n\t\t\tfileMode: utils.pad(mode, 7),\n\t\t\tuid: utils.pad(uid, 7),\n\t\t\tgid: utils.pad(gid, 7),\n\t\t\tfileSize: utils.pad(input.length, 11),\n\t\t\tmtime: utils.pad(mtime, 11),\n\t\t\tchecksum: ' ',\n\t\t\ttype: '0', // just a file\n\t\t\tustar: 'ustar ',\n\t\t\towner: opts.owner || '',\n\t\t\tgroup: opts.group || ''\n\t\t};\n\n\t\t// calculate the checksum\n\t\tchecksum = 0;\n\t\tObject.keys(data).forEach(function (key) {\n\t\t\tvar i, value = data[key], length;\n\n\t\t\tfor (i = 0, length = value.length; i < length; i += 1) {\n\t\t\t\tchecksum += value.charCodeAt(i);\n\t\t\t}\n\t\t});\n\n\t\tdata.checksum = utils.pad(checksum, 6) + \"\\u0000 \";\n\n\t\theaderArr = header.format(data);\n\n\t\tvar headerLength = Math.ceil( headerArr.length / recordSize ) * recordSize;\n\t\tvar inputLength = Math.ceil( input.length / recordSize ) * recordSize;\n\n\t\tthis.blocks.push( { header: headerArr, input: input, headerLength: headerLength, inputLength: inputLength } );\n\n\t};\n\n\tTar.prototype.save = function() {\n\n\t\tvar buffers = [];\n\t\tvar chunks = [];\n\t\tvar length = 0;\n\t\tvar max = Math.pow( 2, 20 );\n\n\t\tvar chunk = [];\n\t\tthis.blocks.forEach( function( b ) {\n\t\t\tif( length + b.headerLength + b.inputLength > max ) {\n\t\t\t\tchunks.push( { blocks: chunk, length: length } );\n\t\t\t\tchunk = [];\n\t\t\t\tlength = 0;\n\t\t\t}\n\t\t\tchunk.push( b );\n\t\t\tlength += b.headerLength + b.inputLength;\n\t\t} );\n\t\tchunks.push( { blocks: chunk, length: length } );\n\n\t\tchunks.forEach( function( c ) {\n\n\t\t\tvar buffer = new Uint8Array( c.length );\n\t\t\tvar written = 0;\n\t\t\tc.blocks.forEach( function( b ) {\n\t\t\t\tbuffer.set( b.header, written );\n\t\t\t\twritten += b.headerLength;\n\t\t\t\tbuffer.set( b.input, written );\n\t\t\t\twritten += b.inputLength;\n\t\t\t} );\n\t\t\tbuffers.push( buffer );\n\n\t\t} );\n\n\t\tbuffers.push( new Uint8Array( 2 * recordSize ) );\n\n\t\treturn new Blob( buffers, { type: 'octet/stream' } );\n\n\t};\n\n\tTar.prototype.clear = function () {\n\t\tthis.written = 0;\n\t\tthis.out = utils.clean(blockSize);\n\t};\n\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n module.exports = Tar;\n } else {\n window.Tar = Tar;\n }\n}());\n","/**\n * A tool for presenting an ArrayBuffer as a stream for writing some simple data types.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n// (function(){\n /*\n * Create an ArrayBuffer of the given length and present it as a writable stream with methods\n * for writing data in different formats.\n */\n var ArrayBufferDataStream = function(length) {\n this.data = new Uint8Array(length);\n this.pos = 0;\n };\n\n ArrayBufferDataStream.prototype.seek = function(offset) {\n this.pos = offset;\n };\n\n ArrayBufferDataStream.prototype.writeBytes = function(arr) {\n for (var i = 0; i < arr.length; i++) {\n this.data[this.pos++] = arr[i];\n }\n };\n\n ArrayBufferDataStream.prototype.writeByte = function(b) {\n this.data[this.pos++] = b;\n };\n\n //Synonym:\n ArrayBufferDataStream.prototype.writeU8 = ArrayBufferDataStream.prototype.writeByte;\n\n ArrayBufferDataStream.prototype.writeU16BE = function(u) {\n this.data[this.pos++] = u >> 8;\n this.data[this.pos++] = u;\n };\n\n ArrayBufferDataStream.prototype.writeDoubleBE = function(d) {\n var\n bytes = new Uint8Array(new Float64Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n ArrayBufferDataStream.prototype.writeFloatBE = function(d) {\n var\n bytes = new Uint8Array(new Float32Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n /**\n * Write an ASCII string to the stream\n */\n ArrayBufferDataStream.prototype.writeString = function(s) {\n for (var i = 0; i < s.length; i++) {\n this.data[this.pos++] = s.charCodeAt(i);\n }\n };\n\n /**\n * Write the given 32-bit integer to the stream as an EBML variable-length integer using the given byte width\n * (use measureEBMLVarInt).\n *\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * @param i Integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeEBMLVarIntWidth = function(i, width) {\n switch (width) {\n case 1:\n this.writeU8((1 << 7) | i);\n break;\n case 2:\n this.writeU8((1 << 6) | (i >> 8));\n this.writeU8(i);\n break;\n case 3:\n this.writeU8((1 << 5) | (i >> 16));\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 4:\n this.writeU8((1 << 4) | (i >> 24));\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 5:\n /*\n * JavaScript converts its doubles to 32-bit integers for bitwise operations, so we need to do a\n * division by 2^32 instead of a right-shift of 32 to retain those top 3 bits\n */\n this.writeU8((1 << 3) | ((i / 4294967296) & 0x7));\n this.writeU8(i >> 24);\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n default:\n throw new RuntimeException(\"Bad EBML VINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to encode the given integer as an EBML VINT.\n */\n ArrayBufferDataStream.prototype.measureEBMLVarInt = function(val) {\n if (val < (1 << 7) - 1) {\n /* Top bit is set, leaving 7 bits to hold the integer, but we can't store 127 because\n * \"all bits set to one\" is a reserved value. Same thing for the other cases below:\n */\n return 1;\n } else if (val < (1 << 14) - 1) {\n return 2;\n } else if (val < (1 << 21) - 1) {\n return 3;\n } else if (val < (1 << 28) - 1) {\n return 4;\n } else if (val < 34359738367) { // 2 ^ 35 - 1 (can address 32GB)\n return 5;\n } else {\n throw new RuntimeException(\"EBML VINT size not supported \" + val);\n }\n };\n\n ArrayBufferDataStream.prototype.writeEBMLVarInt = function(i) {\n this.writeEBMLVarIntWidth(i, this.measureEBMLVarInt(i));\n };\n\n /**\n * Write the given unsigned 32-bit integer to the stream in big-endian order using the given byte width.\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * Omit the width parameter to have it determined automatically for you.\n *\n * @param u Unsigned integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeUnsignedIntBE = function(u, width) {\n if (width === undefined) {\n width = this.measureUnsignedInt(u);\n }\n\n // Each case falls through:\n switch (width) {\n case 5:\n this.writeU8(Math.floor(u / 4294967296)); // Need to use division to access >32 bits of floating point var\n case 4:\n this.writeU8(u >> 24);\n case 3:\n this.writeU8(u >> 16);\n case 2:\n this.writeU8(u >> 8);\n case 1:\n this.writeU8(u);\n break;\n default:\n throw new RuntimeException(\"Bad UINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to hold the non-zero bits of the given unsigned integer.\n */\n ArrayBufferDataStream.prototype.measureUnsignedInt = function(val) {\n // Force to 32-bit unsigned integer\n if (val < (1 << 8)) {\n return 1;\n } else if (val < (1 << 16)) {\n return 2;\n } else if (val < (1 << 24)) {\n return 3;\n } else if (val < 4294967296) {\n return 4;\n } else {\n return 5;\n }\n };\n\n /**\n * Return a view on the portion of the buffer from the beginning to the current seek position as a Uint8Array.\n */\n ArrayBufferDataStream.prototype.getAsDataArray = function() {\n if (this.pos < this.data.byteLength) {\n return this.data.subarray(0, this.pos);\n } else if (this.pos == this.data.byteLength) {\n return this.data;\n } else {\n throw \"ArrayBufferDataStream's pos lies beyond end of buffer\";\n }\n };\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = ArrayBufferDataStream;\n// \t} else {\n// \t\twindow.ArrayBufferDataStream = ArrayBufferDataStream;\n// \t}\n// }());\"use strict\";\n\n/**\n * Allows a series of Blob-convertible objects (ArrayBuffer, Blob, String, etc) to be added to a buffer. Seeking and\n * overwriting of blobs is allowed.\n *\n * You can supply a FileWriter, in which case the BlobBuffer is just used as temporary storage before it writes it\n * through to the disk.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n// (function() {\n\tvar BlobBuffer = function(fs) {\n\t\treturn function(destination) {\n\t\t\tvar\n\t\t\t\tbuffer = [],\n\t\t\t\twritePromise = Promise.resolve(),\n\t\t\t\tfileWriter = null,\n\t\t\t\tfd = null;\n\n\t\t\tif (typeof FileWriter !== \"undefined\" && destination instanceof FileWriter) {\n\t\t\t\tfileWriter = destination;\n\t\t\t} else if (fs && destination) {\n\t\t\t\tfd = destination;\n\t\t\t}\n\n\t\t\t// Current seek offset\n\t\t\tthis.pos = 0;\n\n\t\t\t// One more than the index of the highest byte ever written\n\t\t\tthis.length = 0;\n\n\t\t\t// Returns a promise that converts the blob to an ArrayBuffer\n\t\t\tfunction readBlobAsBuffer(blob) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tvar\n\t\t\t\t\t\treader = new FileReader();\n\n\t\t\t\t\treader.addEventListener(\"loadend\", function () {\n\t\t\t\t\t\tresolve(reader.result);\n\t\t\t\t\t});\n\n\t\t\t\t\treader.readAsArrayBuffer(blob);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction convertToUint8Array(thing) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tif (thing instanceof Uint8Array) {\n\t\t\t\t\t\tresolve(thing);\n\t\t\t\t\t} else if (thing instanceof ArrayBuffer || ArrayBuffer.isView(thing)) {\n\t\t\t\t\t\tresolve(new Uint8Array(thing));\n\t\t\t\t\t} else if (thing instanceof Blob) {\n\t\t\t\t\t\tresolve(readBlobAsBuffer(thing).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Assume that Blob will know how to read this thing\n\t\t\t\t\t\tresolve(readBlobAsBuffer(new Blob([thing])).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction measureData(data) {\n\t\t\t\tvar\n\t\t\t\t\tresult = data.byteLength || data.length || data.size;\n\n\t\t\t\tif (!Number.isInteger(result)) {\n\t\t\t\t\tthrow \"Failed to determine size of element\";\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Seek to the given absolute offset.\n\t\t\t *\n\t\t\t * You may not seek beyond the end of the file (this would create a hole and/or allow blocks to be written in non-\n\t\t\t * sequential order, which isn't currently supported by the memory buffer backend).\n\t\t\t */\n\t\t\tthis.seek = function (offset) {\n\t\t\t\tif (offset < 0) {\n\t\t\t\t\tthrow \"Offset may not be negative\";\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(offset)) {\n\t\t\t\t\tthrow \"Offset may not be NaN\";\n\t\t\t\t}\n\n\t\t\t\tif (offset > this.length) {\n\t\t\t\t\tthrow \"Seeking beyond the end of file is not allowed\";\n\t\t\t\t}\n\n\t\t\t\tthis.pos = offset;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Write the Blob-convertible data to the buffer at the current seek position.\n\t\t\t *\n\t\t\t * Note: If overwriting existing data, the write must not cross preexisting block boundaries (written data must\n\t\t\t * be fully contained by the extent of a previous write).\n\t\t\t */\n\t\t\tthis.write = function (data) {\n\t\t\t\tvar\n\t\t\t\t\tnewEntry = {\n\t\t\t\t\t\toffset: this.pos,\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tlength: measureData(data)\n\t\t\t\t\t},\n\t\t\t\t\tisAppend = newEntry.offset >= this.length;\n\n\t\t\t\tthis.pos += newEntry.length;\n\t\t\t\tthis.length = Math.max(this.length, this.pos);\n\n\t\t\t\t// After previous writes complete, perform our write\n\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\tif (fd) {\n\t\t\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\t\t\tconvertToUint8Array(newEntry.data).then(function(dataArray) {\n\t\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\t\ttotalWritten = 0,\n\t\t\t\t\t\t\t\t\tbuffer = Buffer.from(dataArray.buffer),\n\n\t\t\t\t\t\t\t\t\thandleWriteComplete = function(err, written, buffer) {\n\t\t\t\t\t\t\t\t\t\ttotalWritten += written;\n\n\t\t\t\t\t\t\t\t\t\tif (totalWritten >= buffer.length) {\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// We still have more to write...\n\t\t\t\t\t\t\t\t\t\t\tfs.write(fd, buffer, totalWritten, buffer.length - totalWritten, newEntry.offset + totalWritten, handleWriteComplete);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tfs.write(fd, buffer, 0, buffer.length, newEntry.offset, handleWriteComplete);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (fileWriter) {\n\t\t\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\t\tfileWriter.onwriteend = resolve;\n\n\t\t\t\t\t\t\tfileWriter.seek(newEntry.offset);\n\t\t\t\t\t\t\tfileWriter.write(new Blob([newEntry.data]));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!isAppend) {\n\t\t\t\t\t\t// We might be modifying a write that was already buffered in memory.\n\n\t\t\t\t\t\t// Slow linear search to find a block we might be overwriting\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\tentry = buffer[i];\n\n\t\t\t\t\t\t\t// If our new entry overlaps the old one in any way...\n\t\t\t\t\t\t\tif (!(newEntry.offset + newEntry.length <= entry.offset || newEntry.offset >= entry.offset + entry.length)) {\n\t\t\t\t\t\t\t\tif (newEntry.offset < entry.offset || newEntry.offset + newEntry.length > entry.offset + entry.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Overwrite crosses blob boundaries\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (newEntry.offset == entry.offset && newEntry.length == entry.length) {\n\t\t\t\t\t\t\t\t\t// We overwrote the entire block\n\t\t\t\t\t\t\t\t\tentry.data = newEntry.data;\n\n\t\t\t\t\t\t\t\t\t// We're done\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn convertToUint8Array(entry.data)\n\t\t\t\t\t\t\t\t\t\t.then(function (entryArray) {\n\t\t\t\t\t\t\t\t\t\t\tentry.data = entryArray;\n\n\t\t\t\t\t\t\t\t\t\t\treturn convertToUint8Array(newEntry.data);\n\t\t\t\t\t\t\t\t\t\t}).then(function (newEntryArray) {\n\t\t\t\t\t\t\t\t\t\t\tnewEntry.data = newEntryArray;\n\n\t\t\t\t\t\t\t\t\t\t\tentry.data.set(newEntry.data, newEntry.offset - entry.offset);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Else fall through to do a simple append, as we didn't overwrite any pre-existing blocks\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.push(newEntry);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Finish all writes to the buffer, returning a promise that signals when that is complete.\n\t\t\t *\n\t\t\t * If a FileWriter was not provided, the promise is resolved with a Blob that represents the completed BlobBuffer\n\t\t\t * contents. You can optionally pass in a mimeType to be used for this blob.\n\t\t\t *\n\t\t\t * If a FileWriter was provided, the promise is resolved with null as the first argument.\n\t\t\t */\n\t\t\tthis.complete = function (mimeType) {\n\t\t\t\tif (fd || fileWriter) {\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// After writes complete we need to merge the buffer to give to the caller\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\tvar\n\t\t\t\t\t\t\tresult = [];\n\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tresult.push(buffer[i].data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Blob(result, {mimeType: mimeType});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn writePromise;\n\t\t\t};\n\t\t};\n\t}(null);\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = BlobBuffer(require('fs'));\n// \t} else {\n// \t\twindow.BlobBuffer = BlobBuffer(null);\n// \t}\n// })();\n/**\n * WebM video encoder for Google Chrome. This implementation is suitable for creating very large video files, because\n * it can stream Blobs directly to a FileWriter without buffering the entire video in memory.\n *\n * When FileWriter is not available or not desired, it can buffer the video in memory as a series of Blobs which are\n * eventually returned as one composite Blob.\n *\n * By Nicholas Sherlock.\n *\n * Based on the ideas from Whammy: https://github.com/antimatter15/whammy\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n(function() {\n var WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {\n function extend(base, top) {\n var\n target = {};\n\n [base, top].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n });\n\n return target;\n }\n\n /**\n * Decode a Base64 data URL into a binary string.\n *\n * Returns the binary string, or false if the URL could not be decoded.\n */\n function decodeBase64WebPDataURL(url) {\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n\n return window.atob(url.substring(\"data:image\\/webp;base64,\".length));\n }\n\n /**\n * Convert a raw binary string (one character = one output byte) to an ArrayBuffer\n */\n function stringToArrayBuffer(string) {\n var\n buffer = new ArrayBuffer(string.length),\n int8Array = new Uint8Array(buffer);\n\n for (var i = 0; i < string.length; i++) {\n int8Array[i] = string.charCodeAt(i);\n }\n\n return buffer;\n }\n\n /**\n * Convert the given canvas to a WebP encoded image and return the image data as a string.\n */\n function renderAsWebP(canvas, quality) {\n var\n frame = canvas.toDataURL('image/webp', {quality: quality});\n\n return decodeBase64WebPDataURL(frame);\n }\n\n function extractKeyframeFromWebP(webP) {\n // Assume that Chrome will generate a Simple Lossy WebP which has this header:\n var\n keyframeStartIndex = webP.indexOf('VP8 ');\n\n if (keyframeStartIndex == -1) {\n throw \"Failed to identify beginning of keyframe in WebP image\";\n }\n\n // Skip the header and the 4 bytes that encode the length of the VP8 chunk\n keyframeStartIndex += 'VP8 '.length + 4;\n\n return webP.substring(keyframeStartIndex);\n }\n\n // Just a little utility so we can tag values as floats for the EBML encoder's benefit\n function EBMLFloat32(value) {\n this.value = value;\n }\n\n function EBMLFloat64(value) {\n this.value = value;\n }\n\n /**\n * Write the given EBML object to the provided ArrayBufferStream.\n *\n * The buffer's first byte is at bufferFileOffset inside the video file. This is used to complete offset and\n * dataOffset fields in each EBML structure, indicating the file offset of the first byte of the EBML element and\n * its data payload.\n */\n function writeEBML(buffer, bufferFileOffset, ebml) {\n // Is the ebml an array of sibling elements?\n if (Array.isArray(ebml)) {\n for (var i = 0; i < ebml.length; i++) {\n writeEBML(buffer, bufferFileOffset, ebml[i]);\n }\n // Is this some sort of raw data that we want to write directly?\n } else if (typeof ebml === \"string\") {\n buffer.writeString(ebml);\n } else if (ebml instanceof Uint8Array) {\n buffer.writeBytes(ebml);\n } else if (ebml.id){\n // We're writing an EBML element\n ebml.offset = buffer.pos + bufferFileOffset;\n\n buffer.writeUnsignedIntBE(ebml.id); // ID field\n\n // Now we need to write the size field, so we must know the payload size:\n\n if (Array.isArray(ebml.data)) {\n // Writing an array of child elements. We won't try to measure the size of the children up-front\n\n var\n sizePos, dataBegin, dataEnd;\n\n if (ebml.size === -1) {\n // Write the reserved all-one-bits marker to note that the size of this element is unknown/unbounded\n buffer.writeByte(0xFF);\n } else {\n sizePos = buffer.pos;\n\n /* Write a dummy size field to overwrite later. 4 bytes allows an element maximum size of 256MB,\n * which should be plenty (we don't want to have to buffer that much data in memory at one time\n * anyway!)\n */\n buffer.writeBytes([0, 0, 0, 0]);\n }\n\n dataBegin = buffer.pos;\n\n ebml.dataOffset = dataBegin + bufferFileOffset;\n writeEBML(buffer, bufferFileOffset, ebml.data);\n\n if (ebml.size !== -1) {\n dataEnd = buffer.pos;\n\n ebml.size = dataEnd - dataBegin;\n\n buffer.seek(sizePos);\n buffer.writeEBMLVarIntWidth(ebml.size, 4); // Size field\n\n buffer.seek(dataEnd);\n }\n } else if (typeof ebml.data === \"string\") {\n buffer.writeEBMLVarInt(ebml.data.length); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeString(ebml.data);\n } else if (typeof ebml.data === \"number\") {\n // Allow the caller to explicitly choose the size if they wish by supplying a size field\n if (!ebml.size) {\n ebml.size = buffer.measureUnsignedInt(ebml.data);\n }\n\n buffer.writeEBMLVarInt(ebml.size); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeUnsignedIntBE(ebml.data, ebml.size);\n } else if (ebml.data instanceof EBMLFloat64) {\n buffer.writeEBMLVarInt(8); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeDoubleBE(ebml.data.value);\n } else if (ebml.data instanceof EBMLFloat32) {\n buffer.writeEBMLVarInt(4); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeFloatBE(ebml.data.value);\n } else if (ebml.data instanceof Uint8Array) {\n buffer.writeEBMLVarInt(ebml.data.byteLength); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeBytes(ebml.data);\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n }\n\n return function(options) {\n var\n MAX_CLUSTER_DURATION_MSEC = 5000,\n DEFAULT_TRACK_NUMBER = 1,\n\n writtenHeader = false,\n videoWidth, videoHeight,\n\n clusterFrameBuffer = [],\n clusterStartTime = 0,\n clusterDuration = 0,\n\n optionDefaults = {\n quality: 0.95, // WebM image quality from 0.0 (worst) to 1.0 (best)\n fileWriter: null, // Chrome FileWriter in order to stream to a file instead of buffering to memory (optional)\n fd: null, // Node.JS file descriptor to write to instead of buffering (optional)\n\n // You must supply one of:\n frameDuration: null, // Duration of frames in milliseconds\n frameRate: null, // Number of frames per second\n },\n\n seekPoints = {\n Cues: {id: new Uint8Array([0x1C, 0x53, 0xBB, 0x6B]), positionEBML: null},\n SegmentInfo: {id: new Uint8Array([0x15, 0x49, 0xA9, 0x66]), positionEBML: null},\n Tracks: {id: new Uint8Array([0x16, 0x54, 0xAE, 0x6B]), positionEBML: null},\n },\n\n ebmlSegment,\n segmentDuration = {\n \"id\": 0x4489, // Duration\n \"data\": new EBMLFloat64(0)\n },\n\n seekHead,\n\n cues = [],\n\n blobBuffer = new BlobBuffer(options.fileWriter || options.fd);\n\n function fileOffsetToSegmentRelative(fileOffset) {\n return fileOffset - ebmlSegment.dataOffset;\n }\n\n /**\n * Create a SeekHead element with descriptors for the points in the global seekPoints array.\n *\n * 5 bytes of position values are reserved for each node, which lie at the offset point.positionEBML.dataOffset,\n * to be overwritten later.\n */\n function createSeekHead() {\n var\n seekPositionEBMLTemplate = {\n \"id\": 0x53AC, // SeekPosition\n \"size\": 5, // Allows for 32GB video files\n \"data\": 0 // We'll overwrite this when the file is complete\n },\n\n result = {\n \"id\": 0x114D9B74, // SeekHead\n \"data\": []\n };\n\n for (var name in seekPoints) {\n var\n seekPoint = seekPoints[name];\n\n seekPoint.positionEBML = Object.create(seekPositionEBMLTemplate);\n\n result.data.push({\n \"id\": 0x4DBB, // Seek\n \"data\": [\n {\n \"id\": 0x53AB, // SeekID\n \"data\": seekPoint.id\n },\n seekPoint.positionEBML\n ]\n });\n }\n\n return result;\n }\n\n /**\n * Write the WebM file header to the stream.\n */\n function writeHeader() {\n seekHead = createSeekHead();\n\n var\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n\n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ]\n }\n ]\n }\n ]\n };\n\n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n\n var\n bufferStream = new ArrayBufferDataStream(256);\n\n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n\n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n };\n\n /**\n * Create a SimpleBlock keyframe header using these fields:\n * timecode - Time of this keyframe\n * trackNumber - Track number from 1 to 126 (inclusive)\n * frame - Raw frame data payload string\n *\n * Returns an EBML element.\n */\n function createKeyframeBlock(keyframe) {\n var\n bufferStream = new ArrayBufferDataStream(1 + 2 + 1);\n\n if (!(keyframe.trackNumber > 0 && keyframe.trackNumber < 127)) {\n throw \"TrackNumber must be > 0 and < 127\";\n }\n\n bufferStream.writeEBMLVarInt(keyframe.trackNumber); // Always 1 byte since we limit the range of trackNumber\n bufferStream.writeU16BE(keyframe.timecode);\n\n // Flags byte\n bufferStream.writeByte(\n 1 << 7 // Keyframe\n );\n\n return {\n \"id\": 0xA3, // SimpleBlock\n \"data\": [\n bufferStream.getAsDataArray(),\n keyframe.frame\n ]\n };\n }\n\n /**\n * Create a Cluster node using these fields:\n *\n * timecode - Start time for the cluster\n *\n * Returns an EBML element.\n */\n function createCluster(cluster) {\n return {\n \"id\": 0x1f43b675,\n \"data\": [\n {\n \"id\": 0xe7, // Timecode\n \"data\": Math.round(cluster.timecode)\n }\n ]\n };\n }\n\n function addCuePoint(trackIndex, clusterTime, clusterFileOffset) {\n cues.push({\n \"id\": 0xBB, // Cue\n \"data\": [\n {\n \"id\": 0xB3, // CueTime\n \"data\": clusterTime\n },\n {\n \"id\": 0xB7, // CueTrackPositions\n \"data\": [\n {\n \"id\": 0xF7, // CueTrack\n \"data\": trackIndex\n },\n {\n \"id\": 0xF1, // CueClusterPosition\n \"data\": fileOffsetToSegmentRelative(clusterFileOffset)\n }\n ]\n }\n ]\n });\n }\n\n /**\n * Write a Cues element to the blobStream using the global `cues` array of CuePoints (use addCuePoint()).\n * The seek entry for the Cues in the SeekHead is updated.\n */\n function writeCues() {\n var\n ebml = {\n \"id\": 0x1C53BB6B,\n \"data\": cues\n },\n\n cuesBuffer = new ArrayBufferDataStream(16 + cues.length * 32); // Pretty crude estimate of the buffer size we'll need\n\n writeEBML(cuesBuffer, blobBuffer.pos, ebml);\n blobBuffer.write(cuesBuffer.getAsDataArray());\n\n // Now we know where the Cues element has ended up, we can update the SeekHead\n seekPoints.Cues.positionEBML.data = fileOffsetToSegmentRelative(ebml.offset);\n }\n\n /**\n * Flush the frames in the current clusterFrameBuffer out to the stream as a Cluster.\n */\n function flushClusterFrameBuffer() {\n if (clusterFrameBuffer.length == 0) {\n return;\n }\n\n // First work out how large of a buffer we need to hold the cluster data\n var\n rawImageSize = 0;\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n rawImageSize += clusterFrameBuffer[i].frame.length;\n }\n\n var\n buffer = new ArrayBufferDataStream(rawImageSize + clusterFrameBuffer.length * 32), // Estimate 32 bytes per SimpleBlock header\n\n cluster = createCluster({\n timecode: Math.round(clusterStartTime),\n });\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n cluster.data.push(createKeyframeBlock(clusterFrameBuffer[i]));\n }\n\n writeEBML(buffer, blobBuffer.pos, cluster);\n blobBuffer.write(buffer.getAsDataArray());\n\n addCuePoint(DEFAULT_TRACK_NUMBER, Math.round(clusterStartTime), cluster.offset);\n\n clusterFrameBuffer = [];\n clusterStartTime += clusterDuration;\n clusterDuration = 0;\n }\n\n function validateOptions() {\n // Derive frameDuration setting if not already supplied\n if (!options.frameDuration) {\n if (options.frameRate) {\n options.frameDuration = 1000 / options.frameRate;\n } else {\n throw \"Missing required frameDuration or frameRate setting\";\n }\n }\n }\n\n function addFrameToCluster(frame) {\n frame.trackNumber = DEFAULT_TRACK_NUMBER;\n\n // Frame timecodes are relative to the start of their cluster:\n frame.timecode = Math.round(clusterDuration);\n\n clusterFrameBuffer.push(frame);\n\n clusterDuration += frame.duration;\n\n if (clusterDuration >= MAX_CLUSTER_DURATION_MSEC) {\n flushClusterFrameBuffer();\n }\n }\n\n /**\n * Rewrites the SeekHead element that was initially written to the stream with the offsets of top level elements.\n *\n * Call once writing is complete (so the offset of all top level elements is known).\n */\n function rewriteSeekHead() {\n var\n seekHeadBuffer = new ArrayBufferDataStream(seekHead.size),\n oldPos = blobBuffer.pos;\n\n // Write the rewritten SeekHead element's data payload to the stream (don't need to update the id or size)\n writeEBML(seekHeadBuffer, seekHead.dataOffset, seekHead.data);\n\n // And write that through to the file\n blobBuffer.seek(seekHead.dataOffset);\n blobBuffer.write(seekHeadBuffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Rewrite the Duration field of the Segment with the newly-discovered video duration.\n */\n function rewriteDuration() {\n var\n buffer = new ArrayBufferDataStream(8),\n oldPos = blobBuffer.pos;\n\n // Rewrite the data payload (don't need to update the id or size)\n buffer.writeDoubleBE(clusterStartTime);\n\n // And write that through to the file\n blobBuffer.seek(segmentDuration.dataOffset);\n blobBuffer.write(buffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Add a frame to the video. Currently the frame must be a Canvas element.\n */\n this.addFrame = function(canvas) {\n if (writtenHeader) {\n if (canvas.width != videoWidth || canvas.height != videoHeight) {\n throw \"Frame size differs from previous frames\";\n }\n } else {\n videoWidth = canvas.width;\n videoHeight = canvas.height;\n\n writeHeader();\n writtenHeader = true;\n }\n\n var\n webP = renderAsWebP(canvas, {quality: options.quality});\n\n if (!webP) {\n throw \"Couldn't decode WebP frame, does the browser support WebP?\";\n }\n\n addFrameToCluster({\n frame: extractKeyframeFromWebP(webP),\n duration: options.frameDuration\n });\n };\n\n /**\n * Finish writing the video and return a Promise to signal completion.\n *\n * If the destination device was memory (i.e. options.fileWriter was not supplied), the Promise is resolved with\n * a Blob with the contents of the entire video.\n */\n this.complete = function() {\n flushClusterFrameBuffer();\n\n writeCues();\n rewriteSeekHead();\n rewriteDuration();\n\n return blobBuffer.complete('video/webm');\n };\n\n this.getWrittenSize = function() {\n return blobBuffer.length;\n };\n\n options = extend(optionDefaults, options || {});\n validateOptions();\n };\n };\n\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n\t // module.exports = WebMWriter(require(\"./ArrayBufferDataStream\"), require(\"./BlobBuffer\"));\n module.exports = WebMWriter(ArrayBufferDataStream,BlobBuffer);\n } else {\n\t window.WebMWriter = WebMWriter(ArrayBufferDataStream, BlobBuffer);\n }\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","// Default export.\nimport * as CanvasCapture from './CanvasCapture';\nexport default CanvasCapture;\n\n// Named export.\nexport { CanvasCapture };"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"canvas-capture.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;ACVA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,QAAQ,kBAAkB,EAAE,mBAAO,CAAC,GAAoB;;AAExD;AACA;AACA;AACA;AACA,YAAY,MAAsC;AAClD,MAAM,CAA4D;AAClE,wCAAwC,6CAA6C;AACrF;;;;;;;;ACVA,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,UAAU,SAAS,UAAU;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;;;;;;;ACtCA;AACA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,QAAQ,MAAM,EAAE,mBAAO,CAAC,GAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,KAAK,cAAc,gBAAgB;AACpD,iCAAiC,gBAAgB;AACjD;AACA,iBAAiB,KAAK,aAAa,QAAQ;AAC3C;AACA;;AAEA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;AC7DA,uBAAuB,mBAAO,CAAC,EAAkB;AACjD,4BAA4B,mBAAO,CAAC,GAAuB;AAC3D,kBAAkB,mBAAO,CAAC,GAAa;;AAEvC;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;ACjDA,QAAQ,2BAA2B,EAAE,mBAAO,CAAC,GAAU;AACvD,QAAQ,mCAAmC,EAAE,mBAAO,CAAC,GAAa;AAClE,sBAAsB,mBAAO,CAAC,GAAuB;AACrD,kBAAkB,mBAAO,CAAC,EAAmB;AAC7C,QAAQ,sCAAsC,EAAE,mBAAO,CAAC,GAAQ;AAChE,QAAQ,UAAU,EAAE,mBAAO,CAAC,GAAiB;;AAE7C;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,QAAQ,EAAE,uDAAuD,YAAY,gCAAgC;AACvI;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA,+CAA+C,QAAQ;AACvD,UAAU;AACV,gDAAgD,QAAQ;AACxD,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClNA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,eAAe;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;ACRA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC,MAAM;AACN,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;;;;;;;;AC3Ba;;AAEb,8CAA6C;AAC7C;AACA,CAAC,EAAC;AACF,qBAAqB;AACrB,wBAAwB;;AAExB,mCAAmC,0BAA0B,0CAA0C,gBAAgB,OAAO,oBAAoB,eAAe,OAAO;;AAExK;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,8BAA8B;AAC9B,gCAAgC;AAChC,8BAA8B;AAC9B,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B,8BAA8B;AAC9B,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAiC;AACjC,kCAAkC;AAClC,kCAAkC;AAClC,uBAAuB;;AAEvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AChMA,+GAAe,GAAG,IAAqC,CAAC,iCAAO,EAAE,oCAAC,CAAC;AAAA;AAAA;AAAA,kGAAC,CAAC,KAAK,EAA6E,CAAC,kBAAkB,aAAa,gBAAgB,+BAA+B,WAAW,4FAA4F,WAAW,kEAAkE,4DAA4D,YAAY,IAAI,kBAAkB,yBAAyB,0DAA0D,kBAAkB,sBAAsB,yCAAyC,UAAU,cAAc,yBAAyB,oBAAoB,IAAI,SAAS,UAAU,oCAAoC,cAAc,IAAI,yCAAyC,SAAS,0CAA0C,0FAA0F,2HAA2H,q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2DAA2D;AAC3D;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yDAAyD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,gGAAgG;;AAEhG;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,gBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;;AAEA,gFAAgF,aAAa;AAC7F;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,iDAAiD;;AAEjD;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,0DAA0D;;AAE1D,0DAA0D;AAC1D;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA,uDAAuD;;AAEvD,iDAAiD;AACjD;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,GAAG;;AAE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AAE,KAAK;IACnB,YAAY,EAAE,KAAK;CACnB,CAAC;;;;;;;;;ACNF,mCAAC;AACD;AACA,IAAI,KAA6B;AACjC,YAAY,mBAAO,CAAC,GAAU;AAC9B,iBAAiB,mBAAO,CAAC,GAAe;AACxC,YAAY,mBAAO,CAAC,GAAU;AAC9B,mBAAmB,mBAAO,CAAC,GAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,qBAAM,gBAAgB,qBAAM;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB;AACzD,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uBAAuB;AAC7D;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wCAAwC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,uBAAuB;AAC9F,uEAAuE,uBAAuB;AAC9F,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,MAAM,IAA0E;AAChF;AACA;AACA,IAAI,mCAAO;AACX;AACA,KAAK;AAAA,kGAAC;AACN;AACA;AACA,OAAO,EAWN;AACD;AACA,CAAC;;;;;;;;ACr9BD,iCAAiC;AACjC;AACA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;;;AAGpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC,4BAA4B;AAC5B;AACA;AACA;AACA;;;;AAIA;AACA,iDAAiD;AACjD;AACA;AACA,cAAc;AACd,EAAE;;AAEF;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,EAAE;AACF;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA;;;;AAIA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,KAAK;;AAEb,uBAAuB,QAAQ;AAC/B;;AAEA;;;AAGA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uBAAuB,kCAAkC;AAChF,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;;AAGA;AACA,yBAAyB,wBAAwB;;AAEjD,EAAE;;;AAGF,6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A+C,wBAAwB,wBAAwB,2BAA2B,2CAA2C,sBAAsB,oBAAoB,sBAAsB,eAAe,WAAW,uBAAuB,MAAM,KAAK,YAAY,0BAA0B,eAAe,GAAG,wCAAwC,KAAK,iCAAiC,+BAA+B,gCAAgC,EAAE,oBAAoB,EAAE,GAAG,SAAS;AACl/5B;;;;;;;;ACFA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAkD,YAAY;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA,kCAAkC;AAClC,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,YAAY;AAChD;AACA;AACA;;AAEA,+BAA+B;AAC/B,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,YAAY;AAClD;AACA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA,sBAAsB,wFAAwF;;AAE9G;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,iBAAiB,gCAAgC;;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,IAAI;;AAEJ;;AAEA,8BAA8B,uBAAuB;;AAErD;;AAEA;AACA;AACA;AACA;;AAEA,MAAM,KAA6B;AACnC;AACA,IAAI;AACJ;AACA;AACA,CAAC;;;;;;;;;ACjVD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU,8BAA8B;AACxC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI,IAAI;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR,OAAO;AACP,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP,OAAO;AACP;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;;AAEA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA,+BAA+B,mBAAmB;AAClD,MAAM;AACN;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;;AAEA,+DAA+D;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,mBAAmB;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wDAAwD,iBAAiB;;AAEzE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;;AAEA,oDAAoD;;AAEpD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,mEAAmE;;AAEnE;AACA;AACA,kBAAkB;AAClB,8DAA8D;AAC9D;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,+CAA+C;AAC/C;AACA;AACA,kBAAkB;AAClB,kEAAkE;AAClE;AACA;AACA,kBAAkB;AAClB;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA,2BAA2B,iEAAiE;AAC5F,kCAAkC,iEAAiE;AACnG,6BAA6B,iEAAiE;AAC9F,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oEAAoE;AACpE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB,mFAAmF;;AAEnF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB,gCAAgC,+BAA+B;AAC/D;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,yBAAyB;;AAE1E;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0DAA0D;AAC1D;AACA;AACA;;AAEA,QAAQ,KAA6B;AACrC;AACA;AACA,MAAM;AACN;AACA;AACA,CAAC;;;;;;;;;;;;;;;UC1kCD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;;;;;;;;ACJA,kBAAkB;AAClB,6CAAiD;AAIxC,sCAAa;AAHtB,qBAAe,aAAa,CAAC","sources":["webpack://CanvasCapture/webpack/universalModuleDefinition","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/browser/index.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/config.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/utils/log.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","webpack://CanvasCapture/./node_modules/@ffmpeg/ffmpeg/src/utils/parseProgress.js","webpack://CanvasCapture/./node_modules/changedpi/dist/index.js","webpack://CanvasCapture/./node_modules/file-saver/dist/FileSaver.min.js","webpack://CanvasCapture/./node_modules/jszip/dist/jszip.min.js","webpack://CanvasCapture/./node_modules/mdn-polyfills/HTMLCanvasElement.prototype.toBlob.js","webpack://CanvasCapture/./node_modules/micromodal/dist/micromodal.es.js","webpack://CanvasCapture/./src/CCapture.js/gif.worker.js","webpack://CanvasCapture/./node_modules/resolve-url/resolve-url.js","webpack://CanvasCapture/./src/CanvasCapture.ts","webpack://CanvasCapture/./src/micromodal.css.ts","webpack://CanvasCapture/./src/modals.ts","webpack://CanvasCapture/./src/params.ts","webpack://CanvasCapture/./src/CCapture.js/CCapture.js","webpack://CanvasCapture/./src/CCapture.js/download.js","webpack://CanvasCapture/./src/CCapture.js/gif.js","webpack://CanvasCapture/./src/CCapture.js/tar.js","webpack://CanvasCapture/./src/CCapture.js/webm-writer-0.2.0.js","webpack://CanvasCapture/webpack/bootstrap","webpack://CanvasCapture/webpack/runtime/define property getters","webpack://CanvasCapture/webpack/runtime/global","webpack://CanvasCapture/webpack/runtime/hasOwnProperty shorthand","webpack://CanvasCapture/webpack/runtime/make namespace object","webpack://CanvasCapture/webpack/runtime/node module decorator","webpack://CanvasCapture/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CanvasCapture\"] = factory();\n\telse\n\t\troot[\"CanvasCapture\"] = factory();\n})(self, function() {\nreturn ","const resolveURL = require('resolve-url');\nconst { devDependencies } = require('../../package.json');\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: process.env.NODE_ENV === 'development'\n ? resolveURL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js')\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n","const resolveURL = require('resolve-url');\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.changeDpiBlob = changeDpiBlob;\nexports.changeDpiDataUrl = changeDpiDataUrl;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction createPngDataTable() {\n /* Table of CRCs of all 8-bit messages. */\n var crcTable = new Int32Array(256);\n for (var n = 0; n < 256; n++) {\n var c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1;\n }\n crcTable[n] = c;\n }\n return crcTable;\n}\n\nfunction calcCrc(buf) {\n var c = -1;\n if (!pngDataTable) pngDataTable = createPngDataTable();\n for (var n = 0; n < buf.length; n++) {\n c = pngDataTable[(c ^ buf[n]) & 0xFF] ^ c >>> 8;\n }\n return c ^ -1;\n}\n\nvar pngDataTable = void 0;\n\nvar PNG = 'image/png';\nvar JPEG = 'image/jpeg';\n\n// those are 3 possible signature of the physBlock in base64.\n// the pHYs signature block is preceed by the 4 bytes of lenght. The length of\n// the block is always 9 bytes. So a phys block has always this signature:\n// 0 0 0 9 p H Y s.\n// However the data64 encoding aligns we will always find one of those 3 strings.\n// this allow us to find this particular occurence of the pHYs block without\n// converting from b64 back to string\nvar b64PhysSignature1 = 'AAlwSFlz';\nvar b64PhysSignature2 = 'AAAJcEhZ';\nvar b64PhysSignature3 = 'AAAACXBI';\n\nvar _P = 'p'.charCodeAt(0);\nvar _H = 'H'.charCodeAt(0);\nvar _Y = 'Y'.charCodeAt(0);\nvar _S = 's'.charCodeAt(0);\n\nfunction changeDpiBlob(blob, dpi) {\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var headerChunk = blob.slice(0, 33);\n return new Promise(function (resolve, reject) {\n var fileReader = new FileReader();\n fileReader.onload = function () {\n var dataArray = new Uint8Array(fileReader.result);\n var tail = blob.slice(33);\n var changedArray = changeDpiOnArray(dataArray, dpi, blob.type);\n resolve(new Blob([changedArray, tail], { type: blob.type }));\n };\n fileReader.readAsArrayBuffer(headerChunk);\n });\n}\n\nfunction changeDpiDataUrl(base64Image, dpi) {\n var dataSplitted = base64Image.split(',');\n var format = dataSplitted[0];\n var body = dataSplitted[1];\n var type = void 0;\n var headerLength = void 0;\n var overwritepHYs = false;\n if (format.indexOf(PNG) !== -1) {\n type = PNG;\n var b64Index = detectPhysChunkFromDataUrl(body);\n // 28 bytes in dataUrl are 21bytes, length of phys chunk with everything inside.\n if (b64Index >= 0) {\n headerLength = Math.ceil((b64Index + 28) / 3) * 4;\n overwritepHYs = true;\n } else {\n headerLength = 33 / 3 * 4;\n }\n }\n if (format.indexOf(JPEG) !== -1) {\n type = JPEG;\n headerLength = 18 / 3 * 4;\n }\n // 33 bytes are ok for pngs and jpegs\n // to contain the information.\n var stringHeader = body.substring(0, headerLength);\n var restOfData = body.substring(headerLength);\n var headerBytes = atob(stringHeader);\n var dataArray = new Uint8Array(headerBytes.length);\n for (var i = 0; i < dataArray.length; i++) {\n dataArray[i] = headerBytes.charCodeAt(i);\n }\n var finalArray = changeDpiOnArray(dataArray, dpi, type, overwritepHYs);\n var base64Header = btoa(String.fromCharCode.apply(String, _toConsumableArray(finalArray)));\n return [format, ',', base64Header, restOfData].join('');\n}\n\nfunction detectPhysChunkFromDataUrl(data) {\n var b64index = data.indexOf(b64PhysSignature1);\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature2);\n }\n if (b64index === -1) {\n b64index = data.indexOf(b64PhysSignature3);\n }\n // if b64index === -1 chunk is not found\n return b64index;\n}\n\nfunction searchStartOfPhys(data) {\n var length = data.length - 1;\n // we check from the end since we cut the string in proximity of the header\n // the header is within 21 bytes from the end.\n for (var i = length; i >= 4; i--) {\n if (data[i - 4] === 9 && data[i - 3] === _P && data[i - 2] === _H && data[i - 1] === _Y && data[i] === _S) {\n return i - 3;\n }\n }\n}\n\nfunction changeDpiOnArray(dataArray, dpi, format, overwritepHYs) {\n if (format === JPEG) {\n dataArray[13] = 1; // 1 pixel per inch or 2 pixel per cm\n dataArray[14] = dpi >> 8; // dpiX high byte\n dataArray[15] = dpi & 0xff; // dpiX low byte\n dataArray[16] = dpi >> 8; // dpiY high byte\n dataArray[17] = dpi & 0xff; // dpiY low byte\n return dataArray;\n }\n if (format === PNG) {\n var physChunk = new Uint8Array(13);\n // chunk header pHYs\n // 9 bytes of data\n // 4 bytes of crc\n // this multiplication is because the standard is dpi per meter.\n dpi *= 39.3701;\n physChunk[0] = _P;\n physChunk[1] = _H;\n physChunk[2] = _Y;\n physChunk[3] = _S;\n physChunk[4] = dpi >>> 24; // dpiX highest byte\n physChunk[5] = dpi >>> 16; // dpiX veryhigh byte\n physChunk[6] = dpi >>> 8; // dpiX high byte\n physChunk[7] = dpi & 0xff; // dpiX low byte\n physChunk[8] = physChunk[4]; // dpiY highest byte\n physChunk[9] = physChunk[5]; // dpiY veryhigh byte\n physChunk[10] = physChunk[6]; // dpiY high byte\n physChunk[11] = physChunk[7]; // dpiY low byte\n physChunk[12] = 1; // dot per meter....\n\n var crc = calcCrc(physChunk);\n\n var crcChunk = new Uint8Array(4);\n crcChunk[0] = crc >>> 24;\n crcChunk[1] = crc >>> 16;\n crcChunk[2] = crc >>> 8;\n crcChunk[3] = crc & 0xff;\n\n if (overwritepHYs) {\n var startingIndex = searchStartOfPhys(dataArray);\n dataArray.set(physChunk, startingIndex);\n dataArray.set(crcChunk, startingIndex + 13);\n return dataArray;\n } else {\n // i need to give back an array of data that is divisible by 3 so that\n // dataurl encoding gives me integers, for luck this chunk is 17 + 4 = 21\n // if it was we could add a text chunk contaning some info, untill desired\n // length is met.\n\n // chunk structur 4 bytes for length is 9\n var chunkLength = new Uint8Array(4);\n chunkLength[0] = 0;\n chunkLength[1] = 0;\n chunkLength[2] = 0;\n chunkLength[3] = 9;\n\n var finalHeader = new Uint8Array(54);\n finalHeader.set(dataArray, 0);\n finalHeader.set(chunkLength, 33);\n finalHeader.set(physChunk, 37);\n finalHeader.set(crcChunk, 50);\n return finalHeader;\n }\n }\n}","(function(a,b){if(\"function\"==typeof define&&define.amd)define([],b);else if(\"undefined\"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open(\"GET\",a),d.responseType=\"blob\",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error(\"could not download file\")},d.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof global&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open(\"\",\"_blank\"),g&&(g.document.title=g.document.body.innerText=\"downloading...\"),\"string\"==typeof b)return c(b,d,e);var h=\"application/octet-stream\"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&\"undefined\"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,\"undefined\"!=typeof module&&(module.exports=g)});\n\n//# sourceMappingURL=FileSaver.min.js.map","/*!\n\nJSZip v3.7.1 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=t()}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e=\"function\"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error(\"Cannot find module '\"+r+\"'\");throw i.code=\"MODULE_NOT_FOUND\",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l=\"function\"==typeof require&&require,t=0;t>2,s=(3&e)<<4|r>>4,a=1>6:64,o=2>4,r=(15&n)<<4|(s=p.indexOf(t.charAt(o++)))>>2,i=(3&s)<<6|(a=p.indexOf(t.charAt(o++))),l[h++]=e,64!==s&&(l[h++]=r),64!==a&&(l[h++]=i);return l}},{\"./support\":30,\"./utils\":32}],2:[function(t,e,r){\"use strict\";var i=t(\"./external\"),n=t(\"./stream/DataWorker\"),s=t(\"./stream/Crc32Probe\"),a=t(\"./stream/DataLengthProbe\");function o(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(i.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 n(i.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 i=t(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(t){return new i(\"STORE compression\")},uncompressWorker:function(){return new i(\"STORE decompression\")}},r.DEFLATE=t(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(t,e,r){\"use strict\";var i=t(\"./utils\");var o=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)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\"!==i.getTypeOf(t)?function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,r,i){var n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):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 i=null;i=\"undefined\"!=typeof Promise?Promise:t(\"lie\"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){\"use strict\";var i=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,n=t(\"pako\"),s=t(\"./utils\"),a=t(\"./stream/GenericWorker\"),o=i?\"uint8array\":\"array\";function h(t,e){a.call(this,\"FlateWorker/\"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic=\"\\b\\0\",s.inherits(h,a),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(t){return new h(\"Deflate\",t)},r.uncompressWorker=function(){return new h(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(t,e,r){\"use strict\";function A(t,e){var r,i=\"\";for(r=0;r>>=8;return i}function i(t,e,r,i,n,s){var a,o,h=t.file,u=t.compression,l=s!==O.utf8encode,f=I.transformTo(\"string\",s(h.name)),d=I.transformTo(\"string\",O.utf8encode(h.name)),c=h.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",O.utf8encode(c)),_=d.length!==h.name.length,g=m.length!==c.length,b=\"\",v=\"\",y=\"\",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(x.crc32=t.crc32,x.compressedSize=t.compressedSize,x.uncompressedSize=t.uncompressedSize);var S=0;e&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),\"UNIX\"===n?(C=798,z|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(t){return 63&(t||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+d,b+=\"up\"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+=\"uc\"+A(y.length,2)+y);var E=\"\";return E+=\"\\n\\0\",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+\"\\0\\0\\0\\0\"+A(z,4)+A(i,4)+f+b+p}}var I=t(\"../utils\"),n=t(\"../stream/GenericWorker\"),O=t(\"../utf8\"),B=t(\"../crc32\"),R=t(\"../signature\");function s(t,e,r,i){n.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,n),s.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,n.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},s.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},s.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 R.DATA_DESCRIPTOR+A(t.crc32,4)+A(t.compressedSize,4)+A(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},s.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 i.transformTo(\"string\",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},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=n},{\"../utils\":32}],19:[function(t,e,r){\"use strict\";var i=t(\"./Uint8ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(t,e,r){\"use strict\";var i=t(\"./DataReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.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=n},{\"../utils\":32,\"./DataReader\":18}],21:[function(t,e,r){\"use strict\";var i=t(\"./ArrayReader\");function n(t){i.call(this,t)}t(\"../utils\").inherits(n,i),n.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=n},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"../support\"),s=t(\"./ArrayReader\"),a=t(\"./StringReader\"),o=t(\"./NodeBufferReader\"),h=t(\"./Uint8ArrayReader\");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),\"string\"!==e||n.uint8array?\"nodebuffer\"===e?new o(t):n.uint8array?new h(i.transformTo(\"uint8array\",t)):new s(i.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\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../utils\");function s(t){i.call(this,\"ConvertWorker to \"+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(t,e,r){\"use strict\";var i=t(\"./GenericWorker\"),n=t(\"../crc32\");function s(){i.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}t(\"../utils\").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(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 i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.call(this,\"DataLengthProbe for \"+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(t,e,r){\"use strict\";var i=t(\"../utils\"),n=t(\"./GenericWorker\");function s(t){n.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=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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 i(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}i.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=i},{}],29:[function(t,e,r){\"use strict\";var h=t(\"../utils\"),n=t(\"./ConvertWorker\"),s=t(\"./GenericWorker\"),u=t(\"../base64\"),i=t(\"../support\"),a=t(\"../external\"),o=null;if(i.nodestream)try{o=t(\"../nodejs/NodejsStreamOutputAdapter\")}catch(t){}function l(t,o){return new a.Promise(function(e,r){var i=[],n=t._internalType,s=t._outputType,a=t._mimeType;t.on(\"data\",function(t,e){i.push(t),o&&o(e)}).on(\"error\",function(t){i=[],r(t)}).on(\"end\",function(){try{var t=function(t,e,r){switch(t){case\"blob\":return h.newBlob(h.transformTo(\"arraybuffer\",e),r);case\"base64\":return u.encode(e);default:return h.transformTo(t,e)}}(s,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},s.utf8decode=function(t){return h.nodebuffer?o.transformTo(\"nodebuffer\",t).toString(\"utf-8\"):function(t){var e,r,i,n,s=t.length,a=new Array(2*s);for(e=r=0;e>10&1023,a[r++]=56320|1023&i)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(t=o.transformTo(h.uint8array?\"uint8array\":\"array\",t))},o.inherits(a,i),a.prototype.processChunk=function(t){var e=o.transformTo(h.uint8array?\"uint8array\":\"array\",t.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var i=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?e:0===r?e:r+u[t[r]]>e?r:e}(e),n=e;i!==e.length&&(h.uint8array?(n=e.subarray(0,i),this.leftOver=e.subarray(i,e.length)):(n=e.slice(0,i),this.leftOver=e.slice(i,e.length))),this.push({data:s.utf8decode(n),meta:t.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,i),l.prototype.processChunk=function(t){this.push({data:s.utf8encode(t.data),meta:t.meta})},s.Utf8EncodeWorker=l},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(t,e,a){\"use strict\";var o=t(\"./support\"),h=t(\"./base64\"),r=t(\"./nodejsUtils\"),i=t(\"set-immediate-shim\"),u=t(\"./external\");function n(t){return t}function l(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(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new h.Buf8(t.length),r=0,i=e.length;r>10&1023,o[i++]=56320|1023&n)}return l(o,i)},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?e:0===r?e:r+u[t[r]]>e?r:e}},{\"./common\":41}],43:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var n=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 n=o,s=i+r;t^=-1;for(var a=i;a>>8^n[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){\"use strict\";var h,d=t(\"../utils/common\"),u=t(\"./trees\"),c=t(\"./adler32\"),p=t(\"./crc32\"),i=t(\"./messages\"),l=0,f=4,m=0,_=-2,g=-1,b=4,n=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(t,e){return t.msg=i[e],e}function T(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(d.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 N(t,e){u._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,F(t.strm)}function U(t,e){t.pending_buf[t.pending++]=e}function P(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function L(t,e){var r,i,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-z?t.strstart-(t.w_size-z):0,u=t.window,l=t.w_mask,f=t.prev,d=t.strstart+S,c=u[s+a-1],p=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--n);return a<=t.lookahead?a:t.lookahead}function j(t){var e,r,i,n,s,a,o,h,u,l,f=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-z)){for(d.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);n+=f}if(0===t.strm.avail_in)break;if(a=t.strm,o=t.window,h=t.strstart+t.lookahead,u=n,l=void 0,l=a.avail_in,u=x)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x)if(i=u._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=x&&(t.ins_h=(t.ins_h<=x&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-x,i=u._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(j(t),0===t.lookahead&&e===l)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-z&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(t,e){return Y(t,e,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?_:(t.state.gzhead=e,m):_},r.deflate=function(t,e){var r,i,n,s;if(!t||!t.state||5>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=p(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=E);else{var a=v+(i.w_bits-8<<4)<<8;a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=E,P(i,a),0!==i.strstart&&(P(i,t.adler>>>16),P(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),F(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexn&&(t.adler=p(t.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(t),i.pending+2<=i.pending_buf_size&&(U(i,255&t.adler),U(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(F(t),0===t.avail_out)return i.last_flush=-1,m}else if(0===t.avail_in&&T(e)<=T(r)&&e!==f)return R(t,-5);if(666===i.status&&0!==t.avail_in)return R(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==l&&666!==i.status){var o=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(j(t),0===t.lookahead)){if(e===l)return A;break}if(t.match_length=0,r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):3===i.strategy?function(t,e){for(var r,i,n,s,a=t.window;;){if(t.lookahead<=S){if(j(t),t.lookahead<=S&&e===l)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(r=u._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=u._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===f?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):h[i.level].func(i,e);if(o!==O&&o!==B||(i.status=666),o===A||o===O)return 0===t.avail_out&&(i.last_flush=-1),m;if(o===I&&(1===e?u._tr_align(i):5!==e&&(u._tr_stored_block(i,0,0,!1),3===e&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),F(t),0===t.avail_out))return i.last_flush=-1,m}return e!==f?m:i.wrap<=0?1:(2===i.wrap?(U(i,255&t.adler),U(i,t.adler>>8&255),U(i,t.adler>>16&255),U(i,t.adler>>24&255),U(i,255&t.total_in),U(i,t.total_in>>8&255),U(i,t.total_in>>16&255),U(i,t.total_in>>24&255)):(P(i,t.adler>>>16),P(i,65535&t.adler)),F(t),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new d.Buf8(r.w_size),d.arraySet(u,e,l-r.w_size,r.w_size,0),e=u,l=r.w_size),a=t.avail_in,o=t.next_in,h=t.input,t.avail_in=l,t.next_in=0,t.input=e,j(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(c&(1<>>=y,p-=y),p<15&&(c+=z[i++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(c&(1<>>=y,p-=y,(y=s-a)>3,c&=(1<<(p-=w<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){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 I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=P,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new I.Buf32(i),e.distcode=e.distdyn=new I.Buf32(n),e.sane=1,e.back=-1,N):U}function o(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,a(t)):U}function h(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(I.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(n=s.wsize-s.wnext)&&(n=i),I.arraySet(s.window,e,r-i,n,s.wnext),(i-=n)?(I.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){t.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break t;o--,u+=i[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(c=r.length)&&(c=o),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,i,s,c,k)),512&r.flags&&(r.check=B(r.check,i,c,s)),o-=c,s+=c,r.length-=c),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break t;for(c=0;k=i[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break t;o--,u+=i[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break t;o--,u+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==e)break;u>>>=2,l-=2;break t;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break t;o--,u+=i[s++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(c=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+c>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}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,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){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<=o&&258<=h){t.next_out=a,t.avail_out=h,t.next_in=s,t.avail_in=o,r.hold=u,r.bits=l,R(t,d),a=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break t;o--,u+=i[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=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===h)break t;if(c=d-h,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=n,p=a-r.offset,c=r.length;for(hc?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=e[r+a[v]]}if(k>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function P(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function Z(t,e,r){var i,n,s=new Array(g+1),a=0;for(i=1;i<=g;i++)s[i]=a=a+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=j(s[o]++,o))}}function W(t){var e;for(e=0;e>1;1<=r;r--)G(t,s,r);for(n=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,G(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,a,o,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=g;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<_;r++)p<(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)&&(s=p,m++),h[2*i+1]=s,u>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return h;for(e=32;e>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?J(t,e,r,i):4===t.strategy||s===n?(P(t,2+(i?1:0),3),K(t,z,C)):(P(t,4+(i?1:0),3),function(t,e,r,i){var n;for(P(t,e-257,5),P(t,r-1,5),P(t,i-4,4),n=0;n>>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*(A[r]+u+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){P(t,2,3),L(t,m,z),function(t){16===t.bi_valid?(U(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){\"use strict\";e.exports=\"function\"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)});","HTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(a,r,t){var i=this.toDataURL(r,t).split(\",\")[1];setTimeout(function(){for(var t=atob(i),o=t.length,e=new Uint8Array(o),n=0;n arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar MicroModal = function () {\n\n var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n var Modal = /*#__PURE__*/function () {\n function Modal(_ref) {\n var targetModal = _ref.targetModal,\n _ref$triggers = _ref.triggers,\n triggers = _ref$triggers === void 0 ? [] : _ref$triggers,\n _ref$onShow = _ref.onShow,\n onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n _ref$openTrigger = _ref.openTrigger,\n openTrigger = _ref$openTrigger === void 0 ? 'data-micromodal-trigger' : _ref$openTrigger,\n _ref$closeTrigger = _ref.closeTrigger,\n closeTrigger = _ref$closeTrigger === void 0 ? 'data-micromodal-close' : _ref$closeTrigger,\n _ref$openClass = _ref.openClass,\n openClass = _ref$openClass === void 0 ? 'is-open' : _ref$openClass,\n _ref$disableScroll = _ref.disableScroll,\n disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,\n _ref$disableFocus = _ref.disableFocus,\n disableFocus = _ref$disableFocus === void 0 ? false : _ref$disableFocus,\n _ref$awaitCloseAnimat = _ref.awaitCloseAnimation,\n awaitCloseAnimation = _ref$awaitCloseAnimat === void 0 ? false : _ref$awaitCloseAnimat,\n _ref$awaitOpenAnimati = _ref.awaitOpenAnimation,\n awaitOpenAnimation = _ref$awaitOpenAnimati === void 0 ? false : _ref$awaitOpenAnimati,\n _ref$debugMode = _ref.debugMode,\n debugMode = _ref$debugMode === void 0 ? false : _ref$debugMode;\n\n _classCallCheck(this, Modal);\n\n // Save a reference of the modal\n this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n this.config = {\n debugMode: debugMode,\n disableScroll: disableScroll,\n openTrigger: openTrigger,\n closeTrigger: closeTrigger,\n openClass: openClass,\n onShow: onShow,\n onClose: onClose,\n awaitCloseAnimation: awaitCloseAnimation,\n awaitOpenAnimation: awaitOpenAnimation,\n disableFocus: disableFocus\n }; // Register click events only if pre binding eventListeners\n\n if (triggers.length > 0) this.registerTriggers.apply(this, _toConsumableArray(triggers)); // pre bind functions for event listeners\n\n this.onClick = this.onClick.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n }\n /**\n * Loops through all openTriggers and binds click event\n * @param {array} triggers [Array of node elements]\n * @return {void}\n */\n\n\n _createClass(Modal, [{\n key: \"registerTriggers\",\n value: function registerTriggers() {\n var _this = this;\n\n for (var _len = arguments.length, triggers = new Array(_len), _key = 0; _key < _len; _key++) {\n triggers[_key] = arguments[_key];\n }\n\n triggers.filter(Boolean).forEach(function (trigger) {\n trigger.addEventListener('click', function (event) {\n return _this.showModal(event);\n });\n });\n }\n }, {\n key: \"showModal\",\n value: function showModal() {\n var _this2 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n this.activeElement = document.activeElement;\n this.modal.setAttribute('aria-hidden', 'false');\n this.modal.classList.add(this.config.openClass);\n this.scrollBehaviour('disable');\n this.addEventListeners();\n\n if (this.config.awaitOpenAnimation) {\n var handler = function handler() {\n _this2.modal.removeEventListener('animationend', handler, false);\n\n _this2.setFocusToFirstNode();\n };\n\n this.modal.addEventListener('animationend', handler, false);\n } else {\n this.setFocusToFirstNode();\n }\n\n this.config.onShow(this.modal, this.activeElement, event);\n }\n }, {\n key: \"closeModal\",\n value: function closeModal() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var modal = this.modal;\n this.modal.setAttribute('aria-hidden', 'true');\n this.removeEventListeners();\n this.scrollBehaviour('enable');\n\n if (this.activeElement && this.activeElement.focus) {\n this.activeElement.focus();\n }\n\n this.config.onClose(this.modal, this.activeElement, event);\n\n if (this.config.awaitCloseAnimation) {\n var openClass = this.config.openClass; // <- old school ftw\n\n this.modal.addEventListener('animationend', function handler() {\n modal.classList.remove(openClass);\n modal.removeEventListener('animationend', handler, false);\n }, false);\n } else {\n modal.classList.remove(this.config.openClass);\n }\n }\n }, {\n key: \"closeModalById\",\n value: function closeModalById(targetModal) {\n this.modal = document.getElementById(targetModal);\n if (this.modal) this.closeModal();\n }\n }, {\n key: \"scrollBehaviour\",\n value: function scrollBehaviour(toggle) {\n if (!this.config.disableScroll) return;\n var body = document.querySelector('body');\n\n switch (toggle) {\n case 'enable':\n Object.assign(body.style, {\n overflow: ''\n });\n break;\n\n case 'disable':\n Object.assign(body.style, {\n overflow: 'hidden'\n });\n break;\n }\n }\n }, {\n key: \"addEventListeners\",\n value: function addEventListeners() {\n this.modal.addEventListener('touchstart', this.onClick);\n this.modal.addEventListener('click', this.onClick);\n document.addEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n this.modal.removeEventListener('touchstart', this.onClick);\n this.modal.removeEventListener('click', this.onClick);\n document.removeEventListener('keydown', this.onKeydown);\n }\n }, {\n key: \"onClick\",\n value: function onClick(event) {\n if (event.target.hasAttribute(this.config.closeTrigger)) {\n this.closeModal(event);\n }\n }\n }, {\n key: \"onKeydown\",\n value: function onKeydown(event) {\n if (event.keyCode === 27) this.closeModal(event); // esc\n\n if (event.keyCode === 9) this.retainFocus(event); // tab\n }\n }, {\n key: \"getFocusableNodes\",\n value: function getFocusableNodes() {\n var nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n return Array.apply(void 0, _toConsumableArray(nodes));\n }\n /**\n * Tries to set focus on a node which is not a close trigger\n * if no other nodes exist then focuses on first close trigger\n */\n\n }, {\n key: \"setFocusToFirstNode\",\n value: function setFocusToFirstNode() {\n var _this3 = this;\n\n if (this.config.disableFocus) return;\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes\n // could not think of a better name :(\n\n var nodesWhichAreNotCloseTargets = focusableNodes.filter(function (node) {\n return !node.hasAttribute(_this3.config.closeTrigger);\n });\n if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus();\n if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus();\n }\n }, {\n key: \"retainFocus\",\n value: function retainFocus(event) {\n var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n if (focusableNodes.length === 0) return;\n /**\n * Filters nodes which are hidden to prevent\n * focus leak outside modal\n */\n\n focusableNodes = focusableNodes.filter(function (node) {\n return node.offsetParent !== null;\n }); // if disableFocus is true\n\n if (!this.modal.contains(document.activeElement)) {\n focusableNodes[0].focus();\n } else {\n var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableNodes[focusableNodes.length - 1].focus();\n event.preventDefault();\n }\n\n if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) {\n focusableNodes[0].focus();\n event.preventDefault();\n }\n }\n }\n }]);\n\n return Modal;\n }();\n /**\n * Modal prototype ends.\n * Here on code is responsible for detecting and\n * auto binding event handlers on modal triggers\n */\n // Keep a reference to the opened modal\n\n\n var activeModal = null;\n /**\n * Generates an associative array of modals and it's\n * respective triggers\n * @param {array} triggers An array of all triggers\n * @param {string} triggerAttr The data-attribute which triggers the module\n * @return {array}\n */\n\n var generateTriggerMap = function generateTriggerMap(triggers, triggerAttr) {\n var triggerMap = [];\n triggers.forEach(function (trigger) {\n var targetModal = trigger.attributes[triggerAttr].value;\n if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n triggerMap[targetModal].push(trigger);\n });\n return triggerMap;\n };\n /**\n * Validates whether a modal of the given id exists\n * in the DOM\n * @param {number} id The id of the modal\n * @return {boolean}\n */\n\n\n var validateModalPresence = function validateModalPresence(id) {\n if (!document.getElementById(id)) {\n console.warn(\"MicroModal: \\u2757Seems like you have missed %c'\".concat(id, \"'\"), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"
\"));\n return false;\n }\n };\n /**\n * Validates if there are modal triggers present\n * in the DOM\n * @param {array} triggers An array of data-triggers\n * @return {boolean}\n */\n\n\n var validateTriggerPresence = function validateTriggerPresence(triggers) {\n if (triggers.length <= 0) {\n console.warn(\"MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"\");\n return false;\n }\n };\n /**\n * Checks if triggers and their corresponding modals\n * are present in the DOM\n * @param {array} triggers Array of DOM nodes which have data-triggers\n * @param {array} triggerMap Associative array of modals and their triggers\n * @return {boolean}\n */\n\n\n var validateArgs = function validateArgs(triggers, triggerMap) {\n validateTriggerPresence(triggers);\n if (!triggerMap) return true;\n\n for (var id in triggerMap) {\n validateModalPresence(id);\n }\n\n return true;\n };\n /**\n * Binds click handlers to all modal triggers\n * @param {object} config [description]\n * @return void\n */\n\n\n var init = function init(config) {\n // Create an config object with default openTrigger\n var options = Object.assign({}, {\n openTrigger: 'data-micromodal-trigger'\n }, config); // Collects all the nodes with the trigger\n\n var triggers = _toConsumableArray(document.querySelectorAll(\"[\".concat(options.openTrigger, \"]\"))); // Makes a mappings of modals with their trigger nodes\n\n\n var triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n for (var key in triggerMap) {\n var value = triggerMap[key];\n options.targetModal = key;\n options.triggers = _toConsumableArray(value);\n activeModal = new Modal(options); // eslint-disable-line no-new\n }\n };\n /**\n * Shows a particular modal\n * @param {string} targetModal [The id of the modal to display]\n * @param {object} config [The configuration object to pass]\n * @return {void}\n */\n\n\n var show = function show(targetModal, config) {\n var options = config || {};\n options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // clear events in case previous modal wasn't close\n\n if (activeModal) activeModal.removeEventListeners(); // stores reference to active modal\n\n activeModal = new Modal(options); // eslint-disable-line no-new\n\n activeModal.showModal();\n };\n /**\n * Closes the active modal\n * @param {string} targetModal [The id of the modal to close]\n * @return {void}\n */\n\n\n var close = function close(targetModal) {\n targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n };\n\n return {\n init: init,\n show: show,\n close: close\n };\n}();\nwindow.MicroModal = MicroModal;\n\nexport default MicroModal;\n","export default \"(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c},a.define('/gif.worker.coffee',function(d,e,f,g){var b,c;b=a('/GIFEncoder.js',d),c=function(a){var c,e,d,f;return c=new b(a.width,a.height),a.index===0?c.writeHeader():c.firstFrame=!1,c.setTransparent(a.transparent),c.setRepeat(a.repeat),c.setDelay(a.delay),c.setQuality(a.quality),c.addFrame(a.data),a.last&&c.finish(),d=c.stream(),a.data=d.pages,a.cursor=d.cursor,a.pageSize=d.constructor.pageSize,a.canTransfer?(f=function(c){for(var b=0,d=a.data.length;b=c.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=a},c.prototype.writeUTFBytes=function(b){for(var c=b.length,a=0;a=0&&(this.dispose=a)},b.prototype.setRepeat=function(a){this.repeat=a},b.prototype.setTransparent=function(a){this.transparent=a},b.prototype.addFrame=function(a){this.image=a,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1},b.prototype.finish=function(){this.out.writeByte(59)},b.prototype.setQuality=function(a){a<1&&(a=1),this.sample=a},b.prototype.writeHeader=function(){this.out.writeUTFBytes('GIF89a')},b.prototype.analyzePixels=function(){var g=this.pixels.length,d=g/3;this.indexedPixels=new Uint8Array(d);var a=new f(this.pixels,this.sample);a.buildColormap(),this.colorTab=a.getColormap();var b=0;for(var c=0;c>16,l=(e&65280)>>8,m=e&255,c=0,d=16777216,j=this.colorTab.length;for(var a=0;a=0&&(a=dispose&7),a<<=2,this.out.writeByte(0|a|0|b),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},b.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},b.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},b.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes('NETSCAPE2.0'),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},b.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var b=768-this.colorTab.length;for(var a=0;a>8&255)},b.prototype.writePixels=function(){var a=new g(this.width,this.height,this.indexedPixels,this.colorDepth);a.encode(this.out)},b.prototype.stream=function(){return this.out},e.exports=b}),a.define('/LZWEncoder.js',function(e,g,h,i){function f(y,D,C,B){function w(a,b){r[f++]=a,f>=254&&t(b)}function x(b){u(a),k=i+2,j=!0,l(i,b)}function u(b){for(var a=0;a=0){y=w-d,d===0&&(y=1);do if((d-=y)<0&&(d+=w),h[d]===g){e=n[d];continue a}while(h[d]>=0)}l(e,r),e=t,k<1<0&&(a.writeByte(f),a.writeBytes(r,0,f),f=0)}function p(a){return(1<0?g|=a<=8)w(g&255,c),g>>=8,e-=8;if((k>m||j)&&(j?(m=p(n_bits=q),j=!1):(++n_bits,n_bits==b?m=1<0)w(g&255,c),g>>=8,e-=8;t(c)}}var s=Math.max(2,B),r=new Uint8Array(256),h=new Int32Array(a),n=new Int32Array(a),g,e=0,f,k=0,m,j=!1,q,i,o;this.encode=z}var c=-1,b=12,a=5003,d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=f}),a.define('/TypedNeuQuant.js',function(A,F,E,D){function C(A,B){function I(){o=[],q=new Int32Array(256),t=new Int32Array(a),y=new Int32Array(a),z=new Int32Array(a>>3);var c,d;for(c=0;c>=b,o[c][1]>>=b,o[c][2]>>=b,o[c][3]=c}function K(b,a,c,e,f){o[a][0]-=b*(o[a][0]-c)/d,o[a][1]-=b*(o[a][1]-e)/d,o[a][2]-=b*(o[a][2]-f)/d}function L(j,e,n,l,k){var h=Math.abs(e-j),i=Math.min(e+j,a),g=e+1,f=e-1,m=1,b,d;while(gh)d=z[m++],gh&&(b=o[f--],b[0]-=d*(b[0]-n)/c,b[1]-=d*(b[1]-l)/c,b[2]-=d*(b[2]-k)/c)}function C(p,s,q){var h=2147483647,k=h,d=-1,m=d,c,j,e,n,l;for(c=0;c>i-b),n>g,y[c]-=l,t[c]+=l<>1,b=f+1;b>1,b=f+1;b<256;b++)q[b]=n}function E(j,i,k){var b,d,c,e=1e3,h=-1,f=q[i],g=f-1;while(f=0)f=e?f=a:(f++,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c=0&&(d=o[g],c=i-d[1],c>=e?g=-1:(g--,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c>h;for(a<=1&&(a=0),c=0;c=f&&(g-=f),c++,q===0&&(q=1),c%q===0)for(n-=n/D,o-=o/v,a=o>>h,a<=1&&(a=0),e=0;e>g,r=e<>3,h=6,t=1< void;\ntype CAPTURE_TYPE =\n\ttypeof GIF | typeof WEBM | typeof MP4 |\n\ttypeof JPEGZIP | typeof PNGZIP;\n\n// Save options for hotkey controls.\nexport type WEBM_OPTIONS = {\n\tformat?: typeof WEBM,\n\tfps?: number,\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tonExportProgress?: (progress: number) => void, // Download is immediate, so this isn't very informative. progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type MP4_OPTIONS = {\n\tformat?: typeof MP4,\n\tfps?: number,\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tffmpegOptions?: { [key: string]: string },\n\tonExportProgress?: (progress: number) => void, // FFMPEG encoding progress, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type GIF_OPTIONS = {\n\tfps?: number,\n\tname?: string,\n\tquality?: number // A number 0-1.\n\tonExportProgress?: (progress: number) => void, // progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type PNG_OPTIONS = {\n\tname?: string,\n\tdpi?: number, // Default is screen dpi (72).\n\tonExportProgress?: (progress: number) => void, // Zipping progress, only used for recording PNG frames, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nexport type JPEG_OPTIONS = {\n\tname?: string,\n\tquality?: number, // A number 0-1.\n\tdpi?: number, // Default is screen dpi (72).\n\tonExportProgress?: (progress: number) => void, // Zipping progress, only used for recording JPEG frames, progress is a number between 0 and 1.\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\n\nexport type ACTIVE_CAPTURE = {\n\tname: string,\n\tcapturer: CCapture | JSZip,\n\tnumFrames: number,\n\ttype: CAPTURE_TYPE,\n\tzipOptions?: PNG_OPTIONS | JPEG_OPTIONS, // Only used for frame zip record.\n\tzipPromises?: Promise[],\n\tffmpegOptions?: { [key: string]: string }, // Only used for mp4 record.\n\tonExportProgress?: (progress: number) => void,\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tonError?: (error: any) => void,\n};\nconst activeCaptures: ACTIVE_CAPTURE[] = [];\n\n// This is an unused variable,\n// but needed for proper import of CCapture at the moment.\n// See https://github.com/spite/ccapture.js/issues/78\nconst temp = CCapture;\n\ntype HOTKEY_TYPE =\n\ttypeof GIF | typeof WEBM | typeof MP4 |\n\ttypeof JPEGZIP | typeof PNGZIP |\n\ttypeof JPEG | typeof PNG;\n\nconst hotkeyOptions:\n{\n\t[MP4]?: MP4_OPTIONS,\n\t[WEBM]?: WEBM_OPTIONS,\n\t[GIF]?: GIF_OPTIONS,\n\t[PNGZIP]?: PNG_OPTIONS,\n\t[JPEGZIP]?: JPEG_OPTIONS,\n\t[PNG]?: PNG_OPTIONS,\n\t[JPEG]?: JPEG_OPTIONS,\n} = {};\n\nconst hotkeys: {\n\t[MP4]?: string,\n\t[WEBM]?: string,\n\t[GIF]?: string,\n\t[PNGZIP]?: string,\n\t[JPEGZIP]?: string,\n\t[PNG]?: string,\n\t[JPEG]?: string,\n} = {};\n\nlet canvas: HTMLCanvasElement | null = null;\n\nexport function init(_canvas: HTMLCanvasElement, options?: {\n\tffmpegCorePath?: string,\n\tverbose?: boolean,\n\tshowAlerts?: boolean,\n\tshowDialogs?: boolean,\n\tshowRecDot?: boolean,\n\trecDotCSS?: {[key: string]: string},\n}) {\n\tcanvas = _canvas;\n\t// Use public address if you don't want to host your own.\n\tffmpegPath = options?.ffmpegCorePath || 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n\tif (options && options.verbose !== undefined) setVerbose(options.verbose);\n\tif (options && options.showAlerts !== undefined) PARAMS.SHOW_ALERTS = options.showAlerts;\n\tif (options && options.showDialogs !== undefined) PARAMS.SHOW_DIALOGS = options.showDialogs;\n\tif (options && options.showRecDot !== undefined) PARAMS.SHOW_REC_DOT = options.showRecDot;\n\tif (PARAMS.SHOW_REC_DOT) {\n\t\tinitDotWithCSS(options?.recDotCSS);\n\t}\n\tcanvas.addEventListener('resize', function(){\n\t\tif (activeCaptures.length) {\n\t\t\tconst warningMsg = \"Don't resize while recording canvas!\";\n\t\t\tshowWarning(warningMsg);\n\t\t}\n\t});\n}\n\nexport function setVerbose(state: boolean) {\n\tPARAMS.VERBOSE = !!state;\n\tif (ffmpeg) ffmpeg.setLogging(PARAMS.VERBOSE);\n}\n\nfunction checkCanvas() {\n\tif (canvas === null) {\n\t\tthrow new Error('No canvas supplied, please call CanvasCapture.init() and pass in canvas element.');\n\t}\n}\n\nfunction setHotkey(key: string, type: HOTKEY_TYPE) {\n\t// Unbind other hotkeys attached to same key.\n\tObject.keys(hotkeys).forEach(keyName => {\n\t\tif (hotkeys[keyName as HOTKEY_TYPE] === key) {\n\t\t\tdelete hotkeys[keyName as HOTKEY_TYPE];\n\t\t}\n\t});\n\thotkeys[type] = key;\n}\n\n// Pressing key once will start record, press again to stop.\nexport function bindKeyToVideoRecord(key: string, options?: WEBM_OPTIONS | MP4_OPTIONS) {\n\tif (options?.format === WEBM) {\n\t\thotkeyOptions.webm = options as WEBM_OPTIONS;\n\t\tsetHotkey(key, WEBM);\n\t} else {\n\t\t// Default to MP4.\n\t\thotkeyOptions.mp4 = options as MP4_OPTIONS;\n\t\tsetHotkey(key, MP4);\n\t}\n}\nexport function bindKeyToGIFRecord(key: string, options?: GIF_OPTIONS) {\n\thotkeyOptions.gif = options;\n\tsetHotkey(key, GIF);\n}\nexport function bindKeyToPNGFramesRecord(key: string, options?: PNG_OPTIONS) {\n\thotkeyOptions.pngzip = options;\n\tsetHotkey(key, PNGZIP);\n}\nexport function bindKeyToJPEGFramesRecord(key: string, options?: JPEG_OPTIONS) {\n\thotkeyOptions.jpegzip = options;\n\tsetHotkey(key, JPEGZIP);\n}\n// Snapshots just take a single shot.\nexport function bindKeyToPNGSnapshot(key: string, options?: PNG_OPTIONS) {\n\thotkeyOptions.png = options;\n\tsetHotkey(key, PNG);\n}\nexport function bindKeyToJPEGSnapshot(key: string, options?: JPEG_OPTIONS) {\n\thotkeyOptions.jpeg = options;\n\tsetHotkey(key, JPEG);\n}\n\nwindow.addEventListener('keydown', (e: KeyboardEvent) => {\n\tif (hotkeys.mp4 && e.key === hotkeys[MP4]) {\n\t\tconst MP4s = activeCapturesOfType(MP4);\n\t\tif (MP4s.length) stopRecord(MP4s);\n\t\telse {\n\t\t\tif (!browserSupportsMP4()) {\n\t\t\t\tconst errorMsg = `This browser does not support MP4 video recording, please try again in Chrome.`;\n\t\t\t\tconst onError = hotkeyOptions[MP4]?.onError;\n\t\t\t\tif (onError) onError(new Error(errorMsg));\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t}\n\t\t\tbeginVideoRecord(hotkeyOptions[MP4]);\n\t\t}\n\t}\n\tif (hotkeys.webm && e.key === hotkeys[WEBM]) {\n\t\tconst WEBMs = activeCapturesOfType(WEBM);\n\t\tif (WEBMs.length) stopRecord(WEBMs);\n\t\telse {\n\t\t\tif (!browserSupportsWEBM()) {\n\t\t\t\tconst errorMsg = `This browser does not support WEBM video recording, please try again in Chrome.`;\n\t\t\t\tconst onError = hotkeyOptions[WEBM]?.onError;\n\t\t\t\tif (onError) onError(new Error(errorMsg));\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t}\n\t\t\tbeginVideoRecord(hotkeyOptions[WEBM]);\n\t\t}\n\t}\n\tif (hotkeys.gif && e.key === hotkeys[GIF]) {\n\t\tconst GIFs = activeCapturesOfType(GIF);\n\t\tif (GIFs.length) stopRecord(GIFs);\n\t\telse beginGIFRecord(hotkeyOptions[GIF]);\n\t}\n\tif (hotkeys.pngzip && e.key === hotkeys[PNGZIP]) {\n\t\tconst pngzips = activeCapturesOfType(PNGZIP);\n\t\tif (pngzips.length) stopRecord(pngzips);\n\t\telse beginPNGFramesRecord(hotkeyOptions[PNGZIP]);\n\t}\n\tif (hotkeys.jpegzip && e.key === hotkeys[JPEGZIP]) {\n\t\tconst jpgzips = activeCapturesOfType(JPEGZIP);\n\t\tif (jpgzips.length) stopRecord(jpgzips);\n\t\telse beginJPEGFramesRecord(hotkeyOptions[JPEGZIP]);\n\t}\n\tif (hotkeys.png && e.key === hotkeys[PNG]) {\n\t\ttakePNGSnapshot(hotkeyOptions[PNG]);\n\t}\n\tif (hotkeys.jpeg && e.key === hotkeys[JPEG]) {\n\t\ttakeJPEGSnapshot(hotkeyOptions[JPEG]);\n\t}\n});\n\nfunction startCapture(capture: ACTIVE_CAPTURE) {\n\tactiveCaptures.push(capture);\n\tif (capture.type !== PNGZIP && capture.type !== JPEGZIP) (capture.capturer as CCapture).start();\n\t// For multi-frame records, we should also throw up an indicator to show that we're in record mode.\n\tshowDot(isRecording());\n}\n\nexport function beginVideoRecord(options?: WEBM_OPTIONS | MP4_OPTIONS) {\n\ttry {\n\t\tconst format = options?.format || MP4; // Default to MP4 record.\n\t\tif (format === MP4) {\n\t\t\tif (!browserSupportsMP4()) {\n\t\t\t\tconst errorMsg = `This browser does not support MP4 video recording, please try again in Chrome.`;\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t\tthrow new Error(errorMsg);\n\t\t\t}\n\t\t} else if (format === WEBM) {\n\t\t\tif (!browserSupportsWEBM()) {\n\t\t\t\tconst errorMsg = `This browser does not support WEBM video recording, please try again in Chrome.`;\n\t\t\t\tshowWarning(errorMsg);\n\t\t\t\tthrow new Error(errorMsg);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(`invalid video format ${format}.`);\n\t\t}\n\t\tif (activeVideoGifCaptures().length) {\n\t\t\tconst errorMsg = `CCapture.js only supports one video/gif capture at a time.`;\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\t\n\t\tlet quality = 1;\n\t\tif (options && options.quality) {\n\t\t\tquality = options.quality;\n\t\t}\n\t\tconst name = options?.name || 'Video_Capture';\n\t\t// Create a capturer that exports a WebM video.\n\t\t// @ts-ignore\n\t\tconst capturer = new (window.CCapture as CCapture)({\n\t\t\tformat: WEBM,\n\t\t\tname,\n\t\t\tframerate: options?.fps || 60,\n\t\t\tquality: quality * 100, // CCapture seems to expect a quality between 0 and 100.\n\t\t\tverbose: PARAMS.VERBOSE,\n\t\t});\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tcapturer,\n\t\t\tnumFrames: 0,\n\t\t\ttype: format,\n\t\t\tffmpegOptions: (options as MP4_OPTIONS)?.ffmpegOptions,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginGIFRecord(options?: GIF_OPTIONS) {\n\ttry {\n\t\tif (activeVideoGifCaptures().length) {\n\t\t\tconst errorMsg = `CCapture.js only supports one video/gif capture at a time.`;\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\t// CCapture seems to expect a quality between 0 and 100.\n\t\tlet quality = 100;\n\t\tif (options && options.quality) {\n\t\t\tquality = options.quality * 100;\n\t\t}\n\t\tconst name = options?.name || 'GIF_Capture';\n\t\t// Create a capturer that exports a GIF.\n\t\t// @ts-ignore\n\t\tconst capturer = new (window.CCapture as CCapture)({\n\t\t\tformat: GIF,\n\t\t\tname,\n\t\t\tframerate: options?.fps || 60,\n\t\t\tworkersPath: gifWorkersPath,\n\t\t\tquality,\n\t\t\tverbose: PARAMS.VERBOSE,\n\t\t\tonProgress: options?.onExportProgress,\n\t\t});\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tcapturer,\n\t\t\tnumFrames: 0,\n\t\t\ttype: GIF as CAPTURE_TYPE,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginPNGFramesRecord(options?: PNG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'PNG_Frames_Capture';\n\t\tconst zipOptions = { dpi: options?.dpi };\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tzipOptions,\n\t\t\tzipPromises: [],\n\t\t\tcapturer: new JSZip(),\n\t\t\tnumFrames: 0,\n\t\t\ttype: PNGZIP as CAPTURE_TYPE,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function beginJPEGFramesRecord(options?: JPEG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'JPEG_Frames_Capture';\n\t\tconst zipOptions = { dpi: options?.dpi, quality: options?.quality };\n\t\tconst capture = {\n\t\t\tname,\n\t\t\tzipOptions,\n\t\t\tzipPromises: [],\n\t\t\tcapturer: new JSZip(),\n\t\t\tnumFrames: 0,\n\t\t\ttype: JPEGZIP as CAPTURE_TYPE,\n\t\t\tonExportProgress: options?.onExportProgress,\n\t\t\tonExport: options?.onExport,\n\t\t\tonExportFinish: options?.onExportFinish,\n\t\t\tonError: options?.onError,\n\t\t};\n\t\tstartCapture(capture);\n\t\treturn capture;\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nasync function canvasToBlobAsync(canvas: HTMLCanvasElement, type: typeof PNG | typeof JPEG, quality?: number) {\n\treturn new Promise((resolve: (blob: Blob | null) => void) => {\n\t\tcanvas.toBlob((blob: Blob | null) => {\n\t\t\tresolve(blob);\n\t\t}, `image/${type}`, quality);\n\t});\n}\n\nasync function takeImageSnapshot(filename: string, type: typeof PNG | typeof JPEG, quality?: number, options?: JPEG_OPTIONS | PNG_OPTIONS) {\n\tcheckCanvas();\n\tconst onExportFinish = options?.onExportFinish;\n\tconst blob = await canvasToBlobAsync(canvas!, type, quality);\n\tif (!blob) {\n\t\tconst errorMsg = `Problem saving ${type.toUpperCase()}, please try again!`;\n\t\tshowWarning(errorMsg);\n\t\tthrow new Error(errorMsg);\n\t}\n\tconst onExport = options?.onExport || saveAs;\n\tif (options?.dpi) {\n\t\tawait changeDpiBlob(blob, options?.dpi).then((blob: Blob) => {\n\t\t\tonExport(blob, filename);\n\t\t\tif (onExportFinish) onExportFinish();\n\t\t});\n\t} else {\n\t\tonExport(blob, filename);\n\t\tif (onExportFinish) onExportFinish();\n\t}\n}\n\nexport async function takePNGSnapshot(options?: PNG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'PNG_Capture';\n\t\tconst filename = `${name}.png`;\n\t\tawait takeImageSnapshot(filename, PNG, undefined, options);\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport async function takeJPEGSnapshot(options?: JPEG_OPTIONS) {\n\ttry {\n\t\tconst name = options?.name || 'JPEG_Capture';\n\t\tconst filename = `${name}.jpg`;\n\t\t// Quality is a number between 0 and 1 https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n\t\tawait takeImageSnapshot(filename, JPEG, options?.quality || 1, options);\n\t} catch (error) {\n\t\tif (options?.onError) options.onError(error);\n\t\telse throw error;\n\t}\n}\n\nexport function recordFrame(capture?: ACTIVE_CAPTURE | ACTIVE_CAPTURE[]) {\n\tlet captures = activeCaptures;\n\tif (capture) {\n\t\tif (!Array.isArray(capture)) {\n\t\t\tcaptures = [capture];\n\t\t} else {\n\t\t\tcaptures = capture;\n\t\t}\n\t}\n\ttry {\n\t\tcheckCanvas();\n\t\tif (captures.length === 0) {\n\t\t\tconst errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst { capturer, type, zipOptions, zipPromises, numFrames } = captures[i];\n\t\t\tif (type === JPEGZIP || type === PNGZIP) {\n\t\t\t\t// Name should correspond to current frame.\n\t\t\t\tconst frameName = `frame_${numFrames + 1}`;\n\t\t\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\t\t\tconst options = {\n\t\t\t\t\t\tdpi: zipOptions?.dpi,\n\t\t\t\t\t\tquality: (zipOptions as JPEG_OPTIONS).quality,\n\t\t\t\t\t\tname: frameName,\n\t\t\t\t\t\tonExport: (blob: Blob, filename: string) => {\n\t\t\t\t\t\t\t(capturer as JSZip).file(filename, blob);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonExportFinish: resolve,\n\t\t\t\t\t\tonError: reject,\n\t\t\t\t\t};\n\t\t\t\t\tif (type === JPEGZIP) {\n\t\t\t\t\t\ttakeJPEGSnapshot(options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttakePNGSnapshot(options);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tzipPromises!.push(promise);\n\t\t\t} else {\n\t\t\t\t(capturer as CCapture).capture(canvas!);\n\t\t\t}\n\t\t\tcaptures[i].numFrames = numFrames + 1\n\t\t}\n\t} catch (error) {\n\t\tlet handled = true;\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst capture = captures[i];\n\t\t\tif (capture.onError) capture.onError(error);\n\t\t\telse handled = false;\n\t\t}\n\t\tif (!captures.length || !handled) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nasync function CCaptureSaveAsync(capturer: CCapture) {\n\treturn new Promise((resolve: (blob: Blob) => void) => {\n\t\tcapturer.save((blob: Blob) => {\n\t\t\tresolve(blob);\n\t\t});\n\t});\n}\n\nasync function stopRecordAtIndex(index: number) {\n\tconst {\n\t\tname,\n\t\tcapturer,\n\t\tnumFrames,\n\t\ttype,\n\t\tzipPromises,\n\t\tonExportProgress,\n\t\tonExport,\n\t\tonExportFinish,\n\t\tonError,\n\t\tffmpegOptions,\n\t} = activeCaptures[index];\n\t// Remove ref to capturer.\n\tactiveCaptures.splice(index, 1);\n\n\tif (type !== PNGZIP && type !== JPEGZIP) (capturer as CCapture).stop();\n\n\tif (numFrames === 0) {\n\t\tconst errorMsg = 'No frames recorded, call CanvasCapture.recordFrame().';\n\t\tshowWarning(errorMsg);\n\t\tthrow new Error(errorMsg);\n\t}\n\n\tswitch (type) {\n\t\tcase MP4:\n\t\t\t{\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\t// Tell the user that mp4s take a sec to process.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'MP4 is processing and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\tawait convertWEBMtoMP4({\n\t\t\t\t\tname,\n\t\t\t\t\tblob,\n\t\t\t\t\tonExportProgress: onExportProgress,\n\t\t\t\t\tonExport: onExport,\n\t\t\t\t\tonExportFinish: onExportFinish,\n\t\t\t\t\tffmpegOptions,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase WEBM:\n\t\t\t{\n\t\t\t\tif (onExportProgress) onExportProgress(0);\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\tif (onExportProgress) onExportProgress(1);// Save is nearly immediate.\n\t\t\t\tconst filename = `${name}.webm`;\n\t\t\t\tif (onExport) {\n\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t} else {\n\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t}\n\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase GIF:\n\t\t\t{\n\t\t\t\t// Tell the user that gifs take a sec to process.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'GIF is processing and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\t// onExportProgress callback already passed to CCapture.\n\t\t\t\tconst blob = await CCaptureSaveAsync(capturer as CCapture);\n\t\t\t\tconst filename = `${name}.gif`;\n\t\t\t\tif (onExport) {\n\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t} else {\n\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t}\n\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase PNGZIP:\n\t\tcase JPEGZIP:\n\t\t\t{\n\t\t\t\t// Wait for all frames to finish saving.\n\t\t\t\tawait Promise.all(zipPromises!);\n\t\t\t\t// Tell the user that frames take a sec to zip.\n\t\t\t\tshowDialog(\n\t\t\t\t\t'Processing...',\n\t\t\t\t\t'Frames are being zipped and may take a minute to save. You can close this dialog in the meantime.',\n\t\t\t\t\t{ autoCloseDelay: 7000 },\n\t\t\t\t);\n\t\t\t\tawait (capturer as JSZip).generateAsync({ type: 'blob' }, (metadata) => {\n\t\t\t\t\tif (onExportProgress) onExportProgress(metadata.percent / 100);\n\t\t\t\t}).then((blob) => {\n\t\t\t\t\tconst filename = `${name}.zip`;\n\t\t\t\t\tif (onExport) {\n\t\t\t\t\t\tonExport(blob, filename);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsaveAs(blob, filename);\n\t\t\t\t\t}\n\t\t\t\t\tif (onExportFinish) onExportFinish();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(`Need to handle saving type ${type}.`);\n\t}\n}\n\nexport async function stopRecord(capture?: ACTIVE_CAPTURE | ACTIVE_CAPTURE[]) {\n\tif (capture && !Array.isArray(capture)) {\n\t\tcapture = [capture];\n\t}\n\tconst captures = capture || activeCaptures;\n\ttry {\n\t\tif (activeCaptures.length === 0) {\n\t\t\tconst errorMsg = 'No valid capturer inited, please call CanvasCapture.beginVideoRecord(), CanvasCapture.beginGIFRecord(), CanvasCapture.beginPNGFramesRecord(), or CanvasCapture.beginJPEGFramesRecord() first.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t}\n\n\t\tconst promises: Promise[] = [];\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst index = activeCaptures.indexOf(captures[i]);\n\t\t\tif (index < 0) throw new Error(`Invalid capture ${captures[i]} – may have already been stopped.`);\n\t\t\tpromises.push(stopRecordAtIndex(index));\n\t\t}\n\t\tshowDot(isRecording());\n\t\tawait Promise.all(promises);\n\t} catch (error) {\n\t\tlet handled = true;\n\t\tfor (let i = 0; i < captures.length; i++) {\n\t\t\tconst capture = captures[i];\n\t\t\tif (capture.onError) capture.onError(error);\n\t\t\telse handled = false;\n\t\t}\n\t\tif (!captures.length || !handled) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nfunction activeCapturesOfType(type: CAPTURE_TYPE) {\n\tconst captures: ACTIVE_CAPTURE[] = [];\n\tfor (let i = 0; i < activeCaptures.length; i++) {\n\t\tif (activeCaptures[i].type === type) {\n\t\t\tcaptures.push(activeCaptures[i]);\n\t\t}\n\t}\n\treturn captures;\n}\n\nfunction activeVideoGifCaptures() {\n\treturn activeCapturesOfType(WEBM).concat(activeCapturesOfType(MP4)).concat(activeCapturesOfType(GIF));\n}\n\nexport function isRecording() {\n\treturn activeCaptures.length > 0;\n}\n\nlet ffmpegLoaded = false;\nasync function convertWEBMtoMP4(options: {\n\tname: string,\n\tblob: Blob,\n\tonExportProgress?: (progress: number) => void,\n\tonExport?: onExport,\n\tonExportFinish?: () => void,\n\tffmpegOptions?: { [key: string]: string },\n}) {\n\tif (!ffmpeg) {\n\t\tconst createFFmpeg = require('@ffmpeg/ffmpeg/src/createFFmpeg');\n\t\tffmpeg = createFFmpeg({\n\t\t\tcorePath: ffmpegPath,\n\t\t});\n\t}\n\tif (!ffmpegLoaded) {\n\t\tawait ffmpeg!.load().catch(() => {\n\t\t\tconst errorMsg = 'MP4 export not supported in this browser, try again in the latest version of Chrome.';\n\t\t\tshowWarning(errorMsg);\n\t\t\tthrow new Error(errorMsg);\n\t\t});\n\t\tffmpegLoaded = true;\n\t}\n\tconst { name, blob, onExportProgress, onExport, onExportFinish, ffmpegOptions } = options;\n\t// Convert blob to Uint8 array.\n\tconst _data = await blob.arrayBuffer();\n\tconst data = new Uint8Array(_data);\n\t// Write data to MEMFS, need to use Uint8Array for binary data.\n\tffmpeg!.FS('writeFile', `${name}.webm`, data);\n\t// Convert to MP4.\n\t// TODO: onProgress callback is not working quite right yet.\n\t// https://github.com/ffmpegwasm/ffmpeg.wasm/issues/112\n\tif (onExportProgress) ffmpeg!.setProgress(({ ratio }) => {\n\t\tonExportProgress(Math.max(0, Math.min(ratio, 1)));\n\t});\n\t// -vf \"crop=trunc(iw/2)*2:trunc(ih/2)*2\" ensures the dimensions of the mp4 are divisible by 2.\n\t// -c:v libx264 -preset slow -crf 22 encodes as h.264 with better compression settings.\n\t// -pix_fmt yuv420p makes it compatible with the web browser.\n\t// -an creates a video with no audio.\n\tconst defaultFFMPEGOptions = {\n\t\t'-c:v': 'libx264',\n\t\t'-preset': 'slow',\n\t\t'-crf': '22',\n\t\t'-pix_fmt': 'yuv420p',\n\t};\n\tconst combinedOptions: { [key: string]: string } = {...defaultFFMPEGOptions, ...(ffmpegOptions || {})};\n\tconst _ffmpegOptions: string[] = [];\n\tObject.keys(combinedOptions).forEach(key => {\n\t\t_ffmpegOptions.push(key, combinedOptions[key]);\n\t});\n\tconst filename = `${name}.mp4`;\n\tawait ffmpeg!.run(\n\t\t'-i', `${name}.webm`,\n\t\t..._ffmpegOptions,\n\t\t'-vf', 'crop=trunc(iw/2)*2:trunc(ih/2)*2',\n\t\t'-an',\n\t\tfilename,\n\t);\n\tconst output = await ffmpeg!.FS('readFile', filename);\n\tconst outputBlob = new Blob([output], { type: 'video/mp4' });\n\tif (onExport) {\n\t\tonExport(blob, filename);\n\t} else {\n\t\tsaveAs(outputBlob, filename);\n\t}\n\t// Delete files in MEMFS.\n\tffmpeg!.FS('unlink', `${name}.webm`);\n\tffmpeg!.FS('unlink', filename);\n\tif (onExportFinish) onExportFinish();\n}\n\nfunction browserSupportsWEBP() {\n\tconst _canvas = document.createElement('canvas');\n\tconst url = _canvas!.toDataURL('image/webp', { quality: 1 });\n\tif (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction browserSupportsSharedArrayBuffer() {\n\ttry {\n\t\tconst test = new SharedArrayBuffer(1024);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction browserSupportsWebWorkers() {\n\treturn !!window.Worker;\n}\n\nexport function browserSupportsWEBM() {\n\treturn browserSupportsWEBP();\n}\n\nexport function browserSupportsMP4() {\n\t// Also web workers?\n\t// && browserSupportsWebWorkers()\n\treturn browserSupportsWEBP() && browserSupportsSharedArrayBuffer();\n}\n\nexport function browserSupportsGIF() {\n\treturn browserSupportsWebWorkers();\n}","export const css = `\n/**************************\\\n Basic Modal Styles\n\\**************************/\n\n.modal {\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\n}\n\n.modal__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0,0,0,0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.modal__container {\n background-color: #fff;\n padding: 30px;\n max-width: 500px;\n max-height: 100vh;\n overflow-y: auto;\n box-sizing: border-box;\n}\n\n.modal__header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.modal__title {\n margin-top: 0;\n margin-bottom: 0;\n font-weight: 600;\n font-size: 1.25rem;\n line-height: 1.25;\n color: #222;\n box-sizing: border-box;\n}\n\n.modal__footer {\n text-align: right;\n}\n\n.modal__footer>.modal__btn {\n margin-right: 8px;\n}\n\n.modal__close {\n background: transparent;\n border: 0;\n}\n\n.modal__header .modal__close:before { content: \"\\u2715\"; }\n\n.modal__content {\n margin-top: 2rem;\n margin-bottom: 2rem;\n line-height: 1.5;\n color: rgba(0,0,0,.8);\n}\n\n.modal__btn {\n font-size: .875rem;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: .5rem;\n padding-bottom: .5rem;\n background-color: #e6e6e6;\n color: rgba(0,0,0,.8);\n border-radius: .25rem;\n border-style: none;\n border-width: 0;\n cursor: pointer;\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n line-height: 1.15;\n margin: 0;\n will-change: transform;\n -moz-osx-font-smoothing: grayscale;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n transition: -webkit-transform .25s ease-out;\n transition: transform .25s ease-out;\n transition: transform .25s ease-out,-webkit-transform .25s ease-out;\n}\n\n.modal__btn:focus, .modal__btn:hover {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n}\n\n.modal__btn-primary {\n background-color: #333;\n color: #fff;\n}\n\n\n\n/**************************\\\n Demo Animation Style\n\\**************************/\n@keyframes mmfadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes mmfadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes mmslideIn {\n from { transform: translateY(15%); }\n to { transform: translateY(0); }\n}\n\n@keyframes mmslideOut {\n from { transform: translateY(0); }\n to { transform: translateY(-10%); }\n}\n\n.micromodal-slide {\n display: none;\n}\n\n.micromodal-slide.is-open {\n display: block;\n}\n\n.micromodal-slide[aria-hidden=\"false\"] .modal__overlay {\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"false\"] .modal__container {\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"true\"] .modal__overlay {\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden=\"true\"] .modal__container {\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide .modal__container,\n.micromodal-slide .modal__overlay {\n will-change: transform;\n}\n`\n","import MicroModal from 'micromodal';\nimport { css } from './micromodal.css';\nimport { PARAMS } from './params';\n\n// Add modal styling.\nconst style = document.createElement('style');\nstyle.textContent = css;\ndocument.head.append(style);\n\nfunction initModalHTML(modalID: string, title: string, content: string = '') {\n\tconst modalString =\n\t`
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t${title}\n\t\t\t\t

\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t${content}\n\t\t\t\t

\n\t\t\t
\n\t\t
\n\t\t
\n\t
`;\n\t// This is a trick to create an element from string.\n\tconst temp = document.createElement('div');\n\ttemp.innerHTML = modalString;\n\treturn temp.firstChild as Node;\n};\n\nlet alertModalInited = false;\nlet dialogModalInited = false;\n\nconst ALERT_MODAL_ID = 'alert';\nconst alertModal = initModalHTML(ALERT_MODAL_ID, 'Warning');\n\nconst DIALOG_MODAL_ID = 'dialog';\nconst dialogModal = initModalHTML(DIALOG_MODAL_ID, 'Saving...');\n\nexport function showWarning(message: string) {\n\tconsole.warn(message);\n\tif (!PARAMS.SHOW_ALERTS) {\n\t\treturn;\n\t}\n\tif (!alertModalInited) {\n\t\talertModalInited = true;\n\t\tdocument.getElementsByTagName('body')[0].appendChild(alertModal);\n\t}\n\t(document.getElementById(`modal-${ALERT_MODAL_ID}-content`) as HTMLElement).innerHTML = message;\n\tMicroModal.show(`modal-${ALERT_MODAL_ID}`);\n}\n\nexport function showDialog(title: string, message: string, options?: {\n\tautoCloseDelay?: number,\n}) {\n\tif (PARAMS.VERBOSE) console.log(title, message);\n\tif (!PARAMS.SHOW_DIALOGS) {\n\t\treturn;\n\t}\n\tif (!dialogModalInited) {\n\t\tdialogModalInited = true;\n\t\tdocument.getElementsByTagName('body')[0].appendChild(dialogModal);\n\t}\n\t(document.getElementById(`modal-${DIALOG_MODAL_ID}-title`) as HTMLElement).innerHTML = title;\n\t(document.getElementById(`modal-${DIALOG_MODAL_ID}-content`) as HTMLElement).innerHTML = message;\n\tMicroModal.show(`modal-${DIALOG_MODAL_ID}`);\n\tconst autoCloseDelay = options?.autoCloseDelay !== undefined ? options.autoCloseDelay : -1;\n\tif (autoCloseDelay > 0) {\n\t\tsetTimeout(() => {\n\t\t\tMicroModal.close(`modal-${DIALOG_MODAL_ID}`);\n\t\t}, autoCloseDelay);\n\t}\n}\n\n// Create record red dot vis to overlay when recording is happening.\nconst dot = document.createElement('div');\nexport function initDotWithCSS(css?: {[key: string]: string}){\n\tdot.id = 'recordingDot';\n\tconst dotCSS = {\n\t\tbackground: \"red\",\n\t\twidth: \"20px\",\n\t\theight: \"20px\",\n\t\t\"border-radius\": \"50%\",\n\t\tdisplay: \"none\",\n\t\tposition: \"absolute\",\n\t\ttop: \"0\",\n\t\tright: \"0\",\n\t\t\"z-index\": \"10\",\n\t\tmargin: \"20px\",\n\t\t...css,\n\t};\n\tObject.assign(dot.style, dotCSS);\n\tdocument.getElementsByTagName('body')[0].appendChild(dot);\n}\n\nexport function showDot(visible: boolean) {\n\tif (!PARAMS.SHOW_REC_DOT) return;\n\tif (visible) {\n\t\tdot.style.display = \"inline-block\";\n\t} else {\n\t\tdot.style.display = \"none\";\n\t}\n}","// Params.\nexport const PARAMS = {\n\tVERBOSE: false,\n\tSHOW_ALERTS: false,\n\tSHOW_DIALOGS: false,\n\tSHOW_REC_DOT: false,\n};",";(function() {\r\n\r\nif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\r\n var Tar = require('./tar.js');\r\n var download = require('./download.js');\r\n var GIF = require('./gif.js');\r\n var WebMWriter = require('./webm-writer-0.2.0');\r\n}\r\n\r\n\"use strict\";\r\n\r\nvar objectTypes = {\r\n'function': true,\r\n'object': true\r\n};\r\n\r\nfunction checkGlobal(value) {\r\n return (value && value.Object === Object) ? value : null;\r\n }\r\n\r\n/** Built-in method references without a dependency on `root`. */\r\nvar freeParseFloat = parseFloat,\r\n freeParseInt = parseInt;\r\n\r\n/** Detect free variable `exports`. */\r\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\r\n? exports\r\n: undefined;\r\n\r\n/** Detect free variable `module`. */\r\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\r\n? module\r\n: undefined;\r\n\r\n/** Detect the popular CommonJS extension `module.exports`. */\r\nvar moduleExports = (freeModule && freeModule.exports === freeExports)\r\n? freeExports\r\n: undefined;\r\n\r\n/** Detect free variable `global` from Node.js. */\r\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\r\n\r\n/** Detect free variable `self`. */\r\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\r\n\r\n/** Detect free variable `window`. */\r\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\r\n\r\n/** Detect `this` as the global object. */\r\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\r\n\r\n/**\r\n* Used as a reference to the global object.\r\n*\r\n* The `this` value is used if it's the global object to avoid Greasemonkey's\r\n* restricted `window` object, otherwise the `window` object is used.\r\n*/\r\nvar root = freeGlobal ||\r\n((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\r\n freeSelf || thisGlobal || Function('return this')();\r\n\r\nif( !('gc' in window ) ) {\r\n\twindow.gc = function(){}\r\n}\r\n\r\nif (!HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\r\n\t\tthis.count++;\r\n\t\tthis.step();\r\n\t}.bind( this );\r\n\tfileReader.readAsArrayBuffer(blob);\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.save = function( callback ) {\r\n\r\n\tcallback( this.tape.save() );\r\n\r\n}\r\n\r\nCCTarEncoder.prototype.dispose = function() {\r\n\r\n\tthis.tape = new Tar();\r\n\tthis.count = 0;\r\n\r\n}\r\n\r\nfunction CCPNGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/png';\r\n\tthis.fileExtension = '.png';\r\n\r\n}\r\n\r\nCCPNGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCPNGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type )\r\n\r\n}\r\n\r\nfunction CCJPEGEncoder( settings ) {\r\n\r\n\tCCTarEncoder.call( this, settings );\r\n\r\n\tthis.type = 'image/jpeg';\r\n\tthis.fileExtension = '.jpg';\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n}\r\n\r\nCCJPEGEncoder.prototype = Object.create( CCTarEncoder.prototype );\r\n\r\nCCJPEGEncoder.prototype.add = function( canvas ) {\r\n\r\n\tcanvas.toBlob( function( blob ) {\r\n\t\tCCTarEncoder.prototype.add.call( this, blob );\r\n\t}.bind( this ), this.type, this.quality )\r\n\r\n}\r\n\r\n/*\r\n\r\n\tWebM Encoder\r\n\r\n*/\r\n\r\nfunction CCWebMEncoder( settings ) {\r\n\r\n\tvar canvas = document.createElement( 'canvas' );\r\n\tif( canvas.toDataURL( 'image/webp' ).substr(5,10) !== 'image/webp' ){\r\n\t\tconsole.log( \"WebP not supported - try another export format\" )\r\n\t}\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.extension = '.webm'\r\n\tthis.mimeType = 'video/webm'\r\n\tthis.baseFilename = this.filename;\r\n\r\n\tthis.frames = [];\r\n\tthis.part = 1;\r\n\r\n this.videoWriter = new WebMWriter({\r\n quality: this.quality,\r\n fileWriter: null,\r\n fd: null,\r\n frameRate: settings.framerate\r\n});\r\n\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCWebMEncoder.prototype.start = function( canvas ) {\r\n\r\n\tthis.dispose();\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.add = function( canvas ) {\r\n\r\n this.videoWriter.addFrame(canvas);\r\n\r\n\t//this.frames.push( canvas.toDataURL('image/webp', this.quality) );\r\n\r\n\tif( this.settings.autoSaveTime > 0 && ( this.frames.length / this.settings.framerate ) >= this.settings.autoSaveTime ) {\r\n\t\tthis.save( function( blob ) {\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tdownload( blob, this.filename + this.extension, this.mimeType );\r\n\t\t\tthis.dispose();\r\n\t\t\tthis.part++;\r\n\t\t\tthis.filename = this.baseFilename + '-part-' + pad( this.part );\r\n\t\t\tthis.step();\r\n\t\t}.bind( this ) )\r\n\t} else {\r\n\t\tthis.step();\r\n\t}\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.save = function( callback ) {\r\n\r\n//\tif( !this.frames.length ) return;\r\n\r\n this.videoWriter.complete().then(callback);\r\n\r\n\t/*var webm = Whammy.fromImageArray( this.frames, this.settings.framerate )\r\n\tvar blob = new Blob( [ webm ], { type: \"octet/stream\" } );\r\n\tcallback( blob );*/\r\n\r\n}\r\n\r\nCCWebMEncoder.prototype.dispose = function( canvas ) {\r\n\r\n\tthis.frames = [];\r\n\r\n}\r\n\r\nfunction CCFFMpegServerEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = ( settings.quality / 100 ) || .8;\r\n\r\n\tthis.encoder = new FFMpegServer.Video( settings );\r\n this.encoder.on( 'process', function() {\r\n this.emit( 'process' )\r\n }.bind( this ) );\r\n this.encoder.on('finished', function( url, size ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( url, size );\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n this.encoder.on( 'error', function( data ) {\r\n alert(JSON.stringify(data, null, 2));\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCFFMpegServerEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start( this.settings );\r\n\r\n};\r\n\r\nCCFFMpegServerEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.encoder.add( canvas );\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n this.encoder.end();\r\n\r\n}\r\n\r\nCCFFMpegServerEncoder.prototype.safeToProceed = function() {\r\n return this.encoder.safeToProceed();\r\n};\r\n\r\n/*\r\n\tHTMLCanvasElement.captureStream()\r\n*/\r\n\r\nfunction CCStreamEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tthis.framerate = this.settings.framerate;\r\n\tthis.type = 'video/webm';\r\n\tthis.extension = '.webm';\r\n\tthis.stream = null;\r\n\tthis.mediaRecorder = null;\r\n\tthis.chunks = [];\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCStreamEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.stream ) {\r\n\t\tthis.stream = canvas.captureStream( this.framerate );\r\n\t\tthis.mediaRecorder = new MediaRecorder( this.stream );\r\n\t\tthis.mediaRecorder.start();\r\n\r\n\t\tthis.mediaRecorder.ondataavailable = function(e) {\r\n\t\t\tthis.chunks.push(e.data);\r\n\t\t}.bind( this );\r\n\r\n\t}\r\n\tthis.step();\r\n\r\n}\r\n\r\nCCStreamEncoder.prototype.save = function( callback ) {\r\n\r\n\tthis.mediaRecorder.onstop = function( e ) {\r\n\t\tvar blob = new Blob( this.chunks, { 'type' : 'video/webm' });\r\n\t\tthis.chunks = [];\r\n\t\tcallback( blob );\r\n\r\n\t}.bind( this );\r\n\r\n\tthis.mediaRecorder.stop();\r\n\r\n}\r\n\r\n/*function CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this );\r\n\r\n\tsettings.quality = settings.quality || 6;\r\n\tthis.settings = settings;\r\n\r\n\tthis.encoder = new GIFEncoder();\r\n\tthis.encoder.setRepeat( 1 );\r\n \tthis.encoder.setDelay( settings.step );\r\n \tthis.encoder.setQuality( 6 );\r\n \tthis.encoder.setTransparent( null );\r\n \tthis.encoder.setSize( 150, 150 );\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder );\r\n\r\nCCGIFEncoder.prototype.start = function() {\r\n\r\n\tthis.encoder.start();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\tthis.encoder.addFrame( this.ctx );\r\n\r\n\tthis.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.stop = function() {\r\n\r\n\tthis.encoder.finish();\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n\tvar binary_gif = this.encoder.stream().getData();\r\n\r\n\tvar data_url = 'data:image/gif;base64,'+encode64(binary_gif);\r\n\twindow.location = data_url;\r\n\treturn;\r\n\r\n\tvar blob = new Blob( [ binary_gif ], { type: \"octet/stream\" } );\r\n\tvar url = window.URL.createObjectURL( blob );\r\n\tcallback( url );\r\n\r\n}*/\r\n\r\nfunction CCGIFEncoder( settings ) {\r\n\r\n\tCCFrameEncoder.call( this, settings );\r\n\r\n\tsettings.quality = 31 - ( ( settings.quality * 30 / 100 ) || 10 );\r\n\tsettings.workers = settings.workers || 4;\r\n\r\n\tthis.extension = '.gif'\r\n\tthis.mimeType = 'image/gif'\r\n\r\n \tthis.canvas = document.createElement( 'canvas' );\r\n \tthis.ctx = this.canvas.getContext( '2d' );\r\n \tthis.sizeSet = false;\r\n\r\n \tthis.encoder = new GIF({\r\n\t\tworkers: settings.workers,\r\n\t\tquality: settings.quality,\r\n\t\tworkerScript: settings.workersPath,\r\n\t} );\r\n\r\n this.encoder.on( 'progress', function( progress ) {\r\n if ( this.settings.onProgress ) {\r\n this.settings.onProgress( progress )\r\n }\r\n }.bind( this ) );\r\n\r\n this.encoder.on('finished', function( blob ) {\r\n var cb = this.callback;\r\n if ( cb ) {\r\n this.callback = undefined;\r\n cb( blob );\r\n }\r\n }.bind( this ) );\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype = Object.create( CCFrameEncoder.prototype );\r\n\r\nCCGIFEncoder.prototype.add = function( canvas ) {\r\n\r\n\tif( !this.sizeSet ) {\r\n\t\tthis.encoder.setOption( 'width',canvas.width );\r\n\t\tthis.encoder.setOption( 'height',canvas.height );\r\n\t\tthis.sizeSet = true;\r\n\t}\r\n\r\n\tthis.canvas.width = canvas.width;\r\n\tthis.canvas.height = canvas.height;\r\n\tthis.ctx.drawImage( canvas, 0, 0 );\r\n\r\n\tthis.encoder.addFrame( this.ctx, { copy: true, delay: this.settings.step } );\r\n\tthis.step();\r\n\r\n\t/*this.encoder.setSize( canvas.width, canvas.height );\r\n\tvar readBuffer = new Uint8Array(canvas.width * canvas.height * 4);\r\n\tvar context = canvas.getContext( 'webgl' );\r\n\tcontext.readPixels(0, 0, canvas.width, canvas.height, context.RGBA, context.UNSIGNED_BYTE, readBuffer);\r\n\tthis.encoder.addFrame( readBuffer, true );*/\r\n\r\n}\r\n\r\nCCGIFEncoder.prototype.save = function( callback ) {\r\n\r\n this.callback = callback;\r\n\r\n\tthis.encoder.render();\r\n\r\n}\r\n\r\nfunction CCapture( settings ) {\r\n\r\n\tvar _settings = settings || {},\r\n\t\t_date = new Date(),\r\n\t\t_verbose,\r\n\t\t_display,\r\n\t\t_time,\r\n\t\t_startTime,\r\n\t\t_performanceTime,\r\n\t\t_performanceStartTime,\r\n\t\t_step,\r\n _encoder,\r\n\t\t_timeouts = [],\r\n\t\t_intervals = [],\r\n\t\t_frameCount = 0,\r\n\t\t_intermediateFrameCount = 0,\r\n\t\t_lastFrame = null,\r\n\t\t_requestAnimationFrameCallbacks = [],\r\n\t\t_capturing = false,\r\n _handlers = {};\r\n\r\n\t_settings.framerate = _settings.framerate || 60;\r\n\t_settings.motionBlurFrames = 2 * ( _settings.motionBlurFrames || 1 );\r\n\t_verbose = _settings.verbose || false;\r\n\t_display = _settings.display || false;\r\n\t_settings.step = 1000.0 / _settings.framerate ;\r\n\t_settings.timeLimit = _settings.timeLimit || 0;\r\n\t_settings.frameLimit = _settings.frameLimit || 0;\r\n\t_settings.startTime = _settings.startTime || 0;\r\n\r\n\tvar _timeDisplay = document.createElement( 'div' );\r\n\t_timeDisplay.style.position = 'absolute';\r\n\t_timeDisplay.style.left = _timeDisplay.style.top = 0\r\n\t_timeDisplay.style.backgroundColor = 'black';\r\n\t_timeDisplay.style.fontFamily = 'monospace'\r\n\t_timeDisplay.style.fontSize = '11px'\r\n\t_timeDisplay.style.padding = '5px'\r\n\t_timeDisplay.style.color = 'red';\r\n\t_timeDisplay.style.zIndex = 100000\r\n\tif( _settings.display ) document.body.appendChild( _timeDisplay );\r\n\r\n\tvar canvasMotionBlur = document.createElement( 'canvas' );\r\n\tvar ctxMotionBlur = canvasMotionBlur.getContext( '2d' );\r\n\tvar bufferMotionBlur;\r\n\tvar imageData;\r\n\r\n\t_log( 'Step is set to ' + _settings.step + 'ms' );\r\n\r\n var _encoders = {\r\n\t\tgif: CCGIFEncoder,\r\n\t\twebm: CCWebMEncoder,\r\n\t\tffmpegserver: CCFFMpegServerEncoder,\r\n\t\tpng: CCPNGEncoder,\r\n\t\tjpg: CCJPEGEncoder,\r\n\t\t'webm-mediarecorder': CCStreamEncoder\r\n };\r\n\r\n var ctor = _encoders[ _settings.format ];\r\n if ( !ctor ) {\r\n\t\tthrow \"Error: Incorrect or missing format: Valid formats are \" + Object.keys(_encoders).join(\", \");\r\n }\r\n _encoder = new ctor( _settings );\r\n _encoder.step = _step\r\n\r\n\t_encoder.on('process', _process);\r\n _encoder.on('progress', _progress);\r\n\r\n if (\"performance\" in window == false) {\r\n \twindow.performance = {};\r\n }\r\n\r\n\tDate.now = (Date.now || function () { // thanks IE8\r\n\t\treturn new Date().getTime();\r\n\t});\r\n\r\n\tif (\"now\" in window.performance == false){\r\n\r\n\t\tvar nowOffset = Date.now();\r\n\r\n\t\tif (performance.timing && performance.timing.navigationStart){\r\n\t\t\tnowOffset = performance.timing.navigationStart\r\n\t\t}\r\n\r\n\t\twindow.performance.now = function now(){\r\n\t\t\treturn Date.now() - nowOffset;\r\n\t\t}\r\n\t}\r\n\r\n\tvar _oldSetTimeout = window.setTimeout,\r\n\t\t_oldSetInterval = window.setInterval,\r\n\t \t_oldClearInterval = window.clearInterval,\r\n\t\t_oldClearTimeout = window.clearTimeout,\r\n\t\t_oldRequestAnimationFrame = window.requestAnimationFrame,\r\n\t\t_oldNow = window.Date.now,\r\n\t\t_oldPerformanceNow = window.performance.now,\r\n\t\t_oldGetTime = window.Date.prototype.getTime;\r\n\t// Date.prototype._oldGetTime = Date.prototype.getTime;\r\n\r\n\tvar media = [];\r\n\r\n\tfunction _init() {\r\n\r\n\t\t_log( 'Capturer start' );\r\n\r\n\t\t_startTime = window.Date.now();\r\n\t\t_time = _startTime + _settings.startTime;\r\n\t\t_performanceStartTime = window.performance.now();\r\n\t\t_performanceTime = _performanceStartTime + _settings.startTime;\r\n\r\n\t\twindow.Date.prototype.getTime = function(){\r\n\t\t\treturn _time;\r\n\t\t};\r\n\t\twindow.Date.now = function() {\r\n\t\t\treturn _time;\r\n\t\t};\r\n\r\n\t\twindow.setTimeout = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_timeouts.push( t );\r\n\t\t\t_log( 'Timeout set to ' + t.time );\r\n return t;\r\n\t\t};\r\n\t\twindow.clearTimeout = function( id ) {\r\n\t\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\t\tif( _timeouts[ j ] == id ) {\r\n\t\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\t\t_log( 'Timeout cleared' );\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\twindow.setInterval = function( callback, time ) {\r\n\t\t\tvar t = {\r\n\t\t\t\tcallback: callback,\r\n\t\t\t\ttime: time,\r\n\t\t\t\ttriggerTime: _time + time\r\n\t\t\t};\r\n\t\t\t_intervals.push( t );\r\n\t\t\t_log( 'Interval set to ' + t.time );\r\n\t\t\treturn t;\r\n\t\t};\r\n\t\twindow.clearInterval = function( id ) {\r\n\t\t\t_log( 'clear Interval' );\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\twindow.requestAnimationFrame = function( callback ) {\r\n\t\t\t_requestAnimationFrameCallbacks.push( callback );\r\n\t\t};\r\n\t\twindow.performance.now = function(){\r\n\t\t\treturn _performanceTime;\r\n\t\t};\r\n\r\n\t\tfunction hookCurrentTime() {\r\n\t\t\tif( !this._hooked ) {\r\n\t\t\t\tthis._hooked = true;\r\n\t\t\t\tthis._hookedTime = this.currentTime || 0;\r\n\t\t\t\tthis.pause();\r\n\t\t\t\tmedia.push( this );\r\n\t\t\t}\r\n\t\t\treturn this._hookedTime + _settings.startTime;\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tObject.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t\tObject.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } )\r\n\t\t} catch (err) {\r\n\t\t\t_log(err);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _start() {\r\n\t\t_init();\r\n\t\t_encoder.start();\r\n\t\t_capturing = true;\r\n\t}\r\n\r\n\tfunction _stop() {\r\n\t\t_capturing = false;\r\n\t\t_encoder.stop();\r\n\t\t_destroy();\r\n\t}\r\n\r\n\tfunction _call( fn, p ) {\r\n\t\t_oldSetTimeout( fn, 0, p );\r\n\t}\r\n\r\n\tfunction _step() {\r\n\t\t//_oldRequestAnimationFrame( _process );\r\n\t\t_call( _process );\r\n\t}\r\n\r\n\tfunction _destroy() {\r\n\t\t_log( 'Capturer stop' );\r\n\t\twindow.setTimeout = _oldSetTimeout;\r\n\t\twindow.setInterval = _oldSetInterval;\r\n\t\twindow.clearInterval = _oldClearInterval;\r\n\t\twindow.clearTimeout = _oldClearTimeout;\r\n\t\twindow.requestAnimationFrame = _oldRequestAnimationFrame;\r\n\t\twindow.Date.prototype.getTime = _oldGetTime;\r\n\t\twindow.Date.now = _oldNow;\r\n\t\twindow.performance.now = _oldPerformanceNow;\r\n\t}\r\n\r\n\tfunction _updateTime() {\r\n\t\tvar seconds = _frameCount / _settings.framerate;\r\n\t\tif( ( _settings.frameLimit && _frameCount >= _settings.frameLimit ) || ( _settings.timeLimit && seconds >= _settings.timeLimit ) ) {\r\n\t\t\t_stop();\r\n\t\t\t_save();\r\n\t\t}\r\n\t\tvar d = new Date( null );\r\n\t\td.setSeconds( seconds );\r\n\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames (' + _intermediateFrameCount + ' inter) | ' + d.toISOString().substr( 11, 8 );\r\n\t\t} else {\r\n\t\t\t_timeDisplay.textContent = 'CCapture ' + _settings.format + ' | ' + _frameCount + ' frames | ' + d.toISOString().substr( 11, 8 );\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _checkFrame( canvas ) {\r\n\r\n\t\tif( canvasMotionBlur.width !== canvas.width || canvasMotionBlur.height !== canvas.height ) {\r\n\t\t\tcanvasMotionBlur.width = canvas.width;\r\n\t\t\tcanvasMotionBlur.height = canvas.height;\r\n\t\t\tbufferMotionBlur = new Uint16Array( canvasMotionBlur.height * canvasMotionBlur.width * 4 );\r\n\t\t\tctxMotionBlur.fillStyle = '#0'\r\n\t\t\tctxMotionBlur.fillRect( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _blendFrame( canvas ) {\r\n\r\n\t\t//_log( 'Intermediate Frame: ' + _intermediateFrameCount );\r\n\r\n\t\tctxMotionBlur.drawImage( canvas, 0, 0 );\r\n\t\timageData = ctxMotionBlur.getImageData( 0, 0, canvasMotionBlur.width, canvasMotionBlur.height );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] += imageData.data[ j ];\r\n\t\t\tbufferMotionBlur[ j + 1 ] += imageData.data[ j + 1 ];\r\n\t\t\tbufferMotionBlur[ j + 2 ] += imageData.data[ j + 2 ];\r\n\t\t}\r\n\t\t_intermediateFrameCount++;\r\n\r\n\t}\r\n\r\n\tfunction _saveFrame(){\r\n\r\n\t\tvar data = imageData.data;\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tdata[ j ] = bufferMotionBlur[ j ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 1 ] = bufferMotionBlur[ j + 1 ] * 2 / _settings.motionBlurFrames;\r\n\t\t\tdata[ j + 2 ] = bufferMotionBlur[ j + 2 ] * 2 / _settings.motionBlurFrames;\r\n\t\t}\r\n\t\tctxMotionBlur.putImageData( imageData, 0, 0 );\r\n\t\t_encoder.add( canvasMotionBlur );\r\n\t\t_frameCount++;\r\n\t\t_intermediateFrameCount = 0;\r\n\t\t_log( 'Full MB Frame! ' + _frameCount + ' ' + _time );\r\n\t\tfor( var j = 0; j < bufferMotionBlur.length; j+= 4 ) {\r\n\t\t\tbufferMotionBlur[ j ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 1 ] = 0;\r\n\t\t\tbufferMotionBlur[ j + 2 ] = 0;\r\n\t\t}\r\n\t\tgc();\r\n\r\n\t}\r\n\r\n\tfunction _capture( canvas ) {\r\n\r\n\t\tif( _capturing ) {\r\n\r\n\t\t\tif( _settings.motionBlurFrames > 2 ) {\r\n\r\n\t\t\t\t_checkFrame( canvas );\r\n\t\t\t\t_blendFrame( canvas );\r\n\r\n\t\t\t\tif( _intermediateFrameCount >= .5 * _settings.motionBlurFrames ) {\r\n\t\t\t\t\t_saveFrame();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_step();\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t_encoder.add( canvas );\r\n\t\t\t\t_frameCount++;\r\n\t\t\t\t_log( 'Full Frame! ' + _frameCount );\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _process() {\r\n\r\n\t\tvar step = 1000 / _settings.framerate;\r\n\t\tvar dt = ( _frameCount + _intermediateFrameCount / _settings.motionBlurFrames ) * step;\r\n\r\n\t\t_time = _startTime + dt;\r\n\t\t_performanceTime = _performanceStartTime + dt;\r\n\r\n\t\tmedia.forEach( function( v ) {\r\n\t\t\tv._hookedTime = dt / 1000;\r\n\t\t} );\r\n\r\n\t\t_updateTime();\r\n\t\t_log( 'Frame: ' + _frameCount + ' ' + _intermediateFrameCount );\r\n\r\n\t\tfor( var j = 0; j < _timeouts.length; j++ ) {\r\n\t\t\tif( _time >= _timeouts[ j ].triggerTime ) {\r\n\t\t\t\t_call( _timeouts[ j ].callback )\r\n\t\t\t\t//console.log( 'timeout!' );\r\n\t\t\t\t_timeouts.splice( j, 1 );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor( var j = 0; j < _intervals.length; j++ ) {\r\n\t\t\tif( _time >= _intervals[ j ].triggerTime ) {\r\n\t\t\t\t_call( _intervals[ j ].callback );\r\n\t\t\t\t_intervals[ j ].triggerTime += _intervals[ j ].time;\r\n\t\t\t\t//console.log( 'interval!' );\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_requestAnimationFrameCallbacks.forEach( function( cb ) {\r\n \t\t_call( cb, _time - g_startTime );\r\n } );\r\n _requestAnimationFrameCallbacks = [];\r\n\r\n\t}\r\n\r\n\tfunction _save( callback ) {\r\n\r\n\t\tif( !callback ) {\r\n\t\t\tcallback = function( blob ) {\r\n\t\t\t\tdownload( blob, _encoder.filename + _encoder.extension, _encoder.mimeType );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t_encoder.save( callback );\r\n\r\n\t}\r\n\r\n\tfunction _log( message ) {\r\n\t\tif( _verbose ) console.log( message );\r\n\t}\r\n\r\n function _on( event, handler ) {\r\n\r\n _handlers[event] = handler;\r\n\r\n }\r\n\r\n function _emit( event ) {\r\n\r\n var handler = _handlers[event];\r\n if ( handler ) {\r\n\r\n handler.apply( null, Array.prototype.slice.call( arguments, 1 ) );\r\n\r\n }\r\n\r\n }\r\n\r\n function _progress( progress ) {\r\n\r\n _emit( 'progress', progress );\r\n\r\n }\r\n\r\n\treturn {\r\n\t\tstart: _start,\r\n\t\tcapture: _capture,\r\n\t\tstop: _stop,\r\n\t\tsave: _save,\r\n on: _on\r\n\t}\r\n}\r\n\r\n(freeWindow || freeSelf || {}).CCapture = CCapture;\r\n\r\n // Some AMD build optimizers like r.js check for condition patterns like the following:\r\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\r\n // Define as an anonymous module so, through path mapping, it can be\r\n // referenced as the \"underscore\" module.\r\n define(function() {\r\n \treturn CCapture;\r\n });\r\n}\r\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\r\n else if (freeExports && freeModule) {\r\n // Export for Node.js.\r\n if (moduleExports) {\r\n \t(freeModule.exports = CCapture).CCapture = CCapture;\r\n }\r\n // Export for CommonJS support.\r\n freeExports.CCapture = CCapture;\r\n}\r\nelse {\r\n // Export to the global object.\r\n root.CCapture = CCapture;\r\n}\r\n\r\n}());\r\n","//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage\n// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime\n// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs\n// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support\n\n// data can be a string, Blob, File, or dataURL\n\n\n\n\nfunction download(data, strFileName, strMimeType) {\n\n\tvar self = window, // this script is only for browsers anyway...\n\t\tu = \"application/octet-stream\", // this default mime also triggers iframe downloads\n\t\tm = strMimeType || u,\n\t\tx = data,\n\t\tD = document,\n\t\ta = D.createElement(\"a\"),\n\t\tz = function(a){return String(a);},\n\n\n\t\tB = self.Blob || self.MozBlob || self.WebKitBlob || z,\n\t\tBB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,\n\t\tfn = strFileName || \"download\",\n\t\tblob,\n\t\tb,\n\t\tua,\n\t\tfr;\n\n\t//if(typeof B.bind === 'function' ){ B=B.bind(self); }\n\n\tif(String(this)===\"true\"){ //reverse arguments, allowing download.bind(true, \"text/xml\", \"export.xml\") to act as a callback\n\t\tx=[x, m];\n\t\tm=x[0];\n\t\tx=x[1];\n\t}\n\n\n\n\t//go ahead and download dataURLs right away\n\tif(String(x).match(/^data\\:[\\w+\\-]+\\/[\\w+\\-]+[,;]/)){\n\t\treturn navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:\n\t\t\tnavigator.msSaveBlob(d2b(x), fn) :\n\t\t\tsaver(x) ; // everyone else can save dataURLs un-processed\n\t}//end if dataURL passed?\n\n\ttry{\n\n\t\tblob = x instanceof B ?\n\t\t\tx :\n\t\t\tnew B([x], {type: m}) ;\n\t}catch(y){\n\t\tif(BB){\n\t\t\tb = new BB();\n\t\t\tb.append([x]);\n\t\t\tblob = b.getBlob(m); // the blob\n\t\t}\n\n\t}\n\n\n\n\tfunction d2b(u) {\n\t\tvar p= u.split(/[:;,]/),\n\t\tt= p[1],\n\t\tdec= p[2] == \"base64\" ? atob : decodeURIComponent,\n\t\tbin= dec(p.pop()),\n\t\tmx= bin.length,\n\t\ti= 0,\n\t\tuia= new Uint8Array(mx);\n\n\t\tfor(i;i0&&this._events[type].length>m){this._events[type].warned=true;console.error(\"(node) warning: possible EventEmitter memory \"+\"leak detected. %d listeners added. \"+\"Use emitter.setMaxListeners() to increase limit.\",this._events[type].length);if(typeof console.trace===\"function\"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit(\"removeListener\",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key===\"removeListener\")continue;this.removeAllListeners(key)}this.removeAllListeners(\"removeListener\");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg===\"function\"}function isNumber(arg){return typeof arg===\"number\"}function isObject(arg){return typeof arg===\"object\"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){var NeuQuant=require(\"./TypedNeuQuant.js\");var LZWEncoder=require(\"./LZWEncoder.js\");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv=\"\";for(var p=0;p=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither=\"FloydSteinberg\";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes(\"GIF89a\")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace(\"-serpentine\",\"\"),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=this.dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes(\"NETSCAPE2.0\");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{\"./LZWEncoder.js\":3,\"./TypedNeuQuant.js\":4}],3:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],4:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;jref;i=0<=ref?++j:--j){results.push(null)}return results}.call(this);numWorkers=this.spawnWorkers();if(this.options.globalPalette===true){this.renderNextFrame()}else{for(i=j=0,ref=numWorkers;0<=ref?jref;i=0<=ref?++j:--j){this.renderNextFrame()}}this.emit(\"start\");return this.emit(\"progress\",0)};GIF.prototype.abort=function(){var worker;while(true){worker=this.activeWorkers.shift();if(worker==null){break}this.log(\"killing active worker\");worker.terminate()}this.running=false;return this.emit(\"abort\")};GIF.prototype.spawnWorkers=function(){var j,numWorkers,ref,results;numWorkers=Math.min(this.options.workers,this.frames.length);(function(){results=[];for(var j=ref=this.freeWorkers.length;ref<=numWorkers?jnumWorkers;ref<=numWorkers?j++:j--){results.push(j)}return results}).apply(this).forEach(function(_this){return function(i){var worker;_this.log(\"spawning worker \"+i);worker=new Worker(_this.options.workerScript);worker.onmessage=function(event){_this.activeWorkers.splice(_this.activeWorkers.indexOf(worker),1);_this.freeWorkers.push(worker);return _this.frameFinished(event.data)};return _this.freeWorkers.push(worker)}}(this));return numWorkers};GIF.prototype.frameFinished=function(frame){var i,j,ref;this.log(\"frame \"+frame.index+\" finished - \"+this.activeWorkers.length+\" active\");this.finishedFrames++;this.emit(\"progress\",this.finishedFrames/this.frames.length);this.imageParts[frame.index]=frame;if(this.options.globalPalette===true){this.options.globalPalette=frame.globalPalette;this.log(\"global palette analyzed\");if(this.frames.length>2){for(i=j=1,ref=this.freeWorkers.length;1<=ref?jref;i=1<=ref?++j:--j){this.renderNextFrame()}}}if(indexOf.call(this.imageParts,null)>=0){return this.renderNextFrame()}else{return this.finishRendering()}};GIF.prototype.finishRendering=function(){var data,frame,i,image,j,k,l,len,len1,len2,len3,offset,page,ref,ref1,ref2;len=0;ref=this.imageParts;for(j=0,len1=ref.length;j=this.frames.length){return}frame=this.frames[this.nextFrame++];worker=this.freeWorkers.shift();task=this.getTask(frame);this.log(\"starting frame \"+(task.index+1)+\" of \"+this.frames.length);this.activeWorkers.push(worker);return worker.postMessage(task)};GIF.prototype.getContextData=function(ctx){return ctx.getImageData(0,0,this.options.width,this.options.height).data};GIF.prototype.getImageData=function(image){var ctx;if(this._canvas==null){this._canvas=document.createElement(\"canvas\");this._canvas.width=this.options.width;this._canvas.height=this.options.height}ctx=this._canvas.getContext(\"2d\");ctx.setFill=this.options.background;ctx.fillRect(0,0,this.options.width,this.options.height);ctx.drawImage(image,0,0);return this.getContextData(ctx)};GIF.prototype.getTask=function(frame){var index,task;index=this.frames.indexOf(frame);task={index:index,last:index===this.frames.length-1,delay:frame.delay,dispose:frame.dispose,transparent:frame.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:browser.name===\"chrome\"};if(frame.data!=null){task.data=frame.data}else if(frame.context!=null){task.data=this.getContextData(frame.context)}else if(frame.image!=null){task.data=this.getImageData(frame.image)}else{throw new Error(\"Invalid frame\")}return task};GIF.prototype.log=function(){var args;args=1<=arguments.length?slice.call(arguments,0):[];if(!this.options.debug){return}return console.log.apply(console,args)};return GIF}(EventEmitter)},{\"./GIFEncoder.js\":2,\"./browser.coffee\":5,\"./gif.worker.coffee\":7,events:1}],7:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require(\"./GIFEncoder.js\");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setDispose(frame.dispose);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n\t\t};\n\n\t\t// go through the array every three bytes, we'll deal with trailing stuff later\n\t\tfor (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n\t\t\ttemp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);\n\t\t\toutput += tripletToBase64(temp);\n\t\t}\n\n\t\t// this prevents an ERR_INVALID_URL in Chrome (Firefox okay)\n\t\tswitch (output.length % 4) {\n\t\t\tcase 1:\n\t\t\t\toutput += '=';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\toutput += '==';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\twindow.utils = {}\n\twindow.utils.clean = clean;\n\twindow.utils.pad = pad;\n\twindow.utils.extend = extend;\n\twindow.utils.stringToUint8 = stringToUint8;\n\twindow.utils.uint8ToBase64 = uint8ToBase64;\n}());\n\n(function () {\n\t\"use strict\";\n\n/*\nstruct posix_header { // byte offset\n\tchar name[100]; // 0\n\tchar mode[8]; // 100\n\tchar uid[8]; // 108\n\tchar gid[8]; // 116\n\tchar size[12]; // 124\n\tchar mtime[12]; // 136\n\tchar chksum[8]; // 148\n\tchar typeflag; // 156\n\tchar linkname[100]; // 157\n\tchar magic[6]; // 257\n\tchar version[2]; // 263\n\tchar uname[32]; // 265\n\tchar gname[32]; // 297\n\tchar devmajor[8]; // 329\n\tchar devminor[8]; // 337\n\tchar prefix[155]; // 345\n // 500\n};\n*/\n\n\tvar utils = window.utils,\n\t\theaderFormat;\n\n\theaderFormat = [\n\t\t{\n\t\t\t'field': 'fileName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'fileMode',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'uid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'gid',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'fileSize',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'mtime',\n\t\t\t'length': 12\n\t\t},\n\t\t{\n\t\t\t'field': 'checksum',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'type',\n\t\t\t'length': 1\n\t\t},\n\t\t{\n\t\t\t'field': 'linkName',\n\t\t\t'length': 100\n\t\t},\n\t\t{\n\t\t\t'field': 'ustar',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'owner',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'group',\n\t\t\t'length': 32\n\t\t},\n\t\t{\n\t\t\t'field': 'majorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'minorNumber',\n\t\t\t'length': 8\n\t\t},\n\t\t{\n\t\t\t'field': 'filenamePrefix',\n\t\t\t'length': 155\n\t\t},\n\t\t{\n\t\t\t'field': 'padding',\n\t\t\t'length': 12\n\t\t}\n\t];\n\n\tfunction formatHeader(data, cb) {\n\t\tvar buffer = utils.clean(512),\n\t\t\toffset = 0;\n\n\t\theaderFormat.forEach(function (value) {\n\t\t\tvar str = data[value.field] || \"\",\n\t\t\t\ti, length;\n\n\t\t\tfor (i = 0, length = str.length; i < length; i += 1) {\n\t\t\t\tbuffer[offset] = str.charCodeAt(i);\n\t\t\t\toffset += 1;\n\t\t\t}\n\n\t\t\toffset += value.length - i; // space it out with nulls\n\t\t});\n\n\t\tif (typeof cb === 'function') {\n\t\t\treturn cb(buffer, offset);\n\t\t}\n\t\treturn buffer;\n\t}\n\n\twindow.header = {}\n\twindow.header.structure = headerFormat;\n\twindow.header.format = formatHeader;\n}());\n\n(function () {\n\t\"use strict\";\n\n\tvar header = window.header,\n\t\tutils = window.utils,\n\t\trecordSize = 512,\n\t\tblockSize;\n\n\tfunction Tar(recordsPerBlock) {\n\t\tthis.written = 0;\n\t\tblockSize = (recordsPerBlock || 20) * recordSize;\n\t\tthis.out = utils.clean(blockSize);\n\t\tthis.blocks = [];\n\t\tthis.length = 0;\n\t}\n\n\tTar.prototype.append = function (filepath, input, opts, callback) {\n\t\tvar data,\n\t\t\tchecksum,\n\t\t\tmode,\n\t\t\tmtime,\n\t\t\tuid,\n\t\t\tgid,\n\t\t\theaderArr;\n\n\t\tif (typeof input === 'string') {\n\t\t\tinput = utils.stringToUint8(input);\n\t\t} else if (input.constructor !== Uint8Array.prototype.constructor) {\n\t\t\tthrow 'Invalid input type. You gave me: ' + input.constructor.toString().match(/function\\s*([$A-Za-z_][0-9A-Za-z_]*)\\s*\\(/)[1];\n\t\t}\n\n\t\tif (typeof opts === 'function') {\n\t\t\tcallback = opts;\n\t\t\topts = {};\n\t\t}\n\n\t\topts = opts || {};\n\n\t\tmode = opts.mode || parseInt('777', 8) & 0xfff;\n\t\tmtime = opts.mtime || Math.floor(+new Date() / 1000);\n\t\tuid = opts.uid || 0;\n\t\tgid = opts.gid || 0;\n\n\t\tdata = {\n\t\t\tfileName: filepath,\n\t\t\tfileMode: utils.pad(mode, 7),\n\t\t\tuid: utils.pad(uid, 7),\n\t\t\tgid: utils.pad(gid, 7),\n\t\t\tfileSize: utils.pad(input.length, 11),\n\t\t\tmtime: utils.pad(mtime, 11),\n\t\t\tchecksum: ' ',\n\t\t\ttype: '0', // just a file\n\t\t\tustar: 'ustar ',\n\t\t\towner: opts.owner || '',\n\t\t\tgroup: opts.group || ''\n\t\t};\n\n\t\t// calculate the checksum\n\t\tchecksum = 0;\n\t\tObject.keys(data).forEach(function (key) {\n\t\t\tvar i, value = data[key], length;\n\n\t\t\tfor (i = 0, length = value.length; i < length; i += 1) {\n\t\t\t\tchecksum += value.charCodeAt(i);\n\t\t\t}\n\t\t});\n\n\t\tdata.checksum = utils.pad(checksum, 6) + \"\\u0000 \";\n\n\t\theaderArr = header.format(data);\n\n\t\tvar headerLength = Math.ceil( headerArr.length / recordSize ) * recordSize;\n\t\tvar inputLength = Math.ceil( input.length / recordSize ) * recordSize;\n\n\t\tthis.blocks.push( { header: headerArr, input: input, headerLength: headerLength, inputLength: inputLength } );\n\n\t};\n\n\tTar.prototype.save = function() {\n\n\t\tvar buffers = [];\n\t\tvar chunks = [];\n\t\tvar length = 0;\n\t\tvar max = Math.pow( 2, 20 );\n\n\t\tvar chunk = [];\n\t\tthis.blocks.forEach( function( b ) {\n\t\t\tif( length + b.headerLength + b.inputLength > max ) {\n\t\t\t\tchunks.push( { blocks: chunk, length: length } );\n\t\t\t\tchunk = [];\n\t\t\t\tlength = 0;\n\t\t\t}\n\t\t\tchunk.push( b );\n\t\t\tlength += b.headerLength + b.inputLength;\n\t\t} );\n\t\tchunks.push( { blocks: chunk, length: length } );\n\n\t\tchunks.forEach( function( c ) {\n\n\t\t\tvar buffer = new Uint8Array( c.length );\n\t\t\tvar written = 0;\n\t\t\tc.blocks.forEach( function( b ) {\n\t\t\t\tbuffer.set( b.header, written );\n\t\t\t\twritten += b.headerLength;\n\t\t\t\tbuffer.set( b.input, written );\n\t\t\t\twritten += b.inputLength;\n\t\t\t} );\n\t\t\tbuffers.push( buffer );\n\n\t\t} );\n\n\t\tbuffers.push( new Uint8Array( 2 * recordSize ) );\n\n\t\treturn new Blob( buffers, { type: 'octet/stream' } );\n\n\t};\n\n\tTar.prototype.clear = function () {\n\t\tthis.written = 0;\n\t\tthis.out = utils.clean(blockSize);\n\t};\n\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n module.exports = Tar;\n } else {\n window.Tar = Tar;\n }\n}());\n","/**\n * A tool for presenting an ArrayBuffer as a stream for writing some simple data types.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n// (function(){\n /*\n * Create an ArrayBuffer of the given length and present it as a writable stream with methods\n * for writing data in different formats.\n */\n var ArrayBufferDataStream = function(length) {\n this.data = new Uint8Array(length);\n this.pos = 0;\n };\n\n ArrayBufferDataStream.prototype.seek = function(offset) {\n this.pos = offset;\n };\n\n ArrayBufferDataStream.prototype.writeBytes = function(arr) {\n for (var i = 0; i < arr.length; i++) {\n this.data[this.pos++] = arr[i];\n }\n };\n\n ArrayBufferDataStream.prototype.writeByte = function(b) {\n this.data[this.pos++] = b;\n };\n\n //Synonym:\n ArrayBufferDataStream.prototype.writeU8 = ArrayBufferDataStream.prototype.writeByte;\n\n ArrayBufferDataStream.prototype.writeU16BE = function(u) {\n this.data[this.pos++] = u >> 8;\n this.data[this.pos++] = u;\n };\n\n ArrayBufferDataStream.prototype.writeDoubleBE = function(d) {\n var\n bytes = new Uint8Array(new Float64Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n ArrayBufferDataStream.prototype.writeFloatBE = function(d) {\n var\n bytes = new Uint8Array(new Float32Array([d]).buffer);\n\n for (var i = bytes.length - 1; i >= 0; i--) {\n this.writeByte(bytes[i]);\n }\n };\n\n /**\n * Write an ASCII string to the stream\n */\n ArrayBufferDataStream.prototype.writeString = function(s) {\n for (var i = 0; i < s.length; i++) {\n this.data[this.pos++] = s.charCodeAt(i);\n }\n };\n\n /**\n * Write the given 32-bit integer to the stream as an EBML variable-length integer using the given byte width\n * (use measureEBMLVarInt).\n *\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * @param i Integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeEBMLVarIntWidth = function(i, width) {\n switch (width) {\n case 1:\n this.writeU8((1 << 7) | i);\n break;\n case 2:\n this.writeU8((1 << 6) | (i >> 8));\n this.writeU8(i);\n break;\n case 3:\n this.writeU8((1 << 5) | (i >> 16));\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 4:\n this.writeU8((1 << 4) | (i >> 24));\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n case 5:\n /*\n * JavaScript converts its doubles to 32-bit integers for bitwise operations, so we need to do a\n * division by 2^32 instead of a right-shift of 32 to retain those top 3 bits\n */\n this.writeU8((1 << 3) | ((i / 4294967296) & 0x7));\n this.writeU8(i >> 24);\n this.writeU8(i >> 16);\n this.writeU8(i >> 8);\n this.writeU8(i);\n break;\n default:\n throw new RuntimeException(\"Bad EBML VINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to encode the given integer as an EBML VINT.\n */\n ArrayBufferDataStream.prototype.measureEBMLVarInt = function(val) {\n if (val < (1 << 7) - 1) {\n /* Top bit is set, leaving 7 bits to hold the integer, but we can't store 127 because\n * \"all bits set to one\" is a reserved value. Same thing for the other cases below:\n */\n return 1;\n } else if (val < (1 << 14) - 1) {\n return 2;\n } else if (val < (1 << 21) - 1) {\n return 3;\n } else if (val < (1 << 28) - 1) {\n return 4;\n } else if (val < 34359738367) { // 2 ^ 35 - 1 (can address 32GB)\n return 5;\n } else {\n throw new RuntimeException(\"EBML VINT size not supported \" + val);\n }\n };\n\n ArrayBufferDataStream.prototype.writeEBMLVarInt = function(i) {\n this.writeEBMLVarIntWidth(i, this.measureEBMLVarInt(i));\n };\n\n /**\n * Write the given unsigned 32-bit integer to the stream in big-endian order using the given byte width.\n * No error checking is performed to ensure that the supplied width is correct for the integer.\n *\n * Omit the width parameter to have it determined automatically for you.\n *\n * @param u Unsigned integer to be written\n * @param width Number of bytes to write to the stream\n */\n ArrayBufferDataStream.prototype.writeUnsignedIntBE = function(u, width) {\n if (width === undefined) {\n width = this.measureUnsignedInt(u);\n }\n\n // Each case falls through:\n switch (width) {\n case 5:\n this.writeU8(Math.floor(u / 4294967296)); // Need to use division to access >32 bits of floating point var\n case 4:\n this.writeU8(u >> 24);\n case 3:\n this.writeU8(u >> 16);\n case 2:\n this.writeU8(u >> 8);\n case 1:\n this.writeU8(u);\n break;\n default:\n throw new RuntimeException(\"Bad UINT size \" + width);\n }\n };\n\n /**\n * Return the number of bytes needed to hold the non-zero bits of the given unsigned integer.\n */\n ArrayBufferDataStream.prototype.measureUnsignedInt = function(val) {\n // Force to 32-bit unsigned integer\n if (val < (1 << 8)) {\n return 1;\n } else if (val < (1 << 16)) {\n return 2;\n } else if (val < (1 << 24)) {\n return 3;\n } else if (val < 4294967296) {\n return 4;\n } else {\n return 5;\n }\n };\n\n /**\n * Return a view on the portion of the buffer from the beginning to the current seek position as a Uint8Array.\n */\n ArrayBufferDataStream.prototype.getAsDataArray = function() {\n if (this.pos < this.data.byteLength) {\n return this.data.subarray(0, this.pos);\n } else if (this.pos == this.data.byteLength) {\n return this.data;\n } else {\n throw \"ArrayBufferDataStream's pos lies beyond end of buffer\";\n }\n };\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = ArrayBufferDataStream;\n// \t} else {\n// \t\twindow.ArrayBufferDataStream = ArrayBufferDataStream;\n// \t}\n// }());\"use strict\";\n\n/**\n * Allows a series of Blob-convertible objects (ArrayBuffer, Blob, String, etc) to be added to a buffer. Seeking and\n * overwriting of blobs is allowed.\n *\n * You can supply a FileWriter, in which case the BlobBuffer is just used as temporary storage before it writes it\n * through to the disk.\n *\n * By Nicholas Sherlock\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n// (function() {\n\tvar BlobBuffer = function(fs) {\n\t\treturn function(destination) {\n\t\t\tvar\n\t\t\t\tbuffer = [],\n\t\t\t\twritePromise = Promise.resolve(),\n\t\t\t\tfileWriter = null,\n\t\t\t\tfd = null;\n\n\t\t\tif (typeof FileWriter !== \"undefined\" && destination instanceof FileWriter) {\n\t\t\t\tfileWriter = destination;\n\t\t\t} else if (fs && destination) {\n\t\t\t\tfd = destination;\n\t\t\t}\n\n\t\t\t// Current seek offset\n\t\t\tthis.pos = 0;\n\n\t\t\t// One more than the index of the highest byte ever written\n\t\t\tthis.length = 0;\n\n\t\t\t// Returns a promise that converts the blob to an ArrayBuffer\n\t\t\tfunction readBlobAsBuffer(blob) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tvar\n\t\t\t\t\t\treader = new FileReader();\n\n\t\t\t\t\treader.addEventListener(\"loadend\", function () {\n\t\t\t\t\t\tresolve(reader.result);\n\t\t\t\t\t});\n\n\t\t\t\t\treader.readAsArrayBuffer(blob);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction convertToUint8Array(thing) {\n\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\tif (thing instanceof Uint8Array) {\n\t\t\t\t\t\tresolve(thing);\n\t\t\t\t\t} else if (thing instanceof ArrayBuffer || ArrayBuffer.isView(thing)) {\n\t\t\t\t\t\tresolve(new Uint8Array(thing));\n\t\t\t\t\t} else if (thing instanceof Blob) {\n\t\t\t\t\t\tresolve(readBlobAsBuffer(thing).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Assume that Blob will know how to read this thing\n\t\t\t\t\t\tresolve(readBlobAsBuffer(new Blob([thing])).then(function (buffer) {\n\t\t\t\t\t\t\treturn new Uint8Array(buffer);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction measureData(data) {\n\t\t\t\tvar\n\t\t\t\t\tresult = data.byteLength || data.length || data.size;\n\n\t\t\t\tif (!Number.isInteger(result)) {\n\t\t\t\t\tthrow \"Failed to determine size of element\";\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Seek to the given absolute offset.\n\t\t\t *\n\t\t\t * You may not seek beyond the end of the file (this would create a hole and/or allow blocks to be written in non-\n\t\t\t * sequential order, which isn't currently supported by the memory buffer backend).\n\t\t\t */\n\t\t\tthis.seek = function (offset) {\n\t\t\t\tif (offset < 0) {\n\t\t\t\t\tthrow \"Offset may not be negative\";\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(offset)) {\n\t\t\t\t\tthrow \"Offset may not be NaN\";\n\t\t\t\t}\n\n\t\t\t\tif (offset > this.length) {\n\t\t\t\t\tthrow \"Seeking beyond the end of file is not allowed\";\n\t\t\t\t}\n\n\t\t\t\tthis.pos = offset;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Write the Blob-convertible data to the buffer at the current seek position.\n\t\t\t *\n\t\t\t * Note: If overwriting existing data, the write must not cross preexisting block boundaries (written data must\n\t\t\t * be fully contained by the extent of a previous write).\n\t\t\t */\n\t\t\tthis.write = function (data) {\n\t\t\t\tvar\n\t\t\t\t\tnewEntry = {\n\t\t\t\t\t\toffset: this.pos,\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tlength: measureData(data)\n\t\t\t\t\t},\n\t\t\t\t\tisAppend = newEntry.offset >= this.length;\n\n\t\t\t\tthis.pos += newEntry.length;\n\t\t\t\tthis.length = Math.max(this.length, this.pos);\n\n\t\t\t\t// After previous writes complete, perform our write\n\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\tif (fd) {\n\t\t\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\t\t\tconvertToUint8Array(newEntry.data).then(function(dataArray) {\n\t\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\t\ttotalWritten = 0,\n\t\t\t\t\t\t\t\t\tbuffer = Buffer.from(dataArray.buffer),\n\n\t\t\t\t\t\t\t\t\thandleWriteComplete = function(err, written, buffer) {\n\t\t\t\t\t\t\t\t\t\ttotalWritten += written;\n\n\t\t\t\t\t\t\t\t\t\tif (totalWritten >= buffer.length) {\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// We still have more to write...\n\t\t\t\t\t\t\t\t\t\t\tfs.write(fd, buffer, totalWritten, buffer.length - totalWritten, newEntry.offset + totalWritten, handleWriteComplete);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tfs.write(fd, buffer, 0, buffer.length, newEntry.offset, handleWriteComplete);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (fileWriter) {\n\t\t\t\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\t\tfileWriter.onwriteend = resolve;\n\n\t\t\t\t\t\t\tfileWriter.seek(newEntry.offset);\n\t\t\t\t\t\t\tfileWriter.write(new Blob([newEntry.data]));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!isAppend) {\n\t\t\t\t\t\t// We might be modifying a write that was already buffered in memory.\n\n\t\t\t\t\t\t// Slow linear search to find a block we might be overwriting\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tvar\n\t\t\t\t\t\t\t\tentry = buffer[i];\n\n\t\t\t\t\t\t\t// If our new entry overlaps the old one in any way...\n\t\t\t\t\t\t\tif (!(newEntry.offset + newEntry.length <= entry.offset || newEntry.offset >= entry.offset + entry.length)) {\n\t\t\t\t\t\t\t\tif (newEntry.offset < entry.offset || newEntry.offset + newEntry.length > entry.offset + entry.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(\"Overwrite crosses blob boundaries\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (newEntry.offset == entry.offset && newEntry.length == entry.length) {\n\t\t\t\t\t\t\t\t\t// We overwrote the entire block\n\t\t\t\t\t\t\t\t\tentry.data = newEntry.data;\n\n\t\t\t\t\t\t\t\t\t// We're done\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn convertToUint8Array(entry.data)\n\t\t\t\t\t\t\t\t\t\t.then(function (entryArray) {\n\t\t\t\t\t\t\t\t\t\t\tentry.data = entryArray;\n\n\t\t\t\t\t\t\t\t\t\t\treturn convertToUint8Array(newEntry.data);\n\t\t\t\t\t\t\t\t\t\t}).then(function (newEntryArray) {\n\t\t\t\t\t\t\t\t\t\t\tnewEntry.data = newEntryArray;\n\n\t\t\t\t\t\t\t\t\t\t\tentry.data.set(newEntry.data, newEntry.offset - entry.offset);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Else fall through to do a simple append, as we didn't overwrite any pre-existing blocks\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.push(newEntry);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Finish all writes to the buffer, returning a promise that signals when that is complete.\n\t\t\t *\n\t\t\t * If a FileWriter was not provided, the promise is resolved with a Blob that represents the completed BlobBuffer\n\t\t\t * contents. You can optionally pass in a mimeType to be used for this blob.\n\t\t\t *\n\t\t\t * If a FileWriter was provided, the promise is resolved with null as the first argument.\n\t\t\t */\n\t\t\tthis.complete = function (mimeType) {\n\t\t\t\tif (fd || fileWriter) {\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// After writes complete we need to merge the buffer to give to the caller\n\t\t\t\t\twritePromise = writePromise.then(function () {\n\t\t\t\t\t\tvar\n\t\t\t\t\t\t\tresult = [];\n\n\t\t\t\t\t\tfor (var i = 0; i < buffer.length; i++) {\n\t\t\t\t\t\t\tresult.push(buffer[i].data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Blob(result, {mimeType: mimeType});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn writePromise;\n\t\t\t};\n\t\t};\n\t}(null);\n\n// \tif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n// \t\tmodule.exports = BlobBuffer(require('fs'));\n// \t} else {\n// \t\twindow.BlobBuffer = BlobBuffer(null);\n// \t}\n// })();\n/**\n * WebM video encoder for Google Chrome. This implementation is suitable for creating very large video files, because\n * it can stream Blobs directly to a FileWriter without buffering the entire video in memory.\n *\n * When FileWriter is not available or not desired, it can buffer the video in memory as a series of Blobs which are\n * eventually returned as one composite Blob.\n *\n * By Nicholas Sherlock.\n *\n * Based on the ideas from Whammy: https://github.com/antimatter15/whammy\n *\n * Released under the WTFPLv2 https://en.wikipedia.org/wiki/WTFPL\n */\n\n\"use strict\";\n\n(function() {\n var WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {\n function extend(base, top) {\n var\n target = {};\n\n [base, top].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n });\n\n return target;\n }\n\n /**\n * Decode a Base64 data URL into a binary string.\n *\n * Returns the binary string, or false if the URL could not be decoded.\n */\n function decodeBase64WebPDataURL(url) {\n if (typeof url !== \"string\" || !url.match(/^data:image\\/webp;base64,/i)) {\n return false;\n }\n\n return window.atob(url.substring(\"data:image\\/webp;base64,\".length));\n }\n\n /**\n * Convert a raw binary string (one character = one output byte) to an ArrayBuffer\n */\n function stringToArrayBuffer(string) {\n var\n buffer = new ArrayBuffer(string.length),\n int8Array = new Uint8Array(buffer);\n\n for (var i = 0; i < string.length; i++) {\n int8Array[i] = string.charCodeAt(i);\n }\n\n return buffer;\n }\n\n /**\n * Convert the given canvas to a WebP encoded image and return the image data as a string.\n */\n function renderAsWebP(canvas, quality) {\n var\n frame = canvas.toDataURL('image/webp', {quality: quality});\n\n return decodeBase64WebPDataURL(frame);\n }\n\n function extractKeyframeFromWebP(webP) {\n // Assume that Chrome will generate a Simple Lossy WebP which has this header:\n var\n keyframeStartIndex = webP.indexOf('VP8 ');\n\n if (keyframeStartIndex == -1) {\n throw \"Failed to identify beginning of keyframe in WebP image\";\n }\n\n // Skip the header and the 4 bytes that encode the length of the VP8 chunk\n keyframeStartIndex += 'VP8 '.length + 4;\n\n return webP.substring(keyframeStartIndex);\n }\n\n // Just a little utility so we can tag values as floats for the EBML encoder's benefit\n function EBMLFloat32(value) {\n this.value = value;\n }\n\n function EBMLFloat64(value) {\n this.value = value;\n }\n\n /**\n * Write the given EBML object to the provided ArrayBufferStream.\n *\n * The buffer's first byte is at bufferFileOffset inside the video file. This is used to complete offset and\n * dataOffset fields in each EBML structure, indicating the file offset of the first byte of the EBML element and\n * its data payload.\n */\n function writeEBML(buffer, bufferFileOffset, ebml) {\n // Is the ebml an array of sibling elements?\n if (Array.isArray(ebml)) {\n for (var i = 0; i < ebml.length; i++) {\n writeEBML(buffer, bufferFileOffset, ebml[i]);\n }\n // Is this some sort of raw data that we want to write directly?\n } else if (typeof ebml === \"string\") {\n buffer.writeString(ebml);\n } else if (ebml instanceof Uint8Array) {\n buffer.writeBytes(ebml);\n } else if (ebml.id){\n // We're writing an EBML element\n ebml.offset = buffer.pos + bufferFileOffset;\n\n buffer.writeUnsignedIntBE(ebml.id); // ID field\n\n // Now we need to write the size field, so we must know the payload size:\n\n if (Array.isArray(ebml.data)) {\n // Writing an array of child elements. We won't try to measure the size of the children up-front\n\n var\n sizePos, dataBegin, dataEnd;\n\n if (ebml.size === -1) {\n // Write the reserved all-one-bits marker to note that the size of this element is unknown/unbounded\n buffer.writeByte(0xFF);\n } else {\n sizePos = buffer.pos;\n\n /* Write a dummy size field to overwrite later. 4 bytes allows an element maximum size of 256MB,\n * which should be plenty (we don't want to have to buffer that much data in memory at one time\n * anyway!)\n */\n buffer.writeBytes([0, 0, 0, 0]);\n }\n\n dataBegin = buffer.pos;\n\n ebml.dataOffset = dataBegin + bufferFileOffset;\n writeEBML(buffer, bufferFileOffset, ebml.data);\n\n if (ebml.size !== -1) {\n dataEnd = buffer.pos;\n\n ebml.size = dataEnd - dataBegin;\n\n buffer.seek(sizePos);\n buffer.writeEBMLVarIntWidth(ebml.size, 4); // Size field\n\n buffer.seek(dataEnd);\n }\n } else if (typeof ebml.data === \"string\") {\n buffer.writeEBMLVarInt(ebml.data.length); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeString(ebml.data);\n } else if (typeof ebml.data === \"number\") {\n // Allow the caller to explicitly choose the size if they wish by supplying a size field\n if (!ebml.size) {\n ebml.size = buffer.measureUnsignedInt(ebml.data);\n }\n\n buffer.writeEBMLVarInt(ebml.size); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeUnsignedIntBE(ebml.data, ebml.size);\n } else if (ebml.data instanceof EBMLFloat64) {\n buffer.writeEBMLVarInt(8); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeDoubleBE(ebml.data.value);\n } else if (ebml.data instanceof EBMLFloat32) {\n buffer.writeEBMLVarInt(4); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeFloatBE(ebml.data.value);\n } else if (ebml.data instanceof Uint8Array) {\n buffer.writeEBMLVarInt(ebml.data.byteLength); // Size field\n ebml.dataOffset = buffer.pos + bufferFileOffset;\n buffer.writeBytes(ebml.data);\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n } else {\n throw \"Bad EBML datatype \" + typeof ebml.data;\n }\n }\n\n return function(options) {\n var\n MAX_CLUSTER_DURATION_MSEC = 5000,\n DEFAULT_TRACK_NUMBER = 1,\n\n writtenHeader = false,\n videoWidth, videoHeight,\n\n clusterFrameBuffer = [],\n clusterStartTime = 0,\n clusterDuration = 0,\n\n optionDefaults = {\n quality: 0.95, // WebM image quality from 0.0 (worst) to 1.0 (best)\n fileWriter: null, // Chrome FileWriter in order to stream to a file instead of buffering to memory (optional)\n fd: null, // Node.JS file descriptor to write to instead of buffering (optional)\n\n // You must supply one of:\n frameDuration: null, // Duration of frames in milliseconds\n frameRate: null, // Number of frames per second\n },\n\n seekPoints = {\n Cues: {id: new Uint8Array([0x1C, 0x53, 0xBB, 0x6B]), positionEBML: null},\n SegmentInfo: {id: new Uint8Array([0x15, 0x49, 0xA9, 0x66]), positionEBML: null},\n Tracks: {id: new Uint8Array([0x16, 0x54, 0xAE, 0x6B]), positionEBML: null},\n },\n\n ebmlSegment,\n segmentDuration = {\n \"id\": 0x4489, // Duration\n \"data\": new EBMLFloat64(0)\n },\n\n seekHead,\n\n cues = [],\n\n blobBuffer = new BlobBuffer(options.fileWriter || options.fd);\n\n function fileOffsetToSegmentRelative(fileOffset) {\n return fileOffset - ebmlSegment.dataOffset;\n }\n\n /**\n * Create a SeekHead element with descriptors for the points in the global seekPoints array.\n *\n * 5 bytes of position values are reserved for each node, which lie at the offset point.positionEBML.dataOffset,\n * to be overwritten later.\n */\n function createSeekHead() {\n var\n seekPositionEBMLTemplate = {\n \"id\": 0x53AC, // SeekPosition\n \"size\": 5, // Allows for 32GB video files\n \"data\": 0 // We'll overwrite this when the file is complete\n },\n\n result = {\n \"id\": 0x114D9B74, // SeekHead\n \"data\": []\n };\n\n for (var name in seekPoints) {\n var\n seekPoint = seekPoints[name];\n\n seekPoint.positionEBML = Object.create(seekPositionEBMLTemplate);\n\n result.data.push({\n \"id\": 0x4DBB, // Seek\n \"data\": [\n {\n \"id\": 0x53AB, // SeekID\n \"data\": seekPoint.id\n },\n seekPoint.positionEBML\n ]\n });\n }\n\n return result;\n }\n\n /**\n * Write the WebM file header to the stream.\n */\n function writeHeader() {\n seekHead = createSeekHead();\n\n var\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n\n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ]\n }\n ]\n }\n ]\n };\n\n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n\n var\n bufferStream = new ArrayBufferDataStream(256);\n\n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n\n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n };\n\n /**\n * Create a SimpleBlock keyframe header using these fields:\n * timecode - Time of this keyframe\n * trackNumber - Track number from 1 to 126 (inclusive)\n * frame - Raw frame data payload string\n *\n * Returns an EBML element.\n */\n function createKeyframeBlock(keyframe) {\n var\n bufferStream = new ArrayBufferDataStream(1 + 2 + 1);\n\n if (!(keyframe.trackNumber > 0 && keyframe.trackNumber < 127)) {\n throw \"TrackNumber must be > 0 and < 127\";\n }\n\n bufferStream.writeEBMLVarInt(keyframe.trackNumber); // Always 1 byte since we limit the range of trackNumber\n bufferStream.writeU16BE(keyframe.timecode);\n\n // Flags byte\n bufferStream.writeByte(\n 1 << 7 // Keyframe\n );\n\n return {\n \"id\": 0xA3, // SimpleBlock\n \"data\": [\n bufferStream.getAsDataArray(),\n keyframe.frame\n ]\n };\n }\n\n /**\n * Create a Cluster node using these fields:\n *\n * timecode - Start time for the cluster\n *\n * Returns an EBML element.\n */\n function createCluster(cluster) {\n return {\n \"id\": 0x1f43b675,\n \"data\": [\n {\n \"id\": 0xe7, // Timecode\n \"data\": Math.round(cluster.timecode)\n }\n ]\n };\n }\n\n function addCuePoint(trackIndex, clusterTime, clusterFileOffset) {\n cues.push({\n \"id\": 0xBB, // Cue\n \"data\": [\n {\n \"id\": 0xB3, // CueTime\n \"data\": clusterTime\n },\n {\n \"id\": 0xB7, // CueTrackPositions\n \"data\": [\n {\n \"id\": 0xF7, // CueTrack\n \"data\": trackIndex\n },\n {\n \"id\": 0xF1, // CueClusterPosition\n \"data\": fileOffsetToSegmentRelative(clusterFileOffset)\n }\n ]\n }\n ]\n });\n }\n\n /**\n * Write a Cues element to the blobStream using the global `cues` array of CuePoints (use addCuePoint()).\n * The seek entry for the Cues in the SeekHead is updated.\n */\n function writeCues() {\n var\n ebml = {\n \"id\": 0x1C53BB6B,\n \"data\": cues\n },\n\n cuesBuffer = new ArrayBufferDataStream(16 + cues.length * 32); // Pretty crude estimate of the buffer size we'll need\n\n writeEBML(cuesBuffer, blobBuffer.pos, ebml);\n blobBuffer.write(cuesBuffer.getAsDataArray());\n\n // Now we know where the Cues element has ended up, we can update the SeekHead\n seekPoints.Cues.positionEBML.data = fileOffsetToSegmentRelative(ebml.offset);\n }\n\n /**\n * Flush the frames in the current clusterFrameBuffer out to the stream as a Cluster.\n */\n function flushClusterFrameBuffer() {\n if (clusterFrameBuffer.length == 0) {\n return;\n }\n\n // First work out how large of a buffer we need to hold the cluster data\n var\n rawImageSize = 0;\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n rawImageSize += clusterFrameBuffer[i].frame.length;\n }\n\n var\n buffer = new ArrayBufferDataStream(rawImageSize + clusterFrameBuffer.length * 32), // Estimate 32 bytes per SimpleBlock header\n\n cluster = createCluster({\n timecode: Math.round(clusterStartTime),\n });\n\n for (var i = 0; i < clusterFrameBuffer.length; i++) {\n cluster.data.push(createKeyframeBlock(clusterFrameBuffer[i]));\n }\n\n writeEBML(buffer, blobBuffer.pos, cluster);\n blobBuffer.write(buffer.getAsDataArray());\n\n addCuePoint(DEFAULT_TRACK_NUMBER, Math.round(clusterStartTime), cluster.offset);\n\n clusterFrameBuffer = [];\n clusterStartTime += clusterDuration;\n clusterDuration = 0;\n }\n\n function validateOptions() {\n // Derive frameDuration setting if not already supplied\n if (!options.frameDuration) {\n if (options.frameRate) {\n options.frameDuration = 1000 / options.frameRate;\n } else {\n throw \"Missing required frameDuration or frameRate setting\";\n }\n }\n }\n\n function addFrameToCluster(frame) {\n frame.trackNumber = DEFAULT_TRACK_NUMBER;\n\n // Frame timecodes are relative to the start of their cluster:\n frame.timecode = Math.round(clusterDuration);\n\n clusterFrameBuffer.push(frame);\n\n clusterDuration += frame.duration;\n\n if (clusterDuration >= MAX_CLUSTER_DURATION_MSEC) {\n flushClusterFrameBuffer();\n }\n }\n\n /**\n * Rewrites the SeekHead element that was initially written to the stream with the offsets of top level elements.\n *\n * Call once writing is complete (so the offset of all top level elements is known).\n */\n function rewriteSeekHead() {\n var\n seekHeadBuffer = new ArrayBufferDataStream(seekHead.size),\n oldPos = blobBuffer.pos;\n\n // Write the rewritten SeekHead element's data payload to the stream (don't need to update the id or size)\n writeEBML(seekHeadBuffer, seekHead.dataOffset, seekHead.data);\n\n // And write that through to the file\n blobBuffer.seek(seekHead.dataOffset);\n blobBuffer.write(seekHeadBuffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Rewrite the Duration field of the Segment with the newly-discovered video duration.\n */\n function rewriteDuration() {\n var\n buffer = new ArrayBufferDataStream(8),\n oldPos = blobBuffer.pos;\n\n // Rewrite the data payload (don't need to update the id or size)\n buffer.writeDoubleBE(clusterStartTime);\n\n // And write that through to the file\n blobBuffer.seek(segmentDuration.dataOffset);\n blobBuffer.write(buffer.getAsDataArray());\n\n blobBuffer.seek(oldPos);\n }\n\n /**\n * Add a frame to the video. Currently the frame must be a Canvas element.\n */\n this.addFrame = function(canvas) {\n if (writtenHeader) {\n if (canvas.width != videoWidth || canvas.height != videoHeight) {\n throw \"Frame size differs from previous frames\";\n }\n } else {\n videoWidth = canvas.width;\n videoHeight = canvas.height;\n\n writeHeader();\n writtenHeader = true;\n }\n\n var\n webP = renderAsWebP(canvas, {quality: options.quality});\n\n if (!webP) {\n throw \"Couldn't decode WebP frame, does the browser support WebP?\";\n }\n\n addFrameToCluster({\n frame: extractKeyframeFromWebP(webP),\n duration: options.frameDuration\n });\n };\n\n /**\n * Finish writing the video and return a Promise to signal completion.\n *\n * If the destination device was memory (i.e. options.fileWriter was not supplied), the Promise is resolved with\n * a Blob with the contents of the entire video.\n */\n this.complete = function() {\n flushClusterFrameBuffer();\n\n writeCues();\n rewriteSeekHead();\n rewriteDuration();\n\n return blobBuffer.complete('video/webm');\n };\n\n this.getWrittenSize = function() {\n return blobBuffer.length;\n };\n\n options = extend(optionDefaults, options || {});\n validateOptions();\n };\n };\n\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n\t // module.exports = WebMWriter(require(\"./ArrayBufferDataStream\"), require(\"./BlobBuffer\"));\n module.exports = WebMWriter(ArrayBufferDataStream,BlobBuffer);\n } else {\n\t window.WebMWriter = WebMWriter(ArrayBufferDataStream, BlobBuffer);\n }\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","// Default export.\nimport * as CanvasCapture from './CanvasCapture';\nexport default CanvasCapture;\n\n// Named export.\nexport { CanvasCapture };"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/canvas-capture.min.js b/dist/canvas-capture.min.js index 8d86d53..3782e61 100644 --- a/dist/canvas-capture.min.js +++ b/dist/canvas-capture.min.js @@ -10,5 +10,5 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */ -t.exports=function n(i,o,a){function s(e,t){if(!o[e]){if(!i[e]){if(0,l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r=o[e]={exports:{}};i[e][0].call(r.exports,function(t){return s(i[e][1][t]||t)},r,r.exports,n,i,o,a)}return o[e].exports}for(var l=void 0,t=0;t>4,i=1>6:64,o=2>2)+f.charAt(n)+f.charAt(i)+f.charAt(o));return s.join("")},r.decode=function(t){var e,r,n,i,o,a=0,s=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var l,h=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===f.charAt(64)&&h--,t.charAt(t.length-2)===f.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(l=new(u.uint8array?Uint8Array:Array)(0|h);a>4,r=(15&n)<<4|(i=f.indexOf(t.charAt(a++)))>>2,n=(3&i)<<6|(o=f.indexOf(t.charAt(a++))),l[s++]=e,64!==i&&(l[s++]=r),64!==o&&(l[s++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function s(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}s.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)}},s.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=s},{"./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(t){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"),a=function(){for(var t=[],e=0;e<256;e++){for(var r=e,n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;t[e]=r}return t}();e.exports=function(t,e){return void 0!==t&&t.length?("string"!==n.getTypeOf(t)?function(t,e,r){var n=a,i=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e[o])];return-1^t}:function(t,e,r){var n=a,i=0+r;t^=-1;for(var o=0;o>>8^n[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="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"),o=t("./utils"),a=t("./stream/GenericWorker"),s=n?"uint8array":"array";function l(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(l,a),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,t.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function v(t,e){for(var r="",n=0;n>>=8;return r}function n(t,e,r,n,i,o){var a,s=t.file,l=t.compression,h=o!==k.utf8encode,u=_.transformTo("string",o(s.name)),c=_.transformTo("string",k.utf8encode(s.name)),f=s.comment,d=_.transformTo("string",o(f)),p=_.transformTo("string",k.utf8encode(f)),m=c.length!==s.name.length,g=p.length!==f.length,w="",b=s.dir,o=s.date,f={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(f.crc32=t.crc32,f.compressedSize=t.compressedSize,f.uncompressedSize=t.uncompressedSize);t=0;e&&(t|=8),h||!m&&!g||(t|=2048);e=0,h=0;b&&(e|=16),"UNIX"===i?(h=798,e|=(65535&((i=s.unixPermissions)?i:b?16893:33204))<<16):(h=20,e|=63&(s.dosPermissions||0)),b=o.getUTCHours(),b<<=6,b|=o.getUTCMinutes(),b<<=5,b|=o.getUTCSeconds()/2,s=o.getUTCFullYear()-1980,s<<=4,s|=o.getUTCMonth()+1,s<<=5,s|=o.getUTCDate(),m&&(a=v(1,1)+v(x(u),4)+c,w+="up"+v(a.length,2)+a),g&&(y=v(1,1)+v(x(d),4)+p,w+="uc"+v(y.length,2)+y);var y="";return y+="\n\0",y+=v(t,2),y+=l.magic,y+=v(b,2),y+=v(s,2),y+=v(f.crc32,4),y+=v(f.compressedSize,4),y+=v(f.uncompressedSize,4),y+=v(u.length,2),y+=v(w.length,2),{fileRecord:E.LOCAL_FILE_HEADER+y+u+w,dirRecord:E.CENTRAL_FILE_HEADER+v(h,2)+y+v(d.length,2)+"\0\0\0\0"+v(e,4)+v(n,4)+u+w+d}}var _=t("../utils"),i=t("../stream/GenericWorker"),k=t("../utf8"),x=t("../crc32"),E=t("../signature");function o(t,e,r,n){i.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=[]}_.inherits(o,i),o.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,i.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},o.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;e?(e=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},o.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:(t=t,E.DATA_DESCRIPTOR+v(t.crc32,4)+v(t.compressedSize,4)+v(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},o.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(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},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"),o=t("./ArrayReader"),a=t("./StringReader"),s=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new s(t):i.uint8array?new l(n.transformTo("uint8array",t)):new o(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 o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){var e;t&&(e=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=e+t.data.length),i.prototype.processChunk.call(this,t)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function o(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(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.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=o},{"../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,e,r){"use strict";var h=t("../utils"),i=t("./ConvertWorker"),o=t("./GenericWorker"),u=t("../base64"),n=t("../support"),a=t("../external"),s=null;if(n.nodestream)try{s=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function l(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,h.checkSupport(n),this._worker=t.pipe(new i(n)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}l.prototype={accumulate:function(t){return s=this,l=t,new a.Promise(function(e,r){var n=[],i=s._internalType,o=s._outputType,a=s._mimeType;s.on("data",function(t,e){n.push(t),l&&l(e)}).on("error",function(t){n=[],r(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return h.newBlob(h.transformTo("arraybuffer",e),r);case"base64":return u.encode(e);default:return h.transformTo(t,e)}}(o,function(t,e){for(var r=0,n=null,i=0,o=0;o>>6:(r<65536?e[i++]=224|r>>>12:(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63),e[i++]=128|r>>>6&63),e[i++]=128|63&r);return e}(t)},i.utf8decode=function(t){return l.nodebuffer?s.transformTo("nodebuffer",t).toString("utf-8"):function(t){for(var e,r,n,i=t.length,o=new Array(2*i),a=e=0;a>10&1023,o[e++]=56320|1023&r)}return o.length!==e&&(o.subarray?o=o.subarray(0,e):o.length=e),s.applyFromCharCode(o)}(t=s.transformTo(l.uint8array?"uint8array":"array",t))},s.inherits(a,n),a.prototype.processChunk=function(t){var e=s.transformTo(l.uint8array?"uint8array":"array",t.data);this.leftOver&&this.leftOver.length&&(l.uint8array?(n=e,(e=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),e.set(n,this.leftOver.length)):e=this.leftOver.concat(e),this.leftOver=null);var r=function(t,e){for(var r=(e=(e=e||t.length)>t.length?t.length:e)-1;0<=r&&128==(192&t[r]);)r--;return!(r<0)&&0!==r&&r+h[t[r]]>e?r:e}(e),n=e;r!==e.length&&(l.uint8array?(n=e.subarray(0,r),this.leftOver=e.subarray(r,e.length)):(n=e.slice(0,r),this.leftOver=e.slice(r,e.length))),this.push({data:i.utf8decode(n),meta:t.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=a,s.inherits(u,n),u.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,a){"use strict";var s=t("./support"),l=t("./base64"),r=t("./nodejsUtils"),n=t("set-immediate-shim"),h=t("./external");function i(t){return t}function u(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(t){var e;this.extraFields[1]&&(e=n(this.extraFields[1].value),this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.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[i++]=224|r>>>12:(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63),e[i++]=128|r>>>6&63),e[i++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new l.Buf8(t.length),r=0,n=e.length;r>10&1023,a[r++]=56320|1023&n)}return u(a,r)},r.utf8border=function(t,e){for(var r=(e=(e=e||t.length)>t.length?t.length:e)-1;0<=r&&128==(192&t[r]);)r--;return!(r<0)&&0!==r&&r+h[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,o=t>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:r>>>1;t[e]=r}return t}();e.exports=function(t,e,r,n){var i=s,o=n+r;t^=-1;for(var a=n;a>>8^i[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var s,c=t("../utils/common"),l=t("./trees"),f=t("./adler32"),d=t("./crc32"),n=t("./messages"),h=0,u=0,p=-2,i=2,m=8,o=286,a=30,g=19,w=2*o+1,b=15,y=3,v=258,_=v+y+1,k=42,x=113;function E(t,e){return t.msg=n[e],e}function S(t){return(t<<1)-(4t.avail_out?t.avail_out:r)&&(c.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 B(t,e){l._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,C(t.strm)}function z(t,e){t.pending_buf[t.pending++]=e}function F(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function P(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-_?t.strstart-(t.w_size-_):0,h=t.window,u=t.w_mask,c=t.prev,f=t.strstart+v,d=h[o+a-1],p=h[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(h[(r=e)+a]===p&&h[r+a-1]===d&&h[r]===h[o]&&h[++r]===h[o+1]){for(o+=2,r++;h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&ol&&0!=--i);return a<=t.lookahead?a:t.lookahead}function T(t){var e,r,n,i,o,a,s,l,h,u=t.w_size;do{if(l=t.window_size-t.lookahead-t.strstart,t.strstart>=u+(u-_)){for(c.arraySet(t.window,t.window,u,u,0),t.match_start-=u,t.strstart-=u,t.block_start-=u,e=r=t.hash_size;n=t.head[--e],t.head[e]=u<=n?n-u:0,--r;);for(e=r=u;n=t.prev[--e],t.prev[e]=u<=n?n-u:0,--r;);l+=u}if(0===t.strm.avail_in)break;if(o=t.strm,a=t.window,s=t.strstart+t.lookahead,h=void 0,r=0===(h=(l=l)<(h=o.avail_in)?l:h)?0:(o.avail_in-=h,c.arraySet(a,o.input,o.next_in,h,s),1===o.state.wrap?o.adler=f(o.adler,a,h,s):2===o.state.wrap&&(o.adler=d(o.adler,a,h,s)),o.next_in+=h,o.total_in+=h,h),t.lookahead+=r,t.lookahead+t.insert>=y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<=y&&(t.ins_h=(t.ins_h<=y)if(n=l._tr_tally(t,t.strstart-t.match_start,t.match_length-y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=y){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=y&&(t.ins_h=(t.ins_h<=y&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-y,n=l._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-y),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(T(t),0===t.lookahead&&e===h)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,B(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-_&&(B(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(B(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(B(t,!1),t.strm.avail_out),1)}),new R(4,4,8,4,I),new R(4,5,16,8,I),new R(4,6,32,32,I),new R(4,4,16,16,O),new R(8,16,32,32,O),new R(8,16,128,128,O),new R(8,32,128,256,O),new R(32,128,258,1024,O),new R(32,258,258,4096,O)],r.deflateInit=function(t,e){return j(t,e,m,15,8,0)},r.deflateInit2=j,r.deflateReset=M,r.deflateResetKeep=L,r.deflateSetHeader=function(t,e){return!t||!t.state||2!==t.state.wrap?p:(t.state.gzhead=e,u)},r.deflate=function(t,e){var r,n,i,o;if(!t||!t.state||5>8&255),z(r,r.gzhead.time>>16&255),z(r,r.gzhead.time>>24&255),z(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(z(r,255&r.gzhead.extra.length),z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=d(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(z(r,0),z(r,0),z(r,0),z(r,0),z(r,0),z(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),z(r,3),r.status=x)):(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=x,F(r,o),0!==r.strstart&&(F(r,t.adler>>>16),F(r,65535&t.adler)),t.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&&(t.adler=d(t.adler,r.pending_buf,r.pending-n,n)),C(t),n=r.pending,r.pending!==r.pending_buf_size));)z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(t.adler=d(t.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&&(t.adler=d(t.adler,r.pending_buf,r.pending-n,n)),C(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(t.adler=d(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(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&&(t.adler=d(t.adler,r.pending_buf,r.pending-n,n)),C(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}}while(i=r.gzindexn&&(t.adler=d(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&C(t),r.pending+2<=r.pending_buf_size&&(z(r,255&t.adler),z(r,t.adler>>8&255),t.adler=0,r.status=x)):r.status=x),0!==r.pending){if(C(t),0===t.avail_out)return r.last_flush=-1,u}else if(0===t.avail_in&&S(e)<=S(a)&&4!==e)return E(t,-5);if(666===r.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==r.lookahead||e!==h&&666!==r.status){var a=2===r.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(T(t),0===t.lookahead)){if(e===h)return 1;break}if(t.match_length=0,r=l._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(B(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(B(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(B(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=v){if(T(t),t.lookahead<=v&&e===h)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=y&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=y?(r=l._tr_tally(t,1,t.match_length-y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=l._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(B(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(B(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(B(t,!1),0===t.strm.avail_out)?1:2}(r,e):s[r.level].func(r,e);if(3!==a&&4!==a||(r.status=666),1===a||3===a)return 0===t.avail_out&&(r.last_flush=-1),u;if(2===a&&(1===e?l._tr_align(r):5!==e&&(l._tr_stored_block(r,0,0,!1),3===e&&(A(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),C(t),0===t.avail_out))return r.last_flush=-1,u}return 4!==e?u:r.wrap<=0?1:(2===r.wrap?(z(r,255&t.adler),z(r,t.adler>>8&255),z(r,t.adler>>16&255),z(r,t.adler>>24&255),z(r,255&t.total_in),z(r,t.total_in>>8&255),z(r,t.total_in>>16&255),z(r,t.total_in>>24&255)):(F(r,t.adler>>>16),F(r,65535&t.adler)),C(t),0=r.w_size&&(0===o&&(A(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new c.Buf8(r.w_size),c.arraySet(l,e,h-r.w_size,r.w_size,0),e=l,h=r.w_size),a=t.avail_in,s=t.next_in,l=t.input,t.avail_in=h,t.next_in=0,t.input=e,T(r);r.lookahead>=y;){for(n=r.strstart,i=r.lookahead-(y-1);r.ins_h=(r.ins_h<>>=n=r>>>24,k-=n,0==(n=r>>>16&255))d[f++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=x[(65535&r)+(_&(1<>>=n,k-=n),k<15&&(_+=u[h++]<>>=n=r>>>24,k-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=E[(65535&r)+(_&(1<>>=n,k-=n,(n=f-p)>3,_&=(1<<(k-=i<<3))-1,t.next_in=h,t.next_out=f,t.avail_in=h>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function o(){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 z.Buf16(320),this.work=new z.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=D,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new z.Buf32(n),e.distcode=e.distdyn=new z.Buf32(i),e.sane=1,e.back=-1,O):R}function s(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,a(t)):R}function l(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=i.wsize?(z.arraySet(i.window,e,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(n<(t=i.wsize-i.wnext)&&(t=n),z.arraySet(i.window,e,r-n,t,i.wnext),(n-=t)?(z.arraySet(i.window,e,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=t,i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,r.check=P(r.check,C,2,0),u=h=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&h)){t.msg="unknown compression method",r.mode=30;break}if(u-=4,k=8+(15&(h>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=P(r.check,C,2,0)),u=h=0,r.mode=3;case 3:for(;u<32;){if(0===s)break t;s--,h+=n[o++]<>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,r.check=P(r.check,C,4,0)),u=h=0,r.mode=4;case 4:for(;u<16;){if(0===s)break t;s--,h+=n[o++]<>8),512&r.flags&&(C[0]=255&h,C[1]=h>>>8&255,r.check=P(r.check,C,2,0)),u=h=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break t;s--,h+=n[o++]<>>8&255,r.check=P(r.check,C,2,0)),u=h=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=s<(d=r.length)?s:d)&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),z.arraySet(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=P(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break t;for(d=0;k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break t;s--,h+=n[o++]<>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break t;s--,h+=n[o++]<>>=1)){case 0:r.mode=14;break;case 1:if(function(t){if(U){var e;for(M=new z.Buf32(512),j=new z.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(I(1,t.lens,0,288,M,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;I(2,t.lens,0,32,j,0,t.work,{bits:5}),U=!1}t.lencode=M,t.lenbits=9,t.distcode=j,t.distbits=5}(r),r.mode=20,6!==e)break;h>>>=2,u-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}h>>>=2,u-=2;break;case 14:for(h>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,h+=n[o++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&h,u=h=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(d=r.length){if(0===(d=l<(d=s>>=5,u-=5,r.ndist=1+(31&h),h>>>=5,u-=5,r.ncode=4+(15&h),h>>>=4,u-=4,286>>=3,u-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},x=I(0,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,x){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&A,!((g=A>>>24)<=u);){if(0===s)break t;s--,h+=n[o++]<>>=g,u-=g,r.lens[r.have++]=b;else{if(16===b){for(S=g+2;u>>=g,u-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&h),h>>>=2,u-=2}else if(17===b){for(S=g+3;u>>=g)),h>>>=3,u-=3}else{for(S=g+7;u>>=g)),h>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}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,E={bits:r.lenbits},x=I(1,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,x){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},x=I(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,x){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<=s&&258<=l){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=h,r.bits=u,T(t,f),a=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,h=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;w=(A=r.lencode[h&(1<>>16&255,b=65535&A,!((g=A>>>24)<=u);){if(0===s)break t;s--,h+=n[o++]<>y)])>>>16&255,b=65535&A,!(y+(g=A>>>24)<=u);){if(0===s)break t;s--,h+=n[o++]<>>=y,u-=y,r.back+=y}if(h>>>=g,u-=g,r.back+=g,r.length=b,0===w){r.mode=26;break}if(32&w){r.back=-1,r.mode=12;break}if(64&w){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&w,r.mode=22;case 22:if(r.extra){for(S=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;w=(A=r.distcode[h&(1<>>16&255,b=65535&A,!((g=A>>>24)<=u);){if(0===s)break t;s--,h+=n[o++]<>y)])>>>16&255,b=65535&A,!(y+(g=A>>>24)<=u);){if(0===s)break t;s--,h+=n[o++]<>>=y,u-=y,r.back+=y}if(h>>>=g,u-=g,r.back+=g,64&w){t.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&w,r.mode=24;case 24:if(r.extra){for(S=r.extra;u>>=r.extra,u-=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===l)break t;if(r.offset>(d=f-l)){if((d=r.offset-d)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(l-=d=ld?(m=T[I+a[y]],B[z+a[y]]):(m=96,0),l=1<<(p=b-E),v=h=1<>E)+(h-=l)]=p<<24|m<<16|g|0,0!==h;);for(l=1<>=1;if(0!==l?(C&=l-1,C+=l):C=0,y++,0==--F[b]){if(b===_)break;b=e[r+a[y]]}if(k>>7)]}function k(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function x(t,e,r){t.bi_valid>o-r?(t.bi_buf|=e<>o-t.bi_valid,t.bi_valid+=r-o):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){for(var n,i=new Array(16),o=0,a=1;a<=15;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=S(i[s]++,s))}}function C(t){for(var e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function B(t){8>1;1<=e;e--)F(t,i,e);for(n=s;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],F(t,i,1),r=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=r,i[2*n]=i[2*e]+i[2*r],t.depth[n]=(t.depth[e]>=t.depth[r]?t.depth[e]:t.depth[r])+1,i[2*e+1]=i[2*r+1]=n,t.heap[1]=n++,F(t,i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){for(var e,r,n,i,o,a=m.dyn_tree,s=m.max_code,l=m.stat_desc.static_tree,h=m.stat_desc.has_stree,u=m.stat_desc.extra_bits,c=m.stat_desc.extra_base,f=m.stat_desc.max_length,d=0,p=0;p<=15;p++)t.bl_count[p]=0;for(a[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<573;e++)f<(p=a[2*a[2*(r=t.heap[e])+1]+1]+1)&&(p=f,d++),a[2*r+1]=p,s>=7;o<30;o++)for(b[o]=n<<7,t=0;t<1<>>=1)if(1&e&&0!==t.dyn_ltree[2*r])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(r=32;r<256;r++)if(0!==t.dyn_ltree[2*r])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),a=function(t){var e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*s[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?D(t,e,r,n):4===t.strategy||o===i?(x(t,2+(n?1:0),3),P(t,u,c)):(x(t,4+(n?1:0),3),function(t,e,r,n){var i;for(x(t,e-257,5),x(t,r-1,5),x(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*(d[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){x(t,2,3),E(t,256,u),16===(t=t).bi_valid?(k(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)}},{"../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){"use strict";e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)},560:()=>{HTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(i,o,t){var a=this.toDataURL(o,t).split(",")[1];setTimeout(function(){for(var t=atob(a),e=t.length,r=new Uint8Array(e),n=0;n{"use strict";function n(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);ra});var o,s,l,h,u,e=(o=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],s=function(){function f(t){var e=t.targetModal,r=t.triggers,n=void 0===r?[]:r,i=t.onShow,o=void 0===i?function(){}:i,a=t.onClose,s=void 0===a?function(){}:a,l=t.openTrigger,h=void 0===l?"data-micromodal-trigger":l,u=t.closeTrigger,c=void 0===u?"data-micromodal-close":u,r=t.openClass,i=void 0===r?"is-open":r,a=t.disableScroll,l=void 0!==a&&a,u=t.disableFocus,r=void 0!==u&&u,a=t.awaitCloseAnimation,u=void 0!==a&&a,a=t.awaitOpenAnimation,a=void 0!==a&&a,t=t.debugMode,t=void 0!==t&&t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.modal=document.getElementById(e),this.config={debugMode:t,disableScroll:l,openTrigger:h,closeTrigger:c,openClass:i,onShow:o,onClose:s,awaitCloseAnimation:u,awaitOpenAnimation:a,disableFocus:r},0')),!1},u=function(t){if(t.length<=0)return console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''),!1},{init:function(t){var r,n,e=Object.assign({},{openTrigger:"data-micromodal-trigger"},t),t=d(document.querySelectorAll("[".concat(e.openTrigger,"]"))),i=(r=e.openTrigger,n=[],t.forEach(function(t){var e=t.attributes[r].value;void 0===n[e]&&(n[e]=[]),n[e].push(t)}),n);if(!0!==e.debugMode||!1!==function(t,e){if(u(t),!e)return!0;for(var r in e)h(r);return!0}(t,i))for(var o in i){var a=i[o];e.targetModal=o,e.triggers=d(a),l=new s(e)}},show:function(t,e){e=e||{};e.targetModal=t,!0===e.debugMode&&!1===h(t)||(l&&l.removeEventListeners(),(l=new s(e)).showModal())},close:function(t){t?l.closeModalById(t):l.closeModal()}});const a=window.MicroModal=e},57:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c},a.define('/gif.worker.coffee',function(d,e,f,g){var b,c;b=a('/GIFEncoder.js',d),c=function(a){var c,e,d,f;return c=new b(a.width,a.height),a.index===0?c.writeHeader():c.firstFrame=!1,c.setTransparent(a.transparent),c.setRepeat(a.repeat),c.setDelay(a.delay),c.setQuality(a.quality),c.addFrame(a.data),a.last&&c.finish(),d=c.stream(),a.data=d.pages,a.cursor=d.cursor,a.pageSize=d.constructor.pageSize,a.canTransfer?(f=function(c){for(var b=0,d=a.data.length;b=c.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=a},c.prototype.writeUTFBytes=function(b){for(var c=b.length,a=0;a=0&&(this.dispose=a)},b.prototype.setRepeat=function(a){this.repeat=a},b.prototype.setTransparent=function(a){this.transparent=a},b.prototype.addFrame=function(a){this.image=a,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1},b.prototype.finish=function(){this.out.writeByte(59)},b.prototype.setQuality=function(a){a<1&&(a=1),this.sample=a},b.prototype.writeHeader=function(){this.out.writeUTFBytes('GIF89a')},b.prototype.analyzePixels=function(){var g=this.pixels.length,d=g/3;this.indexedPixels=new Uint8Array(d);var a=new f(this.pixels,this.sample);a.buildColormap(),this.colorTab=a.getColormap();var b=0;for(var c=0;c>16,l=(e&65280)>>8,m=e&255,c=0,d=16777216,j=this.colorTab.length;for(var a=0;a=0&&(a=dispose&7),a<<=2,this.out.writeByte(0|a|0|b),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},b.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},b.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},b.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes('NETSCAPE2.0'),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},b.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var b=768-this.colorTab.length;for(var a=0;a>8&255)},b.prototype.writePixels=function(){var a=new g(this.width,this.height,this.indexedPixels,this.colorDepth);a.encode(this.out)},b.prototype.stream=function(){return this.out},e.exports=b}),a.define('/LZWEncoder.js',function(e,g,h,i){function f(y,D,C,B){function w(a,b){r[f++]=a,f>=254&&t(b)}function x(b){u(a),k=i+2,j=!0,l(i,b)}function u(b){for(var a=0;a=0){y=w-d,d===0&&(y=1);do if((d-=y)<0&&(d+=w),h[d]===g){e=n[d];continue a}while(h[d]>=0)}l(e,r),e=t,k<1<0&&(a.writeByte(f),a.writeBytes(r,0,f),f=0)}function p(a){return(1<0?g|=a<=8)w(g&255,c),g>>=8,e-=8;if((k>m||j)&&(j?(m=p(n_bits=q),j=!1):(++n_bits,n_bits==b?m=1<0)w(g&255,c),g>>=8,e-=8;t(c)}}var s=Math.max(2,B),r=new Uint8Array(256),h=new Int32Array(a),n=new Int32Array(a),g,e=0,f,k=0,m,j=!1,q,i,o;this.encode=z}var c=-1,b=12,a=5003,d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=f}),a.define('/TypedNeuQuant.js',function(A,F,E,D){function C(A,B){function I(){o=[],q=new Int32Array(256),t=new Int32Array(a),y=new Int32Array(a),z=new Int32Array(a>>3);var c,d;for(c=0;c>=b,o[c][1]>>=b,o[c][2]>>=b,o[c][3]=c}function K(b,a,c,e,f){o[a][0]-=b*(o[a][0]-c)/d,o[a][1]-=b*(o[a][1]-e)/d,o[a][2]-=b*(o[a][2]-f)/d}function L(j,e,n,l,k){var h=Math.abs(e-j),i=Math.min(e+j,a),g=e+1,f=e-1,m=1,b,d;while(gh)d=z[m++],gh&&(b=o[f--],b[0]-=d*(b[0]-n)/c,b[1]-=d*(b[1]-l)/c,b[2]-=d*(b[2]-k)/c)}function C(p,s,q){var h=2147483647,k=h,d=-1,m=d,c,j,e,n,l;for(c=0;c>i-b),n>g,y[c]-=l,t[c]+=l<>1,b=f+1;b>1,b=f+1;b<256;b++)q[b]=n}function E(j,i,k){var b,d,c,e=1e3,h=-1,f=q[i],g=f-1;while(f=0)f=e?f=a:(f++,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c=0&&(d=o[g],c=i-d[1],c>=e?g=-1:(g--,c<0&&(c=-c),b=d[0]-j,b<0&&(b=-b),c+=b,c>h;for(a<=1&&(a=0),c=0;c=f&&(g-=f),c++,q===0&&(q=1),c%q===0)for(n-=n/D,o-=o/v,a=o>>h,a<=1&&(a=0),e=0;e>g,r=e<>3,h=6,t=1<a[0]&&e[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.css=void 0,e.css='\n/************************** Basic Modal Styles\n**************************/\n\n.modal {\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\n}\n\n.modal__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0,0,0,0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.modal__container {\n background-color: #fff;\n padding: 30px;\n max-width: 500px;\n max-height: 100vh;\n overflow-y: auto;\n box-sizing: border-box;\n}\n\n.modal__header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.modal__title {\n margin-top: 0;\n margin-bottom: 0;\n font-weight: 600;\n font-size: 1.25rem;\n line-height: 1.25;\n color: #222;\n box-sizing: border-box;\n}\n\n.modal__footer {\n text-align: right;\n}\n\n.modal__footer>.modal__btn {\n margin-right: 8px;\n}\n\n.modal__close {\n background: transparent;\n border: 0;\n}\n\n.modal__header .modal__close:before { content: "✕"; }\n\n.modal__content {\n margin-top: 2rem;\n margin-bottom: 2rem;\n line-height: 1.5;\n color: rgba(0,0,0,.8);\n}\n\n.modal__btn {\n font-size: .875rem;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: .5rem;\n padding-bottom: .5rem;\n background-color: #e6e6e6;\n color: rgba(0,0,0,.8);\n border-radius: .25rem;\n border-style: none;\n border-width: 0;\n cursor: pointer;\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n line-height: 1.15;\n margin: 0;\n will-change: transform;\n -moz-osx-font-smoothing: grayscale;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n transition: -webkit-transform .25s ease-out;\n transition: transform .25s ease-out;\n transition: transform .25s ease-out,-webkit-transform .25s ease-out;\n}\n\n.modal__btn:focus, .modal__btn:hover {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n}\n\n.modal__btn-primary {\n background-color: #333;\n color: #fff;\n}\n\n\n\n/************************** Demo Animation Style\n**************************/\n@keyframes mmfadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes mmfadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes mmslideIn {\n from { transform: translateY(15%); }\n to { transform: translateY(0); }\n}\n\n@keyframes mmslideOut {\n from { transform: translateY(0); }\n to { transform: translateY(-10%); }\n}\n\n.micromodal-slide {\n display: none;\n}\n\n.micromodal-slide.is-open {\n display: block;\n}\n\n.micromodal-slide[aria-hidden="false"] .modal__overlay {\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden="false"] .modal__container {\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide[aria-hidden="true"] .modal__overlay {\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden="true"] .modal__container {\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide .modal__container,\n.micromodal-slide .modal__overlay {\n will-change: transform;\n}\n'},330:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r