UNPKG

animate-image

Version:
7 lines 78.7 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("process");var Hn=require("fs");require("path");var zn=require("util"),Gn=require("stream"),qn=require("zlib"),Kn=require("assert"),Vn=require("buffer");function it(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Xt=it(Hn),ot=it(zn),te=it(Gn),mt=it(qn),jn=it(Kn),Wn=it(Vn),Qn=Array.isArray;function st(t){return typeof t=="string"}function Pe(t){return t===null}function Jn(t){return typeof t=="boolean"}function Zn(t){return typeof t>"u"}function Xn(t){return typeof t<"u"}var tr=Xn(globalThis?.window),Ot={exports:{}};Ot.exports,function(t,e){(function(n){t.exports=n()})(function(n){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(d,g){var h=d[0],a=d[1],c=d[2],f=d[3];h+=(a&c|~a&f)+g[0]-680876936|0,h=(h<<7|h>>>25)+a|0,f+=(h&a|~h&c)+g[1]-389564586|0,f=(f<<12|f>>>20)+h|0,c+=(f&h|~f&a)+g[2]+606105819|0,c=(c<<17|c>>>15)+f|0,a+=(c&f|~c&h)+g[3]-1044525330|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&f)+g[4]-176418897|0,h=(h<<7|h>>>25)+a|0,f+=(h&a|~h&c)+g[5]+1200080426|0,f=(f<<12|f>>>20)+h|0,c+=(f&h|~f&a)+g[6]-1473231341|0,c=(c<<17|c>>>15)+f|0,a+=(c&f|~c&h)+g[7]-45705983|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&f)+g[8]+1770035416|0,h=(h<<7|h>>>25)+a|0,f+=(h&a|~h&c)+g[9]-1958414417|0,f=(f<<12|f>>>20)+h|0,c+=(f&h|~f&a)+g[10]-42063|0,c=(c<<17|c>>>15)+f|0,a+=(c&f|~c&h)+g[11]-1990404162|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&f)+g[12]+1804603682|0,h=(h<<7|h>>>25)+a|0,f+=(h&a|~h&c)+g[13]-40341101|0,f=(f<<12|f>>>20)+h|0,c+=(f&h|~f&a)+g[14]-1502002290|0,c=(c<<17|c>>>15)+f|0,a+=(c&f|~c&h)+g[15]+1236535329|0,a=(a<<22|a>>>10)+c|0,h+=(a&f|c&~f)+g[1]-165796510|0,h=(h<<5|h>>>27)+a|0,f+=(h&c|a&~c)+g[6]-1069501632|0,f=(f<<9|f>>>23)+h|0,c+=(f&a|h&~a)+g[11]+643717713|0,c=(c<<14|c>>>18)+f|0,a+=(c&h|f&~h)+g[0]-373897302|0,a=(a<<20|a>>>12)+c|0,h+=(a&f|c&~f)+g[5]-701558691|0,h=(h<<5|h>>>27)+a|0,f+=(h&c|a&~c)+g[10]+38016083|0,f=(f<<9|f>>>23)+h|0,c+=(f&a|h&~a)+g[15]-660478335|0,c=(c<<14|c>>>18)+f|0,a+=(c&h|f&~h)+g[4]-405537848|0,a=(a<<20|a>>>12)+c|0,h+=(a&f|c&~f)+g[9]+568446438|0,h=(h<<5|h>>>27)+a|0,f+=(h&c|a&~c)+g[14]-1019803690|0,f=(f<<9|f>>>23)+h|0,c+=(f&a|h&~a)+g[3]-187363961|0,c=(c<<14|c>>>18)+f|0,a+=(c&h|f&~h)+g[8]+1163531501|0,a=(a<<20|a>>>12)+c|0,h+=(a&f|c&~f)+g[13]-1444681467|0,h=(h<<5|h>>>27)+a|0,f+=(h&c|a&~c)+g[2]-51403784|0,f=(f<<9|f>>>23)+h|0,c+=(f&a|h&~a)+g[7]+1735328473|0,c=(c<<14|c>>>18)+f|0,a+=(c&h|f&~h)+g[12]-1926607734|0,a=(a<<20|a>>>12)+c|0,h+=(a^c^f)+g[5]-378558|0,h=(h<<4|h>>>28)+a|0,f+=(h^a^c)+g[8]-2022574463|0,f=(f<<11|f>>>21)+h|0,c+=(f^h^a)+g[11]+1839030562|0,c=(c<<16|c>>>16)+f|0,a+=(c^f^h)+g[14]-35309556|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^f)+g[1]-1530992060|0,h=(h<<4|h>>>28)+a|0,f+=(h^a^c)+g[4]+1272893353|0,f=(f<<11|f>>>21)+h|0,c+=(f^h^a)+g[7]-155497632|0,c=(c<<16|c>>>16)+f|0,a+=(c^f^h)+g[10]-1094730640|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^f)+g[13]+681279174|0,h=(h<<4|h>>>28)+a|0,f+=(h^a^c)+g[0]-358537222|0,f=(f<<11|f>>>21)+h|0,c+=(f^h^a)+g[3]-722521979|0,c=(c<<16|c>>>16)+f|0,a+=(c^f^h)+g[6]+76029189|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^f)+g[9]-640364487|0,h=(h<<4|h>>>28)+a|0,f+=(h^a^c)+g[12]-421815835|0,f=(f<<11|f>>>21)+h|0,c+=(f^h^a)+g[15]+530742520|0,c=(c<<16|c>>>16)+f|0,a+=(c^f^h)+g[2]-995338651|0,a=(a<<23|a>>>9)+c|0,h+=(c^(a|~f))+g[0]-198630844|0,h=(h<<6|h>>>26)+a|0,f+=(a^(h|~c))+g[7]+1126891415|0,f=(f<<10|f>>>22)+h|0,c+=(h^(f|~a))+g[14]-1416354905|0,c=(c<<15|c>>>17)+f|0,a+=(f^(c|~h))+g[5]-57434055|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~f))+g[12]+1700485571|0,h=(h<<6|h>>>26)+a|0,f+=(a^(h|~c))+g[3]-1894986606|0,f=(f<<10|f>>>22)+h|0,c+=(h^(f|~a))+g[10]-1051523|0,c=(c<<15|c>>>17)+f|0,a+=(f^(c|~h))+g[1]-2054922799|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~f))+g[8]+1873313359|0,h=(h<<6|h>>>26)+a|0,f+=(a^(h|~c))+g[15]-30611744|0,f=(f<<10|f>>>22)+h|0,c+=(h^(f|~a))+g[6]-1560198380|0,c=(c<<15|c>>>17)+f|0,a+=(f^(c|~h))+g[13]+1309151649|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~f))+g[4]-145523070|0,h=(h<<6|h>>>26)+a|0,f+=(a^(h|~c))+g[11]-1120210379|0,f=(f<<10|f>>>22)+h|0,c+=(h^(f|~a))+g[2]+718787259|0,c=(c<<15|c>>>17)+f|0,a+=(f^(c|~h))+g[9]-343485551|0,a=(a<<21|a>>>11)+c|0,d[0]=h+d[0]|0,d[1]=a+d[1]|0,d[2]=c+d[2]|0,d[3]=f+d[3]|0}function o(d){var g=[],h;for(h=0;h<64;h+=4)g[h>>2]=d.charCodeAt(h)+(d.charCodeAt(h+1)<<8)+(d.charCodeAt(h+2)<<16)+(d.charCodeAt(h+3)<<24);return g}function s(d){var g=[],h;for(h=0;h<64;h+=4)g[h>>2]=d[h]+(d[h+1]<<8)+(d[h+2]<<16)+(d[h+3]<<24);return g}function l(d){var g=d.length,h=[1732584193,-271733879,-1732584194,271733878],a,c,f,T,A,S;for(a=64;a<=g;a+=64)i(h,o(d.substring(a-64,a)));for(d=d.substring(a-64),c=d.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)f[a>>2]|=d.charCodeAt(a)<<(a%4<<3);if(f[a>>2]|=128<<(a%4<<3),a>55)for(i(h,f),a=0;a<16;a+=1)f[a]=0;return T=g*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(T[2],16),S=parseInt(T[1],16)||0,f[14]=A,f[15]=S,i(h,f),h}function u(d){var g=d.length,h=[1732584193,-271733879,-1732584194,271733878],a,c,f,T,A,S;for(a=64;a<=g;a+=64)i(h,s(d.subarray(a-64,a)));for(d=a-64<g?d.subarray(a-64):new Uint8Array(0),c=d.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)f[a>>2]|=d[a]<<(a%4<<3);if(f[a>>2]|=128<<(a%4<<3),a>55)for(i(h,f),a=0;a<16;a+=1)f[a]=0;return T=g*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(T[2],16),S=parseInt(T[1],16)||0,f[14]=A,f[15]=S,i(h,f),h}function p(d){var g="",h;for(h=0;h<4;h+=1)g+=r[d>>h*8+4&15]+r[d>>h*8&15];return g}function _(d){var g;for(g=0;g<d.length;g+=1)d[g]=p(d[g]);return d.join("")}_(l("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function d(g,h){return g=g|0||0,g<0?Math.max(g+h,0):Math.min(g,h)}ArrayBuffer.prototype.slice=function(g,h){var a=this.byteLength,c=d(g,a),f=a,T,A,S,P;return h!==n&&(f=d(h,a)),c>f?new ArrayBuffer(0):(T=f-c,A=new ArrayBuffer(T),S=new Uint8Array(A),P=new Uint8Array(this,c,T),S.set(P),A)}}();function m(d){return/[\u0080-\uFFFF]/.test(d)&&(d=unescape(encodeURIComponent(d))),d}function y(d,g){var h=d.length,a=new ArrayBuffer(h),c=new Uint8Array(a),f;for(f=0;f<h;f+=1)c[f]=d.charCodeAt(f);return g?c:a}function w(d){return String.fromCharCode.apply(null,new Uint8Array(d))}function C(d,g,h){var a=new Uint8Array(d.byteLength+g.byteLength);return a.set(new Uint8Array(d)),a.set(new Uint8Array(g),d.byteLength),h?a:a.buffer}function E(d){var g=[],h=d.length,a;for(a=0;a<h-1;a+=2)g.push(parseInt(d.substr(a,2),16));return String.fromCharCode.apply(String,g)}function b(){this.reset()}return b.prototype.append=function(d){return this.appendBinary(m(d)),this},b.prototype.appendBinary=function(d){this._buff+=d,this._length+=d.length;var g=this._buff.length,h;for(h=64;h<=g;h+=64)i(this._hash,o(this._buff.substring(h-64,h)));return this._buff=this._buff.substring(h-64),this},b.prototype.end=function(d){var g=this._buff,h=g.length,a,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f;for(a=0;a<h;a+=1)c[a>>2]|=g.charCodeAt(a)<<(a%4<<3);return this._finish(c,h),f=_(this._hash),d&&(f=E(f)),this.reset(),f},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(d){return this._buff=d.buff,this._length=d.length,this._hash=d.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(d,g){var h=g,a,c,f;if(d[h>>2]|=128<<(h%4<<3),h>55)for(i(this._hash,d),h=0;h<16;h+=1)d[h]=0;a=this._length*8,a=a.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(a[2],16),f=parseInt(a[1],16)||0,d[14]=c,d[15]=f,i(this._hash,d)},b.hash=function(d,g){return b.hashBinary(m(d),g)},b.hashBinary=function(d,g){var h=l(d),a=_(h);return g?E(a):a},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(d){var g=C(this._buff.buffer,d,!0),h=g.length,a;for(this._length+=d.byteLength,a=64;a<=h;a+=64)i(this._hash,s(g.subarray(a-64,a)));return this._buff=a-64<h?new Uint8Array(g.buffer.slice(a-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(d){var g=this._buff,h=g.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,f;for(c=0;c<h;c+=1)a[c>>2]|=g[c]<<(c%4<<3);return this._finish(a,h),f=_(this._hash),d&&(f=E(f)),this.reset(),f},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var d=b.prototype.getState.call(this);return d.buff=w(d.buff),d},b.ArrayBuffer.prototype.setState=function(d){return d.buff=y(d.buff,!0),b.prototype.setState.call(this,d)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(d,g){var h=u(new Uint8Array(d)),a=_(h);return g?E(a):a},b})}(Ot,Ot.exports),Ot.exports;function Le(t,e=!1,n=document){if(!Pe(e))return Jn(e)||(n=e,e=!1),Qn(t)?t.reduce((r,i)=>{const o=e?n.querySelectorAll(i):n.querySelector(i);return o?r=e?[...r,...o]:[...r,o]:r},[]):e?n.querySelectorAll(t):n.querySelector(t)}function er(...t){const e=t.length,n=[...t],r=n.slice(0,e-1),i=n.slice(-1)[0];let o=!1,s=!1;l(),document.addEventListener("DOMContentLoaded",l),setTimeout(()=>document.removeEventListener("DOMContentLoaded",l));function l(){if(!s){if(r.forEach((u,p)=>st(u)&&(r[p]=Le(u)||u)),!o&&r.some(st))return o=!0;if(r.some(st))throw new Error(`${r.filter(st).join(", ")} is not a HTMLElement`);i?.(...r),s=!0}}}var V={},Me=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ee={},U={};let ne;const nr=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];U.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},U.getSymbolTotalCodewords=function(e){return nr[e]},U.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},U.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ne=e},U.isKanjiModeEnabled=function(){return typeof ne<"u"},U.toSJIS=function(e){return ne(e)};var vt={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,i){if(t.isValid(r))return r;try{return e(r)}catch{return i}}})(vt);function Re(){this.buffer=[],this.length=0}Re.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var rr=Re;function yt(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}yt.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},yt.prototype.get=function(t,e){return this.data[t*this.size+e]},yt.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},yt.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ir=yt,Oe={};(function(t){const e=U.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,o=e(r),s=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let u=1;u<i-1;u++)l[u]=l[u-1]-s;return l.push(6),l.reverse()},t.getPositions=function(r){const i=[],o=t.getRowColCoords(r),s=o.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l===0&&u===0||l===0&&u===s-1||l===s-1&&u===0||i.push([o[l],o[u]]);return i}})(Oe);var ve={};const or=U.getSymbolSize,Ne=7;ve.getPositions=function(e){const n=or(e);return[[0,0],[n-Ne,0],[0,n-Ne]]};var Ue={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let s=0,l=0,u=0,p=null,_=null;for(let m=0;m<o;m++){l=u=0,p=_=null;for(let y=0;y<o;y++){let w=i.get(m,y);w===p?l++:(l>=5&&(s+=e.N1+(l-5)),p=w,l=1),w=i.get(y,m),w===_?u++:(u>=5&&(s+=e.N1+(u-5)),_=w,u=1)}l>=5&&(s+=e.N1+(l-5)),u>=5&&(s+=e.N1+(u-5))}return s},t.getPenaltyN2=function(i){const o=i.size;let s=0;for(let l=0;l<o-1;l++)for(let u=0;u<o-1;u++){const p=i.get(l,u)+i.get(l,u+1)+i.get(l+1,u)+i.get(l+1,u+1);(p===4||p===0)&&s++}return s*e.N2},t.getPenaltyN3=function(i){const o=i.size;let s=0,l=0,u=0;for(let p=0;p<o;p++){l=u=0;for(let _=0;_<o;_++)l=l<<1&2047|i.get(p,_),_>=10&&(l===1488||l===93)&&s++,u=u<<1&2047|i.get(_,p),_>=10&&(u===1488||u===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let o=0;const s=i.data.length;for(let u=0;u<s;u++)o+=i.data[u];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function n(r,i,o){switch(r){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(i,o){const s=o.size;for(let l=0;l<s;l++)for(let u=0;u<s;u++)o.isReserved(u,l)||o.xor(u,l,n(i,u,l))},t.getBestMask=function(i,o){const s=Object.keys(t.Patterns).length;let l=0,u=1/0;for(let p=0;p<s;p++){o(p),t.applyMask(p,i);const _=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(p,i),_<u&&(u=_,l=p)}return l}})(Ue);var Nt={};const Y=vt,Ut=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Ft=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Nt.getBlocksCount=function(e,n){switch(n){case Y.L:return Ut[(e-1)*4+0];case Y.M:return Ut[(e-1)*4+1];case Y.Q:return Ut[(e-1)*4+2];case Y.H:return Ut[(e-1)*4+3];default:return}},Nt.getTotalCodewordsCount=function(e,n){switch(n){case Y.L:return Ft[(e-1)*4+0];case Y.M:return Ft[(e-1)*4+1];case Y.Q:return Ft[(e-1)*4+2];case Y.H:return Ft[(e-1)*4+3];default:return}};var Fe={},kt={};const wt=new Uint8Array(512),Dt=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)wt[n]=e,Dt[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)wt[n]=wt[n-255]})(),kt.log=function(e){if(e<1)throw new Error("log("+e+")");return Dt[e]},kt.exp=function(e){return wt[e]},kt.mul=function(e,n){return e===0||n===0?0:wt[Dt[e]+Dt[n]]},function(t){const e=kt;t.mul=function(r,i){const o=new Uint8Array(r.length+i.length-1);for(let s=0;s<r.length;s++)for(let l=0;l<i.length;l++)o[s+l]^=e.mul(r[s],i[l]);return o},t.mod=function(r,i){let o=new Uint8Array(r);for(;o.length-i.length>=0;){const s=o[0];for(let u=0;u<i.length;u++)o[u]^=e.mul(i[u],s);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let o=0;o<r;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(Fe);const ke=Fe;function re(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}re.prototype.initialize=function(e){this.degree=e,this.genPoly=ke.generateECPolynomial(this.degree)},re.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(e.length+this.degree);n.set(e);const r=ke.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r};var sr=re,De={},H={},ie={};ie.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var x={};const xe="[0-9]+",ar="[A-Z $%*+\\-./:]+";let bt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";bt=bt.replace(/u/g,"\\u");const lr="(?:(?![A-Z0-9 $%*+\\-./:]|"+bt+`)(?:.|[\r ]))+`;x.KANJI=new RegExp(bt,"g"),x.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),x.BYTE=new RegExp(lr,"g"),x.NUMERIC=new RegExp(xe,"g"),x.ALPHANUMERIC=new RegExp(ar,"g");const hr=new RegExp("^"+bt+"$"),ur=new RegExp("^"+xe+"$"),fr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");x.testKanji=function(e){return hr.test(e)},x.testNumeric=function(e){return ur.test(e)},x.testAlphanumeric=function(e){return fr.test(e)},function(t){const e=ie,n=x;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,s){if(t.isValid(o))return o;try{return r(o)}catch{return s}}}(H),function(t){const e=U,n=Nt,r=vt,i=H,o=ie,s=7973,l=e.getBCHDigit(s);function u(y,w,C){for(let E=1;E<=40;E++)if(w<=t.getCapacity(E,C,y))return E}function p(y,w){return i.getCharCountIndicator(y,w)+4}function _(y,w){let C=0;return y.forEach(function(E){const b=p(E.mode,w);C+=b+E.getBitsLength()}),C}function m(y,w){for(let C=1;C<=40;C++)if(_(y,C)<=t.getCapacity(C,w,i.MIXED))return C}t.from=function(w,C){return o.isValid(w)?parseInt(w,10):C},t.getCapacity=function(w,C,E){if(!o.isValid(w))throw new Error("Invalid QR Code version");typeof E>"u"&&(E=i.BYTE);const b=e.getSymbolTotalCodewords(w),d=n.getTotalCodewordsCount(w,C),g=(b-d)*8;if(E===i.MIXED)return g;const h=g-p(E,w);switch(E){case i.NUMERIC:return Math.floor(h/10*3);case i.ALPHANUMERIC:return Math.floor(h/11*2);case i.KANJI:return Math.floor(h/13);case i.BYTE:default:return Math.floor(h/8)}},t.getBestVersionForData=function(w,C){let E;const b=r.from(C,r.M);if(Array.isArray(w)){if(w.length>1)return m(w,b);if(w.length===0)return 1;E=w[0]}else E=w;return u(E.mode,E.getLength(),b)},t.getEncodedBits=function(w){if(!o.isValid(w)||w<7)throw new Error("Invalid QR Code version");let C=w<<12;for(;e.getBCHDigit(C)-l>=0;)C^=s<<e.getBCHDigit(C)-l;return w<<12|C}}(De);var $e={};const oe=U,Ye=1335,cr=21522,He=oe.getBCHDigit(Ye);$e.getEncodedBits=function(e,n){const r=e.bit<<3|n;let i=r<<10;for(;oe.getBCHDigit(i)-He>=0;)i^=Ye<<oe.getBCHDigit(i)-He;return(r<<10|i)^cr};var ze={};const dr=H;function at(t){this.mode=dr.NUMERIC,this.data=t.toString()}at.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},at.prototype.getLength=function(){return this.data.length},at.prototype.getBitsLength=function(){return at.getBitsLength(this.data.length)},at.prototype.write=function(e){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),e.put(i,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),e.put(i,o*3+1))};var gr=at;const pr=H,se=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function lt(t){this.mode=pr.ALPHANUMERIC,this.data=t}lt.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},lt.prototype.getLength=function(){return this.data.length},lt.prototype.getBitsLength=function(){return lt.getBitsLength(this.data.length)},lt.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=se.indexOf(this.data[n])*45;r+=se.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(se.indexOf(this.data[n]),6)};var _r=lt;const mr=H;function ht(t){this.mode=mr.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}ht.getBitsLength=function(e){return e*8},ht.prototype.getLength=function(){return this.data.length},ht.prototype.getBitsLength=function(){return ht.getBitsLength(this.data.length)},ht.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var yr=ht;const wr=H,br=U;function ut(t){this.mode=wr.KANJI,this.data=t}ut.getBitsLength=function(e){return e*13},ut.prototype.getLength=function(){return this.data.length},ut.prototype.getBitsLength=function(){return ut.getBitsLength(this.data.length)},ut.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=br.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var Cr=ut,ae={exports:{}};ae.exports,function(t){var e={single_source_shortest_paths:function(n,r,i){var o={},s={};s[r]=0;var l=e.PriorityQueue.make();l.push(r,0);for(var u,p,_,m,y,w,C,E,b;!l.empty();){u=l.pop(),p=u.value,m=u.cost,y=n[p]||{};for(_ in y)y.hasOwnProperty(_)&&(w=y[_],C=m+w,E=s[_],b=typeof s[_]>"u",(b||E>C)&&(s[_]=C,l.push(_,C),o[_]=p))}if(typeof i<"u"&&typeof s[i]>"u"){var d=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(n,r){for(var i=[],o=r;o;)i.push(o),n[o],o=n[o];return i.reverse(),i},find_path:function(n,r,i){var o=e.single_source_shortest_paths(n,r,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,i={},o;n=n||{};for(o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);return i.queue=[],i.sorter=n.sorter||r.default_sorter,i},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var i={value:n,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e}(ae);var Er=ae.exports;(function(t){const e=H,n=gr,r=_r,i=yr,o=Cr,s=x,l=U,u=Er;function p(d){return unescape(encodeURIComponent(d)).length}function _(d,g,h){const a=[];let c;for(;(c=d.exec(h))!==null;)a.push({data:c[0],index:c.index,mode:g,length:c[0].length});return a}function m(d){const g=_(s.NUMERIC,e.NUMERIC,d),h=_(s.ALPHANUMERIC,e.ALPHANUMERIC,d);let a,c;return l.isKanjiModeEnabled()?(a=_(s.BYTE,e.BYTE,d),c=_(s.KANJI,e.KANJI,d)):(a=_(s.BYTE_KANJI,e.BYTE,d),c=[]),g.concat(h,a,c).sort(function(T,A){return T.index-A.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function y(d,g){switch(g){case e.NUMERIC:return n.getBitsLength(d);case e.ALPHANUMERIC:return r.getBitsLength(d);case e.KANJI:return o.getBitsLength(d);case e.BYTE:return i.getBitsLength(d)}}function w(d){return d.reduce(function(g,h){const a=g.length-1>=0?g[g.length-1]:null;return a&&a.mode===h.mode?(g[g.length-1].data+=h.data,g):(g.push(h),g)},[])}function C(d){const g=[];for(let h=0;h<d.length;h++){const a=d[h];switch(a.mode){case e.NUMERIC:g.push([a,{data:a.data,mode:e.ALPHANUMERIC,length:a.length},{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.ALPHANUMERIC:g.push([a,{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.KANJI:g.push([a,{data:a.data,mode:e.BYTE,length:p(a.data)}]);break;case e.BYTE:g.push([{data:a.data,mode:e.BYTE,length:p(a.data)}])}}return g}function E(d,g){const h={},a={start:{}};let c=["start"];for(let f=0;f<d.length;f++){const T=d[f],A=[];for(let S=0;S<T.length;S++){const P=T[S],I=""+f+S;A.push(I),h[I]={node:P,lastCount:0},a[I]={};for(let R=0;R<c.length;R++){const N=c[R];h[N]&&h[N].node.mode===P.mode?(a[N][I]=y(h[N].lastCount+P.length,P.mode)-y(h[N].lastCount,P.mode),h[N].lastCount+=P.length):(h[N]&&(h[N].lastCount=P.length),a[N][I]=y(P.length,P.mode)+4+e.getCharCountIndicator(P.mode,g))}}c=A}for(let f=0;f<c.length;f++)a[c[f]].end=0;return{map:a,table:h}}function b(d,g){let h;const a=e.getBestModeForData(d);if(h=e.from(g,a),h!==e.BYTE&&h.bit<a.bit)throw new Error('"'+d+'" cannot be encoded with mode '+e.toString(h)+`. Suggested mode is: `+e.toString(a));switch(h===e.KANJI&&!l.isKanjiModeEnabled()&&(h=e.BYTE),h){case e.NUMERIC:return new n(d);case e.ALPHANUMERIC:return new r(d);case e.KANJI:return new o(d);case e.BYTE:return new i(d)}}t.fromArray=function(g){return g.reduce(function(h,a){return typeof a=="string"?h.push(b(a,null)):a.data&&h.push(b(a.data,a.mode)),h},[])},t.fromString=function(g,h){const a=m(g,l.isKanjiModeEnabled()),c=C(a),f=E(c,h),T=u.find_path(f.map,"start","end"),A=[];for(let S=1;S<T.length-1;S++)A.push(f.table[T[S]].node);return t.fromArray(w(A))},t.rawSplit=function(g){return t.fromArray(m(g,l.isKanjiModeEnabled()))}})(ze);const xt=U,le=vt,Tr=rr,Ir=ir,Ar=Oe,Br=ve,he=Ue,ue=Nt,Sr=sr,$t=De,Pr=$e,Lr=H,fe=ze;function Mr(t,e){const n=t.size,r=Br.getPositions(e);for(let i=0;i<r.length;i++){const o=r[i][0],s=r[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||n<=o+l))for(let u=-1;u<=7;u++)s+u<=-1||n<=s+u||(l>=0&&l<=6&&(u===0||u===6)||u>=0&&u<=6&&(l===0||l===6)||l>=2&&l<=4&&u>=2&&u<=4?t.set(o+l,s+u,!0,!0):t.set(o+l,s+u,!1,!0))}}function Rr(t){const e=t.size;for(let n=8;n<e-8;n++){const r=n%2===0;t.set(n,6,r,!0),t.set(6,n,r,!0)}}function Or(t,e){const n=Ar.getPositions(e);for(let r=0;r<n.length;r++){const i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let l=-2;l<=2;l++)s===-2||s===2||l===-2||l===2||s===0&&l===0?t.set(i+s,o+l,!0,!0):t.set(i+s,o+l,!1,!0)}}function vr(t,e){const n=t.size,r=$t.getEncodedBits(e);let i,o,s;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+n-8-3,s=(r>>l&1)===1,t.set(i,o,s,!0),t.set(o,i,s,!0)}function ce(t,e,n){const r=t.size,i=Pr.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function Nr(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let l=n-1;l>0;l-=2)for(l===6&&l--;;){for(let u=0;u<2;u++)if(!t.isReserved(i,l-u)){let p=!1;s<e.length&&(p=(e[s]>>>o&1)===1),t.set(i,l-u,p),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function Ur(t,e,n){const r=new Tr;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Lr.getCharCountIndicator(u.mode,t)),u.write(r)});const i=xt.getSymbolTotalCodewords(t),o=ue.getTotalCodewordsCount(t,e),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const l=(s-r.getLengthInBits())/8;for(let u=0;u<l;u++)r.put(u%2?17:236,8);return Fr(r,t,e)}function Fr(t,e,n){const r=xt.getSymbolTotalCodewords(e),i=ue.getTotalCodewordsCount(e,n),o=r-i,s=ue.getBlocksCount(e,n),l=r%s,u=s-l,p=Math.floor(r/s),_=Math.floor(o/s),m=_+1,y=p-_,w=new Sr(y);let C=0;const E=new Array(s),b=new Array(s);let d=0;const g=new Uint8Array(t.buffer);for(let T=0;T<s;T++){const A=T<u?_:m;E[T]=g.slice(C,C+A),b[T]=w.encode(E[T]),C+=A,d=Math.max(d,A)}const h=new Uint8Array(r);let a=0,c,f;for(c=0;c<d;c++)for(f=0;f<s;f++)c<E[f].length&&(h[a++]=E[f][c]);for(c=0;c<y;c++)for(f=0;f<s;f++)h[a++]=b[f][c];return h}function kr(t,e,n,r){let i;if(Array.isArray(t))i=fe.fromArray(t);else if(typeof t=="string"){let p=e;if(!p){const _=fe.rawSplit(t);p=$t.getBestVersionForData(_,n)}i=fe.fromString(t,p||40)}else throw new Error("Invalid data");const o=$t.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(` The chosen QR Code version cannot contain this amount of data. Minimum version required to store current data is: `+o+`. `);const s=Ur(e,n,i),l=xt.getSymbolSize(e),u=new Ir(l);return Mr(u,e),Rr(u),Or(u,e),ce(u,n,0),e>=7&&vr(u,e),Nr(u,s),isNaN(r)&&(r=he.getBestMask(u,ce.bind(null,u,n))),he.applyMask(r,u),ce(u,n,r),{modules:u,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}ee.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=le.M,i,o;return typeof n<"u"&&(r=le.from(n.errorCorrectionLevel,le.M),i=$t.from(n.version),o=he.from(n.maskPattern),n.toSJISFunc&&xt.setToSJISFunction(n.toSJISFunc)),kr(e,i,r,o)};var Ge={},qe={},Ke={exports:{}},Ve={exports:{}};let Dr=ot.default,je=te.default,D=Ve.exports=function(){je.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};Dr.inherits(D,je),D.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},D.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return Buffer.isBuffer(t)?n=t:n=Buffer.from(t,e||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused},D.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))},D.prototype.destroySoon=D.prototype.end,D.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},D.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},D.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},D.prototype._processRead=function(t){this._reads.shift();let e=0,n=0,r=Buffer.alloc(t.length);for(;e<t.length;){let i=this._buffers[n++],o=Math.min(i.length,t.length-e);i.copy(r,e,0,o),e+=o,o!==i.length&&(this._buffers[--n]=i.slice(o))}n>0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,r)},D.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else if(this._buffered>=t.length)this._processRead(t);else break}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}};var We=Ve.exports,Qe={exports:{}},Je={exports:{}},Yt={};let z=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];Yt.getImagePasses=function(t,e){let n=[],r=t%8,i=e%8,o=(t-r)/8,s=(e-i)/8;for(let l=0;l<z.length;l++){let u=z[l],p=o*u.x.length,_=s*u.y.length;for(let m=0;m<u.x.length&&u.x[m]<r;m++)p++;for(let m=0;m<u.y.length&&u.y[m]<i;m++)_++;p>0&&_>0&&n.push({width:p,height:_,index:l})}return n},Yt.getInterlaceIterator=function(t){return function(e,n,r){let i=e%z[r].x.length,o=(e-i)/z[r].x.length*8+z[r].x[i],s=n%z[r].y.length,l=(n-s)/z[r].y.length*8+z[r].y[s];return o*4+l*t*4}};var Ze=function(e,n,r){let i=e+n-r,o=Math.abs(i-e),s=Math.abs(i-n),l=Math.abs(i-r);return o<=s&&o<=l?e:s<=l?n:r};let xr=Yt,$r=Ze;function Xe(t,e,n){let r=t*e;return n!==8&&(r=Math.ceil(r/(8/n))),r}let ft=Je.exports=function(t,e){let n=t.width,r=t.height,i=t.interlace,o=t.bpp,s=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],i){let l=xr.getImagePasses(n,r);for(let u=0;u<l.length;u++)this._images.push({byteWidth:Xe(l[u].width,o,s),height:l[u].height,lineIndex:0})}else this._images.push({byteWidth:Xe(n,o,s),height:r,lineIndex:0});s===8?this._xComparison=o:s===16?this._xComparison=o*2:this._xComparison=1};ft.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},ft.prototype._unFilterType1=function(t,e,n){let r=this._xComparison,i=r-1;for(let o=0;o<n;o++){let s=t[1+o],l=o>i?e[o-r]:0;e[o]=s+l}},ft.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let i=0;i<n;i++){let o=t[1+i],s=r?r[i]:0;e[i]=o+s}},ft.prototype._unFilterType3=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let l=t[1+s],u=o?o[s]:0,p=s>i?e[s-r]:0,_=Math.floor((p+u)/2);e[s]=l+_}},ft.prototype._unFilterType4=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let l=t[1+s],u=o?o[s]:0,p=s>i?e[s-r]:0,_=s>i&&o?o[s-r]:0,m=$r(p,u,_);e[s]=l+m}},ft.prototype._reverseFilterLine=function(t){let e=t[0],n,r=this._images[this._imageIndex],i=r.byteWidth;if(e===0)n=t.slice(1,i+1);else switch(n=Buffer.alloc(i),e){case 1:this._unFilterType1(t,n,i);break;case 2:this._unFilterType2(t,n,i);break;case 3:this._unFilterType3(t,n,i);break;case 4:this._unFilterType4(t,n,i);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(n),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=n,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())};var tn=Je.exports;let Yr=ot.default,en=We,Hr=tn,zr=Qe.exports=function(t){en.call(this);let e=[],n=this;this._filter=new Hr(t,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){n.emit("complete",Buffer.concat(e))}}),this._filter.start()};Yr.inherits(zr,en);var Gr=Qe.exports,nn={exports:{}},Ct={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5},rn={exports:{}};let de=[];(function(){for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;de[t]=e}})();let ge=rn.exports=function(){this._crc=-1};ge.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=de[(this._crc^t[e])&255]^this._crc>>>8;return!0},ge.prototype.crc32=function(){return this._crc^-1},ge.crc32=function(t){let e=-1;for(let n=0;n<t.length;n++)e=de[(e^t[n])&255]^e>>>8;return e^-1};var on=rn.exports;let L=Ct,qr=on,M=nn.exports=function(t,e){this._options=t,t.checkCRC=t.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[L.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[L.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[L.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[L.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[L.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[L.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};M.prototype.start=function(){this.read(L.PNG_SIGNATURE.length,this._parseSignature.bind(this))},M.prototype._parseSignature=function(t){let e=L.PNG_SIGNATURE;for(let n=0;n<e.length;n++)if(t[n]!==e[n]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))},M.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r="";for(let o=4;o<8;o++)r+=String.fromCharCode(t[o]);let i=!!(t[4]&32);if(!this._hasIHDR&&n!==L.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new qr,this._crc.write(Buffer.from(r)),this._chunks[n])return this._chunks[n](e);if(!i){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(e+4,this._skipChunk.bind(this))},M.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},M.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},M.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),n=this._crc.crc32();if(this._options.checkCRC&&n!==e){this.error(new Error("Crc error - "+e+" - "+n));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},M.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},M.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r=t[8],i=t[9],o=t[10],s=t[11],l=t[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(i in L.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(o!==0){this.error(new Error("Unsupported compression method"));return}if(s!==0){this.error(new Error("Unsupported filter method"));return}if(l!==0&&l!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=i;let u=L.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:n,depth:r,interlace:!!l,palette:!!(i&L.COLORTYPE_PALETTE),color:!!(i&L.COLORTYPE_COLOR),alpha:!!(i&L.COLORTYPE_ALPHA),bpp:u,colorType:i}),this._handleChunkEnd()},M.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},M.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++)this._palette.push([t[n*3],t[n*3+1],t[n*3+2],255]);this.palette(this._palette),this._handleChunkEnd()},M.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},M.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===L.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(t.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===L.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===L.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},M.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},M.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/L.GAMMA_DIVISION),this._handleChunkEnd()},M.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},M.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===L.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let n=t-e.length;n>0?this._handleIDAT(n):this._handleChunkEnd()},M.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},M.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()};var sn=nn.exports,pe={};let an=Yt,Kr=[function(){},function(t,e,n,r){if(r===e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=255},function(t,e,n,r){if(r+1>=e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=255},function(t,e,n,r){if(r+3>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=e[r+3]}],Vr=[function(){},function(t,e,n,r){let i=e[0];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r,t[n+1]=r,t[n+2]=r,t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=r},function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3]}];function jr(t,e){let n=[],r=0;function i(){if(r===t.length)throw new Error("Ran out of data");let o=t[r];r++;let s,l,u,p,_,m,y,w;switch(e){default:throw new Error("unrecognised depth");case 16:y=t[r],r++,n.push((o<<8)+y);break;case 4:y=o&15,w=o>>4,n.push(w,y);break;case 2:_=o&3,m=o>>2&3,y=o>>4&3,w=o>>6&3,n.push(w,y,m,_);break;case 1:s=o&1,l=o>>1&1,u=o>>2&1,p=o>>3&1,_=o>>4&1,m=o>>5&1,y=o>>6&1,w=o>>7&1,n.push(w,y,m,_,p,u,l,s);break}}return{get:function(o){for(;n.length<o;)i();let s=n.slice(0,o);return n=n.slice(o),s},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}function Wr(t,e,n,r,i,o){let s=t.width,l=t.height,u=t.index;for(let p=0;p<l;p++)for(let _=0;_<s;_++){let m=n(_,p,u);Kr[r](e,i,m,o),o+=r}return o}function Qr(t,e,n,r,i,o){let s=t.width,l=t.height,u=t.index;for(let p=0;p<l;p++){for(let _=0;_<s;_++){let m=i.get(r),y=n(_,p,u);Vr[r](e,m,y,o)}i.resetAfterLine()}}pe.dataToBitMap=function(t,e){let n=e.width,r=e.height,i=e.depth,o=e.bpp,s=e.interlace,l;i!==8&&(l=jr(t,i));let u;i<=8?u=Buffer.alloc(n*r*4):u=new Uint16Array(n*r*4);let p=Math.pow(2,i)-1,_=0,m,y;if(s)m=an.getImagePasses(n,r),y=an.getInterlaceIterator(n,r);else{let w=0;y=function(){let C=w;return w+=4,C},m=[{width:n,height:r}]}for(let w=0;w<m.length;w++)i===8?_=Wr(m[w],u,y,o,t,_):Qr(m[w],u,y,o,l,p);if(i===8){if(_!==t.length)throw new Error("extra data found")}else l.end();return u};function Jr(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let u=i[t[o]];if(!u)throw new Error("index "+t[o]+" not in palette");for(let p=0;p<4;p++)e[o+p]=u[p];o+=4}}function Zr(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let u=!1;if(i.length===1?i[0]===t[o]&&(u=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(u=!0),u)for(let p=0;p<4;p++)e[o+p]=0;o+=4}}function Xr(t,e,n,r,i){let o=255,s=Math.pow(2,i)-1,l=0;for(let u=0;u<r;u++)for(let p=0;p<n;p++){for(let _=0;_<4;_++)e[l+_]=Math.floor(t[l+_]*o/s+.5);l+=4}}var ln=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,l=e.palette,u=t;return o===3?Jr(t,u,r,i,l):(s&&Zr(t,u,r,i,s),n!==8&&(n===16&&(u=Buffer.alloc(r*i*4)),Xr(t,u,r,i,n))),u};let ti=ot.default,_e=mt.default,hn=We,ei=Gr,ni=sn,ri=pe,ii=ln,$=Ke.exports=function(t){hn.call(this),this._parser=new ni(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};ti.inherits($,hn),$.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0},$.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=_e.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let n=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(n,_e.Z_MIN_CHUNK);this._inflate=_e.createInflate({chunkSize:r});let i=n,o=this.emit.bind(this,"error");this._inflate.on("error",function(l){i&&o(l)}),this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(l){i&&(l.length>i&&(l=l.slice(0,i)),i-=l.length,s(l))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},$.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new ei(this._bitmapInfo)},$.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},$.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},$.prototype._simpleTransparency=function(){this._metaData.alpha=!0},$.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},$.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},$.prototype._complete=function(t){if(this.errord)return;let e;try{let n=ri.dataToBitMap(t,this._bitmapInfo);e=ii(n,this._bitmapInfo),n=null}catch(n){this._handleError(n);return}this.emit("parsed",e)};var oi=Ke.exports,un={exports:{}},fn={exports:{}};let F=Ct;var si=function(t,e,n,r){let i=[F.COLORTYPE_COLOR_ALPHA,F.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let C=function(){let E=new ArrayBuffer(2);return new DataView(E).setInt16(0,256,!0),new Int16Array(E)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&C)return t}let o=r.bitDepth!==16?t:new Uint16Array(t.buffer),s=255,l=F.COLORTYPE_TO_BPP_MAP[r.inputColorType];l===4&&!r.inputHasAlpha&&(l=3);let u=F.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,u*=2);let p=Buffer.alloc(e*n*u),_=0,m=0,y=r.bgColor||{};y.red===void 0&&(y.red=s),y.green===void 0&&(y.green=s),y.blue===void 0&&(y.blue=s);function w(){let C,E,b,d=s;switch(r.inputColorType){case F.COLORTYPE_COLOR_ALPHA:d=o[_+3],C=o[_],E=o[_+1],b=o[_+2];break;case F.COLORTYPE_COLOR:C=o[_],E=o[_+1],b=o[_+2];break;case F.COLORTYPE_ALPHA:d=o[_+1],C=o[_],E=C,b=C;break;case F.COLORTYPE_GRAYSCALE:C=o[_],E=C,b=C;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(i||(d/=s,C=Math.min(Math.max(Math.round((1-d)*y.red+d*C),0),s),E=Math.min(Math.max(Math.round((1-d)*y.green+d*E),0),s),b=Math.min(Math.max(Math.round((1-d)*y.blue+d*b),0),s))),{red:C,green:E,blue:b,alpha:d}}for(let C=0;C<n;C++)for(let E=0;E<e;E++){let b=w();switch(r.colorType){case F.COLORTYPE_COLOR_ALPHA:case F.COLORTYPE_COLOR:r.bitDepth===8?(p[m]=b.red,p[m+1]=b.green,p[m+2]=b.blue,i&&(p[m+3]=b.alpha)):(p.writeUInt16BE(b.red,m),p.writeUInt16BE(b.green,m+2),p.writeUInt16BE(b.blue,m+4),i&&p.writeUInt16BE(b.alpha,m+6));break;case F.COLORTYPE_ALPHA:case F.COLORTYPE_GRAYSCALE:{let d=(b.red+b.green+b.blue)/3;r.bitDepth===8?(p[m]=d,i&&(p[m+1]=b.alpha)):(p.writeUInt16BE(d,m),i&&p.writeUInt16BE(b.alpha,m+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}_+=l,m+=u}return p};let cn=Ze;function ai(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]}function li(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++)r+=Math.abs(t[o]);return r}function hi(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,u=t[e+s]-l;r[i+s]=u}}function ui(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=t[e+o]-s;i+=Math.abs(l)}return i}function fi(t,e,n,r,i){for(let o=0;o<n;o++){let s=e>0?t[e+o-n]:0,l=t[e+o]-s;r[i+o]=l}}function ci(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++){let s=e>0?t[o-n]:0,l=t[o]-s;r+=Math.abs(l)}return r}function di(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,u=e>0?t[e+s-n]:0,p=t[e+s]-(l+u>>1);r[i+s]=p}}function gi(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=e>0?t[e+o-n]:0,u=t[e+o]-(s+l>>1);i+=Math.abs(u)}return i}function pi(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,u=e>0?t[e+s-n]:0,p=e>0&&s>=o?t[e+s-(n+o)]:0,_=t[e+s]-cn(l,u,p);r[i+s]=_}}function _i(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=e>0?t[e+o-n]:0,u=e>0&&o>=r?t[e+o-(n+r)]:0,p=t[e+o]-cn(s,l,u);i+=Math.abs(p)}return i}let mi={0:ai,1:hi,2:fi,3:di,4:pi},yi={0:li,1:ui,2:ci,3:gi,4:_i};var wi=function(t,e,n,r,i){let o;if(!("filterType"in r)||r.filterType===-1)o=[0,1,2,3,4];else if(typeof r.filterType=="number")o=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(i*=2);let s=e*i,l=0,u=0,p=Buffer.alloc((s+1)*n),_=o[0];for(let m=0;m<n;m++){if(o.length>1){let y=1/0;for(let w=0;w<o.length;w++){let C=yi[o[w]](t,u,s,i);C<y&&(_=o[w],y=C)}}p[l]=_,l++,mi[_](t,u,s,p,l,i),l+=s,u+=s}return p};let O=Ct,bi=on,Ci=si,Ei=wi,Ti=mt.default,G=fn.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32*1024,t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9,t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3,t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:!0,t.deflateFactory=t.deflateFactory||Ti.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:O.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:O.COLORTYPE_COLOR_ALPHA,[O.COLORTYPE_GRAYSCALE,O.COLORTYPE_COLOR,O.COLORTYPE_COLOR_ALPHA,O.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([O.COLORTYPE_GRAYS