!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AwesomeQR=e():t.AwesomeQR=e()}(this,(function(){return(()=>{var t={154:(t,e,r)=>{const o=r(342);e.parseFont=o,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,o){const n=Object.assign(document.createElement("img"),e);function i(){n.onload=null,n.onerror=null}n.onload=function(){i(),r(n)},n.onerror=function(){i(),o(new Error('Failed to load the image "'+t+'"'))},n.src=t}))}},342:t=>{"use strict";const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),o=new RegExp("(italic|oblique) +","i"),n=new RegExp("(small-caps) +","i"),i=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),a=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),s={};t.exports=function(t){if(s[t])return s[t];const e=a.exec(t);if(!e)return;const l={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let u,h,c,f,d=t.substring(0,e.index);switch((u=r.exec(d))&&(l.weight=u[1]),(h=o.exec(d))&&(l.style=h[1]),(c=n.exec(d))&&(l.variant=c[1]),(f=i.exec(d))&&(l.stretch=f[1]),l.unit){case"pt":l.size/=.75;break;case"pc":l.size*=16;break;case"in":l.size*=96;break;case"cm":l.size*=96/2.54;break;case"mm":l.size*=96/25.4;break;case"%":break;case"em":case"rem":l.size*=16/.75;break;case"q":l.size*=96/25.4/4}return s[t]=l}},662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.loop=e.conditional=e.parse=void 0,e.parse=function t(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o;if(Array.isArray(r))r.forEach((function(r){return t(e,r,o,n)}));else if("function"==typeof r)r(e,o,n,t);else{var i=Object.keys(r)[0];Array.isArray(r[i])?(n[i]={},t(e,r[i],o,n[i])):n[i]=r[i](e,o,n,t)}return o},e.conditional=function(t,e){return function(r,o,n,i){e(r,o,n)&&i(r,t,o,n)}},e.loop=function(t,e){return function(r,o,n,i){for(var a=[];e(r,o,n);){var s={};i(r,t,o,s),a.push(s)}return a}}},58:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readBits=e.readArray=e.readUnsigned=e.readString=e.peekBytes=e.readBytes=e.peekByte=e.readByte=e.buildStream=void 0,e.buildStream=function(t){return{data:t,pos:0}};e.readByte=function(){return function(t){return t.data[t.pos++]}},e.peekByte=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(e){return e.data[e.pos+t]}};var r=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};e.readBytes=r,e.peekBytes=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}},e.readString=function(t){return function(e){return Array.from(r(t)(e)).map((function(t){return String.fromCharCode(t)})).join("")}},e.readUnsigned=function(t){return function(e){var o=r(2)(e);return t?(o[1]<<8)+o[0]:(o[0]<<8)+o[1]}},e.readArray=function(t,e){return function(o,n,i){for(var a="function"==typeof e?e(o,n,i):e,s=r(t),l=new Array(a),u=0;u{"use strict";e.Z=void 0;var o=r(662),n=r(58),i={blocks:function(t){for(var e=[],r=t.data.length,o=0,i=(0,n.readByte)()(t);0!==i;i=(0,n.readByte)()(t)){if(t.pos+i>=r){var a=r-t.pos;e.push((0,n.readBytes)(a)(t)),o+=a;break}e.push((0,n.readBytes)(i)(t)),o+=i}for(var s=new Uint8Array(o),l=0,u=0;u0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]1)throw new Error("dotScale should be in range (0, 1].");r.components.data.scale=r.dotScale,r.components.timing.scale=r.dotScale,r.components.alignment.scale=r.dotScale}this.options=r,this.canvas=s.createCanvas(e.size,e.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new u.QRCodeModel(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}return t.prototype.draw=function(){var t=this;return new Promise((function(e){return t._draw().then(e)}))},t.prototype._clear=function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)},t._prepareRoundedCornerClip=function(t,e,r,o,n,i){t.beginPath(),t.moveTo(e,r),t.arcTo(e+o,r,e+o,r+n,i),t.arcTo(e+o,r+n,e,r+n,i),t.arcTo(e,r+n,e,r,i),t.arcTo(e,r,e+o,r,i),t.closePath()},t._getAverageRGB=function(t){var e,r,o={r:0,g:0,b:0},n=-4,i={r:0,g:0,b:0},a=0;r=t.naturalHeight||t.height,e=t.naturalWidth||t.width;var l,u=s.createCanvas(e,r).getContext("2d");if(!u)return o;u.drawImage(t,0,0);try{l=u.getImageData(0,0,e,r)}catch(t){return o}for(;(n+=20)200||l.data[n+1]>200||l.data[n+2]>200||(++a,i.r+=l.data[n],i.g+=l.data[n+1],i.b+=l.data[n+2]);return i.r=~~(i.r/a),i.g=~~(i.g/a),i.b=~~(i.b/a),i},t._drawDot=function(t,e,r,o,n,i){void 0===n&&(n=0),void 0===i&&(i=1),t.fillRect((e+n)*o,(r+n)*o,i*o,i*o)},t._drawAlignProtector=function(t,e,r,o){t.clearRect((e-2)*o,(r-2)*o,5*o,5*o),t.fillRect((e-2)*o,(r-2)*o,5*o,5*o)},t._drawAlign=function(e,r,o,n,i,a,s,l){void 0===i&&(i=0),void 0===a&&(a=1);var u=e.fillStyle;e.fillStyle=s,new Array(4).fill(0).map((function(s,l){t._drawDot(e,r-2+l,o-2,n,i,a),t._drawDot(e,r+2,o-2+l,n,i,a),t._drawDot(e,r+2-l,o+2,n,i,a),t._drawDot(e,r-2,o+2-l,n,i,a)})),t._drawDot(e,r,o,n,i,a),l||(e.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((function(s,l){t._drawDot(e,r-1+l,o-1,n,i,a),t._drawDot(e,r+1,o-1+l,n,i,a),t._drawDot(e,r+1-l,o+1,n,i,a),t._drawDot(e,r-1,o+1-l,n,i,a)}))),e.fillStyle=u},t.prototype._draw=function(){var e,r,o,a,f,p,g,m,v,y,w,b,C,B,P,x,A,E,R;return n(this,void 0,void 0,(function(){var n,k,D,T,_,L,M,S,I,O,N,Q,F,U,j,z,G,H,q,K,X,Y,J,Z,W,V,$,tt,et,rt,ot,nt,it,at,st,lt,ut,ht,ct,ft,dt,pt,gt,mt,vt,yt,wt,bt,Ct,Bt,Pt,xt,At,Et,Rt,kt,Dt,Tt,_t,Lt,Mt,St,It;return i(this,(function(i){switch(i.label){case 0:if(n=null===(e=this.qrCode)||void 0===e?void 0:e.moduleCount,k=this.options.size,((D=this.options.margin)<0||2*D>=k)&&(D=0),T=Math.ceil(D),_=k-2*D,L=this.options.whiteMargin,M=this.options.backgroundDimming,S=Math.ceil(_/n),O=(I=S*n)+2*T,N=s.createCanvas(O,O),Q=N.getContext("2d"),this._clear(),Q.save(),Q.translate(T,T),F=s.createCanvas(O,O),U=F.getContext("2d"),j=null,z=[],!this.options.gifBackground)return[3,1];if(G=l.parseGIF(this.options.gifBackground),j=G,z=l.decompressFrames(G,!0),this.options.autoColor){for(H=0,q=0,K=0,X=0,gt=0;gt200||Y[1]>200||Y[2]>200||0===Y[0]&&0===Y[1]&&0===Y[2]||(X++,H+=Y[0],q+=Y[1],K+=Y[2]);H=~~(H/X),q=~~(q/X),K=~~(K/X),this.options.colorDark="rgb("+H+","+q+","+K+")"}return[3,4];case 1:return this.options.backgroundImage?[4,s.loadImage(this.options.backgroundImage)]:[3,3];case 2:return J=i.sent(),this.options.autoColor&&(Z=t._getAverageRGB(J),this.options.colorDark="rgb("+Z.r+","+Z.g+","+Z.b+")"),U.drawImage(J,0,0,J.width,J.height,0,0,O,O),U.rect(0,0,O,O),U.fillStyle=M,U.fill(),[3,4];case 3:U.rect(0,0,O,O),U.fillStyle=this.options.colorLight,U.fill(),i.label=4;case 4:for(W=u.QRUtil.getPatternPosition(this.qrCode.typeNumber),V=(null===(o=null===(r=this.options.components)||void 0===r?void 0:r.data)||void 0===o?void 0:o.scale)||c,$=.5*(1-V),tt=0;tt=8&&et<=n-8||6==et&&tt>=8&&tt<=n-8,nt=et<8&&(tt<8||tt>=n-8)||et>=n-8&&tt<8||ot,gt=1;gt=W[gt]-2&&tt<=W[gt]+2&&et>=W[gt]-2&&et<=W[gt]+2;it=et*S+(nt?0:$*S),at=tt*S+(nt?0:$*S),Q.strokeStyle=rt?this.options.colorDark:this.options.colorLight,Q.lineWidth=.5,Q.fillStyle=rt?this.options.colorDark:"rgba(255, 255, 255, 0.6)",0===W.length?nt||Q.fillRect(it,at,(nt?1:V)*S,(nt?1:V)*S):(st=et=n-4-5&&tt=n-4-5,nt||st||Q.fillRect(it,at,(nt?1:V)*S,(nt?1:V)*S))}if(lt=W[W.length-1],Q.fillStyle="rgba(255, 255, 255, 0.6)",Q.fillRect(0,0,8*S,8*S),Q.fillRect(0,(n-8)*S,8*S,8*S),Q.fillRect((n-8)*S,0,8*S,8*S),(null===(f=null===(a=this.options.components)||void 0===a?void 0:a.timing)||void 0===f?void 0:f.protectors)&&(Q.fillRect(8*S,6*S,(n-8-8)*S,S),Q.fillRect(6*S,8*S,S,(n-8-8)*S)),(null===(g=null===(p=this.options.components)||void 0===p?void 0:p.cornerAlignment)||void 0===g?void 0:g.protectors)&&t._drawAlignProtector(Q,lt,lt,S),null===(v=null===(m=this.options.components)||void 0===m?void 0:m.alignment)||void 0===v?void 0:v.protectors)for(gt=0;gt=1)&&(bt=.2),Ct<0&&(Ct=0),Bt<0&&(Bt=0),At=xt=.5*(O-(Pt=I*bt)),Q.restore(),Q.fillStyle="#FFFFFF",Q.save(),t._prepareRoundedCornerClip(Q,xt-Ct,At-Ct,Pt+2*Ct,Pt+2*Ct,Bt+Ct),Q.clip(),Et=Q.globalCompositeOperation,Q.globalCompositeOperation="destination-out",Q.fill(),Q.globalCompositeOperation=Et,Q.restore(),Q.save(),t._prepareRoundedCornerClip(Q,xt,At,Pt,Pt,Bt),Q.clip(),Q.drawImage(wt,xt,At,Pt,Pt),Q.restore(),Q.save(),Q.translate(T,T),i.label=6;case 6:if(j){if(z.forEach((function(t){Rt||((Rt=new h.default(k,k)).setDelay(t.delay),Rt.setRepeat(0));var e=t.dims,r=e.width,o=e.height;kt||(kt=s.createCanvas(r,o),(Dt=kt.getContext("2d")).rect(0,0,kt.width,kt.height),Dt.fillStyle="#ffffff",Dt.fill()),Tt&&Lt&&r===Tt.width&&o===Tt.height||(Tt=s.createCanvas(r,o),_t=Tt.getContext("2d"),Lt=_t.createImageData(r,o)),Lt.data.set(t.patch),_t.putImageData(Lt,0,0),Dt.drawImage(Tt,t.dims.left,t.dims.top);var n=s.createCanvas(O,O),i=n.getContext("2d");i.drawImage(kt,0,0,O,O),i.rect(0,0,O,O),i.fillStyle=M,i.fill(),i.drawImage(N,0,0,O,O);var a=s.createCanvas(k,k),l=a.getContext("2d");l.drawImage(n,0,0,k,k),Rt.addFrame(l.getImageData(0,0,a.width,a.height).data)})),!Rt)throw new Error("No frames.");return Rt.finish(),d(this.canvas)?(Mt=Rt.stream().toFlattenUint8Array(),St=Mt.reduce((function(t,e){return t+String.fromCharCode(e)}),""),[2,Promise.resolve("data:image/gif;base64,"+window.btoa(St))]):[2,Promise.resolve(Buffer.from(Rt.stream().toFlattenUint8Array()))]}return U.drawImage(N,0,0,O,O),Q.drawImage(F,-T,-T,O,O),(It=s.createCanvas(k,k)).getContext("2d").drawImage(N,0,0,k,k),this.canvas=It,d(this.canvas)?[2,Promise.resolve(this.canvas.toDataURL())]:[2,Promise.resolve(this.canvas.toBuffer())]}}))}))},t.CorrectLevel=u.QRErrorCorrectLevel,t.defaultComponentOptions={data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}},t.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"#ffffff",correctLevel:u.QRErrorCorrectLevel.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:t.defaultComponentOptions,autoColor:!0},t}();function d(t){try{return t instanceof HTMLElement}catch(e){return"object"==typeof t&&1===t.nodeType&&"object"==typeof t.style&&"object"==typeof t.ownerDocument}}e.AwesomeQR=f},642:function(t,e,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,r,o){void 0===o&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){void 0===o&&(o=r),t[o]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||o(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(937),e);var i=r(294);Object.defineProperty(e,"AwesomeQR",{enumerable:!0,get:function(){return i.AwesomeQR}})},937:(t,e)=>{"use strict";function r(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=Number(t)?3:0)}Object.defineProperty(e,"__esModule",{value:!0}),e.QRMath=e.QRUtil=e.QRMaskPattern=e.QRErrorCorrectLevel=e.QRCodeModel=void 0;var o=function(){function t(t){this.mode=i.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;for(var e=[],r=0,o=this.data.length;r65536?(n[0]=240|(1835008&a)>>>18,n[1]=128|(258048&a)>>>12,n[2]=128|(4032&a)>>>6,n[3]=128|63&a):a>2048?(n[0]=224|(61440&a)>>>12,n[1]=128|(4032&a)>>>6,n[2]=128|63&a):a>128?(n[0]=192|(1984&a)>>>6,n[1]=128|63&a):n[0]=a,e.push(n)}this.parsedData=Array.prototype.concat.apply([],e),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return t.prototype.getLength=function(){return this.parsedData.length},t.prototype.write=function(t){for(var e=0,r=this.parsedData.length;ec.length)throw new Error("Too long data");return n}(t,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error("Invalid QR version: "+this.typeNumber);if(!function(t,o,n){var i=r(o),a=t-1,s=0;switch(n){case e.QRErrorCorrectLevel.L:s=c[a][0];break;case e.QRErrorCorrectLevel.M:s=c[a][1];break;case e.QRErrorCorrectLevel.Q:s=c[a][2];break;case e.QRErrorCorrectLevel.H:s=c[a][3]}return i<=s}(this.typeNumber,t,this.errorCorrectLevel))throw new Error("Data is too long for QR version: "+this.typeNumber)}var n=new o(t);this.dataList.push(n),this.dataCache=void 0},t.prototype.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},t.prototype.getModuleCount=function(){return this.moduleCount},t.prototype.make=function(){this.makeImpl(!1,this.getBestMaskPattern())},t.prototype.makeImpl=function(e,r){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var o=0;o=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=t.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},t.prototype.setupPositionProbePattern=function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var o=-1;o<=7;o++)e+o<=-1||this.moduleCount<=e+o||(this.modules[t+r][e+o]=0<=r&&r<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=o&&o<=4)},t.prototype.getBestMaskPattern=function(){if(Number.isInteger(this.maskPattern)&&Object.values(e.QRMaskPattern).includes(this.maskPattern))return this.maskPattern;for(var t=0,r=0,o=0;o<8;o++){this.makeImpl(!0,o);var n=a.getLostPoint(this);(0==o||t>n)&&(t=n,r=o)}return r},t.prototype.setupTimingPattern=function(){for(var t=8;t>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=o}for(r=0;r<18;r++)o=!t&&1==(e>>r&1),this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=o},t.prototype.setupTypeInfo=function(t,e){for(var r=this.errorCorrectLevel<<3|e,o=a.getBCHTypeInfo(r),n=0;n<15;n++){var i=!t&&1==(o>>n&1);n<6?this.modules[n][8]=i:n<8?this.modules[n+1][8]=i:this.modules[this.moduleCount-15+n][8]=i}for(n=0;n<15;n++)i=!t&&1==(o>>n&1),n<8?this.modules[8][this.moduleCount-n-1]=i:n<9?this.modules[8][15-n-1+1]=i:this.modules[8][15-n-1]=i;this.modules[this.moduleCount-8][8]=!t},t.prototype.mapData=function(t,e){for(var r=-1,o=this.moduleCount-1,n=7,i=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var l=0;l<2;l++)if(null==this.modules[o][s-l]){var u=!1;i>>n&1)),a.getMask(e,o,s-l)&&(u=!u),this.modules[o][s-l]=u,-1==--n&&(i++,n=7)}if((o+=r)<0||this.moduleCount<=o){o-=r,r=-r;break}}},t.createData=function(e,r,o){for(var n=u.getRSBlocks(e,r),i=new h,s=0;s8*c)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*c+")");for(i.getLengthInBits()+4<=8*c&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*c||(i.put(t.PAD0,8),i.getLengthInBits()>=8*c));)i.put(t.PAD1,8);return t.createBytes(i,n)},t.createBytes=function(t,e){for(var r=0,o=0,n=0,i=new Array(e.length),s=new Array(e.length),u=0;u=0?p.get(g):0}}var m=0;for(f=0;f=0;)r^=t.G15<=0;)r^=t.G18<>>=1;return e},t.getPatternPosition=function(e){return t.PATTERN_POSITION_TABLE[e-1]},t.getMask=function(t,r,o){switch(t){case e.QRMaskPattern.PATTERN000:return(r+o)%2==0;case e.QRMaskPattern.PATTERN001:return r%2==0;case e.QRMaskPattern.PATTERN010:return o%3==0;case e.QRMaskPattern.PATTERN011:return(r+o)%3==0;case e.QRMaskPattern.PATTERN100:return(Math.floor(r/2)+Math.floor(o/3))%2==0;case e.QRMaskPattern.PATTERN101:return r*o%2+r*o%3==0;case e.QRMaskPattern.PATTERN110:return(r*o%2+r*o%3)%2==0;case e.QRMaskPattern.PATTERN111:return(r*o%3+(r+o)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},t.getErrorCorrectPolynomial=function(t){for(var e=new l([1],0),r=0;r5&&(r+=3+i-5)}for(o=0;o=256;)e-=255;return t.EXP_TABLE[e]},t.EXP_TABLE=new Array(256),t.LOG_TABLE=new Array(256),t._constructor=function(){for(var e=0;e<8;e++)t.EXP_TABLE[e]=1<>>7-t%8&1)},t.prototype.put=function(t,e){for(var r=0;r>>e-r-1&1))},t.prototype.getLengthInBits=function(){return this.length},t.prototype.putBit=function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++},t}(),c=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]},137:(t,e,r)=>{var o=r(110),n=r(970);function i(){this.page=-1,this.pages=[],this.newPage()}i.pageSize=4096,i.charMap={};for(var a=0;a<256;a++)i.charMap[a]=String.fromCharCode(a);function s(t,e){this.width=~~t,this.height=~~e,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.neuQuant=null,this.usedEntry=new Array,this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.dither=!1,this.globalPalette=!1,this.out=new i}i.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(i.pageSize),this.cursor=0},i.prototype.getData=function(){for(var t="",e=0;et+e.length),0));return t.reduce(((t,e)=>(r.set(e,t),t+e.length)),0),r},i.prototype.writeByte=function(t){this.cursor>=i.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=t},i.prototype.writeUTFBytes=function(t){for(var e=t.length,r=0;r=0&&(this.dispose=t)},s.prototype.setRepeat=function(t){this.repeat=t},s.prototype.setTransparent=function(t){this.transparent=t},s.prototype.addFrame=function(t){this.image=t,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),!0===this.globalPalette&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.globalPalette||this.writePalette(),this.writePixels(),this.firstFrame=!1},s.prototype.finish=function(){this.out.writeByte(59)},s.prototype.setQuality=function(t){t<1&&(t=1),this.sample=t},s.prototype.setDither=function(t){!0===t&&(t="FloydSteinberg"),this.dither=t},s.prototype.setGlobalPalette=function(t){this.globalPalette=t},s.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette},s.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")},s.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new o(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),null!==this.dither.match(/-serpentine/)):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent,!0))},s.prototype.indexPixels=function(t){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);for(var r=0,o=0;o=0&&C+h=0&&B+u>16,(65280&t)>>8,255&t,e)},s.prototype.findClosestRGB=function(t,e,r,o){if(null===this.colorTab)return-1;if(this.neuQuant&&!o)return this.neuQuant.lookupRGB(t,e,r);for(var n=0,i=16777216,a=this.colorTab.length,s=0,l=0;s=0&&(e=7&this.dispose),e<<=2,this.out.writeByte(0|e|t),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},s.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},s.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)},s.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)},s.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e>8&255)},s.prototype.writePixels=function(){new n(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)},s.prototype.stream=function(){return this.out},t.exports=s},970:t=>{var e=5003,r=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];t.exports=function(t,o,n,i){var a,s,l,u,h,c,f,d,p,g=Math.max(2,i),m=new Uint8Array(256),v=new Int32Array(e),y=new Int32Array(e),w=0,b=0,C=!1;function B(t,e){m[s++]=t,s>=254&&A(e)}function P(t){x(e),b=h+2,C=!0,k(h,t)}function x(t){for(var e=0;e0&&(t.writeByte(s),t.writeBytes(m,0,s),s=0)}function E(t){return(1<0?a|=t<=8;)B(255&a,e),a>>=8,w-=8;if((b>l||C)&&(C?(l=E(p=u),C=!1):(++p,l=12==p?4096:E(p))),t==c){for(;w>0;)B(255&a,e),a>>=8,w-=8;A(e)}}this.encode=function(r){r.writeByte(g),f=t*o,d=0,function(t,r){var o,n,i,a,f,d;for(C=!1,l=E(p=u=t),c=1+(h=1<=0){f=5003-i,0===i&&(f=1);do{if((i-=f)<0&&(i+=5003),v[i]===o){a=y[i];continue t}}while(v[i]>=0)}k(a,r),a=n,b<4096?(y[i]=b++,v[i]=o):P(r)}else a=y[i];k(a,r),k(c,r)}(g+1,r),r.writeByte(0)}}},110:t=>{var e=256,r=1024,o=1<<18;t.exports=function(t,n){var i,a,s,l,u;function h(t,e,o,n,a){i[e][0]-=t*(i[e][0]-o)/r,i[e][1]-=t*(i[e][1]-n)/r,i[e][2]-=t*(i[e][2]-a)/r}function c(t,r,n,a,s){for(var l,h,c=Math.abs(r-t),f=Math.min(r+t,e),d=r+1,p=r-1,g=1;dc;)h=u[g++],dc&&((l=i[p--])[0]-=h*(l[0]-n)/o,l[1]-=h*(l[1]-a)/o,l[2]-=h*(l[2]-s)/o)}function f(t,r,o){var n,a,u,h,c,f=~(1<<31),d=f,p=-1,g=p;for(n=0;n>12))>10,l[n]-=c,s[n]+=c<<10;return l[p]+=64,s[p]-=65536,g}this.buildColormap=function(){!function(){var t,r;for(i=[],a=new Int32Array(256),s=new Int32Array(e),l=new Int32Array(e),u=new Int32Array(32),t=0;t>6;for(w<=1&&(w=0),e=0;e=d&&(b-=d),0===m&&(m=1),++e%m==0)for(v-=v/p,(w=(y-=y/30)>>6)<=1&&(w=0),l=0;l>=4,i[t][1]>>=4,i[t][2]>>=4,i[t][3]=t}(),function(){var t,r,o,n,s,l,u=0,h=0;for(t=0;t>1,r=u+1;r>1,r=u+1;r<256;r++)a[r]=255}()},this.getColormap=function(){for(var t=[],r=[],o=0;o=0;)c=u?c=e:(c++,l<0&&(l=-l),(n=s[0]-t)<0&&(n=-n),(l+=n)=0&&((l=r-(s=i[f])[1])>=u?f=-1:(f--,l<0&&(l=-l),(n=s[0]-t)<0&&(n=-n),(l+=n){"use strict";r.r(e),r.d(e,{decompressFrame:()=>s,decompressFrames:()=>l,parseGIF:()=>a});var o=r(323),n=r(662),i=r(58);const a=t=>{const e=new Uint8Array(t);return(0,n.parse)((0,i.buildStream)(e),o.Z)},s=(t,e,r)=>{if(!t.image)return void console.warn("gif frame does not have associated image.");const{image:o}=t,n=o.descriptor.width*o.descriptor.height;var i=((t,e,r)=>{const o=4096,n=r;var i,a,s,l,u,h,c,f,d,p;const g=new Array(r),m=new Array(o),v=new Array(o),y=new Array(4097);for(u=1+(a=1<<(p=t)),i=a+2,c=-1,s=(1<<(l=p+1))-1,f=0;f>=l,b-=l,f>i||f==u)break;if(f==a){s=(1<<(l=p+1))-1,i=a+2,c=-1;continue}if(-1==c){y[B++]=v[f],c=f,C=f;continue}for(h=f,f==i&&(y[B++]=C,f=c);f>a;)y[B++]=v[f],f=m[f];C=255&v[f],y[B++]=C,i{const r=new Array(t.length),o=t.length/e,n=function(o,n){const i=t.slice(n*e,(n+1)*e);r.splice.apply(r,[o*e,e].concat(i))},i=[0,4,2,1],a=[8,8,4,2];for(var s=0,l=0;l<4;l++)for(var u=i[l];u{const e=t.pixels.length,r=new Uint8ClampedArray(4*e);for(var o=0;ot.frames.filter((t=>t.image)).map((r=>s(r,t.gct,e)))}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}return r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(642)})()}));