animate-image
Version:
7 lines • 75.5 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("process");var In=require("fs");require("path");var Sn=require("util"),Ln=require("stream"),Pn=require("zlib"),Rn=require("assert"),Mn=require("buffer");function q(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Mt=q(In),V=q(Sn),Ot=q(Ln),tt=q(Pn),On=q(Rn),vn=q(Mn),Nn=Array.isArray;function j(t){return typeof t=="string"}function se(t){return t===null}function Un(t){return typeof t=="boolean"}function kn(t){return typeof t>"u"}function Fn(t){return typeof t<"u"}var Dn=Fn(globalThis?.window),pt={exports:{}};pt.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(g,d){var u=g[0],a=g[1],c=g[2],h=g[3];u+=(a&c|~a&h)+d[0]-680876936|0,u=(u<<7|u>>>25)+a|0,h+=(u&a|~u&c)+d[1]-389564586|0,h=(h<<12|h>>>20)+u|0,c+=(h&u|~h&a)+d[2]+606105819|0,c=(c<<17|c>>>15)+h|0,a+=(c&h|~c&u)+d[3]-1044525330|0,a=(a<<22|a>>>10)+c|0,u+=(a&c|~a&h)+d[4]-176418897|0,u=(u<<7|u>>>25)+a|0,h+=(u&a|~u&c)+d[5]+1200080426|0,h=(h<<12|h>>>20)+u|0,c+=(h&u|~h&a)+d[6]-1473231341|0,c=(c<<17|c>>>15)+h|0,a+=(c&h|~c&u)+d[7]-45705983|0,a=(a<<22|a>>>10)+c|0,u+=(a&c|~a&h)+d[8]+1770035416|0,u=(u<<7|u>>>25)+a|0,h+=(u&a|~u&c)+d[9]-1958414417|0,h=(h<<12|h>>>20)+u|0,c+=(h&u|~h&a)+d[10]-42063|0,c=(c<<17|c>>>15)+h|0,a+=(c&h|~c&u)+d[11]-1990404162|0,a=(a<<22|a>>>10)+c|0,u+=(a&c|~a&h)+d[12]+1804603682|0,u=(u<<7|u>>>25)+a|0,h+=(u&a|~u&c)+d[13]-40341101|0,h=(h<<12|h>>>20)+u|0,c+=(h&u|~h&a)+d[14]-1502002290|0,c=(c<<17|c>>>15)+h|0,a+=(c&h|~c&u)+d[15]+1236535329|0,a=(a<<22|a>>>10)+c|0,u+=(a&h|c&~h)+d[1]-165796510|0,u=(u<<5|u>>>27)+a|0,h+=(u&c|a&~c)+d[6]-1069501632|0,h=(h<<9|h>>>23)+u|0,c+=(h&a|u&~a)+d[11]+643717713|0,c=(c<<14|c>>>18)+h|0,a+=(c&u|h&~u)+d[0]-373897302|0,a=(a<<20|a>>>12)+c|0,u+=(a&h|c&~h)+d[5]-701558691|0,u=(u<<5|u>>>27)+a|0,h+=(u&c|a&~c)+d[10]+38016083|0,h=(h<<9|h>>>23)+u|0,c+=(h&a|u&~a)+d[15]-660478335|0,c=(c<<14|c>>>18)+h|0,a+=(c&u|h&~u)+d[4]-405537848|0,a=(a<<20|a>>>12)+c|0,u+=(a&h|c&~h)+d[9]+568446438|0,u=(u<<5|u>>>27)+a|0,h+=(u&c|a&~c)+d[14]-1019803690|0,h=(h<<9|h>>>23)+u|0,c+=(h&a|u&~a)+d[3]-187363961|0,c=(c<<14|c>>>18)+h|0,a+=(c&u|h&~u)+d[8]+1163531501|0,a=(a<<20|a>>>12)+c|0,u+=(a&h|c&~h)+d[13]-1444681467|0,u=(u<<5|u>>>27)+a|0,h+=(u&c|a&~c)+d[2]-51403784|0,h=(h<<9|h>>>23)+u|0,c+=(h&a|u&~a)+d[7]+1735328473|0,c=(c<<14|c>>>18)+h|0,a+=(c&u|h&~u)+d[12]-1926607734|0,a=(a<<20|a>>>12)+c|0,u+=(a^c^h)+d[5]-378558|0,u=(u<<4|u>>>28)+a|0,h+=(u^a^c)+d[8]-2022574463|0,h=(h<<11|h>>>21)+u|0,c+=(h^u^a)+d[11]+1839030562|0,c=(c<<16|c>>>16)+h|0,a+=(c^h^u)+d[14]-35309556|0,a=(a<<23|a>>>9)+c|0,u+=(a^c^h)+d[1]-1530992060|0,u=(u<<4|u>>>28)+a|0,h+=(u^a^c)+d[4]+1272893353|0,h=(h<<11|h>>>21)+u|0,c+=(h^u^a)+d[7]-155497632|0,c=(c<<16|c>>>16)+h|0,a+=(c^h^u)+d[10]-1094730640|0,a=(a<<23|a>>>9)+c|0,u+=(a^c^h)+d[13]+681279174|0,u=(u<<4|u>>>28)+a|0,h+=(u^a^c)+d[0]-358537222|0,h=(h<<11|h>>>21)+u|0,c+=(h^u^a)+d[3]-722521979|0,c=(c<<16|c>>>16)+h|0,a+=(c^h^u)+d[6]+76029189|0,a=(a<<23|a>>>9)+c|0,u+=(a^c^h)+d[9]-640364487|0,u=(u<<4|u>>>28)+a|0,h+=(u^a^c)+d[12]-421815835|0,h=(h<<11|h>>>21)+u|0,c+=(h^u^a)+d[15]+530742520|0,c=(c<<16|c>>>16)+h|0,a+=(c^h^u)+d[2]-995338651|0,a=(a<<23|a>>>9)+c|0,u+=(c^(a|~h))+d[0]-198630844|0,u=(u<<6|u>>>26)+a|0,h+=(a^(u|~c))+d[7]+1126891415|0,h=(h<<10|h>>>22)+u|0,c+=(u^(h|~a))+d[14]-1416354905|0,c=(c<<15|c>>>17)+h|0,a+=(h^(c|~u))+d[5]-57434055|0,a=(a<<21|a>>>11)+c|0,u+=(c^(a|~h))+d[12]+1700485571|0,u=(u<<6|u>>>26)+a|0,h+=(a^(u|~c))+d[3]-1894986606|0,h=(h<<10|h>>>22)+u|0,c+=(u^(h|~a))+d[10]-1051523|0,c=(c<<15|c>>>17)+h|0,a+=(h^(c|~u))+d[1]-2054922799|0,a=(a<<21|a>>>11)+c|0,u+=(c^(a|~h))+d[8]+1873313359|0,u=(u<<6|u>>>26)+a|0,h+=(a^(u|~c))+d[15]-30611744|0,h=(h<<10|h>>>22)+u|0,c+=(u^(h|~a))+d[6]-1560198380|0,c=(c<<15|c>>>17)+h|0,a+=(h^(c|~u))+d[13]+1309151649|0,a=(a<<21|a>>>11)+c|0,u+=(c^(a|~h))+d[4]-145523070|0,u=(u<<6|u>>>26)+a|0,h+=(a^(u|~c))+d[11]-1120210379|0,h=(h<<10|h>>>22)+u|0,c+=(u^(h|~a))+d[2]+718787259|0,c=(c<<15|c>>>17)+h|0,a+=(h^(c|~u))+d[9]-343485551|0,a=(a<<21|a>>>11)+c|0,g[0]=u+g[0]|0,g[1]=a+g[1]|0,g[2]=c+g[2]|0,g[3]=h+g[3]|0}function o(g){var d=[],u;for(u=0;u<64;u+=4)d[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return d}function s(g){var d=[],u;for(u=0;u<64;u+=4)d[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return d}function l(g){var d=g.length,u=[1732584193,-271733879,-1732584194,271733878],a,c,h,T,B,I;for(a=64;a<=d;a+=64)i(u,o(g.substring(a-64,a)));for(g=g.substring(a-64),c=g.length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)h[a>>2]|=g.charCodeAt(a)<<(a%4<<3);if(h[a>>2]|=128<<(a%4<<3),a>55)for(i(u,h),a=0;a<16;a+=1)h[a]=0;return T=d*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(T[2],16),I=parseInt(T[1],16)||0,h[14]=B,h[15]=I,i(u,h),u}function f(g){var d=g.length,u=[1732584193,-271733879,-1732584194,271733878],a,c,h,T,B,I;for(a=64;a<=d;a+=64)i(u,s(g.subarray(a-64,a)));for(g=a-64<d?g.subarray(a-64):new Uint8Array(0),c=g.length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)h[a>>2]|=g[a]<<(a%4<<3);if(h[a>>2]|=128<<(a%4<<3),a>55)for(i(u,h),a=0;a<16;a+=1)h[a]=0;return T=d*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(T[2],16),I=parseInt(T[1],16)||0,h[14]=B,h[15]=I,i(u,h),u}function p(g){var d="",u;for(u=0;u<4;u+=1)d+=r[g>>u*8+4&15]+r[g>>u*8&15];return d}function m(g){var d;for(d=0;d<g.length;d+=1)g[d]=p(g[d]);return g.join("")}m(l("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(d,u){return d=d|0||0,d<0?Math.max(d+u,0):Math.min(d,u)}ArrayBuffer.prototype.slice=function(d,u){var a=this.byteLength,c=g(d,a),h=a,T,B,I,S;return u!==n&&(h=g(u,a)),c>h?new ArrayBuffer(0):(T=h-c,B=new ArrayBuffer(T),I=new Uint8Array(B),S=new Uint8Array(this,c,T),I.set(S),B)}}();function y(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function _(g,d){var u=g.length,a=new ArrayBuffer(u),c=new Uint8Array(a),h;for(h=0;h<u;h+=1)c[h]=g.charCodeAt(h);return d?c:a}function w(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function E(g,d,u){var a=new Uint8Array(g.byteLength+d.byteLength);return a.set(new Uint8Array(g)),a.set(new Uint8Array(d),g.byteLength),u?a:a.buffer}function C(g){var d=[],u=g.length,a;for(a=0;a<u-1;a+=2)d.push(parseInt(g.substr(a,2),16));return String.fromCharCode.apply(String,d)}function b(){this.reset()}return b.prototype.append=function(g){return this.appendBinary(y(g)),this},b.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var d=this._buff.length,u;for(u=64;u<=d;u+=64)i(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},b.prototype.end=function(g){var d=this._buff,u=d.length,a,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h;for(a=0;a<u;a+=1)c[a>>2]|=d.charCodeAt(a)<<(a%4<<3);return this._finish(c,u),h=m(this._hash),g&&(h=C(h)),this.reset(),h},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(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(g,d){var u=d,a,c,h;if(g[u>>2]|=128<<(u%4<<3),u>55)for(i(this._hash,g),u=0;u<16;u+=1)g[u]=0;a=this._length*8,a=a.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(a[2],16),h=parseInt(a[1],16)||0,g[14]=c,g[15]=h,i(this._hash,g)},b.hash=function(g,d){return b.hashBinary(y(g),d)},b.hashBinary=function(g,d){var u=l(g),a=m(u);return d?C(a):a},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(g){var d=E(this._buff.buffer,g,!0),u=d.length,a;for(this._length+=g.byteLength,a=64;a<=u;a+=64)i(this._hash,s(d.subarray(a-64,a)));return this._buff=a-64<u?new Uint8Array(d.buffer.slice(a-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(g){var d=this._buff,u=d.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,h;for(c=0;c<u;c+=1)a[c>>2]|=d[c]<<(c%4<<3);return this._finish(a,u),h=m(this._hash),g&&(h=C(h)),this.reset(),h},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 g=b.prototype.getState.call(this);return g.buff=w(g.buff),g},b.ArrayBuffer.prototype.setState=function(g){return g.buff=_(g.buff,!0),b.prototype.setState.call(this,g)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(g,d){var u=f(new Uint8Array(g)),a=m(u);return d?C(a):a},b})}(pt,pt.exports),pt.exports;function ae(t,e=!1,n=document){if(!se(e))return Un(e)||(n=e,e=!1),Nn(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 $n(...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((f,p)=>j(f)&&(r[p]=ae(f)||f)),!o&&r.some(j))return o=!0;if(r.some(j))throw new Error(`${r.filter(j).join(", ")} is not a HTMLElement`);i?.(...r),s=!0}}}var z={},le=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},vt={},v={};let Nt;const xn=[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];v.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},v.getSymbolTotalCodewords=function(e){return xn[e]},v.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},v.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Nt=e},v.isKanjiModeEnabled=function(){return typeof Nt<"u"},v.toSJIS=function(e){return Nt(e)};var mt={};(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}}})(mt);function ue(){this.buffer=[],this.length=0}ue.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 Yn=ue;function et(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)}et.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},et.prototype.get=function(t,e){return this.data[t*this.size+e]},et.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},et.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Hn=et,fe={};(function(t){const e=v.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 f=1;f<i-1;f++)l[f]=l[f-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 f=0;f<s;f++)l===0&&f===0||l===0&&f===s-1||l===s-1&&f===0||i.push([o[l],o[f]]);return i}})(fe);var he={};const zn=v.getSymbolSize,ce=7;he.getPositions=function(e){const n=zn(e);return[[0,0],[n-ce,0],[0,n-ce]]};var de={};(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,f=0,p=null,m=null;for(let y=0;y<o;y++){l=f=0,p=m=null;for(let _=0;_<o;_++){let w=i.get(y,_);w===p?l++:(l>=5&&(s+=e.N1+(l-5)),p=w,l=1),w=i.get(_,y),w===m?f++:(f>=5&&(s+=e.N1+(f-5)),m=w,f=1)}l>=5&&(s+=e.N1+(l-5)),f>=5&&(s+=e.N1+(f-5))}return s},t.getPenaltyN2=function(i){const o=i.size;let s=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const p=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(p===4||p===0)&&s++}return s*e.N2},t.getPenaltyN3=function(i){const o=i.size;let s=0,l=0,f=0;for(let p=0;p<o;p++){l=f=0;for(let m=0;m<o;m++)l=l<<1&2047|i.get(p,m),m>=10&&(l===1488||l===93)&&s++,f=f<<1&2047|i.get(m,p),m>=10&&(f===1488||f===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let o=0;const s=i.data.length;for(let f=0;f<s;f++)o+=i.data[f];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 f=0;f<s;f++)o.isReserved(f,l)||o.xor(f,l,n(i,f,l))},t.getBestMask=function(i,o){const s=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let p=0;p<s;p++){o(p),t.applyMask(p,i);const m=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(p,i),m<f&&(f=m,l=p)}return l}})(de);var yt={};const $=mt,_t=[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],wt=[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];yt.getBlocksCount=function(e,n){switch(n){case $.L:return _t[(e-1)*4+0];case $.M:return _t[(e-1)*4+1];case $.Q:return _t[(e-1)*4+2];case $.H:return _t[(e-1)*4+3];default:return}},yt.getTotalCodewordsCount=function(e,n){switch(n){case $.L:return wt[(e-1)*4+0];case $.M:return wt[(e-1)*4+1];case $.Q:return wt[(e-1)*4+2];case $.H:return wt[(e-1)*4+3];default:return}};var ge={},bt={};const nt=new Uint8Array(512),Et=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)nt[n]=e,Et[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)nt[n]=nt[n-255]})(),bt.log=function(e){if(e<1)throw new Error("log("+e+")");return Et[e]},bt.exp=function(e){return nt[e]},bt.mul=function(e,n){return e===0||n===0?0:nt[Et[e]+Et[n]]},function(t){const e=bt;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 f=0;f<i.length;f++)o[f]^=e.mul(i[f],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}}(ge);const pe=ge;function Ut(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Ut.prototype.initialize=function(e){this.degree=e,this.genPoly=pe.generateECPolynomial(this.degree)},Ut.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=pe.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 Gn=Ut,me={},x={},kt={};kt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var F={};const ye="[0-9]+",qn="[A-Z $%*+\\-./:]+";let rt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";rt=rt.replace(/u/g,"\\u");const Vn="(?:(?![A-Z0-9 $%*+\\-./:]|"+rt+`)(?:.|[\r
]))+`;F.KANJI=new RegExp(rt,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(Vn,"g"),F.NUMERIC=new RegExp(ye,"g"),F.ALPHANUMERIC=new RegExp(qn,"g");const jn=new RegExp("^"+rt+"$"),Kn=new RegExp("^"+ye+"$"),Wn=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");F.testKanji=function(e){return jn.test(e)},F.testNumeric=function(e){return Kn.test(e)},F.testAlphanumeric=function(e){return Wn.test(e)},function(t){const e=kt,n=F;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}}}(x),function(t){const e=v,n=yt,r=mt,i=x,o=kt,s=7973,l=e.getBCHDigit(s);function f(_,w,E){for(let C=1;C<=40;C++)if(w<=t.getCapacity(C,E,_))return C}function p(_,w){return i.getCharCountIndicator(_,w)+4}function m(_,w){let E=0;return _.forEach(function(C){const b=p(C.mode,w);E+=b+C.getBitsLength()}),E}function y(_,w){for(let E=1;E<=40;E++)if(m(_,E)<=t.getCapacity(E,w,i.MIXED))return E}t.from=function(w,E){return o.isValid(w)?parseInt(w,10):E},t.getCapacity=function(w,E,C){if(!o.isValid(w))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=i.BYTE);const b=e.getSymbolTotalCodewords(w),g=n.getTotalCodewordsCount(w,E),d=(b-g)*8;if(C===i.MIXED)return d;const u=d-p(C,w);switch(C){case i.NUMERIC:return Math.floor(u/10*3);case i.ALPHANUMERIC:return Math.floor(u/11*2);case i.KANJI:return Math.floor(u/13);case i.BYTE:default:return Math.floor(u/8)}},t.getBestVersionForData=function(w,E){let C;const b=r.from(E,r.M);if(Array.isArray(w)){if(w.length>1)return y(w,b);if(w.length===0)return 1;C=w[0]}else C=w;return f(C.mode,C.getLength(),b)},t.getEncodedBits=function(w){if(!o.isValid(w)||w<7)throw new Error("Invalid QR Code version");let E=w<<12;for(;e.getBCHDigit(E)-l>=0;)E^=s<<e.getBCHDigit(E)-l;return w<<12|E}}(me);var _e={};const Ft=v,we=1335,Qn=21522,be=Ft.getBCHDigit(we);_e.getEncodedBits=function(e,n){const r=e.bit<<3|n;let i=r<<10;for(;Ft.getBCHDigit(i)-be>=0;)i^=we<<Ft.getBCHDigit(i)-be;return(r<<10|i)^Qn};var Ee={};const Jn=x;function K(t){this.mode=Jn.NUMERIC,this.data=t.toString()}K.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},K.prototype.getLength=function(){return this.data.length},K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)},K.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 Zn=K;const Xn=x,Dt=["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 W(t){this.mode=Xn.ALPHANUMERIC,this.data=t}W.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},W.prototype.getLength=function(){return this.data.length},W.prototype.getBitsLength=function(){return W.getBitsLength(this.data.length)},W.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=Dt.indexOf(this.data[n])*45;r+=Dt.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(Dt.indexOf(this.data[n]),6)};var tr=W;const er=x;function Q(t){this.mode=er.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}Q.getBitsLength=function(e){return e*8},Q.prototype.getLength=function(){return this.data.length},Q.prototype.getBitsLength=function(){return Q.getBitsLength(this.data.length)},Q.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var nr=Q;const rr=x,ir=v;function J(t){this.mode=rr.KANJI,this.data=t}J.getBitsLength=function(e){return e*13},J.prototype.getLength=function(){return this.data.length},J.prototype.getBitsLength=function(){return J.getBitsLength(this.data.length)},J.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=ir.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 or=J,$t={exports:{}};$t.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 f,p,m,y,_,w,E,C,b;!l.empty();){f=l.pop(),p=f.value,y=f.cost,_=n[p]||{};for(m in _)_.hasOwnProperty(m)&&(w=_[m],E=y+w,C=s[m],b=typeof s[m]>"u",(b||C>E)&&(s[m]=E,l.push(m,E),o[m]=p))}if(typeof i<"u"&&typeof s[i]>"u"){var g=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(g)}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}($t);var sr=$t.exports;(function(t){const e=x,n=Zn,r=tr,i=nr,o=or,s=F,l=v,f=sr;function p(g){return unescape(encodeURIComponent(g)).length}function m(g,d,u){const a=[];let c;for(;(c=g.exec(u))!==null;)a.push({data:c[0],index:c.index,mode:d,length:c[0].length});return a}function y(g){const d=m(s.NUMERIC,e.NUMERIC,g),u=m(s.ALPHANUMERIC,e.ALPHANUMERIC,g);let a,c;return l.isKanjiModeEnabled()?(a=m(s.BYTE,e.BYTE,g),c=m(s.KANJI,e.KANJI,g)):(a=m(s.BYTE_KANJI,e.BYTE,g),c=[]),d.concat(u,a,c).sort(function(T,B){return T.index-B.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function _(g,d){switch(d){case e.NUMERIC:return n.getBitsLength(g);case e.ALPHANUMERIC:return r.getBitsLength(g);case e.KANJI:return o.getBitsLength(g);case e.BYTE:return i.getBitsLength(g)}}function w(g){return g.reduce(function(d,u){const a=d.length-1>=0?d[d.length-1]:null;return a&&a.mode===u.mode?(d[d.length-1].data+=u.data,d):(d.push(u),d)},[])}function E(g){const d=[];for(let u=0;u<g.length;u++){const a=g[u];switch(a.mode){case e.NUMERIC:d.push([a,{data:a.data,mode:e.ALPHANUMERIC,length:a.length},{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.ALPHANUMERIC:d.push([a,{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.KANJI:d.push([a,{data:a.data,mode:e.BYTE,length:p(a.data)}]);break;case e.BYTE:d.push([{data:a.data,mode:e.BYTE,length:p(a.data)}])}}return d}function C(g,d){const u={},a={start:{}};let c=["start"];for(let h=0;h<g.length;h++){const T=g[h],B=[];for(let I=0;I<T.length;I++){const S=T[I],A=""+h+I;B.push(A),u[A]={node:S,lastCount:0},a[A]={};for(let R=0;R<c.length;R++){const N=c[R];u[N]&&u[N].node.mode===S.mode?(a[N][A]=_(u[N].lastCount+S.length,S.mode)-_(u[N].lastCount,S.mode),u[N].lastCount+=S.length):(u[N]&&(u[N].lastCount=S.length),a[N][A]=_(S.length,S.mode)+4+e.getCharCountIndicator(S.mode,d))}}c=B}for(let h=0;h<c.length;h++)a[c[h]].end=0;return{map:a,table:u}}function b(g,d){let u;const a=e.getBestModeForData(g);if(u=e.from(d,a),u!==e.BYTE&&u.bit<a.bit)throw new Error('"'+g+'" cannot be encoded with mode '+e.toString(u)+`.
Suggested mode is: `+e.toString(a));switch(u===e.KANJI&&!l.isKanjiModeEnabled()&&(u=e.BYTE),u){case e.NUMERIC:return new n(g);case e.ALPHANUMERIC:return new r(g);case e.KANJI:return new o(g);case e.BYTE:return new i(g)}}t.fromArray=function(d){return d.reduce(function(u,a){return typeof a=="string"?u.push(b(a,null)):a.data&&u.push(b(a.data,a.mode)),u},[])},t.fromString=function(d,u){const a=y(d,l.isKanjiModeEnabled()),c=E(a),h=C(c,u),T=f.find_path(h.map,"start","end"),B=[];for(let I=1;I<T.length-1;I++)B.push(h.table[T[I]].node);return t.fromArray(w(B))},t.rawSplit=function(d){return t.fromArray(y(d,l.isKanjiModeEnabled()))}})(Ee);const Ct=v,xt=mt,ar=Yn,lr=Hn,ur=fe,fr=he,Yt=de,Ht=yt,hr=Gn,Tt=me,cr=_e,dr=x,zt=Ee;function gr(t,e){const n=t.size,r=fr.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 f=-1;f<=7;f++)s+f<=-1||n<=s+f||(l>=0&&l<=6&&(f===0||f===6)||f>=0&&f<=6&&(l===0||l===6)||l>=2&&l<=4&&f>=2&&f<=4?t.set(o+l,s+f,!0,!0):t.set(o+l,s+f,!1,!0))}}function pr(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 mr(t,e){const n=ur.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 yr(t,e){const n=t.size,r=Tt.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 Gt(t,e,n){const r=t.size,i=cr.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 _r(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 f=0;f<2;f++)if(!t.isReserved(i,l-f)){let p=!1;s<e.length&&(p=(e[s]>>>o&1)===1),t.set(i,l-f,p),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function wr(t,e,n){const r=new ar;n.forEach(function(f){r.put(f.mode.bit,4),r.put(f.getLength(),dr.getCharCountIndicator(f.mode,t)),f.write(r)});const i=Ct.getSymbolTotalCodewords(t),o=Ht.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 f=0;f<l;f++)r.put(f%2?17:236,8);return br(r,t,e)}function br(t,e,n){const r=Ct.getSymbolTotalCodewords(e),i=Ht.getTotalCodewordsCount(e,n),o=r-i,s=Ht.getBlocksCount(e,n),l=r%s,f=s-l,p=Math.floor(r/s),m=Math.floor(o/s),y=m+1,_=p-m,w=new hr(_);let E=0;const C=new Array(s),b=new Array(s);let g=0;const d=new Uint8Array(t.buffer);for(let T=0;T<s;T++){const B=T<f?m:y;C[T]=d.slice(E,E+B),b[T]=w.encode(C[T]),E+=B,g=Math.max(g,B)}const u=new Uint8Array(r);let a=0,c,h;for(c=0;c<g;c++)for(h=0;h<s;h++)c<C[h].length&&(u[a++]=C[h][c]);for(c=0;c<_;c++)for(h=0;h<s;h++)u[a++]=b[h][c];return u}function Er(t,e,n,r){let i;if(Array.isArray(t))i=zt.fromArray(t);else if(typeof t=="string"){let p=e;if(!p){const m=zt.rawSplit(t);p=Tt.getBestVersionForData(m,n)}i=zt.fromString(t,p||40)}else throw new Error("Invalid data");const o=Tt.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=wr(e,n,i),l=Ct.getSymbolSize(e),f=new lr(l);return gr(f,e),pr(f),mr(f,e),Gt(f,n,0),e>=7&&yr(f,e),_r(f,s),isNaN(r)&&(r=Yt.getBestMask(f,Gt.bind(null,f,n))),Yt.applyMask(r,f),Gt(f,n,r),{modules:f,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}vt.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=xt.M,i,o;return typeof n<"u"&&(r=xt.from(n.errorCorrectionLevel,xt.M),i=Tt.from(n.version),o=Yt.from(n.maskPattern),n.toSJISFunc&&Ct.setToSJISFunction(n.toSJISFunc)),Er(e,i,r,o)};var Ce={},Te={},Ae={exports:{}},Be={exports:{}};let Cr=V.default,Ie=Ot.default,k=Be.exports=function(){Ie.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};Cr.inherits(k,Ie),k.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))},k.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},k.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()))},k.prototype.destroySoon=k.prototype.end,k.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},k.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},k.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))},k.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)},k.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 Se=Be.exports,Le={exports:{}},Pe={exports:{}},At={};let Y=[{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]}];At.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<Y.length;l++){let f=Y[l],p=o*f.x.length,m=s*f.y.length;for(let y=0;y<f.x.length&&f.x[y]<r;y++)p++;for(let y=0;y<f.y.length&&f.y[y]<i;y++)m++;p>0&&m>0&&n.push({width:p,height:m,index:l})}return n},At.getInterlaceIterator=function(t){return function(e,n,r){let i=e%Y[r].x.length,o=(e-i)/Y[r].x.length*8+Y[r].x[i],s=n%Y[r].y.length,l=(n-s)/Y[r].y.length*8+Y[r].y[s];return o*4+l*t*4}};var Re=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 Tr=At,Ar=Re;function Me(t,e,n){let r=t*e;return n!==8&&(r=Math.ceil(r/(8/n))),r}let Z=Pe.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=Tr.getImagePasses(n,r);for(let f=0;f<l.length;f++)this._images.push({byteWidth:Me(l[f].width,o,s),height:l[f].height,lineIndex:0})}else this._images.push({byteWidth:Me(n,o,s),height:r,lineIndex:0});s===8?this._xComparison=o:s===16?this._xComparison=o*2:this._xComparison=1};Z.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},Z.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}},Z.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}},Z.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],f=o?o[s]:0,p=s>i?e[s-r]:0,m=Math.floor((p+f)/2);e[s]=l+m}},Z.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],f=o?o[s]:0,p=s>i?e[s-r]:0,m=s>i&&o?o[s-r]:0,y=Ar(p,f,m);e[s]=l+y}},Z.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 Oe=Pe.exports;let Br=V.default,ve=Se,Ir=Oe,Sr=Le.exports=function(t){ve.call(this);let e=[],n=this;this._filter=new Ir(t,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){n.emit("complete",Buffer.concat(e))}}),this._filter.start()};Br.inherits(Sr,ve);var Lr=Le.exports,Ne={exports:{}},it={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},Ue={exports:{}};let qt=[];(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;qt[t]=e}})();let Vt=Ue.exports=function(){this._crc=-1};Vt.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=qt[(this._crc^t[e])&255]^this._crc>>>8;return!0},Vt.prototype.crc32=function(){return this._crc^-1},Vt.crc32=function(t){let e=-1;for(let n=0;n<t.length;n++)e=qt[(e^t[n])&255]^e>>>8;return e^-1};var ke=Ue.exports;let L=it,Pr=ke,P=Ne.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(){}};P.prototype.start=function(){this.read(L.PNG_SIGNATURE.length,this._parseSignature.bind(this))},P.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))},P.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 Pr,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))},P.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},P.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},P.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))},P.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},P.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 f=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:f,colorType:i}),this._handleChunkEnd()},P.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},P.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()},P.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},P.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()},P.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},P.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/L.GAMMA_DIVISION),this._handleChunkEnd()},P.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},P.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()},P.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},P.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()};var Fe=Ne.exports,jt={};let De=At,Rr=[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]}],Mr=[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 Or(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,f,p,m,y,_,w;switch(e){default:throw new Error("unrecognised depth");case 16:_=t[r],r++,n.push((o<<8)+_);break;case 4:_=o&15,w=o>>4,n.push(w,_);break;case 2:m=o&3,y=o>>2&3,_=o>>4&3,w=o>>6&3,n.push(w,_,y,m);break;case 1:s=o&1,l=o>>1&1,f=o>>2&1,p=o>>3&1,m=o>>4&1,y=o>>5&1,_=o>>6&1,w=o>>7&1,n.push(w,_,y,m,p,f,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 vr(t,e,n,r,i,o){let s=t.width,l=t.height,f=t.index;for(let p=0;p<l;p++)for(let m=0;m<s;m++){let y=n(m,p,f);Rr[r](e,i,y,o),o+=r}return o}function Nr(t,e,n,r,i,o){let s=t.width,l=t.height,f=t.index;for(let p=0;p<l;p++){for(let m=0;m<s;m++){let y=i.get(r),_=n(m,p,f);Mr[r](e,y,_,o)}i.resetAfterLine()}}jt.dataToBitMap=function(t,e){let n=e.width,r=e.height,i=e.depth,o=e.bpp,s=e.interlace,l;i!==8&&(l=Or(t,i));let f;i<=8?f=Buffer.alloc(n*r*4):f=new Uint16Array(n*r*4);let p=Math.pow(2,i)-1,m=0,y,_;if(s)y=De.getImagePasses(n,r),_=De.getInterlaceIterator(n,r);else{let w=0;_=function(){let E=w;return w+=4,E},y=[{width:n,height:r}]}for(let w=0;w<y.length;w++)i===8?m=vr(y[w],f,_,o,t,m):Nr(y[w],f,_,o,l,p);if(i===8){if(m!==t.length)throw new Error("extra data found")}else l.end();return f};function Ur(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let f=i[t[o]];if(!f)throw new Error("index "+t[o]+" not in palette");for(let p=0;p<4;p++)e[o+p]=f[p];o+=4}}function kr(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let f=!1;if(i.length===1?i[0]===t[o]&&(f=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(f=!0),f)for(let p=0;p<4;p++)e[o+p]=0;o+=4}}function Fr(t,e,n,r,i){let o=255,s=Math.pow(2,i)-1,l=0;for(let f=0;f<r;f++)for(let p=0;p<n;p++){for(let m=0;m<4;m++)e[l+m]=Math.floor(t[l+m]*o/s+.5);l+=4}}var $e=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,l=e.palette,f=t;return o===3?Ur(t,f,r,i,l):(s&&kr(t,f,r,i,s),n!==8&&(n===16&&(f=Buffer.alloc(r*i*4)),Fr(t,f,r,i,n))),f};let Dr=V.default,Kt=tt.default,xe=Se,$r=Lr,xr=Fe,Yr=jt,Hr=$e,D=Ae.exports=function(t){xe.call(this),this._parser=new xr(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()};Dr.inherits(D,xe),D.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},D.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=Kt.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,Kt.Z_MIN_CHUNK);this._inflate=Kt.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)},D.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new $r(this._bitmapInfo)},D.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},D.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},D.prototype._simpleTransparency=function(){this._metaData.alpha=!0},D.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},D.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},D.prototype._complete=function(t){if(this.errord)return;let e;try{let n=Yr.dataToBitMap(t,this._bitmapInfo);e=Hr(n,this._bitmapInfo),n=null}catch(n){this._handleError(n);return}this.emit("parsed",e)};var zr=Ae.exports,Ye={exports:{}},He={exports:{}};let U=it;var Gr=function(t,e,n,r){let i=[U.COLORTYPE_COLOR_ALPHA,U.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let E=function(){let C=new ArrayBuffer(2);return new DataView(C).setInt16(0,256,!0),new Int16Array(C)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&E)return t}let o=r.bitDepth!==16?t:new Uint16Array(t.buffer),s=255,l=U.COLORTYPE_TO_BPP_MAP[r.inputColorType];l===4&&!r.inputHasAlpha&&(l=3);let f=U.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,f*=2);let p=Buffer.alloc(e*n*f),m=0,y=0,_=r.bgColor||{};_.red===void 0&&(_.red=s),_.green===void 0&&(_.green=s),_.blue===void 0&&(_.blue=s);function w(){let E,C,b,g=s;switch(r.inputColorType){case U.COLORTYPE_COLOR_ALPHA:g=o[m+3],E=o[m],C=o[m+1],b=o[m+2];break;case U.COLORTYPE_COLOR:E=o[m],C=o[m+1],b=o[m+2];break;case U.COLORTYPE_ALPHA:g=o[m+1],E=o[m],C=E,b=E;break;case U.COLORTYPE_GRAYSCALE:E=o[m],C=E,b=E;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(i||(g/=s,E=Math.min(Math.max(Math.round((1-g)*_.red+g*E),0),s),C=Math.min(Math.max(Math.round((1-g)*_.green+g*C),0),s),b=Math.min(Math.max(Math.round((1-g)*_.blue+g*b),0),s))),{red:E,green:C,blue:b,alpha:g}}for(let E=0;E<n;E++)for(let C=0;C<e;C++){let b=w();switch(r.colorType){case U.COLORTYPE_COLOR_ALPHA:case U.COLORTYPE_COLOR:r.bitDepth===8?(p[y]=b.red,p[y+1]=b.green,p[y+2]=b.blue,i&&(p[y+3]=b.alpha)):(p.writeUInt16BE(b.red,y),p.writeUInt16BE(b.green,y+2),p.writeUInt16BE(b.blue,y+4),i&&p.writeUInt16BE(b.alpha,y+6));break;case U.COLORTYPE_ALPHA:case U.COLORTYPE_GRAYSCALE:{let g=(b.red+b.green+b.blue)/3;r.bitDepth===8?(p[y]=g,i&&(p[y+1]=b.alpha)):(p.writeUInt16BE(g,y),i&&p.writeUInt16BE(b.alpha,y+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}m+=l,y+=f}return p};let ze=Re;function qr(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]}function Vr(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++)r+=Math.abs(t[o]);return r}function jr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=t[e+s]-l;r[i+s]=f}}function Kr(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 Wr(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 Qr(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 Jr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=e>0?t[e+s-n]:0,p=t[e+s]-(l+f>>1);r[i+s]=p}}function Zr(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,f=t[e+o]-(s+l>>1);i+=Math.abs(f)}return i}function Xr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=e>0?t[e+s-n]:0,p=e>0&&s>=o?t[e+s-(n+o)]:0,m=t[e+s]-ze(l,f,p);r[i+s]=m}}function ti(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,f=e>0&&o>=r?t[e+o-(n+r)]:0,p=t[e+o]-ze(s,l,f);i+=Math.abs(p)}return i}let ei={0:qr,1:jr,2:Wr,3:Jr,4:Xr},ni={0:Vr,1:Kr,2:Qr,3:Zr,4:ti};var ri=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,f=0,p=Buffer.alloc((s+1)*n),m=o[0];for(let y=0;y<n;y++){if(o.length>1){let _=1/0;for(let w=0;w<o.length;w++){let E=ni[o[w]](t,f,s,i);E<_&&(m=o[w],_=E)}}p[l]=m,l++,ei[m](t,f,s,p,l,i),l+=s,f+=s}return p};let M=it,ii=ke,oi=Gr,si=ri,ai=tt.default,H=He.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||ai.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:M.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:M.COLORTYPE_COLOR_ALPHA,[M.COLORTYPE_GRAYSCALE,M.COLORTYPE_COLOR,M.COLORTYPE_COLOR_ALPHA,M.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([M.COLORTYPE_GRAYSCALE,M.COLORTYPE_COLOR,M.COLORTYPE_COLOR_ALPHA,M.CO