@minimax-ai/code 0.5.9 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{a as lTe,b as tD,c as Io,d as CS,e as xS,f as rD,g as hu,h as nD,i as j_}from"./chunk-4ESEMCSG.js";import{a as uTe,b as sD,c as mTe}from"./chunk-EFVDRFCG.js";import{$ as W,$a as NQ,$b as Vbe,$c as VL,$d as ES,$e as MEe,A as mu,Aa as Xve,Ab as xbe,Ac as Yr,Ad as bo,Ae as uEe,Af as XEe,B as AL,Ba as Qve,Bb as Mbe,Bc as rc,Bd as XL,Be as mEe,Bf as QEe,C as hve,Ca as PL,Cb as Pbe,Cc as Jn,Cd as kIe,Ce as fEe,Cf as D_,D as gve,Da as Yve,Db as Obe,Dc as Rs,Dd as RIe,De as pEe,Df as YEe,E as _ve,Ea as Jve,Eb as qbe,Ec as kr,Ed as AIe,Ee as hEe,Ef as JEe,F as U,Fa as Zve,Fb as Lbe,Fc as je,Fd as CIe,Fe as q_,Ff as ZEe,G as yve,Ga as OL,Gb as Dbe,Gc as ye,Gd as pu,Ge as gEe,Gf as eTe,H as wve,Ha as ebe,Hb as jbe,Hc as hn,Hd as xIe,He as _Ee,Hf as tTe,I as Nve,Ia as qL,Ic as nc,Id as MIe,Ie as yEe,If as rTe,J as A,Ja as wQ,Jb as Ube,Jc as C_,Jd as PIe,Je as wEe,Jf as nTe,K as Sve,Ka as tbe,Kb as Bbe,Kc as ed,Kd as bS,Ke as NEe,Kf as sTe,L as vve,La as rbe,Lb as Fbe,Lc as TQ,Ld as OIe,Le as MQ,Lf as iTe,M as bve,Ma as nbe,Mb as Wbe,Mc as nIe,Md as qIe,Me as SEe,Mf as aTe,N as CL,Na as sbe,Nb as WL,Nc as sIe,Nd as LIe,Ne as vEe,Nf as oTe,O as xL,Oa as ibe,Ob as GL,Oc as Pa,Od as DIe,Oe as Tk,Of as cTe,P as pQ,Pa as abe,Pb as _0t,Pc as sc,Pd as jIe,Pe as bEe,Pf as jQ,Q as Ive,Qa as obe,Qb as wk,Qc as iIe,Qd as CQ,Qe as IEe,R as Eve,Ra as cbe,Rb as Nk,Rc as aIe,Rd as UIe,Re as EEe,S as rt,Sa as dbe,Sb as y0t,Sc as oIe,Sd as BIe,Se as TEe,T as Tve,Ta as lbe,Tb as Qm,Tc as cIe,Td as FIe,Te as L_,U as fu,Ua as Qt,Ub as Gbe,Uc as $L,Ud as WIe,Ue as kEe,V as xve,Va as No,Vb as Hbe,Vc as vk,Vd as GIe,Ve as REe,W as Mve,Wa as Ts,Wb as $be,Wc as kQ,Wd as QL,We as AEe,X as Pve,Xa as ks,Xb as NS,Xc as KL,Xd as HIe,Xe as CEe,Y as Ove,Ya as LL,Yb as HL,Yc as dIe,Yd as IS,Ye as JL,Z as hS,Za as yS,Zb as SQ,Zc as SS,Zd as $Ie,Ze as xEe,_ as qve,_a as ube,_b as Kbe,_c as x_,_d as Ek,_e as ZL,a as gk,aa as Lve,ab as DL,ac as zbe,ad as lIe,ae as KIe,af as RS,b as g0t,ba as Dve,bb as mbe,bc as Xbe,bd as M_,be as Oa,bf as PEe,c as tve,ca as jve,cb as Xm,cc as Pn,cd as zL,ce as VIe,cf as td,da as hQ,db as fbe,dc as Qbe,dd as P_,de as TS,df as AS,e as rve,ea as Uve,eb as jL,ec as Sk,ed as uIe,ee as kS,ef as PQ,f as nve,fa as Bve,fb as pbe,fc as Ybe,fd as mIe,fe as zIe,ff as OEe,g as Yd,ga as wo,gb as wS,gc as Jbe,gd as fIe,ge as YL,gf as qEe,h as uQ,ha as Jd,hb as UL,hc as vQ,hd as pIe,he as XIe,hf as LEe,i as sve,ia as Qr,ib as hbe,ic as Zbe,id as hIe,ie as QIe,if as DEe,j as ive,ja as Xt,jb as gbe,jc as Vi,jd as gIe,je as YIe,jf as jEe,k as fS,ka as gQ,kb as _be,kc as R_,kd as vS,ke as xQ,kf as UEe,la as Fve,lb as ybe,lc as A_,ld as bk,le as JIe,lf as eD,ma as Wve,mb as wbe,mc as eIe,md as RQ,me as ZIe,mf as OQ,na as _k,nb as Nbe,nc as tIe,nd as _Ie,ne as eEe,nf as kk,oa as Gve,ob as Sbe,oc as bQ,od as yIe,oe as tEe,of as qQ,p as ave,pa as Hve,pb as BL,pc as rIe,pd as wIe,pe as Jm,pf as LQ,qa as $ve,qb as vbe,qc as Me,qd as NIe,qe as rEe,qf as BEe,r as lve,ra as Kve,rb as bbe,rc as re,rd as SIe,re as nEe,rf as FEe,s as uve,sa as ML,sb as Ibe,sc as Ym,sd as vIe,se as Js,sf as WEe,t as mve,ta as yk,tb as Ebe,tc as Be,td as Ik,te as sEe,tf as GEe,ua as Vve,ub as Tbe,uc as So,ud as bIe,ue as iEe,uf as HEe,v as kL,va as gS,vb as kbe,vc as Zd,vd as O_,ve as aEe,vf as $Ee,w as RL,wa as _Q,wb as Rbe,wc as IQ,wd as IIe,we as oEe,wf as DQ,x as fve,xa as zve,xb as FL,xc as vo,xd as EIe,xe as cEe,xf as KEe,y as pve,ya as yQ,yb as Abe,yc as EQ,yd as TIe,ye as dEe,yf as VEe,z as Gr,za as _S,zb as Cbe,zc as el,zd as AQ,ze as lEe,zf as zEe}from"./chunk-6ETTLULN.js";import{d as JSe,e as ZSe,f as EL,g as TL,h as lQ,i as eve,l as mQ}from"./chunk-JVKXU2EF.js";import{a as dTe}from"./chunk-N55ACUNK.js";import{c as YSe,g as bL}from"./chunk-CF3YFDG4.js";import{a as dQ}from"./chunk-PRXIML4F.js";import{a as IL,b as Ip}from"./chunk-FKQFVOLR.js";import{b as pS}from"./chunk-X4N2MWNJ.js";import{c as Cve}from"./chunk-HVP63X6W.js";import{f as ove,r as fQ,t as cve,v as dve}from"./chunk-S6GSNWAM.js";import{a as Rve,b as Ave}from"./chunk-UJCQHSQD.js";import{a as kve}from"./chunk-G64EFDMH.js";import{a as fTe}from"./chunk-4Y64C4JT.js";import{a as h0t}from"./chunk-HQ2U4QVQ.js";import{a as Y8,e as _Se,f as ySe,g as wSe,j as cQ,l as hk,q as QSe}from"./chunk-EM6SRMJ6.js";import{Ba as Sp,Ca as In,D as vSe,F as bSe,Ga as fL,Ia as Hm,J as uk,Ja as OSe,K as ISe,Ma as qSe,Na as E_,Oa as LSe,P as ESe,Pa as Zc,Ra as T_,Sa as $m,T as mk,Ua as DSe,V as tc,W as TSe,a as wp,aa as kSe,ab as zm,b as J8,ba as RSe,bb as zSe,c as NSe,cb as k_,d as uS,da as ASe,db as aQ,e as Ut,eb as oQ,ha as bt,i as Z8,ia as Kt,j as cL,ja as Np,k as dL,ka as xa,kb as XSe,l as Ki,la as CSe,m as SSe,n as mS,na as xSe,o as Es,oa as lL,p as eQ,va as MSe,w as tQ,wa as uL,x as rQ,xa as mL,ya as PSe}from"./chunk-GN5KQHOZ.js";import{$ as vL,E as _L,G as FSe,H as nQ,I as sQ,J as WSe,K as yL,L as wL,O as GSe,P as HSe,Q as $Se,R as NL,S as KSe,X as bp,Y as SL,Z as VSe,_ as iQ,a as jSe,b as USe,d as pL,k as vi,l as Km,m as hL,n as vp,o as fk,p as BSe,q as gL,r as pk,s as Ma,z as Vm}from"./chunk-Z4VKGZFA.js";import{a as on,c as ke,e as jr}from"./chunk-D76SO2ME.js";var s1e=ke((dos,G1)=>{var n1e=n1e||function(t){return Buffer.from(t).toString("base64")};function lcr(t){var e=this,r=Math.round,n=Math.floor,s=new Array(64),i=new Array(64),a=new Array(64),o=new Array(64),c,d,l,u,m=new Array(65535),f=new Array(65535),p=new Array(64),g=new Array(64),_=[],y=0,w=7,N=new Array(64),v=new Array(64),S=new Array(64),b=new Array(256),E=new Array(2048),j,B=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],F=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],X=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Y=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],ae=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],te=[0,1,2,3,4,5,6,7,8,9,10,11],_e=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],ce=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Re(se){for(var ot=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],wt=0;wt<64;wt++){var pt=n((ot[wt]*se+50)/100);pt<1?pt=1:pt>255&&(pt=255),s[B[wt]]=pt}for(var Pt=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Dt=0;Dt<64;Dt++){var Er=n((Pt[Dt]*se+50)/100);Er<1?Er=1:Er>255&&(Er=255),i[B[Dt]]=Er}for(var Tr=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Vn=0,bn=0;bn<8;bn++)for(var Se=0;Se<8;Se++)a[Vn]=1/(s[B[Vn]]*Tr[bn]*Tr[Se]*8),o[Vn]=1/(i[B[Vn]]*Tr[bn]*Tr[Se]*8),Vn++}function Ie(se,ot){for(var wt=0,pt=0,Pt=new Array,Dt=1;Dt<=16;Dt++){for(var Er=1;Er<=se[Dt];Er++)Pt[ot[pt]]=[],Pt[ot[pt]][0]=wt,Pt[ot[pt]][1]=Dt,pt++,wt++;wt*=2}return Pt}function be(){c=Ie(F,$),d=Ie(ae,te),l=Ie(X,Y),u=Ie(_e,ce)}function Ve(){for(var se=1,ot=2,wt=1;wt<=15;wt++){for(var pt=se;pt<ot;pt++)f[32767+pt]=wt,m[32767+pt]=[],m[32767+pt][1]=wt,m[32767+pt][0]=pt;for(var Pt=-(ot-1);Pt<=-se;Pt++)f[32767+Pt]=wt,m[32767+Pt]=[],m[32767+Pt][1]=wt,m[32767+Pt][0]=ot-1+Pt;se<<=1,ot<<=1}}function ve(){for(var se=0;se<256;se++)E[se]=19595*se,E[se+256>>0]=38470*se,E[se+512>>0]=7471*se+32768,E[se+768>>0]=-11059*se,E[se+1024>>0]=-21709*se,E[se+1280>>0]=32768*se+8421375,E[se+1536>>0]=-27439*se,E[se+1792>>0]=-5329*se}function fe(se){for(var ot=se[0],wt=se[1]-1;wt>=0;)ot&1<<wt&&(y|=1<<w),wt--,w--,w<0&&(y==255?(Q(255),Q(0)):Q(y),w=7,y=0)}function Q(se){_.push(se)}function de(se){Q(se>>8&255),Q(se&255)}function Le(se,ot){var wt,pt,Pt,Dt,Er,Tr,Vn,bn,Se=0,Ze,Rt=8,Gn=64;for(Ze=0;Ze<Rt;++Ze){wt=se[Se],pt=se[Se+1],Pt=se[Se+2],Dt=se[Se+3],Er=se[Se+4],Tr=se[Se+5],Vn=se[Se+6],bn=se[Se+7];var jt=wt+bn,sr=wt-bn,an=pt+Vn,vt=pt-Vn,Dr=Pt+Tr,$i=Pt-Tr,Mn=Dt+Er,Jc=Dt-Er,uu=jt+Mn,I_=jt-Mn,dS=an+Dr,lS=an-Dr;se[Se]=uu+dS,se[Se+4]=uu-dS;var sk=(lS+I_)*.707106781;se[Se+2]=I_+sk,se[Se+6]=I_-sk,uu=Jc+$i,dS=$i+vt,lS=vt+sr;var ik=(uu-lS)*.382683433,sL=.5411961*uu+ik,ak=1.306562965*lS+ik,ok=dS*.707106781,ck=sr+ok,dk=sr-ok;se[Se+5]=dk+sL,se[Se+3]=dk-sL,se[Se+1]=ck+ak,se[Se+7]=ck-ak,Se+=8}for(Se=0,Ze=0;Ze<Rt;++Ze){wt=se[Se],pt=se[Se+8],Pt=se[Se+16],Dt=se[Se+24],Er=se[Se+32],Tr=se[Se+40],Vn=se[Se+48],bn=se[Se+56];var sSe=wt+bn,X8=wt-bn,iSe=pt+Vn,aSe=pt-Vn,oSe=Pt+Tr,cSe=Pt-Tr,dSe=Dt+Er,p0t=Dt-Er,lk=sSe+dSe,Q8=sSe-dSe,iL=iSe+oSe,aL=iSe-oSe;se[Se]=lk+iL,se[Se+32]=lk-iL;var lSe=(aL+Q8)*.707106781;se[Se+16]=Q8+lSe,se[Se+48]=Q8-lSe,lk=p0t+cSe,iL=cSe+aSe,aL=aSe+X8;var uSe=(lk-aL)*.382683433,mSe=.5411961*lk+uSe,fSe=1.306562965*aL+uSe,pSe=iL*.707106781,hSe=X8+pSe,gSe=X8-pSe;se[Se+40]=gSe+mSe,se[Se+24]=gSe-mSe,se[Se+8]=hSe+fSe,se[Se+56]=hSe-fSe,Se++}var oL;for(Ze=0;Ze<Gn;++Ze)oL=se[Ze]*ot[Ze],p[Ze]=oL>0?oL+.5|0:oL-.5|0;return p}function Pe(){de(65504),de(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),de(1),de(1),Q(0),Q(0)}function Ae(se){if(se){de(65505),se[0]===69&&se[1]===120&&se[2]===105&&se[3]===102?de(se.length+2):(de(se.length+5+2),Q(69),Q(120),Q(105),Q(102),Q(0));for(var ot=0;ot<se.length;ot++)Q(se[ot])}}function We(se,ot){de(65472),de(17),Q(8),de(ot),de(se),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)}function ze(){de(65499),de(132),Q(0);for(var se=0;se<64;se++)Q(s[se]);Q(1);for(var ot=0;ot<64;ot++)Q(i[ot])}function Te(){de(65476),de(418),Q(0);for(var se=0;se<16;se++)Q(F[se+1]);for(var ot=0;ot<=11;ot++)Q($[ot]);Q(16);for(var wt=0;wt<16;wt++)Q(X[wt+1]);for(var pt=0;pt<=161;pt++)Q(Y[pt]);Q(1);for(var Pt=0;Pt<16;Pt++)Q(ae[Pt+1]);for(var Dt=0;Dt<=11;Dt++)Q(te[Dt]);Q(17);for(var Er=0;Er<16;Er++)Q(_e[Er+1]);for(var Tr=0;Tr<=161;Tr++)Q(ce[Tr])}function Ne(se){typeof se>"u"||se.constructor!==Array||se.forEach(ot=>{if(typeof ot=="string"){de(65534);var wt=ot.length;de(wt+2);var pt;for(pt=0;pt<wt;pt++)Q(ot.charCodeAt(pt))}})}function kt(){de(65498),de(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0)}function Je(se,ot,wt,pt,Pt){for(var Dt=Pt[0],Er=Pt[240],Tr,Vn=16,bn=63,Se=64,Ze=Le(se,ot),Rt=0;Rt<Se;++Rt)g[B[Rt]]=Ze[Rt];var Gn=g[0]-wt;wt=g[0],Gn==0?fe(pt[0]):(Tr=32767+Gn,fe(pt[f[Tr]]),fe(m[Tr]));for(var jt=63;jt>0&&g[jt]==0;jt--);if(jt==0)return fe(Dt),wt;for(var sr=1,an;sr<=jt;){for(var vt=sr;g[sr]==0&&sr<=jt;++sr);var Dr=sr-vt;if(Dr>=Vn){an=Dr>>4;for(var $i=1;$i<=an;++$i)fe(Er);Dr=Dr&15}Tr=32767+g[sr],fe(Pt[(Dr<<4)+f[Tr]]),fe(m[Tr]),sr++}return jt!=bn&&fe(Dt),wt}function it(){for(var se=String.fromCharCode,ot=0;ot<256;ot++)b[ot]=se(ot)}this.encode=function(se,ot){var wt=new Date().getTime();ot&&Yc(ot),_=new Array,y=0,w=7,de(65496),Pe(),Ne(se.comments),Ae(se.exifBuffer),ze(),We(se.width,se.height),Te(),kt();var pt=0,Pt=0,Dt=0;y=0,w=7,this.encode.displayName="_encode_";for(var Er=se.data,Tr=se.width,Vn=se.height,bn=Tr*4,Se=Tr*3,Ze,Rt=0,Gn,jt,sr,an,vt,Dr,$i,Mn;Rt<Vn;){for(Ze=0;Ze<bn;){for(an=bn*Rt+Ze,vt=an,Dr=-1,$i=0,Mn=0;Mn<64;Mn++)$i=Mn>>3,Dr=(Mn&7)*4,vt=an+$i*bn+Dr,Rt+$i>=Vn&&(vt-=bn*(Rt+1+$i-Vn)),Ze+Dr>=bn&&(vt-=Ze+Dr-bn+4),Gn=Er[vt++],jt=Er[vt++],sr=Er[vt++],N[Mn]=(E[Gn]+E[jt+256>>0]+E[sr+512>>0]>>16)-128,v[Mn]=(E[Gn+768>>0]+E[jt+1024>>0]+E[sr+1280>>0]>>16)-128,S[Mn]=(E[Gn+1280>>0]+E[jt+1536>>0]+E[sr+1792>>0]>>16)-128;pt=Je(N,a,pt,c,l),Pt=Je(v,o,Pt,d,u),Dt=Je(S,o,Dt,d,u),Ze+=32}Rt+=8}if(w>=0){var Jc=[];Jc[1]=w+1,Jc[0]=(1<<w+1)-1,fe(Jc)}if(de(65497),typeof G1>"u")return new Uint8Array(_);return Buffer.from(_);var uu,I_};function Yc(se){if(se<=0&&(se=1),se>100&&(se=100),j!=se){var ot=0;se<50?ot=Math.floor(5e3/se):ot=Math.floor(200-se*2),Re(ot),j=se}}function Qd(){var se=new Date().getTime();t||(t=50),it(),be(),Ve(),ve(),Yc(t);var ot=new Date().getTime()-se}Qd()}typeof G1<"u"?G1.exports=r1e:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=r1e);function r1e(t,e){typeof e>"u"&&(e=50);var r=new lcr(e),n=r.encode(t,e);return{data:n,width:t.width,height:t.height}}});var a1e=ke((los,Dre)=>{var Lre=(function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,n=799,s=3406,i=2276,a=1567,o=3784,c=5793,d=2896;function l(){}function u(w,N){for(var v=0,S=[],b,E,j=16;j>0&&!w[j-1];)j--;S.push({children:[],index:0});var B=S[0],F;for(b=0;b<j;b++){for(E=0;E<w[b];E++){for(B=S.pop(),B.children[B.index]=N[v];B.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");B=S.pop()}for(B.index++,S.push(B);S.length<=b;)S.push(F={children:[],index:0}),B.children[B.index]=F.children,B=F;v++}b+1<j&&(S.push(F={children:[],index:0}),B.children[B.index]=F.children,B=F)}return S[0].children}function m(w,N,v,S,b,E,j,B,F,$){var X=v.precision,Y=v.samplesPerLine,ae=v.scanLines,te=v.mcusPerLine,_e=v.progressive,ce=v.maxH,Re=v.maxV,Ie=N,be=0,Ve=0;function ve(){if(Ve>0)return Ve--,be>>Ve&1;if(be=w[N++],be==255){var Se=w[N++];if(Se)throw new Error("unexpected marker: "+(be<<8|Se).toString(16))}return Ve=7,be>>>7}function fe(Se){for(var Ze=Se,Rt;(Rt=ve())!==null;){if(Ze=Ze[Rt],typeof Ze=="number")return Ze;if(typeof Ze!="object")throw new Error("invalid huffman sequence")}return null}function Q(Se){for(var Ze=0;Se>0;){var Rt=ve();if(Rt===null)return;Ze=Ze<<1|Rt,Se--}return Ze}function de(Se){var Ze=Q(Se);return Ze>=1<<Se-1?Ze:Ze+(-1<<Se)+1}function Le(Se,Ze){var Rt=fe(Se.huffmanTableDC),Gn=Rt===0?0:de(Rt);Ze[0]=Se.pred+=Gn;for(var jt=1;jt<64;){var sr=fe(Se.huffmanTableAC),an=sr&15,vt=sr>>4;if(an===0){if(vt<15)break;jt+=16;continue}jt+=vt;var Dr=e[jt];Ze[Dr]=de(an),jt++}}function Pe(Se,Ze){var Rt=fe(Se.huffmanTableDC),Gn=Rt===0?0:de(Rt)<<F;Ze[0]=Se.pred+=Gn}function Ae(Se,Ze){Ze[0]|=ve()<<F}var We=0;function ze(Se,Ze){if(We>0){We--;return}for(var Rt=E,Gn=j;Rt<=Gn;){var jt=fe(Se.huffmanTableAC),sr=jt&15,an=jt>>4;if(sr===0){if(an<15){We=Q(an)+(1<<an)-1;break}Rt+=16;continue}Rt+=an;var vt=e[Rt];Ze[vt]=de(sr)*(1<<F),Rt++}}var Te=0,Ne;function kt(Se,Ze){for(var Rt=E,Gn=j,jt=0;Rt<=Gn;){var sr=e[Rt],an=Ze[sr]<0?-1:1;switch(Te){case 0:var vt=fe(Se.huffmanTableAC),Dr=vt&15,jt=vt>>4;if(Dr===0)jt<15?(We=Q(jt)+(1<<jt),Te=4):(jt=16,Te=1);else{if(Dr!==1)throw new Error("invalid ACn encoding");Ne=de(Dr),Te=jt?2:3}continue;case 1:case 2:Ze[sr]?Ze[sr]+=(ve()<<F)*an:(jt--,jt===0&&(Te=Te==2?3:0));break;case 3:Ze[sr]?Ze[sr]+=(ve()<<F)*an:(Ze[sr]=Ne<<F,Te=0);break;case 4:Ze[sr]&&(Ze[sr]+=(ve()<<F)*an);break}Rt++}Te===4&&(We--,We===0&&(Te=0))}function Je(Se,Ze,Rt,Gn,jt){var sr=Rt/te|0,an=Rt%te,vt=sr*Se.v+Gn,Dr=an*Se.h+jt;Se.blocks[vt]===void 0&&$.tolerantDecoding||Ze(Se,Se.blocks[vt][Dr])}function it(Se,Ze,Rt){var Gn=Rt/Se.blocksPerLine|0,jt=Rt%Se.blocksPerLine;Se.blocks[Gn]===void 0&&$.tolerantDecoding||Ze(Se,Se.blocks[Gn][jt])}var Yc=S.length,Qd,se,ot,wt,pt,Pt;_e?E===0?Pt=B===0?Pe:Ae:Pt=B===0?ze:kt:Pt=Le;var Dt=0,Er,Tr;Yc==1?Tr=S[0].blocksPerLine*S[0].blocksPerColumn:Tr=te*v.mcusPerColumn,b||(b=Tr);for(var Vn,bn;Dt<Tr;){for(se=0;se<Yc;se++)S[se].pred=0;if(We=0,Yc==1)for(Qd=S[0],pt=0;pt<b;pt++)it(Qd,Pt,Dt),Dt++;else for(pt=0;pt<b;pt++){for(se=0;se<Yc;se++)for(Qd=S[se],Vn=Qd.h,bn=Qd.v,ot=0;ot<bn;ot++)for(wt=0;wt<Vn;wt++)Je(Qd,Pt,Dt,ot,wt);if(Dt++,Dt===Tr)break}if(Dt===Tr)do{if(w[N]===255&&w[N+1]!==0)break;N+=1}while(N<w.length-2);if(Ve=0,Er=w[N]<<8|w[N+1],Er<65280)throw new Error("marker was not found");if(Er>=65488&&Er<=65495)N+=2;else break}return N-Ie}function f(w,N){var v=[],S=N.blocksPerLine,b=N.blocksPerColumn,E=S<<3,j=new Int32Array(64),B=new Uint8Array(64);function F(Ie,be,Ve){var ve=N.quantizationTable,fe,Q,de,Le,Pe,Ae,We,ze,Te,Ne=Ve,kt;for(kt=0;kt<64;kt++)Ne[kt]=Ie[kt]*ve[kt];for(kt=0;kt<8;++kt){var Je=8*kt;if(Ne[1+Je]==0&&Ne[2+Je]==0&&Ne[3+Je]==0&&Ne[4+Je]==0&&Ne[5+Je]==0&&Ne[6+Je]==0&&Ne[7+Je]==0){Te=c*Ne[0+Je]+512>>10,Ne[0+Je]=Te,Ne[1+Je]=Te,Ne[2+Je]=Te,Ne[3+Je]=Te,Ne[4+Je]=Te,Ne[5+Je]=Te,Ne[6+Je]=Te,Ne[7+Je]=Te;continue}fe=c*Ne[0+Je]+128>>8,Q=c*Ne[4+Je]+128>>8,de=Ne[2+Je],Le=Ne[6+Je],Pe=d*(Ne[1+Je]-Ne[7+Je])+128>>8,ze=d*(Ne[1+Je]+Ne[7+Je])+128>>8,Ae=Ne[3+Je]<<4,We=Ne[5+Je]<<4,Te=fe-Q+1>>1,fe=fe+Q+1>>1,Q=Te,Te=de*o+Le*a+128>>8,de=de*a-Le*o+128>>8,Le=Te,Te=Pe-We+1>>1,Pe=Pe+We+1>>1,We=Te,Te=ze+Ae+1>>1,Ae=ze-Ae+1>>1,ze=Te,Te=fe-Le+1>>1,fe=fe+Le+1>>1,Le=Te,Te=Q-de+1>>1,Q=Q+de+1>>1,de=Te,Te=Pe*i+ze*s+2048>>12,Pe=Pe*s-ze*i+2048>>12,ze=Te,Te=Ae*n+We*r+2048>>12,Ae=Ae*r-We*n+2048>>12,We=Te,Ne[0+Je]=fe+ze,Ne[7+Je]=fe-ze,Ne[1+Je]=Q+We,Ne[6+Je]=Q-We,Ne[2+Je]=de+Ae,Ne[5+Je]=de-Ae,Ne[3+Je]=Le+Pe,Ne[4+Je]=Le-Pe}for(kt=0;kt<8;++kt){var it=kt;if(Ne[8+it]==0&&Ne[16+it]==0&&Ne[24+it]==0&&Ne[32+it]==0&&Ne[40+it]==0&&Ne[48+it]==0&&Ne[56+it]==0){Te=c*Ve[kt+0]+8192>>14,Ne[0+it]=Te,Ne[8+it]=Te,Ne[16+it]=Te,Ne[24+it]=Te,Ne[32+it]=Te,Ne[40+it]=Te,Ne[48+it]=Te,Ne[56+it]=Te;continue}fe=c*Ne[0+it]+2048>>12,Q=c*Ne[32+it]+2048>>12,de=Ne[16+it],Le=Ne[48+it],Pe=d*(Ne[8+it]-Ne[56+it])+2048>>12,ze=d*(Ne[8+it]+Ne[56+it])+2048>>12,Ae=Ne[24+it],We=Ne[40+it],Te=fe-Q+1>>1,fe=fe+Q+1>>1,Q=Te,Te=de*o+Le*a+2048>>12,de=de*a-Le*o+2048>>12,Le=Te,Te=Pe-We+1>>1,Pe=Pe+We+1>>1,We=Te,Te=ze+Ae+1>>1,Ae=ze-Ae+1>>1,ze=Te,Te=fe-Le+1>>1,fe=fe+Le+1>>1,Le=Te,Te=Q-de+1>>1,Q=Q+de+1>>1,de=Te,Te=Pe*i+ze*s+2048>>12,Pe=Pe*s-ze*i+2048>>12,ze=Te,Te=Ae*n+We*r+2048>>12,Ae=Ae*r-We*n+2048>>12,We=Te,Ne[0+it]=fe+ze,Ne[56+it]=fe-ze,Ne[8+it]=Q+We,Ne[48+it]=Q-We,Ne[16+it]=de+Ae,Ne[40+it]=de-Ae,Ne[24+it]=Le+Pe,Ne[32+it]=Le-Pe}for(kt=0;kt<64;++kt){var Yc=128+(Ne[kt]+8>>4);be[kt]=Yc<0?0:Yc>255?255:Yc}}y(E*b*8);for(var $,X,Y=0;Y<b;Y++){var ae=Y<<3;for($=0;$<8;$++)v.push(new Uint8Array(E));for(var te=0;te<S;te++){F(N.blocks[Y][te],B,j);var _e=0,ce=te<<3;for(X=0;X<8;X++){var Re=v[ae+X];for($=0;$<8;$++)Re[ce+$]=B[_e++]}}}return v}function p(w){return w<0?0:w>255?255:w}l.prototype={load:function(N){var v=new XMLHttpRequest;v.open("GET",N,!0),v.responseType="arraybuffer",v.onload=(function(){var S=new Uint8Array(v.response||v.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),v.send(null)},parse:function(N){var v=this.opts.maxResolutionInMP*1e3*1e3,S=0,b=N.length;function E(){var vt=N[S]<<8|N[S+1];return S+=2,vt}function j(){var vt=E(),Dr=N.subarray(S,S+vt-2);return S+=Dr.length,Dr}function B(vt){var Dr=1,$i=1,Mn,Jc;for(Jc in vt.components)vt.components.hasOwnProperty(Jc)&&(Mn=vt.components[Jc],Dr<Mn.h&&(Dr=Mn.h),$i<Mn.v&&($i=Mn.v));var uu=Math.ceil(vt.samplesPerLine/8/Dr),I_=Math.ceil(vt.scanLines/8/$i);for(Jc in vt.components)if(vt.components.hasOwnProperty(Jc)){Mn=vt.components[Jc];var dS=Math.ceil(Math.ceil(vt.samplesPerLine/8)*Mn.h/Dr),lS=Math.ceil(Math.ceil(vt.scanLines/8)*Mn.v/$i),sk=uu*Mn.h,ik=I_*Mn.v,sL=ik*sk,ak=[];y(sL*256);for(var ok=0;ok<ik;ok++){for(var ck=[],dk=0;dk<sk;dk++)ck.push(new Int32Array(64));ak.push(ck)}Mn.blocksPerLine=dS,Mn.blocksPerColumn=lS,Mn.blocks=ak}vt.maxH=Dr,vt.maxV=$i,vt.mcusPerLine=uu,vt.mcusPerColumn=I_}var F=null,$=null,X=null,Y,ae,te=[],_e=[],ce=[],Re=[],Ie=E(),be=-1;if(this.comments=[],Ie!=65496)throw new Error("SOI not found");for(Ie=E();Ie!=65497;){var Ve,ve,fe;switch(Ie){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var Q=j();if(Ie===65534){var de=String.fromCharCode.apply(null,Q);this.comments.push(de)}Ie===65504&&Q[0]===74&&Q[1]===70&&Q[2]===73&&Q[3]===70&&Q[4]===0&&(F={version:{major:Q[5],minor:Q[6]},densityUnits:Q[7],xDensity:Q[8]<<8|Q[9],yDensity:Q[10]<<8|Q[11],thumbWidth:Q[12],thumbHeight:Q[13],thumbData:Q.subarray(14,14+3*Q[12]*Q[13])}),Ie===65505&&Q[0]===69&&Q[1]===120&&Q[2]===105&&Q[3]===102&&Q[4]===0&&(this.exifBuffer=Q.subarray(5,Q.length)),Ie===65518&&Q[0]===65&&Q[1]===100&&Q[2]===111&&Q[3]===98&&Q[4]===101&&Q[5]===0&&($={version:Q[6],flags0:Q[7]<<8|Q[8],flags1:Q[9]<<8|Q[10],transformCode:Q[11]});break;case 65499:for(var Le=E(),Pe=Le+S-2;S<Pe;){var Ae=N[S++];y(256);var We=new Int32Array(64);if(Ae>>4===0)for(ve=0;ve<64;ve++){var ze=e[ve];We[ze]=N[S++]}else if(Ae>>4===1)for(ve=0;ve<64;ve++){var ze=e[ve];We[ze]=E()}else throw new Error("DQT: invalid table spec");te[Ae&15]=We}break;case 65472:case 65473:case 65474:E(),Y={},Y.extended=Ie===65473,Y.progressive=Ie===65474,Y.precision=N[S++],Y.scanLines=E(),Y.samplesPerLine=E(),Y.components={},Y.componentsOrder=[];var Te=Y.scanLines*Y.samplesPerLine;if(Te>v){var Ne=Math.ceil((Te-v)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${Ne}MP`)}var kt=N[S++],Je,it=0,Yc=0;for(Ve=0;Ve<kt;Ve++){Je=N[S];var Qd=N[S+1]>>4,se=N[S+1]&15,ot=N[S+2];if(Qd<=0||se<=0)throw new Error("Invalid sampling factor, expected values above 0");Y.componentsOrder.push(Je),Y.components[Je]={h:Qd,v:se,quantizationIdx:ot},S+=3}B(Y),_e.push(Y);break;case 65476:var wt=E();for(Ve=2;Ve<wt;){var pt=N[S++],Pt=new Uint8Array(16),Dt=0;for(ve=0;ve<16;ve++,S++)Dt+=Pt[ve]=N[S];y(16+Dt);var Er=new Uint8Array(Dt);for(ve=0;ve<Dt;ve++,S++)Er[ve]=N[S];Ve+=17+Dt,(pt>>4===0?Re:ce)[pt&15]=u(Pt,Er)}break;case 65501:E(),ae=E();break;case 65500:E(),E();break;case 65498:var Tr=E(),Vn=N[S++],bn=[],Se;for(Ve=0;Ve<Vn;Ve++){Se=Y.components[N[S++]];var Ze=N[S++];Se.huffmanTableDC=Re[Ze>>4],Se.huffmanTableAC=ce[Ze&15],bn.push(Se)}var Rt=N[S++],Gn=N[S++],jt=N[S++],sr=m(N,S,Y,bn,ae,Rt,Gn,jt>>4,jt&15,this.opts);S+=sr;break;case 65535:N[S]!==255&&S--;break;default:if(N[S-3]==255&&N[S-2]>=192&&N[S-2]<=254){S-=3;break}else if(Ie===224||Ie==225){if(be!==-1)throw new Error(`first unknown JPEG marker at offset ${be.toString(16)}, second unknown JPEG marker ${Ie.toString(16)} at offset ${(S-1).toString(16)}`);be=S-1;let vt=E();if(N[S+vt-2]===255){S+=vt-2;break}}throw new Error("unknown JPEG marker "+Ie.toString(16))}Ie=E()}if(_e.length!=1)throw new Error("only single frame JPEGs supported");for(var Ve=0;Ve<_e.length;Ve++){var an=_e[Ve].components;for(var ve in an)an[ve].quantizationTable=te[an[ve].quantizationIdx],delete an[ve].quantizationIdx}this.width=Y.samplesPerLine,this.height=Y.scanLines,this.jfif=F,this.adobe=$,this.components=[];for(var Ve=0;Ve<Y.componentsOrder.length;Ve++){var Se=Y.components[Y.componentsOrder[Ve]];this.components.push({lines:f(Y,Se),scaleX:Se.h/Y.maxH,scaleY:Se.v/Y.maxV})}},getData:function(N,v){var S=this.width/N,b=this.height/v,E,j,B,F,$,X,Y,ae,te,_e,ce=0,Re,Ie,be,Ve,ve,fe,Q,de,Le,Pe,Ae,We=N*v*this.components.length;y(We);var ze=new Uint8Array(We);switch(this.components.length){case 1:for(E=this.components[0],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],te=0;te<N;te++)Re=$[0|te*E.scaleX*S],ze[ce++]=Re;break;case 2:for(E=this.components[0],j=this.components[1],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],te=0;te<N;te++)Re=$[0|te*E.scaleX*S],ze[ce++]=Re,Re=X[0|te*j.scaleX*S],ze[ce++]=Re;break;case 3:for(Ae=!0,this.adobe&&this.adobe.transformCode?Ae=!0:typeof this.opts.colorTransform<"u"&&(Ae=!!this.opts.colorTransform),E=this.components[0],j=this.components[1],B=this.components[2],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],Y=B.lines[0|_e*B.scaleY*b],te=0;te<N;te++)Ae?(Re=$[0|te*E.scaleX*S],Ie=X[0|te*j.scaleX*S],be=Y[0|te*B.scaleX*S],de=p(Re+1.402*(be-128)),Le=p(Re-.3441363*(Ie-128)-.71413636*(be-128)),Pe=p(Re+1.772*(Ie-128))):(de=$[0|te*E.scaleX*S],Le=X[0|te*j.scaleX*S],Pe=Y[0|te*B.scaleX*S]),ze[ce++]=de,ze[ce++]=Le,ze[ce++]=Pe;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(Ae=!1,this.adobe&&this.adobe.transformCode?Ae=!0:typeof this.opts.colorTransform<"u"&&(Ae=!!this.opts.colorTransform),E=this.components[0],j=this.components[1],B=this.components[2],F=this.components[3],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],Y=B.lines[0|_e*B.scaleY*b],ae=F.lines[0|_e*F.scaleY*b],te=0;te<N;te++)Ae?(Re=$[0|te*E.scaleX*S],Ie=X[0|te*j.scaleX*S],be=Y[0|te*B.scaleX*S],Ve=ae[0|te*F.scaleX*S],ve=255-p(Re+1.402*(be-128)),fe=255-p(Re-.3441363*(Ie-128)-.71413636*(be-128)),Q=255-p(Re+1.772*(Ie-128))):(ve=$[0|te*E.scaleX*S],fe=X[0|te*j.scaleX*S],Q=Y[0|te*B.scaleX*S],Ve=ae[0|te*F.scaleX*S]),ze[ce++]=255-ve,ze[ce++]=255-fe,ze[ce++]=255-Q,ze[ce++]=255-Ve;break;default:throw new Error("Unsupported color mode")}return ze},copyToImageData:function(N,v){var S=N.width,b=N.height,E=N.data,j=this.getData(S,b),B=0,F=0,$,X,Y,ae,te,_e,ce,Re,Ie;switch(this.components.length){case 1:for(X=0;X<b;X++)for($=0;$<S;$++)Y=j[B++],E[F++]=Y,E[F++]=Y,E[F++]=Y,v&&(E[F++]=255);break;case 3:for(X=0;X<b;X++)for($=0;$<S;$++)ce=j[B++],Re=j[B++],Ie=j[B++],E[F++]=ce,E[F++]=Re,E[F++]=Ie,v&&(E[F++]=255);break;case 4:for(X=0;X<b;X++)for($=0;$<S;$++)te=j[B++],_e=j[B++],Y=j[B++],ae=j[B++],ce=255-p(te*(1-ae/255)+ae),Re=255-p(_e*(1-ae/255)+ae),Ie=255-p(Y*(1-ae/255)+ae),E[F++]=ce,E[F++]=Re,E[F++]=Ie,v&&(E[F++]=255);break;default:throw new Error("Unsupported color mode")}}};var g=0,_=0;function y(w=0){var N=g+w;if(N>_){var v=Math.ceil((N-_)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${v}MB`)}g=N}return l.resetMaxMemoryUsage=function(w){g=0,_=w},l.getBytesAllocated=function(){return g},l.requestMemoryAllocation=y,l})();typeof Dre<"u"?Dre.exports=i1e:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=i1e);function i1e(t,e={}){var r={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},n={...r,...e},s=new Uint8Array(t),i=new Lre;i.opts=n,Lre.resetMaxMemoryUsage(n.maxMemoryUsageInMB*1024*1024),i.parse(s);var a=n.formatAsRGBA?4:3,o=i.width*i.height*a;try{Lre.requestMemoryAllocation(o);var c={width:i.width,height:i.height,exifBuffer:i.exifBuffer,data:n.useTArray?new Uint8Array(o):Buffer.alloc(o)};i.comments.length>0&&(c.comments=i.comments)}catch(d){throw d instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):d instanceof ReferenceError&&d.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):d}return i.copyToImageData(c,n.formatAsRGBA),c}});var c1e=ke((uos,o1e)=>{var ucr=s1e(),mcr=a1e();o1e.exports={encode:ucr,decode:mcr}});var jre=ke((mos,l1e)=>{"use strict";var fcr=on("util"),d1e=on("stream"),hl=l1e.exports=function(){d1e.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};fcr.inherits(hl,d1e);hl.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))};hl.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return Buffer.isBuffer(t)?r=t:r=Buffer.from(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};hl.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()))};hl.prototype.destroySoon=hl.prototype.end;hl.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};hl.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};hl.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))};hl.prototype._processRead=function(t){this._reads.shift();let e=0,r=0,n=Buffer.alloc(t.length);for(;e<t.length;){let s=this._buffers[r++],i=Math.min(s.length,t.length-e);s.copy(n,e,0,i),e+=i,i!==s.length&&(this._buffers[--r]=s.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)};hl.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 Bre=ke(Ure=>{"use strict";var Sh=[{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]}];Ure.getImagePasses=function(t,e){let r=[],n=t%8,s=e%8,i=(t-n)/8,a=(e-s)/8;for(let o=0;o<Sh.length;o++){let c=Sh[o],d=i*c.x.length,l=a*c.y.length;for(let u=0;u<c.x.length&&c.x[u]<n;u++)d++;for(let u=0;u<c.y.length&&c.y[u]<s;u++)l++;d>0&&l>0&&r.push({width:d,height:l,index:o})}return r};Ure.getInterlaceIterator=function(t){return function(e,r,n){let s=e%Sh[n].x.length,i=(e-s)/Sh[n].x.length*8+Sh[n].x[s],a=r%Sh[n].y.length,o=(r-a)/Sh[n].y.length*8+Sh[n].y[a];return i*4+o*t*4}}});var Fre=ke((pos,u1e)=>{"use strict";u1e.exports=function(e,r,n){let s=e+r-n,i=Math.abs(s-e),a=Math.abs(s-r),o=Math.abs(s-n);return i<=a&&i<=o?e:a<=o?r:n}});var Wre=ke((hos,f1e)=>{"use strict";var pcr=Bre(),hcr=Fre();function m1e(t,e,r){let n=t*e;return r!==8&&(n=Math.ceil(n/(8/r))),n}var ab=f1e.exports=function(t,e){let r=t.width,n=t.height,s=t.interlace,i=t.bpp,a=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],s){let o=pcr.getImagePasses(r,n);for(let c=0;c<o.length;c++)this._images.push({byteWidth:m1e(o[c].width,i,a),height:o[c].height,lineIndex:0})}else this._images.push({byteWidth:m1e(r,i,a),height:n,lineIndex:0});a===8?this._xComparison=i:a===16?this._xComparison=i*2:this._xComparison=1};ab.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};ab.prototype._unFilterType1=function(t,e,r){let n=this._xComparison,s=n-1;for(let i=0;i<r;i++){let a=t[1+i],o=i>s?e[i-n]:0;e[i]=a+o}};ab.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let s=0;s<r;s++){let i=t[1+s],a=n?n[s]:0;e[s]=i+a}};ab.prototype._unFilterType3=function(t,e,r){let n=this._xComparison,s=n-1,i=this._lastLine;for(let a=0;a<r;a++){let o=t[1+a],c=i?i[a]:0,d=a>s?e[a-n]:0,l=Math.floor((d+c)/2);e[a]=o+l}};ab.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,s=n-1,i=this._lastLine;for(let a=0;a<r;a++){let o=t[1+a],c=i?i[a]:0,d=a>s?e[a-n]:0,l=a>s&&i?i[a-n]:0,u=hcr(d,c,l);e[a]=o+u}};ab.prototype._reverseFilterLine=function(t){let e=t[0],r,n=this._images[this._imageIndex],s=n.byteWidth;if(e===0)r=t.slice(1,s+1);else switch(r=Buffer.alloc(s),e){case 1:this._unFilterType1(t,r,s);break;case 2:this._unFilterType2(t,r,s);break;case 3:this._unFilterType3(t,r,s);break;case 4:this._unFilterType4(t,r,s);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(r),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=r,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var g1e=ke((gos,h1e)=>{"use strict";var gcr=on("util"),p1e=jre(),_cr=Wre(),ycr=h1e.exports=function(t){p1e.call(this);let e=[],r=this;this._filter=new _cr(t,{read:this.read.bind(this),write:function(n){e.push(n)},complete:function(){r.emit("complete",Buffer.concat(e))}}),this._filter.start()};gcr.inherits(ycr,p1e)});var ob=ke((_os,_1e)=>{"use strict";_1e.exports={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}});var $re=ke((yos,y1e)=>{"use strict";var Gre=[];(function(){for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e=e>>>1;Gre[t]=e}})();var Hre=y1e.exports=function(){this._crc=-1};Hre.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=Gre[(this._crc^t[e])&255]^this._crc>>>8;return!0};Hre.prototype.crc32=function(){return this._crc^-1};Hre.crc32=function(t){let e=-1;for(let r=0;r<t.length;r++)e=Gre[(e^t[r])&255]^e>>>8;return e^-1}});var Kre=ke((wos,w1e)=>{"use strict";var ni=ob(),wcr=$re(),Pi=w1e.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[ni.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[ni.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[ni.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[ni.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[ni.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[ni.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(){}};Pi.prototype.start=function(){this.read(ni.PNG_SIGNATURE.length,this._parseSignature.bind(this))};Pi.prototype._parseSignature=function(t){let e=ni.PNG_SIGNATURE;for(let r=0;r<e.length;r++)if(t[r]!==e[r]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),r=t.readUInt32BE(4),n="";for(let i=4;i<8;i++)n+=String.fromCharCode(t[i]);let s=!!(t[4]&32);if(!this._hasIHDR&&r!==ni.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new wcr,this._crc.write(Buffer.from(n)),this._chunks[r])return this._chunks[r](e);if(!s){this.error(new Error("Unsupported critical chunk type "+n));return}this.read(e+4,this._skipChunk.bind(this))};Pi.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};Pi.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),r=this._crc.crc32();if(this._options.checkCRC&&r!==e){this.error(new Error("Crc error - "+e+" - "+r));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};Pi.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),r=t.readUInt32BE(4),n=t[8],s=t[9],i=t[10],a=t[11],o=t[12];if(n!==8&&n!==4&&n!==2&&n!==1&&n!==16){this.error(new Error("Unsupported bit depth "+n));return}if(!(s in ni.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(i!==0){this.error(new Error("Unsupported compression method"));return}if(a!==0){this.error(new Error("Unsupported filter method"));return}if(o!==0&&o!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=s;let c=ni.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:r,depth:n,interlace:!!o,palette:!!(s&ni.COLORTYPE_PALETTE),color:!!(s&ni.COLORTYPE_COLOR),alpha:!!(s&ni.COLORTYPE_ALPHA),bpp:c,colorType:s}),this._handleChunkEnd()};Pi.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};Pi.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let r=0;r<e;r++)this._palette.push([t[r*3],t[r*3+1],t[r*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};Pi.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))};Pi.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===ni.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===ni.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===ni.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()};Pi.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};Pi.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/ni.GAMMA_DIVISION),this._handleChunkEnd()};Pi.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))};Pi.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===ni.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let r=t-e.length;r>0?this._handleIDAT(r):this._handleChunkEnd()};Pi.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};Pi.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var Vre=ke(S1e=>{"use strict";var N1e=Bre(),Ncr=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let s=e[n];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let s=e[n];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],Scr=[function(){},function(t,e,r,n){let s=e[0];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function vcr(t,e){let r=[],n=0;function s(){if(n===t.length)throw new Error("Ran out of data");let i=t[n];n++;let a,o,c,d,l,u,m,f;switch(e){default:throw new Error("unrecognised depth");case 16:m=t[n],n++,r.push((i<<8)+m);break;case 4:m=i&15,f=i>>4,r.push(f,m);break;case 2:l=i&3,u=i>>2&3,m=i>>4&3,f=i>>6&3,r.push(f,m,u,l);break;case 1:a=i&1,o=i>>1&1,c=i>>2&1,d=i>>3&1,l=i>>4&1,u=i>>5&1,m=i>>6&1,f=i>>7&1,r.push(f,m,u,l,d,c,o,a);break}}return{get:function(i){for(;r.length<i;)s();let a=r.slice(0,i);return r=r.slice(i),a},resetAfterLine:function(){r.length=0},end:function(){if(n!==t.length)throw new Error("extra data found")}}}function bcr(t,e,r,n,s,i){let a=t.width,o=t.height,c=t.index;for(let d=0;d<o;d++)for(let l=0;l<a;l++){let u=r(l,d,c);Ncr[n](e,s,u,i),i+=n}return i}function Icr(t,e,r,n,s,i){let a=t.width,o=t.height,c=t.index;for(let d=0;d<o;d++){for(let l=0;l<a;l++){let u=s.get(n),m=r(l,d,c);Scr[n](e,u,m,i)}s.resetAfterLine()}}S1e.dataToBitMap=function(t,e){let r=e.width,n=e.height,s=e.depth,i=e.bpp,a=e.interlace,o;s!==8&&(o=vcr(t,s));let c;s<=8?c=Buffer.alloc(r*n*4):c=new Uint16Array(r*n*4);let d=Math.pow(2,s)-1,l=0,u,m;if(a)u=N1e.getImagePasses(r,n),m=N1e.getInterlaceIterator(r,n);else{let f=0;m=function(){let p=f;return f+=4,p},u=[{width:r,height:n}]}for(let f=0;f<u.length;f++)s===8?l=bcr(u[f],c,m,i,t,l):Icr(u[f],c,m,i,o,d);if(s===8){if(l!==t.length)throw new Error("extra data found")}else o.end();return c}});var zre=ke((Sos,v1e)=>{"use strict";function Ecr(t,e,r,n,s){let i=0;for(let a=0;a<n;a++)for(let o=0;o<r;o++){let c=s[t[i]];if(!c)throw new Error("index "+t[i]+" not in palette");for(let d=0;d<4;d++)e[i+d]=c[d];i+=4}}function Tcr(t,e,r,n,s){let i=0;for(let a=0;a<n;a++)for(let o=0;o<r;o++){let c=!1;if(s.length===1?s[0]===t[i]&&(c=!0):s[0]===t[i]&&s[1]===t[i+1]&&s[2]===t[i+2]&&(c=!0),c)for(let d=0;d<4;d++)e[i+d]=0;i+=4}}function kcr(t,e,r,n,s){let i=255,a=Math.pow(2,s)-1,o=0;for(let c=0;c<n;c++)for(let d=0;d<r;d++){for(let l=0;l<4;l++)e[o+l]=Math.floor(t[o+l]*i/a+.5);o+=4}}v1e.exports=function(t,e,r=!1){let n=e.depth,s=e.width,i=e.height,a=e.colorType,o=e.transColor,c=e.palette,d=t;return a===3?Ecr(t,d,s,i,c):(o&&Tcr(t,d,s,i,o),n!==8&&!r&&(n===16&&(d=Buffer.alloc(s*i*4)),kcr(t,d,s,i,n))),d}});var E1e=ke((vos,I1e)=>{"use strict";var Rcr=on("util"),Xre=on("zlib"),b1e=jre(),Acr=g1e(),Ccr=Kre(),xcr=Vre(),Mcr=zre(),Du=I1e.exports=function(t){b1e.call(this),this._parser=new Ccr(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()};Rcr.inherits(Du,b1e);Du.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};Du.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=Xre.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 r=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,n=Math.max(r,Xre.Z_MIN_CHUNK);this._inflate=Xre.createInflate({chunkSize:n});let s=r,i=this.emit.bind(this,"error");this._inflate.on("error",function(o){s&&i(o)}),this._filter.on("complete",this._complete.bind(this));let a=this._filter.write.bind(this._filter);this._inflate.on("data",function(o){s&&(o.length>s&&(o=o.slice(0,s)),s-=o.length,a(o))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)};Du.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new Acr(this._bitmapInfo)};Du.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};Du.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};Du.prototype._simpleTransparency=function(){this._metaData.alpha=!0};Du.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};Du.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};Du.prototype._complete=function(t){if(this.errord)return;let e;try{let r=xcr.dataToBitMap(t,this._bitmapInfo);e=Mcr(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(r){this._handleError(r);return}this.emit("parsed",e)}});var k1e=ke((bos,T1e)=>{"use strict";var gd=ob();T1e.exports=function(t,e,r,n){let s=[gd.COLORTYPE_COLOR_ALPHA,gd.COLORTYPE_ALPHA].indexOf(n.colorType)!==-1;if(n.colorType===n.inputColorType){let p=(function(){let g=new ArrayBuffer(2);return new DataView(g).setInt16(0,256,!0),new Int16Array(g)[0]!==256})();if(n.bitDepth===8||n.bitDepth===16&&p)return t}let i=n.bitDepth!==16?t:new Uint16Array(t.buffer),a=255,o=gd.COLORTYPE_TO_BPP_MAP[n.inputColorType];o===4&&!n.inputHasAlpha&&(o=3);let c=gd.COLORTYPE_TO_BPP_MAP[n.colorType];n.bitDepth===16&&(a=65535,c*=2);let d=Buffer.alloc(e*r*c),l=0,u=0,m=n.bgColor||{};m.red===void 0&&(m.red=a),m.green===void 0&&(m.green=a),m.blue===void 0&&(m.blue=a);function f(){let p,g,_,y=a;switch(n.inputColorType){case gd.COLORTYPE_COLOR_ALPHA:y=i[l+3],p=i[l],g=i[l+1],_=i[l+2];break;case gd.COLORTYPE_COLOR:p=i[l],g=i[l+1],_=i[l+2];break;case gd.COLORTYPE_ALPHA:y=i[l+1],p=i[l],g=p,_=p;break;case gd.COLORTYPE_GRAYSCALE:p=i[l],g=p,_=p;break;default:throw new Error("input color type:"+n.inputColorType+" is not supported at present")}return n.inputHasAlpha&&(s||(y/=a,p=Math.min(Math.max(Math.round((1-y)*m.red+y*p),0),a),g=Math.min(Math.max(Math.round((1-y)*m.green+y*g),0),a),_=Math.min(Math.max(Math.round((1-y)*m.blue+y*_),0),a))),{red:p,green:g,blue:_,alpha:y}}for(let p=0;p<r;p++)for(let g=0;g<e;g++){let _=f(i,l);switch(n.colorType){case gd.COLORTYPE_COLOR_ALPHA:case gd.COLORTYPE_COLOR:n.bitDepth===8?(d[u]=_.red,d[u+1]=_.green,d[u+2]=_.blue,s&&(d[u+3]=_.alpha)):(d.writeUInt16BE(_.red,u),d.writeUInt16BE(_.green,u+2),d.writeUInt16BE(_.blue,u+4),s&&d.writeUInt16BE(_.alpha,u+6));break;case gd.COLORTYPE_ALPHA:case gd.COLORTYPE_GRAYSCALE:{let y=(_.red+_.green+_.blue)/3;n.bitDepth===8?(d[u]=y,s&&(d[u+1]=_.alpha)):(d.writeUInt16BE(y,u),s&&d.writeUInt16BE(_.alpha,u+2));break}default:throw new Error("unrecognised color Type "+n.colorType)}l+=o,u+=c}return d}});var C1e=ke((Ios,A1e)=>{"use strict";var R1e=Fre();function Pcr(t,e,r,n,s){for(let i=0;i<r;i++)n[s+i]=t[e+i]}function Ocr(t,e,r){let n=0,s=e+r;for(let i=e;i<s;i++)n+=Math.abs(t[i]);return n}function qcr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=t[e+a]-o;n[s+a]=c}}function Lcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=t[e+i]-a;s+=Math.abs(o)}return s}function Dcr(t,e,r,n,s){for(let i=0;i<r;i++){let a=e>0?t[e+i-r]:0,o=t[e+i]-a;n[s+i]=o}}function jcr(t,e,r){let n=0,s=e+r;for(let i=e;i<s;i++){let a=e>0?t[i-r]:0,o=t[i]-a;n+=Math.abs(o)}return n}function Ucr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,d=t[e+a]-(o+c>>1);n[s+a]=d}}function Bcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=e>0?t[e+i-r]:0,c=t[e+i]-(a+o>>1);s+=Math.abs(c)}return s}function Fcr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,d=e>0&&a>=i?t[e+a-(r+i)]:0,l=t[e+a]-R1e(o,c,d);n[s+a]=l}}function Wcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=e>0?t[e+i-r]:0,c=e>0&&i>=n?t[e+i-(r+n)]:0,d=t[e+i]-R1e(a,o,c);s+=Math.abs(d)}return s}var Gcr={0:Pcr,1:qcr,2:Dcr,3:Ucr,4:Fcr},Hcr={0:Ocr,1:Lcr,2:jcr,3:Bcr,4:Wcr};A1e.exports=function(t,e,r,n,s){let i;if(!("filterType"in n)||n.filterType===-1)i=[0,1,2,3,4];else if(typeof n.filterType=="number")i=[n.filterType];else throw new Error("unrecognised filter types");n.bitDepth===16&&(s*=2);let a=e*s,o=0,c=0,d=Buffer.alloc((a+1)*r),l=i[0];for(let u=0;u<r;u++){if(i.length>1){let m=1/0;for(let f=0;f<i.length;f++){let p=Hcr[i[f]](t,c,a,s);p<m&&(l=i[f],m=p)}}d[o]=l,o++,Gcr[l](t,c,a,d,o,s),o+=a,c+=a}return d}});var Qre=ke((Eos,x1e)=>{"use strict";var ha=ob(),$cr=$re(),Kcr=k1e(),Vcr=C1e(),zcr=on("zlib"),vh=x1e.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||zcr.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:ha.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:ha.COLORTYPE_COLOR_ALPHA,[ha.COLORTYPE_GRAYSCALE,ha.COLORTYPE_COLOR,ha.COLORTYPE_COLOR_ALPHA,ha.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([ha.COLORTYPE_GRAYSCALE,ha.COLORTYPE_COLOR,ha.COLORTYPE_COLOR_ALPHA,ha.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1)throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(t.bitDepth!==8&&t.bitDepth!==16)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};vh.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};vh.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};vh.prototype.filterData=function(t,e,r){let n=Kcr(t,e,r,this._options),s=ha.COLORTYPE_TO_BPP_MAP[this._options.colorType];return Vcr(n,e,r,this._options,s)};vh.prototype._packChunk=function(t,e){let r=e?e.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(t,4),e&&e.copy(n,8),n.writeInt32BE($cr.crc32(n.slice(4,n.length-4)),n.length-4),n};vh.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*ha.GAMMA_DIVISION),0),this._packChunk(ha.TYPE_gAMA,e)};vh.prototype.packIHDR=function(t,e){let r=Buffer.alloc(13);return r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(ha.TYPE_IHDR,r)};vh.prototype.packIDAT=function(t){return this._packChunk(ha.TYPE_IDAT,t)};vh.prototype.packIEND=function(){return this._packChunk(ha.TYPE_IEND,null)}});var q1e=ke((Tos,O1e)=>{"use strict";var Xcr=on("util"),M1e=on("stream"),Qcr=ob(),Ycr=Qre(),P1e=O1e.exports=function(t){M1e.call(this);let e=t||{};this._packer=new Ycr(e),this._deflate=this._packer.createDeflate(),this.readable=!0};Xcr.inherits(P1e,M1e);P1e.prototype.pack=function(t,e,r,n){this.emit("data",Buffer.from(Qcr.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,r)),n&&this.emit("data",this._packer.packGAMA(n));let s=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(i){this.emit("data",this._packer.packIDAT(i))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(s)}});var F1e=ke((YC,B1e)=>{"use strict";var L1e=on("assert").ok,cb=on("zlib"),Jcr=on("util"),D1e=on("buffer").kMaxLength;function aw(t){if(!(this instanceof aw))return new aw(t);t&&t.chunkSize<cb.Z_MIN_CHUNK&&(t.chunkSize=cb.Z_MIN_CHUNK),cb.Inflate.call(this,t),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&t.maxLength!=null&&(this._maxLength=t.maxLength)}function Zcr(t){return new aw(t)}function j1e(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}aw.prototype._processChunk=function(t,e,r){if(typeof r=="function")return cb.Inflate._processChunk.call(this,t,e,r);let n=this,s=t&&t.length,i=this._chunkSize-this._offset,a=this._maxLength,o=0,c=[],d=0,l;this.on("error",function(p){l=p});function u(p,g){if(n._hadError)return;let _=i-g;if(L1e(_>=0,"have should not go down"),_>0){let y=n._buffer.slice(n._offset,n._offset+_);if(n._offset+=_,y.length>a&&(y=y.slice(0,a)),c.push(y),d+=y.length,a-=y.length,a===0)return!1}return(g===0||n._offset>=n._chunkSize)&&(i=n._chunkSize,n._offset=0,n._buffer=Buffer.allocUnsafe(n._chunkSize)),g===0?(o+=s-p,s=p,!0):!1}L1e(this._handle,"zlib binding closed");let m;do m=this._handle.writeSync(e,t,o,s,this._buffer,this._offset,i),m=m||this._writeState;while(!this._hadError&&u(m[0],m[1]));if(this._hadError)throw l;if(d>=D1e)throw j1e(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+D1e.toString(16)+" bytes");let f=Buffer.concat(c,d);return j1e(this),f};Jcr.inherits(aw,cb.Inflate);function edr(t,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let r=t._finishFlushFlag;return r==null&&(r=cb.Z_FINISH),t._processChunk(e,r)}function U1e(t,e){return edr(new aw(e),t)}B1e.exports=YC=U1e;YC.Inflate=aw;YC.createInflate=Zcr;YC.inflateSync=U1e});var Yre=ke((kos,G1e)=>{"use strict";var W1e=G1e.exports=function(t){this._buffer=t,this._reads=[]};W1e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};W1e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var $1e=ke(H1e=>{"use strict";var tdr=Yre(),rdr=Wre();H1e.process=function(t,e){let r=[],n=new tdr(t);return new rdr(e,{read:n.read.bind(n),write:function(i){r.push(i)},complete:function(){}}).start(),n.process(),Buffer.concat(r)}});var X1e=ke((Aos,z1e)=>{"use strict";var K1e=!0,V1e=on("zlib"),ndr=F1e();V1e.deflateSync||(K1e=!1);var sdr=Yre(),idr=$1e(),adr=Kre(),odr=Vre(),cdr=zre();z1e.exports=function(t,e){if(!K1e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r;function n(v){r=v}let s;function i(v){s=v}function a(v){s.transColor=v}function o(v){s.palette=v}function c(){s.alpha=!0}let d;function l(v){d=v}let u=[];function m(v){u.push(v)}let f=new sdr(t);if(new adr(e,{read:f.read.bind(f),error:n,metadata:i,gamma:l,palette:o,transColor:a,inflateData:m,simpleTransparency:c}).start(),f.process(),r)throw r;let g=Buffer.concat(u);u.length=0;let _;if(s.interlace)_=V1e.inflateSync(g);else{let S=((s.width*s.bpp*s.depth+7>>3)+1)*s.height;_=ndr(g,{chunkSize:S,maxLength:S})}if(g=null,!_||!_.length)throw new Error("bad png - invalid inflate data response");let y=idr.process(_,s);g=null;let w=odr.dataToBitMap(y,s);y=null;let N=cdr(w,s,e.skipRescale);return s.data=N,s.gamma=d||0,s}});var Z1e=ke((Cos,J1e)=>{"use strict";var Q1e=!0,Y1e=on("zlib");Y1e.deflateSync||(Q1e=!1);var ddr=ob(),ldr=Qre();J1e.exports=function(t,e){if(!Q1e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=e||{},n=new ldr(r),s=[];s.push(Buffer.from(ddr.PNG_SIGNATURE)),s.push(n.packIHDR(t.width,t.height)),t.gamma&&s.push(n.packGAMA(t.gamma));let i=n.filterData(t.data,t.width,t.height),a=Y1e.deflateSync(i,n.getDeflateOptions());if(i=null,!a||!a.length)throw new Error("bad png - invalid compressed data response");return s.push(n.packIDAT(a)),s.push(n.packIEND()),Buffer.concat(s)}});var eWe=ke(Jre=>{"use strict";var udr=X1e(),mdr=Z1e();Jre.read=function(t,e){return udr(t,e||{})};Jre.write=function(t,e){return mdr(t,e)}});var H1=ke(rWe=>{"use strict";var fdr=on("util"),tWe=on("stream"),pdr=E1e(),hdr=q1e(),gdr=eWe(),Ha=rWe.PNG=function(t){tWe.call(this),t=t||{},this.width=t.width|0,this.height=t.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new pdr(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new hdr(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};fdr.inherits(Ha,tWe);Ha.sync=gdr;Ha.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};Ha.prototype.parse=function(t,e){if(e){let r,n;r=function(s){this.removeListener("error",n),this.data=s,e(null,this)}.bind(this),n=function(s){this.removeListener("parsed",r),e(s,null)}.bind(this),this.once("parsed",r),this.once("error",n)}return this.end(t),this};Ha.prototype.write=function(t){return this._parser.write(t),!0};Ha.prototype.end=function(t){this._parser.end(t)};Ha.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)};Ha.prototype._gamma=function(t){this.gamma=t};Ha.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};Ha.bitblt=function(t,e,r,n,s,i,a,o){if(r|=0,n|=0,s|=0,i|=0,a|=0,o|=0,r>t.width||n>t.height||r+s>t.width||n+i>t.height)throw new Error("bitblt reading outside image");if(a>e.width||o>e.height||a+s>e.width||o+i>e.height)throw new Error("bitblt writing outside image");for(let c=0;c<i;c++)t.data.copy(e.data,(o+c)*e.width+a<<2,(n+c)*t.width+r<<2,(n+c)*t.width+r+s<<2)};Ha.prototype.bitblt=function(t,e,r,n,s,i,a){return Ha.bitblt(this,t,e,r,n,s,i,a),this};Ha.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let r=0;r<t.width;r++){let n=t.width*e+r<<2;for(let s=0;s<3;s++){let i=t.data[n+s]/255;i=Math.pow(i,1/2.2/t.gamma),t.data[n+s]=Math.round(i*255)}}t.gamma=0}};Ha.prototype.adjustGamma=function(){Ha.adjustGamma(this)}});var hie=ke((xvs,bze)=>{bze.exports=on("stream")});var Bx=ke((gie,Eze)=>{var XG=on("buffer"),yf=XG.Buffer;function Ize(t,e){for(var r in t)e[r]=t[r]}yf.from&&yf.alloc&&yf.allocUnsafe&&yf.allocUnsafeSlow?Eze.exports=XG:(Ize(XG,gie),gie.Buffer=Wb);function Wb(t,e,r){return yf(t,e,r)}Ize(yf,Wb);Wb.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return yf(t,e,r)};Wb.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=yf(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Wb.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return yf(t)};Wb.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return XG.SlowBuffer(t)}});var kze=ke((Mvs,_ie)=>{"use strict";function WNr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Tze=Bx().Buffer,Fx=on("util");function GNr(t,e,r){t.copy(e,r)}_ie.exports=(function(){function t(){WNr(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},t.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},t.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,s=""+n.data;n=n.next;)s+=r+n.data;return s},t.prototype.concat=function(r){if(this.length===0)return Tze.alloc(0);for(var n=Tze.allocUnsafe(r>>>0),s=this.head,i=0;s;)GNr(s.data,n,i),i+=s.data.length,s=s.next;return n},t})();Fx&&Fx.inspect&&Fx.inspect.custom&&(_ie.exports.prototype[Fx.inspect.custom]=function(){var t=Fx.inspect({length:this.length});return this.constructor.name+" "+t})});var yie=ke((Pvs,Rze)=>{"use strict";var QG=GL();function HNr(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return n||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,QG.nextTick(YG,this,t)):QG.nextTick(YG,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(i){!e&&i?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,QG.nextTick(YG,r,i)):QG.nextTick(YG,r,i):e&&e(i)}),this)}function $Nr(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function YG(t,e){t.emit("error",e)}Rze.exports={destroy:HNr,undestroy:$Nr}});var Nie=ke((Ovs,Lze)=>{"use strict";var Nw=GL();Lze.exports=js;function Cze(t){var e=this;this.next=null,this.entry=null,this.finish=function(){dSr(e,t)}}var KNr=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Nw.nextTick,Gb;js.WritableState=Gx;var xze=Object.create(wk());xze.inherits=Nk();var VNr={deprecate:y0t()},Mze=hie(),ZG=Bx().Buffer,zNr=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function XNr(t){return ZG.from(t)}function QNr(t){return ZG.isBuffer(t)||t instanceof zNr}var Pze=yie();xze.inherits(js,Mze);function YNr(){}function Gx(t,e){Gb=Gb||Sw(),t=t||{};var r=e instanceof Gb;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,s=t.writableHighWaterMark,i=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(s||s===0)?this.highWaterMark=s:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=t.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){sSr(e,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cze(this)}Gx.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Gx.prototype,"buffer",{get:VNr.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var JG;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(JG=Function.prototype[Symbol.hasInstance],Object.defineProperty(js,Symbol.hasInstance,{value:function(t){return JG.call(this,t)?!0:this!==js?!1:t&&t._writableState instanceof Gx}})):JG=function(t){return t instanceof this};function js(t){if(Gb=Gb||Sw(),!JG.call(js,this)&&!(this instanceof Gb))return new js(t);this._writableState=new Gx(t,this),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Mze.call(this)}js.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function JNr(t,e){var r=new Error("write after end");t.emit("error",r),Nw.nextTick(e,r)}function ZNr(t,e,r,n){var s=!0,i=!1;return r===null?i=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i&&(t.emit("error",i),Nw.nextTick(n,i),s=!1),s}js.prototype.write=function(t,e,r){var n=this._writableState,s=!1,i=!n.objectMode&&QNr(t);return i&&!ZG.isBuffer(t)&&(t=XNr(t)),typeof e=="function"&&(r=e,e=null),i?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=YNr),n.ended?JNr(this,r):(i||ZNr(this,n,t,r))&&(n.pendingcb++,s=tSr(this,n,i,t,e,r)),s};js.prototype.cork=function(){var t=this._writableState;t.corked++};js.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Oze(this,t))};js.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function eSr(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=ZG.from(e,r)),e}Object.defineProperty(js.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tSr(t,e,r,n,s,i){if(!r){var a=eSr(e,n,s);n!==a&&(r=!0,s="buffer",n=a)}var o=e.objectMode?1:n.length;e.length+=o;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var d=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},d?d.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else wie(t,e,!1,o,n,s,i);return c}function wie(t,e,r,n,s,i,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(s,e.onwrite):t._write(s,i,e.onwrite),e.sync=!1}function rSr(t,e,r,n,s){--e.pendingcb,r?(Nw.nextTick(s,n),Nw.nextTick(Wx,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(s(n),t._writableState.errorEmitted=!0,t.emit("error",n),Wx(t,e))}function nSr(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function sSr(t,e){var r=t._writableState,n=r.sync,s=r.writecb;if(nSr(r),e)rSr(t,r,n,e,s);else{var i=qze(r);!i&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Oze(t,r),n?KNr(Aze,t,r,i,s):Aze(t,r,i,s)}}function Aze(t,e,r,n){r||iSr(t,e),e.pendingcb--,n(),Wx(t,e)}function iSr(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Oze(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),i=e.corkedRequestsFree;i.entry=r;for(var a=0,o=!0;r;)s[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;s.allBuffers=o,wie(t,e,!0,e.length,s,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new Cze(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,d=r.encoding,l=r.callback,u=e.objectMode?1:c.length;if(wie(t,e,!1,u,c,d,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}js.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))};js.prototype._writev=null;js.prototype.end=function(t,e,r){var n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||cSr(this,n,r)};function qze(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function aSr(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),Wx(t,e)})}function oSr(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"?(e.pendingcb++,e.finalCalled=!0,Nw.nextTick(aSr,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Wx(t,e){var r=qze(e);return r&&(oSr(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"))),r}function cSr(t,e,r){e.ending=!0,Wx(t,e),r&&(e.finished?Nw.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function dSr(t,e,r){var n=t.entry;for(t.entry=null;n;){var s=n.callback;e.pendingcb--,s(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(js.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});js.prototype.destroy=Pze.destroy;js.prototype._undestroy=Pze.undestroy;js.prototype._destroy=function(t,e){this.end(),e(t)}});var Sw=ke((qvs,Bze)=>{"use strict";var Dze=GL(),lSr=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Bze.exports=wf;var jze=Object.create(wk());jze.inherits=Nk();var Uze=bie(),vie=Nie();jze.inherits(wf,Uze);for(Sie=lSr(vie.prototype),eH=0;eH<Sie.length;eH++)tH=Sie[eH],wf.prototype[tH]||(wf.prototype[tH]=vie.prototype[tH]);var Sie,tH,eH;function wf(t){if(!(this instanceof wf))return new wf(t);Uze.call(this,t),vie.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",uSr)}Object.defineProperty(wf.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uSr(){this.allowHalfOpen||this._writableState.ended||Dze.nextTick(mSr,this)}function mSr(t){t.end()}Object.defineProperty(wf.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}});wf.prototype._destroy=function(t,e){this.push(null),this.end(),Dze.nextTick(e,t)}});var Tie=ke(Wze=>{"use strict";var Eie=Bx().Buffer,Fze=Eie.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fSr(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function pSr(t){var e=fSr(t);if(typeof e!="string"&&(Eie.isEncoding===Fze||!Fze(t)))throw new Error("Unknown encoding: "+t);return e||t}Wze.StringDecoder=Hx;function Hx(t){this.encoding=pSr(t);var e;switch(this.encoding){case"utf16le":this.text=NSr,this.end=SSr,e=4;break;case"utf8":this.fillLast=_Sr,e=4;break;case"base64":this.text=vSr,this.end=bSr,e=3;break;default:this.write=ISr,this.end=ESr;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Eie.allocUnsafe(e)}Hx.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Hx.prototype.end=wSr;Hx.prototype.text=ySr;Hx.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Iie(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function hSr(t,e,r){var n=e.length-1;if(n<r)return 0;var s=Iie(e[n]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--n<r||s===-2?0:(s=Iie(e[n]),s>=0?(s>0&&(t.lastNeed=s-2),s):--n<r||s===-2?0:(s=Iie(e[n]),s>=0?(s>0&&(s===2?s=0:t.lastNeed=s-3),s):0))}function gSr(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function _Sr(t){var e=this.lastTotal-this.lastNeed,r=gSr(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function ySr(t,e){var r=hSr(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function wSr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function NSr(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function SSr(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function vSr(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function bSr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function ISr(t){return t.toString(this.encoding)}function ESr(t){return t&&t.length?this.write(t):""}});var bie=ke((jvs,e4e)=>{"use strict";var $b=GL();e4e.exports=Dn;var TSr=_0t(),$x;Dn.ReadableState=Xze;var Dvs=on("events").EventEmitter,Kze=function(t,e){return t.listeners(e).length},xie=hie(),Kx=Bx().Buffer,kSr=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function RSr(t){return Kx.from(t)}function ASr(t){return Kx.isBuffer(t)||t instanceof kSr}var Vze=Object.create(wk());Vze.inherits=Nk();var kie=on("util"),Ur=void 0;kie&&kie.debuglog?Ur=kie.debuglog("stream"):Ur=function(){};var CSr=kze(),zze=yie(),Hb;Vze.inherits(Dn,xie);var Rie=["error","close","destroy","pause","resume"];function xSr(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):TSr(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Xze(t,e){$x=$x||Sw(),t=t||{};var r=e instanceof $x;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,i=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(s||s===0)?this.highWaterMark=s:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new CSr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Hb||(Hb=Tie().StringDecoder),this.decoder=new Hb(t.encoding),this.encoding=t.encoding)}function Dn(t){if($x=$x||Sw(),!(this instanceof Dn))return new Dn(t);this._readableState=new Xze(t,this),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),xie.call(this)}Object.defineProperty(Dn.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Dn.prototype.destroy=zze.destroy;Dn.prototype._undestroy=zze.undestroy;Dn.prototype._destroy=function(t,e){this.push(null),e(t)};Dn.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Kx.from(t,e),e=""),n=!0),Qze(this,t,e,!1,n)};Dn.prototype.unshift=function(t){return Qze(this,t,null,!0,!1)};function Qze(t,e,r,n,s){var i=t._readableState;if(e===null)i.reading=!1,qSr(t,i);else{var a;s||(a=MSr(i,e)),a?t.emit("error",a):i.objectMode||e&&e.length>0?(typeof e!="string"&&!i.objectMode&&Object.getPrototypeOf(e)!==Kx.prototype&&(e=RSr(e)),n?i.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):Aie(t,i,e,!0):i.ended?t.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Aie(t,i,e,!1):Yze(t,i)):Aie(t,i,e,!1))):n||(i.reading=!1)}return PSr(i)}function Aie(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&rH(t)),Yze(t,e)}function MSr(t,e){var r;return!ASr(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function PSr(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}Dn.prototype.isPaused=function(){return this._readableState.flowing===!1};Dn.prototype.setEncoding=function(t){return Hb||(Hb=Tie().StringDecoder),this._readableState.decoder=new Hb(t),this._readableState.encoding=t,this};var Gze=8388608;function OSr(t){return t>=Gze?t=Gze:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Hze(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=OSr(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Dn.prototype.read=function(t){Ur("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Ur("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Cie(this):rH(this),null;if(t=Hze(t,e),t===0&&e.ended)return e.length===0&&Cie(this),null;var n=e.needReadable;Ur("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,Ur("length less than watermark",n)),e.ended||e.reading?(n=!1,Ur("reading or ended",n)):n&&(Ur("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Hze(r,e)));var s;return t>0?s=Jze(t,e):s=null,s===null?(e.needReadable=!0,t=0):e.length-=t,e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Cie(this)),s!==null&&this.emit("data",s),s};function qSr(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,rH(t)}}function rH(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Ur("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?$b.nextTick($ze,t):$ze(t))}function $ze(t){Ur("emit readable"),t.emit("readable"),Mie(t)}function Yze(t,e){e.readingMore||(e.readingMore=!0,$b.nextTick(LSr,t,e))}function LSr(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Ur("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}Dn.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))};Dn.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,Ur("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,i=s?o:_;n.endEmitted?$b.nextTick(i):r.once("end",i),t.on("unpipe",a);function a(y,w){Ur("onunpipe"),y===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function o(){Ur("onend"),t.end()}var c=DSr(r);t.on("drain",c);var d=!1;function l(){Ur("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",_),r.removeListener("data",m),d=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&c()}var u=!1;r.on("data",m);function m(y){Ur("ondata"),u=!1;var w=t.write(y);w===!1&&!u&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Zze(n.pipes,t)!==-1)&&!d&&(Ur("false write response, pause",n.awaitDrain),n.awaitDrain++,u=!0),r.pause())}function f(y){Ur("onerror",y),_(),t.removeListener("error",f),Kze(t,"error")===0&&t.emit("error",y)}xSr(t,"error",f);function p(){t.removeListener("finish",g),_()}t.once("close",p);function g(){Ur("onfinish"),t.removeListener("close",p),_()}t.once("finish",g);function _(){Ur("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(Ur("pipe resume"),r.resume()),t};function DSr(t){return function(){var e=t._readableState;Ur("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&Kze(t,"data")&&(e.flowing=!0,Mie(t))}}Dn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=Zze(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Dn.prototype.on=function(t,e){var r=xie.prototype.on.call(this,t,e);if(t==="data")this._readableState.flowing!==!1&&this.resume();else if(t==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&rH(this):$b.nextTick(jSr,this))}return r};Dn.prototype.addListener=Dn.prototype.on;function jSr(t){Ur("readable nexttick read 0"),t.read(0)}Dn.prototype.resume=function(){var t=this._readableState;return t.flowing||(Ur("resume"),t.flowing=!0,USr(this,t)),this};function USr(t,e){e.resumeScheduled||(e.resumeScheduled=!0,$b.nextTick(BSr,t,e))}function BSr(t,e){e.reading||(Ur("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Mie(t),e.flowing&&!e.reading&&t.read(0)}Dn.prototype.pause=function(){return Ur("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ur("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Mie(t){var e=t._readableState;for(Ur("flow",e.flowing);e.flowing&&t.read()!==null;);}Dn.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(Ur("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(Ur("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=e.push(a);o||(n=!0,t.pause())}});for(var s in t)this[s]===void 0&&typeof t[s]=="function"&&(this[s]=(function(a){return function(){return t[a].apply(t,arguments)}})(s));for(var i=0;i<Rie.length;i++)t.on(Rie[i],this.emit.bind(this,Rie[i]));return this._read=function(a){Ur("wrapped _read",a),n&&(n=!1,t.resume())},this};Object.defineProperty(Dn.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Dn._fromList=Jze;function Jze(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.head.data:r=e.buffer.concat(e.length),e.buffer.clear()):r=FSr(t,e.buffer,e.decoder),r}function FSr(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):t===e.head.data.length?n=e.shift():n=r?WSr(t,e):GSr(t,e),n}function WSr(t,e){var r=e.head,n=1,s=r.data;for(t-=s.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(a===i.length?s+=i:s+=i.slice(0,t),t-=a,t===0){a===i.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=i.slice(a));break}++n}return e.length-=n,s}function GSr(t,e){var r=Kx.allocUnsafe(t),n=e.head,s=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var i=n.data,a=t>i.length?i.length:t;if(i.copy(r,r.length-t,0,a),t-=a,t===0){a===i.length?(++s,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=i.slice(a));break}++s}return e.length-=s,r}function Cie(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,$b.nextTick(HSr,e,t))}function HSr(t,e){!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Zze(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Pie=ke((Uvs,n4e)=>{"use strict";n4e.exports=Nf;var nH=Sw(),r4e=Object.create(wk());r4e.inherits=Nk();r4e.inherits(Nf,nH);function $Sr(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Nf(t){if(!(this instanceof Nf))return new Nf(t);nH.call(this,t),this._transformState={afterTransform:$Sr.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",KSr)}function KSr(){var t=this;typeof this._flush=="function"?this._flush(function(e,r){t4e(t,e,r)}):t4e(this,null,null)}Nf.prototype.push=function(t,e){return this._transformState.needTransform=!1,nH.prototype.push.call(this,t,e)};Nf.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")};Nf.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Nf.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Nf.prototype._destroy=function(t,e){var r=this;nH.prototype._destroy.call(this,t,function(n){e(n),r.emit("close")})};function t4e(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}});var o4e=ke((Bvs,a4e)=>{"use strict";a4e.exports=Vx;var s4e=Pie(),i4e=Object.create(wk());i4e.inherits=Nk();i4e.inherits(Vx,s4e);function Vx(t){if(!(this instanceof Vx))return new Vx(t);s4e.call(this,t)}Vx.prototype._transform=function(t,e,r){r(null,t)}});var c4e=ke((Ji,sH)=>{var Hu=on("stream");process.env.READABLE_STREAM==="disable"&&Hu?(sH.exports=Hu,Ji=sH.exports=Hu.Readable,Ji.Readable=Hu.Readable,Ji.Writable=Hu.Writable,Ji.Duplex=Hu.Duplex,Ji.Transform=Hu.Transform,Ji.PassThrough=Hu.PassThrough,Ji.Stream=Hu):(Ji=sH.exports=bie(),Ji.Stream=Hu||Ji,Ji.Readable=Ji,Ji.Writable=Nie(),Ji.Duplex=Sw(),Ji.Transform=Pie(),Ji.PassThrough=o4e())});var l4e=ke((Fvs,d4e)=>{d4e.exports=c4e().PassThrough});var p4e=ke((Wvs,f4e)=>{var u4e=on("util"),oH=l4e();f4e.exports={Readable:iH,Writable:aH};u4e.inherits(iH,oH);u4e.inherits(aH,oH);function m4e(t,e,r){t[e]=function(){return delete t[e],r.apply(this,arguments),this[e].apply(this,arguments)}}function iH(t,e){if(!(this instanceof iH))return new iH(t,e);oH.call(this,e),m4e(this,"_read",function(){var r=t.call(this,e),n=this.emit.bind(this,"error");r.on("error",n),r.pipe(this)}),this.emit("readable")}function aH(t,e){if(!(this instanceof aH))return new aH(t,e);oH.call(this,e),m4e(this,"_write",function(){var r=t.call(this,e),n=this.emit.bind(this,"error");r.on("error",n),this.pipe(r)}),this.emit("writable")}});var Qst=ke((W3s,Xst)=>{function zst(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}zst.prototype.encode=function(){var t=new Buffer(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var e=0,r=3*this.width+this.extraBytes,n=0;n<this.height;n++){for(var s=0;s<this.width;s++){var i=this.pos+n*r+s*3;e++,t[i]=this.buffer[e++],t[i+1]=this.buffer[e++],t[i+2]=this.buffer[e++]}if(this.extraBytes>0){var a=this.pos+n*r+this.width*3;t.fill(0,a,a+this.extraBytes)}}return t};Xst.exports=function(t,e){typeof e>"u"&&(e=100);var r=new zst(t),n=r.encode();return{data:n,width:t.width,height:t.height}}});var Jst=ke((G3s,Yst)=>{function Dl(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),this.flag!="BM")throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}Dl.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++);this.palette[e]={red:s,green:n,blue:r,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)};Dl.prototype.parseRGBA=function(){var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[t]()};Dl.prototype.bit1=function(){for(var t=Math.ceil(this.width/8),e=t%4,r=this.height>=0?this.height-1:-this.height,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,s=0;s<t;s++)for(var i=this.buffer.readUInt8(this.pos++),a=n*this.width*4+s*8*4,o=0;o<8&&s*8+o<this.width;o++){var c=this.palette[i>>7-o&1];this.data[a+o*4]=0,this.data[a+o*4+1]=c.blue,this.data[a+o*4+2]=c.green,this.data[a+o*4+3]=c.red}e!=0&&(this.pos+=4-e)}};Dl.prototype.bit4=function(){if(this.compress==2){let _=function(y){var w=this.palette[y];this.data[t]=0,this.data[t+1]=w.blue,this.data[t+2]=w.green,this.data[t+3]=w.red,t+=4};var g=_;this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t<this.data.length;){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++);if(n==0)if(s==0){this.bottom_up?e--:e++,t=e*this.width*4,r=!1;continue}else{if(s==1)break;if(s==2){var i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=a:e+=a,t+=a*this.width*4+i*4}else{for(var o=this.buffer.readUInt8(this.pos++),c=0;c<s;c++)r?_.call(this,o&15):_.call(this,(o&240)>>4),c&1&&c+1<s&&(o=this.buffer.readUInt8(this.pos++)),r=!r;(s+1>>1&1)==1&&this.pos++}}else for(var c=0;c<n;c++)r?_.call(this,s&15):_.call(this,(s&240)>>4),r=!r}}else for(var d=Math.ceil(this.width/2),l=d%4,a=this.height-1;a>=0;a--){for(var u=this.bottom_up?a:this.height-1-a,i=0;i<d;i++){var s=this.buffer.readUInt8(this.pos++),t=u*this.width*4+i*2*4,m=s>>4,f=s&15,p=this.palette[m];if(this.data[t]=0,this.data[t+1]=p.blue,this.data[t+2]=p.green,this.data[t+3]=p.red,i*2+1>=this.width)break;p=this.palette[f],this.data[t+4]=0,this.data[t+4+1]=p.blue,this.data[t+4+2]=p.green,this.data[t+4+3]=p.red}l!=0&&(this.pos+=4-l)}};Dl.prototype.bit8=function(){if(this.compress==1){let m=function(f){var p=this.palette[f];this.data[t]=0,this.data[t+1]=p.blue,this.data[t+2]=p.green,this.data[t+3]=p.red,t+=4};var u=m;this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t<this.data.length;){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);if(r==0)if(n==0){this.bottom_up?e--:e++,t=e*this.width*4;continue}else{if(n==1)break;if(n==2){var s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=i:e+=i,t+=i*this.width*4+s*4}else{for(var a=0;a<n;a++){var o=this.buffer.readUInt8(this.pos++);m.call(this,o)}n&!0&&this.pos++}}else for(var a=0;a<r;a++)m.call(this,n)}}else for(var c=this.width%4,i=this.height-1;i>=0;i--){for(var d=this.bottom_up?i:this.height-1-i,s=0;s<this.width;s++){var n=this.buffer.readUInt8(this.pos++),t=d*this.width*4+s*4;if(n<this.palette.length){var l=this.palette[n];this.data[t]=0,this.data[t+1]=l.blue,this.data[t+2]=l.green,this.data[t+3]=l.red}else this.data[t]=0,this.data[t+1]=255,this.data[t+2]=255,this.data[t+3]=255}c!=0&&(this.pos+=4-c)}};Dl.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),r=e,n=this.height-1;n>=0;n--){for(var s=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(a&r)/r*255|0,c=(a>>5&r)/r*255|0,d=(a>>10&r)/r*255|0,l=a>>15?255:0,u=s*this.width*4+i*4;this.data[u]=l,this.data[u+1]=o,this.data[u+2]=c,this.data[u+3]=d}this.pos+=t}};Dl.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,this.compress==3&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,this.maskBlue>>r&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var n=this.height-1;n>=0;n--){for(var s=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(a&this.maskBlue)<<e[0],c=(a&this.maskGreen)>>e[1],d=(a&this.maskRed)>>e[2],l=s*this.width*4+i*4;this.data[l]=0,this.data[l+1]=o,this.data[l+2]=c,this.data[l+3]=d}this.pos+=t}};Dl.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=e*this.width*4+r*4;this.data[a]=0,this.data[a+1]=n,this.data[a+2]=s,this.data[a+3]=i}this.pos+=this.width%4}};Dl.prototype.bit32=function(){if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4;for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),o=e*this.width*4+r*4;this.data[o]=n,this.data[o+1]=s,this.data[o+2]=i,this.data[o+3]=a}}else for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=e*this.width*4+r*4;this.data[o]=n,this.data[o+1]=s,this.data[o+2]=i,this.data[o+3]=a}};Dl.prototype.getData=function(){return this.data};Yst.exports=function(t){var e=new Dl(t);return e}});var eit=ke((H3s,Zst)=>{var iYr=Qst(),aYr=Jst();Zst.exports={encode:iYr,decode:aYr}});var Wt=ke((sti,Nct)=>{Nct.exports={options:{usePureJavaScript:!1}}});var bct=ke((iti,vct)=>{var Wfe={};vct.exports=Wfe;var Sct={};Wfe.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=Zrn(t,e);else{var s=0,i=e.length,a=e.charAt(0),o=[0];for(s=0;s<t.length;++s){for(var c=0,d=t[s];c<o.length;++c)d+=o[c]<<8,o[c]=d%i,d=d/i|0;for(;d>0;)o.push(d%i),d=d/i|0}for(s=0;t[s]===0&&s<t.length-1;++s)n+=a;for(s=o.length-1;s>=0;--s)n+=e[o[s]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r
2
+ import{a as lTe,b as tD,c as Io,d as CS,e as xS,f as rD,g as hu,h as nD,i as j_}from"./chunk-4ESEMCSG.js";import{a as uTe,b as sD,c as mTe}from"./chunk-EFVDRFCG.js";import{$ as W,$a as NQ,$b as Vbe,$c as VL,$d as ES,$e as MEe,A as mu,Aa as Xve,Ab as xbe,Ac as Yr,Ad as bo,Ae as uEe,Af as XEe,B as AL,Ba as Qve,Bb as Mbe,Bc as rc,Bd as XL,Be as mEe,Bf as QEe,C as hve,Ca as PL,Cb as Pbe,Cc as Jn,Cd as kIe,Ce as fEe,Cf as D_,D as gve,Da as Yve,Db as Obe,Dc as Rs,Dd as RIe,De as pEe,Df as YEe,E as _ve,Ea as Jve,Eb as qbe,Ec as kr,Ed as AIe,Ee as hEe,Ef as JEe,F as U,Fa as Zve,Fb as Lbe,Fc as je,Fd as CIe,Fe as q_,Ff as ZEe,G as yve,Ga as OL,Gb as Dbe,Gc as ye,Gd as pu,Ge as gEe,Gf as eTe,H as wve,Ha as ebe,Hb as jbe,Hc as hn,Hd as xIe,He as _Ee,Hf as tTe,I as Nve,Ia as qL,Ic as nc,Id as MIe,Ie as yEe,If as rTe,J as A,Ja as wQ,Jb as Ube,Jc as C_,Jd as PIe,Je as wEe,Jf as nTe,K as Sve,Ka as tbe,Kb as Bbe,Kc as ed,Kd as bS,Ke as NEe,Kf as sTe,L as vve,La as rbe,Lb as Fbe,Lc as TQ,Ld as OIe,Le as MQ,Lf as iTe,M as bve,Ma as nbe,Mb as Wbe,Mc as nIe,Md as qIe,Me as SEe,Mf as aTe,N as CL,Na as sbe,Nb as WL,Nc as sIe,Nd as LIe,Ne as vEe,Nf as oTe,O as xL,Oa as ibe,Ob as GL,Oc as Pa,Od as DIe,Oe as Tk,Of as cTe,P as pQ,Pa as abe,Pb as _0t,Pc as sc,Pd as jIe,Pe as bEe,Pf as jQ,Q as Ive,Qa as obe,Qb as wk,Qc as iIe,Qd as CQ,Qe as IEe,R as Eve,Ra as cbe,Rb as Nk,Rc as aIe,Rd as UIe,Re as EEe,S as rt,Sa as dbe,Sb as y0t,Sc as oIe,Sd as BIe,Se as TEe,T as Tve,Ta as lbe,Tb as Qm,Tc as cIe,Td as FIe,Te as L_,U as fu,Ua as Qt,Ub as Gbe,Uc as $L,Ud as WIe,Ue as kEe,V as xve,Va as No,Vb as Hbe,Vc as vk,Vd as GIe,Ve as REe,W as Mve,Wa as Ts,Wb as $be,Wc as kQ,Wd as QL,We as AEe,X as Pve,Xa as ks,Xb as NS,Xc as KL,Xd as HIe,Xe as CEe,Y as Ove,Ya as LL,Yb as HL,Yc as dIe,Yd as IS,Ye as JL,Z as hS,Za as yS,Zb as SQ,Zc as SS,Zd as $Ie,Ze as xEe,_ as qve,_a as ube,_b as Kbe,_c as x_,_d as Ek,_e as ZL,a as gk,aa as Lve,ab as DL,ac as zbe,ad as lIe,ae as KIe,af as RS,b as g0t,ba as Dve,bb as mbe,bc as Xbe,bd as M_,be as Oa,bf as PEe,c as tve,ca as jve,cb as Xm,cc as Pn,cd as zL,ce as VIe,cf as td,da as hQ,db as fbe,dc as Qbe,dd as P_,de as TS,df as AS,e as rve,ea as Uve,eb as jL,ec as Sk,ed as uIe,ee as kS,ef as PQ,f as nve,fa as Bve,fb as pbe,fc as Ybe,fd as mIe,fe as zIe,ff as OEe,g as Yd,ga as wo,gb as wS,gc as Jbe,gd as fIe,ge as YL,gf as qEe,h as uQ,ha as Jd,hb as UL,hc as vQ,hd as pIe,he as XIe,hf as LEe,i as sve,ia as Qr,ib as hbe,ic as Zbe,id as hIe,ie as QIe,if as DEe,j as ive,ja as Xt,jb as gbe,jc as Vi,jd as gIe,je as YIe,jf as jEe,k as fS,ka as gQ,kb as _be,kc as R_,kd as vS,ke as xQ,kf as UEe,la as Fve,lb as ybe,lc as A_,ld as bk,le as JIe,lf as eD,ma as Wve,mb as wbe,mc as eIe,md as RQ,me as ZIe,mf as OQ,na as _k,nb as Nbe,nc as tIe,nd as _Ie,ne as eEe,nf as kk,oa as Gve,ob as Sbe,oc as bQ,od as yIe,oe as tEe,of as qQ,p as ave,pa as Hve,pb as BL,pc as rIe,pd as wIe,pe as Jm,pf as LQ,qa as $ve,qb as vbe,qc as Me,qd as NIe,qe as rEe,qf as BEe,r as lve,ra as Kve,rb as bbe,rc as re,rd as SIe,re as nEe,rf as FEe,s as uve,sa as ML,sb as Ibe,sc as Ym,sd as vIe,se as Js,sf as WEe,t as mve,ta as yk,tb as Ebe,tc as Be,td as Ik,te as sEe,tf as GEe,ua as Vve,ub as Tbe,uc as So,ud as bIe,ue as iEe,uf as HEe,v as kL,va as gS,vb as kbe,vc as Zd,vd as O_,ve as aEe,vf as $Ee,w as RL,wa as _Q,wb as Rbe,wc as IQ,wd as IIe,we as oEe,wf as DQ,x as fve,xa as zve,xb as FL,xc as vo,xd as EIe,xe as cEe,xf as KEe,y as pve,ya as yQ,yb as Abe,yc as EQ,yd as TIe,ye as dEe,yf as VEe,z as Gr,za as _S,zb as Cbe,zc as el,zd as AQ,ze as lEe,zf as zEe}from"./chunk-OIBREUNQ.js";import{d as JSe,e as ZSe,f as EL,g as TL,h as lQ,i as eve,l as mQ}from"./chunk-JVKXU2EF.js";import{a as dTe}from"./chunk-N55ACUNK.js";import{c as YSe,g as bL}from"./chunk-CF3YFDG4.js";import{a as dQ}from"./chunk-PRXIML4F.js";import{a as IL,b as Ip}from"./chunk-FKQFVOLR.js";import{b as pS}from"./chunk-X4N2MWNJ.js";import{c as Cve}from"./chunk-HVP63X6W.js";import{f as ove,r as fQ,t as cve,v as dve}from"./chunk-S6GSNWAM.js";import{a as Rve,b as Ave}from"./chunk-UJCQHSQD.js";import{a as kve}from"./chunk-G64EFDMH.js";import{a as fTe}from"./chunk-4Y64C4JT.js";import{a as h0t}from"./chunk-HQ2U4QVQ.js";import{a as Y8,e as _Se,f as ySe,g as wSe,j as cQ,l as hk,q as QSe}from"./chunk-EM6SRMJ6.js";import{Ba as Sp,Ca as In,D as vSe,F as bSe,Ga as fL,Ia as Hm,J as uk,Ja as OSe,K as ISe,Ma as qSe,Na as E_,Oa as LSe,P as ESe,Pa as Zc,Ra as T_,Sa as $m,T as mk,Ua as DSe,V as tc,W as TSe,a as wp,aa as kSe,ab as zm,b as J8,ba as RSe,bb as zSe,c as NSe,cb as k_,d as uS,da as ASe,db as aQ,e as Ut,eb as oQ,ha as bt,i as Z8,ia as Kt,j as cL,ja as Np,k as dL,ka as xa,kb as XSe,l as Ki,la as CSe,m as SSe,n as mS,na as xSe,o as Es,oa as lL,p as eQ,va as MSe,w as tQ,wa as uL,x as rQ,xa as mL,ya as PSe}from"./chunk-GN5KQHOZ.js";import{$ as vL,E as _L,G as FSe,H as nQ,I as sQ,J as WSe,K as yL,L as wL,O as GSe,P as HSe,Q as $Se,R as NL,S as KSe,X as bp,Y as SL,Z as VSe,_ as iQ,a as jSe,b as USe,d as pL,k as vi,l as Km,m as hL,n as vp,o as fk,p as BSe,q as gL,r as pk,s as Ma,z as Vm}from"./chunk-Z4VKGZFA.js";import{a as on,c as ke,e as jr}from"./chunk-D76SO2ME.js";var s1e=ke((dos,G1)=>{var n1e=n1e||function(t){return Buffer.from(t).toString("base64")};function lcr(t){var e=this,r=Math.round,n=Math.floor,s=new Array(64),i=new Array(64),a=new Array(64),o=new Array(64),c,d,l,u,m=new Array(65535),f=new Array(65535),p=new Array(64),g=new Array(64),_=[],y=0,w=7,N=new Array(64),v=new Array(64),S=new Array(64),b=new Array(256),E=new Array(2048),j,B=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],F=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],X=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Y=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],ae=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],te=[0,1,2,3,4,5,6,7,8,9,10,11],_e=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],ce=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Re(se){for(var ot=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],wt=0;wt<64;wt++){var pt=n((ot[wt]*se+50)/100);pt<1?pt=1:pt>255&&(pt=255),s[B[wt]]=pt}for(var Pt=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Dt=0;Dt<64;Dt++){var Er=n((Pt[Dt]*se+50)/100);Er<1?Er=1:Er>255&&(Er=255),i[B[Dt]]=Er}for(var Tr=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Vn=0,bn=0;bn<8;bn++)for(var Se=0;Se<8;Se++)a[Vn]=1/(s[B[Vn]]*Tr[bn]*Tr[Se]*8),o[Vn]=1/(i[B[Vn]]*Tr[bn]*Tr[Se]*8),Vn++}function Ie(se,ot){for(var wt=0,pt=0,Pt=new Array,Dt=1;Dt<=16;Dt++){for(var Er=1;Er<=se[Dt];Er++)Pt[ot[pt]]=[],Pt[ot[pt]][0]=wt,Pt[ot[pt]][1]=Dt,pt++,wt++;wt*=2}return Pt}function be(){c=Ie(F,$),d=Ie(ae,te),l=Ie(X,Y),u=Ie(_e,ce)}function Ve(){for(var se=1,ot=2,wt=1;wt<=15;wt++){for(var pt=se;pt<ot;pt++)f[32767+pt]=wt,m[32767+pt]=[],m[32767+pt][1]=wt,m[32767+pt][0]=pt;for(var Pt=-(ot-1);Pt<=-se;Pt++)f[32767+Pt]=wt,m[32767+Pt]=[],m[32767+Pt][1]=wt,m[32767+Pt][0]=ot-1+Pt;se<<=1,ot<<=1}}function ve(){for(var se=0;se<256;se++)E[se]=19595*se,E[se+256>>0]=38470*se,E[se+512>>0]=7471*se+32768,E[se+768>>0]=-11059*se,E[se+1024>>0]=-21709*se,E[se+1280>>0]=32768*se+8421375,E[se+1536>>0]=-27439*se,E[se+1792>>0]=-5329*se}function fe(se){for(var ot=se[0],wt=se[1]-1;wt>=0;)ot&1<<wt&&(y|=1<<w),wt--,w--,w<0&&(y==255?(Q(255),Q(0)):Q(y),w=7,y=0)}function Q(se){_.push(se)}function de(se){Q(se>>8&255),Q(se&255)}function Le(se,ot){var wt,pt,Pt,Dt,Er,Tr,Vn,bn,Se=0,Ze,Rt=8,Gn=64;for(Ze=0;Ze<Rt;++Ze){wt=se[Se],pt=se[Se+1],Pt=se[Se+2],Dt=se[Se+3],Er=se[Se+4],Tr=se[Se+5],Vn=se[Se+6],bn=se[Se+7];var jt=wt+bn,sr=wt-bn,an=pt+Vn,vt=pt-Vn,Dr=Pt+Tr,$i=Pt-Tr,Mn=Dt+Er,Jc=Dt-Er,uu=jt+Mn,I_=jt-Mn,dS=an+Dr,lS=an-Dr;se[Se]=uu+dS,se[Se+4]=uu-dS;var sk=(lS+I_)*.707106781;se[Se+2]=I_+sk,se[Se+6]=I_-sk,uu=Jc+$i,dS=$i+vt,lS=vt+sr;var ik=(uu-lS)*.382683433,sL=.5411961*uu+ik,ak=1.306562965*lS+ik,ok=dS*.707106781,ck=sr+ok,dk=sr-ok;se[Se+5]=dk+sL,se[Se+3]=dk-sL,se[Se+1]=ck+ak,se[Se+7]=ck-ak,Se+=8}for(Se=0,Ze=0;Ze<Rt;++Ze){wt=se[Se],pt=se[Se+8],Pt=se[Se+16],Dt=se[Se+24],Er=se[Se+32],Tr=se[Se+40],Vn=se[Se+48],bn=se[Se+56];var sSe=wt+bn,X8=wt-bn,iSe=pt+Vn,aSe=pt-Vn,oSe=Pt+Tr,cSe=Pt-Tr,dSe=Dt+Er,p0t=Dt-Er,lk=sSe+dSe,Q8=sSe-dSe,iL=iSe+oSe,aL=iSe-oSe;se[Se]=lk+iL,se[Se+32]=lk-iL;var lSe=(aL+Q8)*.707106781;se[Se+16]=Q8+lSe,se[Se+48]=Q8-lSe,lk=p0t+cSe,iL=cSe+aSe,aL=aSe+X8;var uSe=(lk-aL)*.382683433,mSe=.5411961*lk+uSe,fSe=1.306562965*aL+uSe,pSe=iL*.707106781,hSe=X8+pSe,gSe=X8-pSe;se[Se+40]=gSe+mSe,se[Se+24]=gSe-mSe,se[Se+8]=hSe+fSe,se[Se+56]=hSe-fSe,Se++}var oL;for(Ze=0;Ze<Gn;++Ze)oL=se[Ze]*ot[Ze],p[Ze]=oL>0?oL+.5|0:oL-.5|0;return p}function Pe(){de(65504),de(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),de(1),de(1),Q(0),Q(0)}function Ae(se){if(se){de(65505),se[0]===69&&se[1]===120&&se[2]===105&&se[3]===102?de(se.length+2):(de(se.length+5+2),Q(69),Q(120),Q(105),Q(102),Q(0));for(var ot=0;ot<se.length;ot++)Q(se[ot])}}function We(se,ot){de(65472),de(17),Q(8),de(ot),de(se),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)}function ze(){de(65499),de(132),Q(0);for(var se=0;se<64;se++)Q(s[se]);Q(1);for(var ot=0;ot<64;ot++)Q(i[ot])}function Te(){de(65476),de(418),Q(0);for(var se=0;se<16;se++)Q(F[se+1]);for(var ot=0;ot<=11;ot++)Q($[ot]);Q(16);for(var wt=0;wt<16;wt++)Q(X[wt+1]);for(var pt=0;pt<=161;pt++)Q(Y[pt]);Q(1);for(var Pt=0;Pt<16;Pt++)Q(ae[Pt+1]);for(var Dt=0;Dt<=11;Dt++)Q(te[Dt]);Q(17);for(var Er=0;Er<16;Er++)Q(_e[Er+1]);for(var Tr=0;Tr<=161;Tr++)Q(ce[Tr])}function Ne(se){typeof se>"u"||se.constructor!==Array||se.forEach(ot=>{if(typeof ot=="string"){de(65534);var wt=ot.length;de(wt+2);var pt;for(pt=0;pt<wt;pt++)Q(ot.charCodeAt(pt))}})}function kt(){de(65498),de(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0)}function Je(se,ot,wt,pt,Pt){for(var Dt=Pt[0],Er=Pt[240],Tr,Vn=16,bn=63,Se=64,Ze=Le(se,ot),Rt=0;Rt<Se;++Rt)g[B[Rt]]=Ze[Rt];var Gn=g[0]-wt;wt=g[0],Gn==0?fe(pt[0]):(Tr=32767+Gn,fe(pt[f[Tr]]),fe(m[Tr]));for(var jt=63;jt>0&&g[jt]==0;jt--);if(jt==0)return fe(Dt),wt;for(var sr=1,an;sr<=jt;){for(var vt=sr;g[sr]==0&&sr<=jt;++sr);var Dr=sr-vt;if(Dr>=Vn){an=Dr>>4;for(var $i=1;$i<=an;++$i)fe(Er);Dr=Dr&15}Tr=32767+g[sr],fe(Pt[(Dr<<4)+f[Tr]]),fe(m[Tr]),sr++}return jt!=bn&&fe(Dt),wt}function it(){for(var se=String.fromCharCode,ot=0;ot<256;ot++)b[ot]=se(ot)}this.encode=function(se,ot){var wt=new Date().getTime();ot&&Yc(ot),_=new Array,y=0,w=7,de(65496),Pe(),Ne(se.comments),Ae(se.exifBuffer),ze(),We(se.width,se.height),Te(),kt();var pt=0,Pt=0,Dt=0;y=0,w=7,this.encode.displayName="_encode_";for(var Er=se.data,Tr=se.width,Vn=se.height,bn=Tr*4,Se=Tr*3,Ze,Rt=0,Gn,jt,sr,an,vt,Dr,$i,Mn;Rt<Vn;){for(Ze=0;Ze<bn;){for(an=bn*Rt+Ze,vt=an,Dr=-1,$i=0,Mn=0;Mn<64;Mn++)$i=Mn>>3,Dr=(Mn&7)*4,vt=an+$i*bn+Dr,Rt+$i>=Vn&&(vt-=bn*(Rt+1+$i-Vn)),Ze+Dr>=bn&&(vt-=Ze+Dr-bn+4),Gn=Er[vt++],jt=Er[vt++],sr=Er[vt++],N[Mn]=(E[Gn]+E[jt+256>>0]+E[sr+512>>0]>>16)-128,v[Mn]=(E[Gn+768>>0]+E[jt+1024>>0]+E[sr+1280>>0]>>16)-128,S[Mn]=(E[Gn+1280>>0]+E[jt+1536>>0]+E[sr+1792>>0]>>16)-128;pt=Je(N,a,pt,c,l),Pt=Je(v,o,Pt,d,u),Dt=Je(S,o,Dt,d,u),Ze+=32}Rt+=8}if(w>=0){var Jc=[];Jc[1]=w+1,Jc[0]=(1<<w+1)-1,fe(Jc)}if(de(65497),typeof G1>"u")return new Uint8Array(_);return Buffer.from(_);var uu,I_};function Yc(se){if(se<=0&&(se=1),se>100&&(se=100),j!=se){var ot=0;se<50?ot=Math.floor(5e3/se):ot=Math.floor(200-se*2),Re(ot),j=se}}function Qd(){var se=new Date().getTime();t||(t=50),it(),be(),Ve(),ve(),Yc(t);var ot=new Date().getTime()-se}Qd()}typeof G1<"u"?G1.exports=r1e:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=r1e);function r1e(t,e){typeof e>"u"&&(e=50);var r=new lcr(e),n=r.encode(t,e);return{data:n,width:t.width,height:t.height}}});var a1e=ke((los,Dre)=>{var Lre=(function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,n=799,s=3406,i=2276,a=1567,o=3784,c=5793,d=2896;function l(){}function u(w,N){for(var v=0,S=[],b,E,j=16;j>0&&!w[j-1];)j--;S.push({children:[],index:0});var B=S[0],F;for(b=0;b<j;b++){for(E=0;E<w[b];E++){for(B=S.pop(),B.children[B.index]=N[v];B.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");B=S.pop()}for(B.index++,S.push(B);S.length<=b;)S.push(F={children:[],index:0}),B.children[B.index]=F.children,B=F;v++}b+1<j&&(S.push(F={children:[],index:0}),B.children[B.index]=F.children,B=F)}return S[0].children}function m(w,N,v,S,b,E,j,B,F,$){var X=v.precision,Y=v.samplesPerLine,ae=v.scanLines,te=v.mcusPerLine,_e=v.progressive,ce=v.maxH,Re=v.maxV,Ie=N,be=0,Ve=0;function ve(){if(Ve>0)return Ve--,be>>Ve&1;if(be=w[N++],be==255){var Se=w[N++];if(Se)throw new Error("unexpected marker: "+(be<<8|Se).toString(16))}return Ve=7,be>>>7}function fe(Se){for(var Ze=Se,Rt;(Rt=ve())!==null;){if(Ze=Ze[Rt],typeof Ze=="number")return Ze;if(typeof Ze!="object")throw new Error("invalid huffman sequence")}return null}function Q(Se){for(var Ze=0;Se>0;){var Rt=ve();if(Rt===null)return;Ze=Ze<<1|Rt,Se--}return Ze}function de(Se){var Ze=Q(Se);return Ze>=1<<Se-1?Ze:Ze+(-1<<Se)+1}function Le(Se,Ze){var Rt=fe(Se.huffmanTableDC),Gn=Rt===0?0:de(Rt);Ze[0]=Se.pred+=Gn;for(var jt=1;jt<64;){var sr=fe(Se.huffmanTableAC),an=sr&15,vt=sr>>4;if(an===0){if(vt<15)break;jt+=16;continue}jt+=vt;var Dr=e[jt];Ze[Dr]=de(an),jt++}}function Pe(Se,Ze){var Rt=fe(Se.huffmanTableDC),Gn=Rt===0?0:de(Rt)<<F;Ze[0]=Se.pred+=Gn}function Ae(Se,Ze){Ze[0]|=ve()<<F}var We=0;function ze(Se,Ze){if(We>0){We--;return}for(var Rt=E,Gn=j;Rt<=Gn;){var jt=fe(Se.huffmanTableAC),sr=jt&15,an=jt>>4;if(sr===0){if(an<15){We=Q(an)+(1<<an)-1;break}Rt+=16;continue}Rt+=an;var vt=e[Rt];Ze[vt]=de(sr)*(1<<F),Rt++}}var Te=0,Ne;function kt(Se,Ze){for(var Rt=E,Gn=j,jt=0;Rt<=Gn;){var sr=e[Rt],an=Ze[sr]<0?-1:1;switch(Te){case 0:var vt=fe(Se.huffmanTableAC),Dr=vt&15,jt=vt>>4;if(Dr===0)jt<15?(We=Q(jt)+(1<<jt),Te=4):(jt=16,Te=1);else{if(Dr!==1)throw new Error("invalid ACn encoding");Ne=de(Dr),Te=jt?2:3}continue;case 1:case 2:Ze[sr]?Ze[sr]+=(ve()<<F)*an:(jt--,jt===0&&(Te=Te==2?3:0));break;case 3:Ze[sr]?Ze[sr]+=(ve()<<F)*an:(Ze[sr]=Ne<<F,Te=0);break;case 4:Ze[sr]&&(Ze[sr]+=(ve()<<F)*an);break}Rt++}Te===4&&(We--,We===0&&(Te=0))}function Je(Se,Ze,Rt,Gn,jt){var sr=Rt/te|0,an=Rt%te,vt=sr*Se.v+Gn,Dr=an*Se.h+jt;Se.blocks[vt]===void 0&&$.tolerantDecoding||Ze(Se,Se.blocks[vt][Dr])}function it(Se,Ze,Rt){var Gn=Rt/Se.blocksPerLine|0,jt=Rt%Se.blocksPerLine;Se.blocks[Gn]===void 0&&$.tolerantDecoding||Ze(Se,Se.blocks[Gn][jt])}var Yc=S.length,Qd,se,ot,wt,pt,Pt;_e?E===0?Pt=B===0?Pe:Ae:Pt=B===0?ze:kt:Pt=Le;var Dt=0,Er,Tr;Yc==1?Tr=S[0].blocksPerLine*S[0].blocksPerColumn:Tr=te*v.mcusPerColumn,b||(b=Tr);for(var Vn,bn;Dt<Tr;){for(se=0;se<Yc;se++)S[se].pred=0;if(We=0,Yc==1)for(Qd=S[0],pt=0;pt<b;pt++)it(Qd,Pt,Dt),Dt++;else for(pt=0;pt<b;pt++){for(se=0;se<Yc;se++)for(Qd=S[se],Vn=Qd.h,bn=Qd.v,ot=0;ot<bn;ot++)for(wt=0;wt<Vn;wt++)Je(Qd,Pt,Dt,ot,wt);if(Dt++,Dt===Tr)break}if(Dt===Tr)do{if(w[N]===255&&w[N+1]!==0)break;N+=1}while(N<w.length-2);if(Ve=0,Er=w[N]<<8|w[N+1],Er<65280)throw new Error("marker was not found");if(Er>=65488&&Er<=65495)N+=2;else break}return N-Ie}function f(w,N){var v=[],S=N.blocksPerLine,b=N.blocksPerColumn,E=S<<3,j=new Int32Array(64),B=new Uint8Array(64);function F(Ie,be,Ve){var ve=N.quantizationTable,fe,Q,de,Le,Pe,Ae,We,ze,Te,Ne=Ve,kt;for(kt=0;kt<64;kt++)Ne[kt]=Ie[kt]*ve[kt];for(kt=0;kt<8;++kt){var Je=8*kt;if(Ne[1+Je]==0&&Ne[2+Je]==0&&Ne[3+Je]==0&&Ne[4+Je]==0&&Ne[5+Je]==0&&Ne[6+Je]==0&&Ne[7+Je]==0){Te=c*Ne[0+Je]+512>>10,Ne[0+Je]=Te,Ne[1+Je]=Te,Ne[2+Je]=Te,Ne[3+Je]=Te,Ne[4+Je]=Te,Ne[5+Je]=Te,Ne[6+Je]=Te,Ne[7+Je]=Te;continue}fe=c*Ne[0+Je]+128>>8,Q=c*Ne[4+Je]+128>>8,de=Ne[2+Je],Le=Ne[6+Je],Pe=d*(Ne[1+Je]-Ne[7+Je])+128>>8,ze=d*(Ne[1+Je]+Ne[7+Je])+128>>8,Ae=Ne[3+Je]<<4,We=Ne[5+Je]<<4,Te=fe-Q+1>>1,fe=fe+Q+1>>1,Q=Te,Te=de*o+Le*a+128>>8,de=de*a-Le*o+128>>8,Le=Te,Te=Pe-We+1>>1,Pe=Pe+We+1>>1,We=Te,Te=ze+Ae+1>>1,Ae=ze-Ae+1>>1,ze=Te,Te=fe-Le+1>>1,fe=fe+Le+1>>1,Le=Te,Te=Q-de+1>>1,Q=Q+de+1>>1,de=Te,Te=Pe*i+ze*s+2048>>12,Pe=Pe*s-ze*i+2048>>12,ze=Te,Te=Ae*n+We*r+2048>>12,Ae=Ae*r-We*n+2048>>12,We=Te,Ne[0+Je]=fe+ze,Ne[7+Je]=fe-ze,Ne[1+Je]=Q+We,Ne[6+Je]=Q-We,Ne[2+Je]=de+Ae,Ne[5+Je]=de-Ae,Ne[3+Je]=Le+Pe,Ne[4+Je]=Le-Pe}for(kt=0;kt<8;++kt){var it=kt;if(Ne[8+it]==0&&Ne[16+it]==0&&Ne[24+it]==0&&Ne[32+it]==0&&Ne[40+it]==0&&Ne[48+it]==0&&Ne[56+it]==0){Te=c*Ve[kt+0]+8192>>14,Ne[0+it]=Te,Ne[8+it]=Te,Ne[16+it]=Te,Ne[24+it]=Te,Ne[32+it]=Te,Ne[40+it]=Te,Ne[48+it]=Te,Ne[56+it]=Te;continue}fe=c*Ne[0+it]+2048>>12,Q=c*Ne[32+it]+2048>>12,de=Ne[16+it],Le=Ne[48+it],Pe=d*(Ne[8+it]-Ne[56+it])+2048>>12,ze=d*(Ne[8+it]+Ne[56+it])+2048>>12,Ae=Ne[24+it],We=Ne[40+it],Te=fe-Q+1>>1,fe=fe+Q+1>>1,Q=Te,Te=de*o+Le*a+2048>>12,de=de*a-Le*o+2048>>12,Le=Te,Te=Pe-We+1>>1,Pe=Pe+We+1>>1,We=Te,Te=ze+Ae+1>>1,Ae=ze-Ae+1>>1,ze=Te,Te=fe-Le+1>>1,fe=fe+Le+1>>1,Le=Te,Te=Q-de+1>>1,Q=Q+de+1>>1,de=Te,Te=Pe*i+ze*s+2048>>12,Pe=Pe*s-ze*i+2048>>12,ze=Te,Te=Ae*n+We*r+2048>>12,Ae=Ae*r-We*n+2048>>12,We=Te,Ne[0+it]=fe+ze,Ne[56+it]=fe-ze,Ne[8+it]=Q+We,Ne[48+it]=Q-We,Ne[16+it]=de+Ae,Ne[40+it]=de-Ae,Ne[24+it]=Le+Pe,Ne[32+it]=Le-Pe}for(kt=0;kt<64;++kt){var Yc=128+(Ne[kt]+8>>4);be[kt]=Yc<0?0:Yc>255?255:Yc}}y(E*b*8);for(var $,X,Y=0;Y<b;Y++){var ae=Y<<3;for($=0;$<8;$++)v.push(new Uint8Array(E));for(var te=0;te<S;te++){F(N.blocks[Y][te],B,j);var _e=0,ce=te<<3;for(X=0;X<8;X++){var Re=v[ae+X];for($=0;$<8;$++)Re[ce+$]=B[_e++]}}}return v}function p(w){return w<0?0:w>255?255:w}l.prototype={load:function(N){var v=new XMLHttpRequest;v.open("GET",N,!0),v.responseType="arraybuffer",v.onload=(function(){var S=new Uint8Array(v.response||v.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),v.send(null)},parse:function(N){var v=this.opts.maxResolutionInMP*1e3*1e3,S=0,b=N.length;function E(){var vt=N[S]<<8|N[S+1];return S+=2,vt}function j(){var vt=E(),Dr=N.subarray(S,S+vt-2);return S+=Dr.length,Dr}function B(vt){var Dr=1,$i=1,Mn,Jc;for(Jc in vt.components)vt.components.hasOwnProperty(Jc)&&(Mn=vt.components[Jc],Dr<Mn.h&&(Dr=Mn.h),$i<Mn.v&&($i=Mn.v));var uu=Math.ceil(vt.samplesPerLine/8/Dr),I_=Math.ceil(vt.scanLines/8/$i);for(Jc in vt.components)if(vt.components.hasOwnProperty(Jc)){Mn=vt.components[Jc];var dS=Math.ceil(Math.ceil(vt.samplesPerLine/8)*Mn.h/Dr),lS=Math.ceil(Math.ceil(vt.scanLines/8)*Mn.v/$i),sk=uu*Mn.h,ik=I_*Mn.v,sL=ik*sk,ak=[];y(sL*256);for(var ok=0;ok<ik;ok++){for(var ck=[],dk=0;dk<sk;dk++)ck.push(new Int32Array(64));ak.push(ck)}Mn.blocksPerLine=dS,Mn.blocksPerColumn=lS,Mn.blocks=ak}vt.maxH=Dr,vt.maxV=$i,vt.mcusPerLine=uu,vt.mcusPerColumn=I_}var F=null,$=null,X=null,Y,ae,te=[],_e=[],ce=[],Re=[],Ie=E(),be=-1;if(this.comments=[],Ie!=65496)throw new Error("SOI not found");for(Ie=E();Ie!=65497;){var Ve,ve,fe;switch(Ie){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var Q=j();if(Ie===65534){var de=String.fromCharCode.apply(null,Q);this.comments.push(de)}Ie===65504&&Q[0]===74&&Q[1]===70&&Q[2]===73&&Q[3]===70&&Q[4]===0&&(F={version:{major:Q[5],minor:Q[6]},densityUnits:Q[7],xDensity:Q[8]<<8|Q[9],yDensity:Q[10]<<8|Q[11],thumbWidth:Q[12],thumbHeight:Q[13],thumbData:Q.subarray(14,14+3*Q[12]*Q[13])}),Ie===65505&&Q[0]===69&&Q[1]===120&&Q[2]===105&&Q[3]===102&&Q[4]===0&&(this.exifBuffer=Q.subarray(5,Q.length)),Ie===65518&&Q[0]===65&&Q[1]===100&&Q[2]===111&&Q[3]===98&&Q[4]===101&&Q[5]===0&&($={version:Q[6],flags0:Q[7]<<8|Q[8],flags1:Q[9]<<8|Q[10],transformCode:Q[11]});break;case 65499:for(var Le=E(),Pe=Le+S-2;S<Pe;){var Ae=N[S++];y(256);var We=new Int32Array(64);if(Ae>>4===0)for(ve=0;ve<64;ve++){var ze=e[ve];We[ze]=N[S++]}else if(Ae>>4===1)for(ve=0;ve<64;ve++){var ze=e[ve];We[ze]=E()}else throw new Error("DQT: invalid table spec");te[Ae&15]=We}break;case 65472:case 65473:case 65474:E(),Y={},Y.extended=Ie===65473,Y.progressive=Ie===65474,Y.precision=N[S++],Y.scanLines=E(),Y.samplesPerLine=E(),Y.components={},Y.componentsOrder=[];var Te=Y.scanLines*Y.samplesPerLine;if(Te>v){var Ne=Math.ceil((Te-v)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${Ne}MP`)}var kt=N[S++],Je,it=0,Yc=0;for(Ve=0;Ve<kt;Ve++){Je=N[S];var Qd=N[S+1]>>4,se=N[S+1]&15,ot=N[S+2];if(Qd<=0||se<=0)throw new Error("Invalid sampling factor, expected values above 0");Y.componentsOrder.push(Je),Y.components[Je]={h:Qd,v:se,quantizationIdx:ot},S+=3}B(Y),_e.push(Y);break;case 65476:var wt=E();for(Ve=2;Ve<wt;){var pt=N[S++],Pt=new Uint8Array(16),Dt=0;for(ve=0;ve<16;ve++,S++)Dt+=Pt[ve]=N[S];y(16+Dt);var Er=new Uint8Array(Dt);for(ve=0;ve<Dt;ve++,S++)Er[ve]=N[S];Ve+=17+Dt,(pt>>4===0?Re:ce)[pt&15]=u(Pt,Er)}break;case 65501:E(),ae=E();break;case 65500:E(),E();break;case 65498:var Tr=E(),Vn=N[S++],bn=[],Se;for(Ve=0;Ve<Vn;Ve++){Se=Y.components[N[S++]];var Ze=N[S++];Se.huffmanTableDC=Re[Ze>>4],Se.huffmanTableAC=ce[Ze&15],bn.push(Se)}var Rt=N[S++],Gn=N[S++],jt=N[S++],sr=m(N,S,Y,bn,ae,Rt,Gn,jt>>4,jt&15,this.opts);S+=sr;break;case 65535:N[S]!==255&&S--;break;default:if(N[S-3]==255&&N[S-2]>=192&&N[S-2]<=254){S-=3;break}else if(Ie===224||Ie==225){if(be!==-1)throw new Error(`first unknown JPEG marker at offset ${be.toString(16)}, second unknown JPEG marker ${Ie.toString(16)} at offset ${(S-1).toString(16)}`);be=S-1;let vt=E();if(N[S+vt-2]===255){S+=vt-2;break}}throw new Error("unknown JPEG marker "+Ie.toString(16))}Ie=E()}if(_e.length!=1)throw new Error("only single frame JPEGs supported");for(var Ve=0;Ve<_e.length;Ve++){var an=_e[Ve].components;for(var ve in an)an[ve].quantizationTable=te[an[ve].quantizationIdx],delete an[ve].quantizationIdx}this.width=Y.samplesPerLine,this.height=Y.scanLines,this.jfif=F,this.adobe=$,this.components=[];for(var Ve=0;Ve<Y.componentsOrder.length;Ve++){var Se=Y.components[Y.componentsOrder[Ve]];this.components.push({lines:f(Y,Se),scaleX:Se.h/Y.maxH,scaleY:Se.v/Y.maxV})}},getData:function(N,v){var S=this.width/N,b=this.height/v,E,j,B,F,$,X,Y,ae,te,_e,ce=0,Re,Ie,be,Ve,ve,fe,Q,de,Le,Pe,Ae,We=N*v*this.components.length;y(We);var ze=new Uint8Array(We);switch(this.components.length){case 1:for(E=this.components[0],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],te=0;te<N;te++)Re=$[0|te*E.scaleX*S],ze[ce++]=Re;break;case 2:for(E=this.components[0],j=this.components[1],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],te=0;te<N;te++)Re=$[0|te*E.scaleX*S],ze[ce++]=Re,Re=X[0|te*j.scaleX*S],ze[ce++]=Re;break;case 3:for(Ae=!0,this.adobe&&this.adobe.transformCode?Ae=!0:typeof this.opts.colorTransform<"u"&&(Ae=!!this.opts.colorTransform),E=this.components[0],j=this.components[1],B=this.components[2],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],Y=B.lines[0|_e*B.scaleY*b],te=0;te<N;te++)Ae?(Re=$[0|te*E.scaleX*S],Ie=X[0|te*j.scaleX*S],be=Y[0|te*B.scaleX*S],de=p(Re+1.402*(be-128)),Le=p(Re-.3441363*(Ie-128)-.71413636*(be-128)),Pe=p(Re+1.772*(Ie-128))):(de=$[0|te*E.scaleX*S],Le=X[0|te*j.scaleX*S],Pe=Y[0|te*B.scaleX*S]),ze[ce++]=de,ze[ce++]=Le,ze[ce++]=Pe;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(Ae=!1,this.adobe&&this.adobe.transformCode?Ae=!0:typeof this.opts.colorTransform<"u"&&(Ae=!!this.opts.colorTransform),E=this.components[0],j=this.components[1],B=this.components[2],F=this.components[3],_e=0;_e<v;_e++)for($=E.lines[0|_e*E.scaleY*b],X=j.lines[0|_e*j.scaleY*b],Y=B.lines[0|_e*B.scaleY*b],ae=F.lines[0|_e*F.scaleY*b],te=0;te<N;te++)Ae?(Re=$[0|te*E.scaleX*S],Ie=X[0|te*j.scaleX*S],be=Y[0|te*B.scaleX*S],Ve=ae[0|te*F.scaleX*S],ve=255-p(Re+1.402*(be-128)),fe=255-p(Re-.3441363*(Ie-128)-.71413636*(be-128)),Q=255-p(Re+1.772*(Ie-128))):(ve=$[0|te*E.scaleX*S],fe=X[0|te*j.scaleX*S],Q=Y[0|te*B.scaleX*S],Ve=ae[0|te*F.scaleX*S]),ze[ce++]=255-ve,ze[ce++]=255-fe,ze[ce++]=255-Q,ze[ce++]=255-Ve;break;default:throw new Error("Unsupported color mode")}return ze},copyToImageData:function(N,v){var S=N.width,b=N.height,E=N.data,j=this.getData(S,b),B=0,F=0,$,X,Y,ae,te,_e,ce,Re,Ie;switch(this.components.length){case 1:for(X=0;X<b;X++)for($=0;$<S;$++)Y=j[B++],E[F++]=Y,E[F++]=Y,E[F++]=Y,v&&(E[F++]=255);break;case 3:for(X=0;X<b;X++)for($=0;$<S;$++)ce=j[B++],Re=j[B++],Ie=j[B++],E[F++]=ce,E[F++]=Re,E[F++]=Ie,v&&(E[F++]=255);break;case 4:for(X=0;X<b;X++)for($=0;$<S;$++)te=j[B++],_e=j[B++],Y=j[B++],ae=j[B++],ce=255-p(te*(1-ae/255)+ae),Re=255-p(_e*(1-ae/255)+ae),Ie=255-p(Y*(1-ae/255)+ae),E[F++]=ce,E[F++]=Re,E[F++]=Ie,v&&(E[F++]=255);break;default:throw new Error("Unsupported color mode")}}};var g=0,_=0;function y(w=0){var N=g+w;if(N>_){var v=Math.ceil((N-_)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${v}MB`)}g=N}return l.resetMaxMemoryUsage=function(w){g=0,_=w},l.getBytesAllocated=function(){return g},l.requestMemoryAllocation=y,l})();typeof Dre<"u"?Dre.exports=i1e:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=i1e);function i1e(t,e={}){var r={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},n={...r,...e},s=new Uint8Array(t),i=new Lre;i.opts=n,Lre.resetMaxMemoryUsage(n.maxMemoryUsageInMB*1024*1024),i.parse(s);var a=n.formatAsRGBA?4:3,o=i.width*i.height*a;try{Lre.requestMemoryAllocation(o);var c={width:i.width,height:i.height,exifBuffer:i.exifBuffer,data:n.useTArray?new Uint8Array(o):Buffer.alloc(o)};i.comments.length>0&&(c.comments=i.comments)}catch(d){throw d instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):d instanceof ReferenceError&&d.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):d}return i.copyToImageData(c,n.formatAsRGBA),c}});var c1e=ke((uos,o1e)=>{var ucr=s1e(),mcr=a1e();o1e.exports={encode:ucr,decode:mcr}});var jre=ke((mos,l1e)=>{"use strict";var fcr=on("util"),d1e=on("stream"),hl=l1e.exports=function(){d1e.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};fcr.inherits(hl,d1e);hl.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))};hl.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return Buffer.isBuffer(t)?r=t:r=Buffer.from(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};hl.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()))};hl.prototype.destroySoon=hl.prototype.end;hl.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};hl.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};hl.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))};hl.prototype._processRead=function(t){this._reads.shift();let e=0,r=0,n=Buffer.alloc(t.length);for(;e<t.length;){let s=this._buffers[r++],i=Math.min(s.length,t.length-e);s.copy(n,e,0,i),e+=i,i!==s.length&&(this._buffers[--r]=s.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)};hl.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 Bre=ke(Ure=>{"use strict";var Sh=[{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]}];Ure.getImagePasses=function(t,e){let r=[],n=t%8,s=e%8,i=(t-n)/8,a=(e-s)/8;for(let o=0;o<Sh.length;o++){let c=Sh[o],d=i*c.x.length,l=a*c.y.length;for(let u=0;u<c.x.length&&c.x[u]<n;u++)d++;for(let u=0;u<c.y.length&&c.y[u]<s;u++)l++;d>0&&l>0&&r.push({width:d,height:l,index:o})}return r};Ure.getInterlaceIterator=function(t){return function(e,r,n){let s=e%Sh[n].x.length,i=(e-s)/Sh[n].x.length*8+Sh[n].x[s],a=r%Sh[n].y.length,o=(r-a)/Sh[n].y.length*8+Sh[n].y[a];return i*4+o*t*4}}});var Fre=ke((pos,u1e)=>{"use strict";u1e.exports=function(e,r,n){let s=e+r-n,i=Math.abs(s-e),a=Math.abs(s-r),o=Math.abs(s-n);return i<=a&&i<=o?e:a<=o?r:n}});var Wre=ke((hos,f1e)=>{"use strict";var pcr=Bre(),hcr=Fre();function m1e(t,e,r){let n=t*e;return r!==8&&(n=Math.ceil(n/(8/r))),n}var ab=f1e.exports=function(t,e){let r=t.width,n=t.height,s=t.interlace,i=t.bpp,a=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],s){let o=pcr.getImagePasses(r,n);for(let c=0;c<o.length;c++)this._images.push({byteWidth:m1e(o[c].width,i,a),height:o[c].height,lineIndex:0})}else this._images.push({byteWidth:m1e(r,i,a),height:n,lineIndex:0});a===8?this._xComparison=i:a===16?this._xComparison=i*2:this._xComparison=1};ab.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};ab.prototype._unFilterType1=function(t,e,r){let n=this._xComparison,s=n-1;for(let i=0;i<r;i++){let a=t[1+i],o=i>s?e[i-n]:0;e[i]=a+o}};ab.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let s=0;s<r;s++){let i=t[1+s],a=n?n[s]:0;e[s]=i+a}};ab.prototype._unFilterType3=function(t,e,r){let n=this._xComparison,s=n-1,i=this._lastLine;for(let a=0;a<r;a++){let o=t[1+a],c=i?i[a]:0,d=a>s?e[a-n]:0,l=Math.floor((d+c)/2);e[a]=o+l}};ab.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,s=n-1,i=this._lastLine;for(let a=0;a<r;a++){let o=t[1+a],c=i?i[a]:0,d=a>s?e[a-n]:0,l=a>s&&i?i[a-n]:0,u=hcr(d,c,l);e[a]=o+u}};ab.prototype._reverseFilterLine=function(t){let e=t[0],r,n=this._images[this._imageIndex],s=n.byteWidth;if(e===0)r=t.slice(1,s+1);else switch(r=Buffer.alloc(s),e){case 1:this._unFilterType1(t,r,s);break;case 2:this._unFilterType2(t,r,s);break;case 3:this._unFilterType3(t,r,s);break;case 4:this._unFilterType4(t,r,s);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(r),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=r,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var g1e=ke((gos,h1e)=>{"use strict";var gcr=on("util"),p1e=jre(),_cr=Wre(),ycr=h1e.exports=function(t){p1e.call(this);let e=[],r=this;this._filter=new _cr(t,{read:this.read.bind(this),write:function(n){e.push(n)},complete:function(){r.emit("complete",Buffer.concat(e))}}),this._filter.start()};gcr.inherits(ycr,p1e)});var ob=ke((_os,_1e)=>{"use strict";_1e.exports={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}});var $re=ke((yos,y1e)=>{"use strict";var Gre=[];(function(){for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e=e>>>1;Gre[t]=e}})();var Hre=y1e.exports=function(){this._crc=-1};Hre.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=Gre[(this._crc^t[e])&255]^this._crc>>>8;return!0};Hre.prototype.crc32=function(){return this._crc^-1};Hre.crc32=function(t){let e=-1;for(let r=0;r<t.length;r++)e=Gre[(e^t[r])&255]^e>>>8;return e^-1}});var Kre=ke((wos,w1e)=>{"use strict";var ni=ob(),wcr=$re(),Pi=w1e.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[ni.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[ni.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[ni.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[ni.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[ni.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[ni.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(){}};Pi.prototype.start=function(){this.read(ni.PNG_SIGNATURE.length,this._parseSignature.bind(this))};Pi.prototype._parseSignature=function(t){let e=ni.PNG_SIGNATURE;for(let r=0;r<e.length;r++)if(t[r]!==e[r]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),r=t.readUInt32BE(4),n="";for(let i=4;i<8;i++)n+=String.fromCharCode(t[i]);let s=!!(t[4]&32);if(!this._hasIHDR&&r!==ni.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new wcr,this._crc.write(Buffer.from(n)),this._chunks[r])return this._chunks[r](e);if(!s){this.error(new Error("Unsupported critical chunk type "+n));return}this.read(e+4,this._skipChunk.bind(this))};Pi.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};Pi.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),r=this._crc.crc32();if(this._options.checkCRC&&r!==e){this.error(new Error("Crc error - "+e+" - "+r));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};Pi.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};Pi.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),r=t.readUInt32BE(4),n=t[8],s=t[9],i=t[10],a=t[11],o=t[12];if(n!==8&&n!==4&&n!==2&&n!==1&&n!==16){this.error(new Error("Unsupported bit depth "+n));return}if(!(s in ni.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(i!==0){this.error(new Error("Unsupported compression method"));return}if(a!==0){this.error(new Error("Unsupported filter method"));return}if(o!==0&&o!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=s;let c=ni.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:r,depth:n,interlace:!!o,palette:!!(s&ni.COLORTYPE_PALETTE),color:!!(s&ni.COLORTYPE_COLOR),alpha:!!(s&ni.COLORTYPE_ALPHA),bpp:c,colorType:s}),this._handleChunkEnd()};Pi.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};Pi.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let r=0;r<e;r++)this._palette.push([t[r*3],t[r*3+1],t[r*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};Pi.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))};Pi.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===ni.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===ni.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===ni.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()};Pi.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};Pi.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/ni.GAMMA_DIVISION),this._handleChunkEnd()};Pi.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))};Pi.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===ni.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let r=t-e.length;r>0?this._handleIDAT(r):this._handleChunkEnd()};Pi.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};Pi.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var Vre=ke(S1e=>{"use strict";var N1e=Bre(),Ncr=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let s=e[n];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let s=e[n];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],Scr=[function(){},function(t,e,r,n){let s=e[0];t[r]=s,t[r+1]=s,t[r+2]=s,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function vcr(t,e){let r=[],n=0;function s(){if(n===t.length)throw new Error("Ran out of data");let i=t[n];n++;let a,o,c,d,l,u,m,f;switch(e){default:throw new Error("unrecognised depth");case 16:m=t[n],n++,r.push((i<<8)+m);break;case 4:m=i&15,f=i>>4,r.push(f,m);break;case 2:l=i&3,u=i>>2&3,m=i>>4&3,f=i>>6&3,r.push(f,m,u,l);break;case 1:a=i&1,o=i>>1&1,c=i>>2&1,d=i>>3&1,l=i>>4&1,u=i>>5&1,m=i>>6&1,f=i>>7&1,r.push(f,m,u,l,d,c,o,a);break}}return{get:function(i){for(;r.length<i;)s();let a=r.slice(0,i);return r=r.slice(i),a},resetAfterLine:function(){r.length=0},end:function(){if(n!==t.length)throw new Error("extra data found")}}}function bcr(t,e,r,n,s,i){let a=t.width,o=t.height,c=t.index;for(let d=0;d<o;d++)for(let l=0;l<a;l++){let u=r(l,d,c);Ncr[n](e,s,u,i),i+=n}return i}function Icr(t,e,r,n,s,i){let a=t.width,o=t.height,c=t.index;for(let d=0;d<o;d++){for(let l=0;l<a;l++){let u=s.get(n),m=r(l,d,c);Scr[n](e,u,m,i)}s.resetAfterLine()}}S1e.dataToBitMap=function(t,e){let r=e.width,n=e.height,s=e.depth,i=e.bpp,a=e.interlace,o;s!==8&&(o=vcr(t,s));let c;s<=8?c=Buffer.alloc(r*n*4):c=new Uint16Array(r*n*4);let d=Math.pow(2,s)-1,l=0,u,m;if(a)u=N1e.getImagePasses(r,n),m=N1e.getInterlaceIterator(r,n);else{let f=0;m=function(){let p=f;return f+=4,p},u=[{width:r,height:n}]}for(let f=0;f<u.length;f++)s===8?l=bcr(u[f],c,m,i,t,l):Icr(u[f],c,m,i,o,d);if(s===8){if(l!==t.length)throw new Error("extra data found")}else o.end();return c}});var zre=ke((Sos,v1e)=>{"use strict";function Ecr(t,e,r,n,s){let i=0;for(let a=0;a<n;a++)for(let o=0;o<r;o++){let c=s[t[i]];if(!c)throw new Error("index "+t[i]+" not in palette");for(let d=0;d<4;d++)e[i+d]=c[d];i+=4}}function Tcr(t,e,r,n,s){let i=0;for(let a=0;a<n;a++)for(let o=0;o<r;o++){let c=!1;if(s.length===1?s[0]===t[i]&&(c=!0):s[0]===t[i]&&s[1]===t[i+1]&&s[2]===t[i+2]&&(c=!0),c)for(let d=0;d<4;d++)e[i+d]=0;i+=4}}function kcr(t,e,r,n,s){let i=255,a=Math.pow(2,s)-1,o=0;for(let c=0;c<n;c++)for(let d=0;d<r;d++){for(let l=0;l<4;l++)e[o+l]=Math.floor(t[o+l]*i/a+.5);o+=4}}v1e.exports=function(t,e,r=!1){let n=e.depth,s=e.width,i=e.height,a=e.colorType,o=e.transColor,c=e.palette,d=t;return a===3?Ecr(t,d,s,i,c):(o&&Tcr(t,d,s,i,o),n!==8&&!r&&(n===16&&(d=Buffer.alloc(s*i*4)),kcr(t,d,s,i,n))),d}});var E1e=ke((vos,I1e)=>{"use strict";var Rcr=on("util"),Xre=on("zlib"),b1e=jre(),Acr=g1e(),Ccr=Kre(),xcr=Vre(),Mcr=zre(),Du=I1e.exports=function(t){b1e.call(this),this._parser=new Ccr(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()};Rcr.inherits(Du,b1e);Du.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};Du.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=Xre.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 r=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,n=Math.max(r,Xre.Z_MIN_CHUNK);this._inflate=Xre.createInflate({chunkSize:n});let s=r,i=this.emit.bind(this,"error");this._inflate.on("error",function(o){s&&i(o)}),this._filter.on("complete",this._complete.bind(this));let a=this._filter.write.bind(this._filter);this._inflate.on("data",function(o){s&&(o.length>s&&(o=o.slice(0,s)),s-=o.length,a(o))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)};Du.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new Acr(this._bitmapInfo)};Du.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};Du.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};Du.prototype._simpleTransparency=function(){this._metaData.alpha=!0};Du.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};Du.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};Du.prototype._complete=function(t){if(this.errord)return;let e;try{let r=xcr.dataToBitMap(t,this._bitmapInfo);e=Mcr(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(r){this._handleError(r);return}this.emit("parsed",e)}});var k1e=ke((bos,T1e)=>{"use strict";var gd=ob();T1e.exports=function(t,e,r,n){let s=[gd.COLORTYPE_COLOR_ALPHA,gd.COLORTYPE_ALPHA].indexOf(n.colorType)!==-1;if(n.colorType===n.inputColorType){let p=(function(){let g=new ArrayBuffer(2);return new DataView(g).setInt16(0,256,!0),new Int16Array(g)[0]!==256})();if(n.bitDepth===8||n.bitDepth===16&&p)return t}let i=n.bitDepth!==16?t:new Uint16Array(t.buffer),a=255,o=gd.COLORTYPE_TO_BPP_MAP[n.inputColorType];o===4&&!n.inputHasAlpha&&(o=3);let c=gd.COLORTYPE_TO_BPP_MAP[n.colorType];n.bitDepth===16&&(a=65535,c*=2);let d=Buffer.alloc(e*r*c),l=0,u=0,m=n.bgColor||{};m.red===void 0&&(m.red=a),m.green===void 0&&(m.green=a),m.blue===void 0&&(m.blue=a);function f(){let p,g,_,y=a;switch(n.inputColorType){case gd.COLORTYPE_COLOR_ALPHA:y=i[l+3],p=i[l],g=i[l+1],_=i[l+2];break;case gd.COLORTYPE_COLOR:p=i[l],g=i[l+1],_=i[l+2];break;case gd.COLORTYPE_ALPHA:y=i[l+1],p=i[l],g=p,_=p;break;case gd.COLORTYPE_GRAYSCALE:p=i[l],g=p,_=p;break;default:throw new Error("input color type:"+n.inputColorType+" is not supported at present")}return n.inputHasAlpha&&(s||(y/=a,p=Math.min(Math.max(Math.round((1-y)*m.red+y*p),0),a),g=Math.min(Math.max(Math.round((1-y)*m.green+y*g),0),a),_=Math.min(Math.max(Math.round((1-y)*m.blue+y*_),0),a))),{red:p,green:g,blue:_,alpha:y}}for(let p=0;p<r;p++)for(let g=0;g<e;g++){let _=f(i,l);switch(n.colorType){case gd.COLORTYPE_COLOR_ALPHA:case gd.COLORTYPE_COLOR:n.bitDepth===8?(d[u]=_.red,d[u+1]=_.green,d[u+2]=_.blue,s&&(d[u+3]=_.alpha)):(d.writeUInt16BE(_.red,u),d.writeUInt16BE(_.green,u+2),d.writeUInt16BE(_.blue,u+4),s&&d.writeUInt16BE(_.alpha,u+6));break;case gd.COLORTYPE_ALPHA:case gd.COLORTYPE_GRAYSCALE:{let y=(_.red+_.green+_.blue)/3;n.bitDepth===8?(d[u]=y,s&&(d[u+1]=_.alpha)):(d.writeUInt16BE(y,u),s&&d.writeUInt16BE(_.alpha,u+2));break}default:throw new Error("unrecognised color Type "+n.colorType)}l+=o,u+=c}return d}});var C1e=ke((Ios,A1e)=>{"use strict";var R1e=Fre();function Pcr(t,e,r,n,s){for(let i=0;i<r;i++)n[s+i]=t[e+i]}function Ocr(t,e,r){let n=0,s=e+r;for(let i=e;i<s;i++)n+=Math.abs(t[i]);return n}function qcr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=t[e+a]-o;n[s+a]=c}}function Lcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=t[e+i]-a;s+=Math.abs(o)}return s}function Dcr(t,e,r,n,s){for(let i=0;i<r;i++){let a=e>0?t[e+i-r]:0,o=t[e+i]-a;n[s+i]=o}}function jcr(t,e,r){let n=0,s=e+r;for(let i=e;i<s;i++){let a=e>0?t[i-r]:0,o=t[i]-a;n+=Math.abs(o)}return n}function Ucr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,d=t[e+a]-(o+c>>1);n[s+a]=d}}function Bcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=e>0?t[e+i-r]:0,c=t[e+i]-(a+o>>1);s+=Math.abs(c)}return s}function Fcr(t,e,r,n,s,i){for(let a=0;a<r;a++){let o=a>=i?t[e+a-i]:0,c=e>0?t[e+a-r]:0,d=e>0&&a>=i?t[e+a-(r+i)]:0,l=t[e+a]-R1e(o,c,d);n[s+a]=l}}function Wcr(t,e,r,n){let s=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,o=e>0?t[e+i-r]:0,c=e>0&&i>=n?t[e+i-(r+n)]:0,d=t[e+i]-R1e(a,o,c);s+=Math.abs(d)}return s}var Gcr={0:Pcr,1:qcr,2:Dcr,3:Ucr,4:Fcr},Hcr={0:Ocr,1:Lcr,2:jcr,3:Bcr,4:Wcr};A1e.exports=function(t,e,r,n,s){let i;if(!("filterType"in n)||n.filterType===-1)i=[0,1,2,3,4];else if(typeof n.filterType=="number")i=[n.filterType];else throw new Error("unrecognised filter types");n.bitDepth===16&&(s*=2);let a=e*s,o=0,c=0,d=Buffer.alloc((a+1)*r),l=i[0];for(let u=0;u<r;u++){if(i.length>1){let m=1/0;for(let f=0;f<i.length;f++){let p=Hcr[i[f]](t,c,a,s);p<m&&(l=i[f],m=p)}}d[o]=l,o++,Gcr[l](t,c,a,d,o,s),o+=a,c+=a}return d}});var Qre=ke((Eos,x1e)=>{"use strict";var ha=ob(),$cr=$re(),Kcr=k1e(),Vcr=C1e(),zcr=on("zlib"),vh=x1e.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||zcr.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:ha.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:ha.COLORTYPE_COLOR_ALPHA,[ha.COLORTYPE_GRAYSCALE,ha.COLORTYPE_COLOR,ha.COLORTYPE_COLOR_ALPHA,ha.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([ha.COLORTYPE_GRAYSCALE,ha.COLORTYPE_COLOR,ha.COLORTYPE_COLOR_ALPHA,ha.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1)throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(t.bitDepth!==8&&t.bitDepth!==16)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};vh.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};vh.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};vh.prototype.filterData=function(t,e,r){let n=Kcr(t,e,r,this._options),s=ha.COLORTYPE_TO_BPP_MAP[this._options.colorType];return Vcr(n,e,r,this._options,s)};vh.prototype._packChunk=function(t,e){let r=e?e.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(t,4),e&&e.copy(n,8),n.writeInt32BE($cr.crc32(n.slice(4,n.length-4)),n.length-4),n};vh.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*ha.GAMMA_DIVISION),0),this._packChunk(ha.TYPE_gAMA,e)};vh.prototype.packIHDR=function(t,e){let r=Buffer.alloc(13);return r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(ha.TYPE_IHDR,r)};vh.prototype.packIDAT=function(t){return this._packChunk(ha.TYPE_IDAT,t)};vh.prototype.packIEND=function(){return this._packChunk(ha.TYPE_IEND,null)}});var q1e=ke((Tos,O1e)=>{"use strict";var Xcr=on("util"),M1e=on("stream"),Qcr=ob(),Ycr=Qre(),P1e=O1e.exports=function(t){M1e.call(this);let e=t||{};this._packer=new Ycr(e),this._deflate=this._packer.createDeflate(),this.readable=!0};Xcr.inherits(P1e,M1e);P1e.prototype.pack=function(t,e,r,n){this.emit("data",Buffer.from(Qcr.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,r)),n&&this.emit("data",this._packer.packGAMA(n));let s=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(i){this.emit("data",this._packer.packIDAT(i))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(s)}});var F1e=ke((YC,B1e)=>{"use strict";var L1e=on("assert").ok,cb=on("zlib"),Jcr=on("util"),D1e=on("buffer").kMaxLength;function aw(t){if(!(this instanceof aw))return new aw(t);t&&t.chunkSize<cb.Z_MIN_CHUNK&&(t.chunkSize=cb.Z_MIN_CHUNK),cb.Inflate.call(this,t),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&t.maxLength!=null&&(this._maxLength=t.maxLength)}function Zcr(t){return new aw(t)}function j1e(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}aw.prototype._processChunk=function(t,e,r){if(typeof r=="function")return cb.Inflate._processChunk.call(this,t,e,r);let n=this,s=t&&t.length,i=this._chunkSize-this._offset,a=this._maxLength,o=0,c=[],d=0,l;this.on("error",function(p){l=p});function u(p,g){if(n._hadError)return;let _=i-g;if(L1e(_>=0,"have should not go down"),_>0){let y=n._buffer.slice(n._offset,n._offset+_);if(n._offset+=_,y.length>a&&(y=y.slice(0,a)),c.push(y),d+=y.length,a-=y.length,a===0)return!1}return(g===0||n._offset>=n._chunkSize)&&(i=n._chunkSize,n._offset=0,n._buffer=Buffer.allocUnsafe(n._chunkSize)),g===0?(o+=s-p,s=p,!0):!1}L1e(this._handle,"zlib binding closed");let m;do m=this._handle.writeSync(e,t,o,s,this._buffer,this._offset,i),m=m||this._writeState;while(!this._hadError&&u(m[0],m[1]));if(this._hadError)throw l;if(d>=D1e)throw j1e(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+D1e.toString(16)+" bytes");let f=Buffer.concat(c,d);return j1e(this),f};Jcr.inherits(aw,cb.Inflate);function edr(t,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let r=t._finishFlushFlag;return r==null&&(r=cb.Z_FINISH),t._processChunk(e,r)}function U1e(t,e){return edr(new aw(e),t)}B1e.exports=YC=U1e;YC.Inflate=aw;YC.createInflate=Zcr;YC.inflateSync=U1e});var Yre=ke((kos,G1e)=>{"use strict";var W1e=G1e.exports=function(t){this._buffer=t,this._reads=[]};W1e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};W1e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var $1e=ke(H1e=>{"use strict";var tdr=Yre(),rdr=Wre();H1e.process=function(t,e){let r=[],n=new tdr(t);return new rdr(e,{read:n.read.bind(n),write:function(i){r.push(i)},complete:function(){}}).start(),n.process(),Buffer.concat(r)}});var X1e=ke((Aos,z1e)=>{"use strict";var K1e=!0,V1e=on("zlib"),ndr=F1e();V1e.deflateSync||(K1e=!1);var sdr=Yre(),idr=$1e(),adr=Kre(),odr=Vre(),cdr=zre();z1e.exports=function(t,e){if(!K1e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r;function n(v){r=v}let s;function i(v){s=v}function a(v){s.transColor=v}function o(v){s.palette=v}function c(){s.alpha=!0}let d;function l(v){d=v}let u=[];function m(v){u.push(v)}let f=new sdr(t);if(new adr(e,{read:f.read.bind(f),error:n,metadata:i,gamma:l,palette:o,transColor:a,inflateData:m,simpleTransparency:c}).start(),f.process(),r)throw r;let g=Buffer.concat(u);u.length=0;let _;if(s.interlace)_=V1e.inflateSync(g);else{let S=((s.width*s.bpp*s.depth+7>>3)+1)*s.height;_=ndr(g,{chunkSize:S,maxLength:S})}if(g=null,!_||!_.length)throw new Error("bad png - invalid inflate data response");let y=idr.process(_,s);g=null;let w=odr.dataToBitMap(y,s);y=null;let N=cdr(w,s,e.skipRescale);return s.data=N,s.gamma=d||0,s}});var Z1e=ke((Cos,J1e)=>{"use strict";var Q1e=!0,Y1e=on("zlib");Y1e.deflateSync||(Q1e=!1);var ddr=ob(),ldr=Qre();J1e.exports=function(t,e){if(!Q1e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=e||{},n=new ldr(r),s=[];s.push(Buffer.from(ddr.PNG_SIGNATURE)),s.push(n.packIHDR(t.width,t.height)),t.gamma&&s.push(n.packGAMA(t.gamma));let i=n.filterData(t.data,t.width,t.height),a=Y1e.deflateSync(i,n.getDeflateOptions());if(i=null,!a||!a.length)throw new Error("bad png - invalid compressed data response");return s.push(n.packIDAT(a)),s.push(n.packIEND()),Buffer.concat(s)}});var eWe=ke(Jre=>{"use strict";var udr=X1e(),mdr=Z1e();Jre.read=function(t,e){return udr(t,e||{})};Jre.write=function(t,e){return mdr(t,e)}});var H1=ke(rWe=>{"use strict";var fdr=on("util"),tWe=on("stream"),pdr=E1e(),hdr=q1e(),gdr=eWe(),Ha=rWe.PNG=function(t){tWe.call(this),t=t||{},this.width=t.width|0,this.height=t.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new pdr(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new hdr(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};fdr.inherits(Ha,tWe);Ha.sync=gdr;Ha.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};Ha.prototype.parse=function(t,e){if(e){let r,n;r=function(s){this.removeListener("error",n),this.data=s,e(null,this)}.bind(this),n=function(s){this.removeListener("parsed",r),e(s,null)}.bind(this),this.once("parsed",r),this.once("error",n)}return this.end(t),this};Ha.prototype.write=function(t){return this._parser.write(t),!0};Ha.prototype.end=function(t){this._parser.end(t)};Ha.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)};Ha.prototype._gamma=function(t){this.gamma=t};Ha.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};Ha.bitblt=function(t,e,r,n,s,i,a,o){if(r|=0,n|=0,s|=0,i|=0,a|=0,o|=0,r>t.width||n>t.height||r+s>t.width||n+i>t.height)throw new Error("bitblt reading outside image");if(a>e.width||o>e.height||a+s>e.width||o+i>e.height)throw new Error("bitblt writing outside image");for(let c=0;c<i;c++)t.data.copy(e.data,(o+c)*e.width+a<<2,(n+c)*t.width+r<<2,(n+c)*t.width+r+s<<2)};Ha.prototype.bitblt=function(t,e,r,n,s,i,a){return Ha.bitblt(this,t,e,r,n,s,i,a),this};Ha.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let r=0;r<t.width;r++){let n=t.width*e+r<<2;for(let s=0;s<3;s++){let i=t.data[n+s]/255;i=Math.pow(i,1/2.2/t.gamma),t.data[n+s]=Math.round(i*255)}}t.gamma=0}};Ha.prototype.adjustGamma=function(){Ha.adjustGamma(this)}});var hie=ke((xvs,bze)=>{bze.exports=on("stream")});var Bx=ke((gie,Eze)=>{var XG=on("buffer"),yf=XG.Buffer;function Ize(t,e){for(var r in t)e[r]=t[r]}yf.from&&yf.alloc&&yf.allocUnsafe&&yf.allocUnsafeSlow?Eze.exports=XG:(Ize(XG,gie),gie.Buffer=Wb);function Wb(t,e,r){return yf(t,e,r)}Ize(yf,Wb);Wb.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return yf(t,e,r)};Wb.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=yf(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Wb.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return yf(t)};Wb.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return XG.SlowBuffer(t)}});var kze=ke((Mvs,_ie)=>{"use strict";function WNr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Tze=Bx().Buffer,Fx=on("util");function GNr(t,e,r){t.copy(e,r)}_ie.exports=(function(){function t(){WNr(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},t.prototype.unshift=function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},t.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(r){if(this.length===0)return"";for(var n=this.head,s=""+n.data;n=n.next;)s+=r+n.data;return s},t.prototype.concat=function(r){if(this.length===0)return Tze.alloc(0);for(var n=Tze.allocUnsafe(r>>>0),s=this.head,i=0;s;)GNr(s.data,n,i),i+=s.data.length,s=s.next;return n},t})();Fx&&Fx.inspect&&Fx.inspect.custom&&(_ie.exports.prototype[Fx.inspect.custom]=function(){var t=Fx.inspect({length:this.length});return this.constructor.name+" "+t})});var yie=ke((Pvs,Rze)=>{"use strict";var QG=GL();function HNr(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return n||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,QG.nextTick(YG,this,t)):QG.nextTick(YG,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(i){!e&&i?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,QG.nextTick(YG,r,i)):QG.nextTick(YG,r,i):e&&e(i)}),this)}function $Nr(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function YG(t,e){t.emit("error",e)}Rze.exports={destroy:HNr,undestroy:$Nr}});var Nie=ke((Ovs,Lze)=>{"use strict";var Nw=GL();Lze.exports=js;function Cze(t){var e=this;this.next=null,this.entry=null,this.finish=function(){dSr(e,t)}}var KNr=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Nw.nextTick,Gb;js.WritableState=Gx;var xze=Object.create(wk());xze.inherits=Nk();var VNr={deprecate:y0t()},Mze=hie(),ZG=Bx().Buffer,zNr=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function XNr(t){return ZG.from(t)}function QNr(t){return ZG.isBuffer(t)||t instanceof zNr}var Pze=yie();xze.inherits(js,Mze);function YNr(){}function Gx(t,e){Gb=Gb||Sw(),t=t||{};var r=e instanceof Gb;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,s=t.writableHighWaterMark,i=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(s||s===0)?this.highWaterMark=s:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=t.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){sSr(e,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cze(this)}Gx.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Gx.prototype,"buffer",{get:VNr.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var JG;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(JG=Function.prototype[Symbol.hasInstance],Object.defineProperty(js,Symbol.hasInstance,{value:function(t){return JG.call(this,t)?!0:this!==js?!1:t&&t._writableState instanceof Gx}})):JG=function(t){return t instanceof this};function js(t){if(Gb=Gb||Sw(),!JG.call(js,this)&&!(this instanceof Gb))return new js(t);this._writableState=new Gx(t,this),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Mze.call(this)}js.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function JNr(t,e){var r=new Error("write after end");t.emit("error",r),Nw.nextTick(e,r)}function ZNr(t,e,r,n){var s=!0,i=!1;return r===null?i=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i&&(t.emit("error",i),Nw.nextTick(n,i),s=!1),s}js.prototype.write=function(t,e,r){var n=this._writableState,s=!1,i=!n.objectMode&&QNr(t);return i&&!ZG.isBuffer(t)&&(t=XNr(t)),typeof e=="function"&&(r=e,e=null),i?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=YNr),n.ended?JNr(this,r):(i||ZNr(this,n,t,r))&&(n.pendingcb++,s=tSr(this,n,i,t,e,r)),s};js.prototype.cork=function(){var t=this._writableState;t.corked++};js.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Oze(this,t))};js.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function eSr(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=ZG.from(e,r)),e}Object.defineProperty(js.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tSr(t,e,r,n,s,i){if(!r){var a=eSr(e,n,s);n!==a&&(r=!0,s="buffer",n=a)}var o=e.objectMode?1:n.length;e.length+=o;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var d=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:i,next:null},d?d.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else wie(t,e,!1,o,n,s,i);return c}function wie(t,e,r,n,s,i,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(s,e.onwrite):t._write(s,i,e.onwrite),e.sync=!1}function rSr(t,e,r,n,s){--e.pendingcb,r?(Nw.nextTick(s,n),Nw.nextTick(Wx,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(s(n),t._writableState.errorEmitted=!0,t.emit("error",n),Wx(t,e))}function nSr(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function sSr(t,e){var r=t._writableState,n=r.sync,s=r.writecb;if(nSr(r),e)rSr(t,r,n,e,s);else{var i=qze(r);!i&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Oze(t,r),n?KNr(Aze,t,r,i,s):Aze(t,r,i,s)}}function Aze(t,e,r,n){r||iSr(t,e),e.pendingcb--,n(),Wx(t,e)}function iSr(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Oze(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),i=e.corkedRequestsFree;i.entry=r;for(var a=0,o=!0;r;)s[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;s.allBuffers=o,wie(t,e,!0,e.length,s,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new Cze(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,d=r.encoding,l=r.callback,u=e.objectMode?1:c.length;if(wie(t,e,!1,u,c,d,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}js.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))};js.prototype._writev=null;js.prototype.end=function(t,e,r){var n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||cSr(this,n,r)};function qze(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function aSr(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),Wx(t,e)})}function oSr(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"?(e.pendingcb++,e.finalCalled=!0,Nw.nextTick(aSr,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Wx(t,e){var r=qze(e);return r&&(oSr(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"))),r}function cSr(t,e,r){e.ending=!0,Wx(t,e),r&&(e.finished?Nw.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function dSr(t,e,r){var n=t.entry;for(t.entry=null;n;){var s=n.callback;e.pendingcb--,s(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(js.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});js.prototype.destroy=Pze.destroy;js.prototype._undestroy=Pze.undestroy;js.prototype._destroy=function(t,e){this.end(),e(t)}});var Sw=ke((qvs,Bze)=>{"use strict";var Dze=GL(),lSr=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Bze.exports=wf;var jze=Object.create(wk());jze.inherits=Nk();var Uze=bie(),vie=Nie();jze.inherits(wf,Uze);for(Sie=lSr(vie.prototype),eH=0;eH<Sie.length;eH++)tH=Sie[eH],wf.prototype[tH]||(wf.prototype[tH]=vie.prototype[tH]);var Sie,tH,eH;function wf(t){if(!(this instanceof wf))return new wf(t);Uze.call(this,t),vie.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",uSr)}Object.defineProperty(wf.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uSr(){this.allowHalfOpen||this._writableState.ended||Dze.nextTick(mSr,this)}function mSr(t){t.end()}Object.defineProperty(wf.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}});wf.prototype._destroy=function(t,e){this.push(null),this.end(),Dze.nextTick(e,t)}});var Tie=ke(Wze=>{"use strict";var Eie=Bx().Buffer,Fze=Eie.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fSr(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function pSr(t){var e=fSr(t);if(typeof e!="string"&&(Eie.isEncoding===Fze||!Fze(t)))throw new Error("Unknown encoding: "+t);return e||t}Wze.StringDecoder=Hx;function Hx(t){this.encoding=pSr(t);var e;switch(this.encoding){case"utf16le":this.text=NSr,this.end=SSr,e=4;break;case"utf8":this.fillLast=_Sr,e=4;break;case"base64":this.text=vSr,this.end=bSr,e=3;break;default:this.write=ISr,this.end=ESr;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Eie.allocUnsafe(e)}Hx.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Hx.prototype.end=wSr;Hx.prototype.text=ySr;Hx.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Iie(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function hSr(t,e,r){var n=e.length-1;if(n<r)return 0;var s=Iie(e[n]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--n<r||s===-2?0:(s=Iie(e[n]),s>=0?(s>0&&(t.lastNeed=s-2),s):--n<r||s===-2?0:(s=Iie(e[n]),s>=0?(s>0&&(s===2?s=0:t.lastNeed=s-3),s):0))}function gSr(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function _Sr(t){var e=this.lastTotal-this.lastNeed,r=gSr(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function ySr(t,e){var r=hSr(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function wSr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function NSr(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function SSr(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function vSr(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function bSr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function ISr(t){return t.toString(this.encoding)}function ESr(t){return t&&t.length?this.write(t):""}});var bie=ke((jvs,e4e)=>{"use strict";var $b=GL();e4e.exports=Dn;var TSr=_0t(),$x;Dn.ReadableState=Xze;var Dvs=on("events").EventEmitter,Kze=function(t,e){return t.listeners(e).length},xie=hie(),Kx=Bx().Buffer,kSr=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function RSr(t){return Kx.from(t)}function ASr(t){return Kx.isBuffer(t)||t instanceof kSr}var Vze=Object.create(wk());Vze.inherits=Nk();var kie=on("util"),Ur=void 0;kie&&kie.debuglog?Ur=kie.debuglog("stream"):Ur=function(){};var CSr=kze(),zze=yie(),Hb;Vze.inherits(Dn,xie);var Rie=["error","close","destroy","pause","resume"];function xSr(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):TSr(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Xze(t,e){$x=$x||Sw(),t=t||{};var r=e instanceof $x;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,i=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:r&&(s||s===0)?this.highWaterMark=s:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new CSr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Hb||(Hb=Tie().StringDecoder),this.decoder=new Hb(t.encoding),this.encoding=t.encoding)}function Dn(t){if($x=$x||Sw(),!(this instanceof Dn))return new Dn(t);this._readableState=new Xze(t,this),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),xie.call(this)}Object.defineProperty(Dn.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Dn.prototype.destroy=zze.destroy;Dn.prototype._undestroy=zze.undestroy;Dn.prototype._destroy=function(t,e){this.push(null),e(t)};Dn.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Kx.from(t,e),e=""),n=!0),Qze(this,t,e,!1,n)};Dn.prototype.unshift=function(t){return Qze(this,t,null,!0,!1)};function Qze(t,e,r,n,s){var i=t._readableState;if(e===null)i.reading=!1,qSr(t,i);else{var a;s||(a=MSr(i,e)),a?t.emit("error",a):i.objectMode||e&&e.length>0?(typeof e!="string"&&!i.objectMode&&Object.getPrototypeOf(e)!==Kx.prototype&&(e=RSr(e)),n?i.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):Aie(t,i,e,!0):i.ended?t.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Aie(t,i,e,!1):Yze(t,i)):Aie(t,i,e,!1))):n||(i.reading=!1)}return PSr(i)}function Aie(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&rH(t)),Yze(t,e)}function MSr(t,e){var r;return!ASr(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function PSr(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}Dn.prototype.isPaused=function(){return this._readableState.flowing===!1};Dn.prototype.setEncoding=function(t){return Hb||(Hb=Tie().StringDecoder),this._readableState.decoder=new Hb(t),this._readableState.encoding=t,this};var Gze=8388608;function OSr(t){return t>=Gze?t=Gze:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Hze(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=OSr(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Dn.prototype.read=function(t){Ur("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Ur("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Cie(this):rH(this),null;if(t=Hze(t,e),t===0&&e.ended)return e.length===0&&Cie(this),null;var n=e.needReadable;Ur("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,Ur("length less than watermark",n)),e.ended||e.reading?(n=!1,Ur("reading or ended",n)):n&&(Ur("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Hze(r,e)));var s;return t>0?s=Jze(t,e):s=null,s===null?(e.needReadable=!0,t=0):e.length-=t,e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Cie(this)),s!==null&&this.emit("data",s),s};function qSr(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,rH(t)}}function rH(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Ur("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?$b.nextTick($ze,t):$ze(t))}function $ze(t){Ur("emit readable"),t.emit("readable"),Mie(t)}function Yze(t,e){e.readingMore||(e.readingMore=!0,$b.nextTick(LSr,t,e))}function LSr(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Ur("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}Dn.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))};Dn.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,Ur("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,i=s?o:_;n.endEmitted?$b.nextTick(i):r.once("end",i),t.on("unpipe",a);function a(y,w){Ur("onunpipe"),y===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function o(){Ur("onend"),t.end()}var c=DSr(r);t.on("drain",c);var d=!1;function l(){Ur("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",_),r.removeListener("data",m),d=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&c()}var u=!1;r.on("data",m);function m(y){Ur("ondata"),u=!1;var w=t.write(y);w===!1&&!u&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Zze(n.pipes,t)!==-1)&&!d&&(Ur("false write response, pause",n.awaitDrain),n.awaitDrain++,u=!0),r.pause())}function f(y){Ur("onerror",y),_(),t.removeListener("error",f),Kze(t,"error")===0&&t.emit("error",y)}xSr(t,"error",f);function p(){t.removeListener("finish",g),_()}t.once("close",p);function g(){Ur("onfinish"),t.removeListener("close",p),_()}t.once("finish",g);function _(){Ur("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(Ur("pipe resume"),r.resume()),t};function DSr(t){return function(){var e=t._readableState;Ur("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&Kze(t,"data")&&(e.flowing=!0,Mie(t))}}Dn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<s;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=Zze(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Dn.prototype.on=function(t,e){var r=xie.prototype.on.call(this,t,e);if(t==="data")this._readableState.flowing!==!1&&this.resume();else if(t==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&rH(this):$b.nextTick(jSr,this))}return r};Dn.prototype.addListener=Dn.prototype.on;function jSr(t){Ur("readable nexttick read 0"),t.read(0)}Dn.prototype.resume=function(){var t=this._readableState;return t.flowing||(Ur("resume"),t.flowing=!0,USr(this,t)),this};function USr(t,e){e.resumeScheduled||(e.resumeScheduled=!0,$b.nextTick(BSr,t,e))}function BSr(t,e){e.reading||(Ur("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Mie(t),e.flowing&&!e.reading&&t.read(0)}Dn.prototype.pause=function(){return Ur("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ur("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Mie(t){var e=t._readableState;for(Ur("flow",e.flowing);e.flowing&&t.read()!==null;);}Dn.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(Ur("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(Ur("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=e.push(a);o||(n=!0,t.pause())}});for(var s in t)this[s]===void 0&&typeof t[s]=="function"&&(this[s]=(function(a){return function(){return t[a].apply(t,arguments)}})(s));for(var i=0;i<Rie.length;i++)t.on(Rie[i],this.emit.bind(this,Rie[i]));return this._read=function(a){Ur("wrapped _read",a),n&&(n=!1,t.resume())},this};Object.defineProperty(Dn.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Dn._fromList=Jze;function Jze(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.head.data:r=e.buffer.concat(e.length),e.buffer.clear()):r=FSr(t,e.buffer,e.decoder),r}function FSr(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):t===e.head.data.length?n=e.shift():n=r?WSr(t,e):GSr(t,e),n}function WSr(t,e){var r=e.head,n=1,s=r.data;for(t-=s.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(a===i.length?s+=i:s+=i.slice(0,t),t-=a,t===0){a===i.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=i.slice(a));break}++n}return e.length-=n,s}function GSr(t,e){var r=Kx.allocUnsafe(t),n=e.head,s=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var i=n.data,a=t>i.length?i.length:t;if(i.copy(r,r.length-t,0,a),t-=a,t===0){a===i.length?(++s,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=i.slice(a));break}++s}return e.length-=s,r}function Cie(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,$b.nextTick(HSr,e,t))}function HSr(t,e){!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Zze(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Pie=ke((Uvs,n4e)=>{"use strict";n4e.exports=Nf;var nH=Sw(),r4e=Object.create(wk());r4e.inherits=Nk();r4e.inherits(Nf,nH);function $Sr(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function Nf(t){if(!(this instanceof Nf))return new Nf(t);nH.call(this,t),this._transformState={afterTransform:$Sr.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",KSr)}function KSr(){var t=this;typeof this._flush=="function"?this._flush(function(e,r){t4e(t,e,r)}):t4e(this,null,null)}Nf.prototype.push=function(t,e){return this._transformState.needTransform=!1,nH.prototype.push.call(this,t,e)};Nf.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")};Nf.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};Nf.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Nf.prototype._destroy=function(t,e){var r=this;nH.prototype._destroy.call(this,t,function(n){e(n),r.emit("close")})};function t4e(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}});var o4e=ke((Bvs,a4e)=>{"use strict";a4e.exports=Vx;var s4e=Pie(),i4e=Object.create(wk());i4e.inherits=Nk();i4e.inherits(Vx,s4e);function Vx(t){if(!(this instanceof Vx))return new Vx(t);s4e.call(this,t)}Vx.prototype._transform=function(t,e,r){r(null,t)}});var c4e=ke((Ji,sH)=>{var Hu=on("stream");process.env.READABLE_STREAM==="disable"&&Hu?(sH.exports=Hu,Ji=sH.exports=Hu.Readable,Ji.Readable=Hu.Readable,Ji.Writable=Hu.Writable,Ji.Duplex=Hu.Duplex,Ji.Transform=Hu.Transform,Ji.PassThrough=Hu.PassThrough,Ji.Stream=Hu):(Ji=sH.exports=bie(),Ji.Stream=Hu||Ji,Ji.Readable=Ji,Ji.Writable=Nie(),Ji.Duplex=Sw(),Ji.Transform=Pie(),Ji.PassThrough=o4e())});var l4e=ke((Fvs,d4e)=>{d4e.exports=c4e().PassThrough});var p4e=ke((Wvs,f4e)=>{var u4e=on("util"),oH=l4e();f4e.exports={Readable:iH,Writable:aH};u4e.inherits(iH,oH);u4e.inherits(aH,oH);function m4e(t,e,r){t[e]=function(){return delete t[e],r.apply(this,arguments),this[e].apply(this,arguments)}}function iH(t,e){if(!(this instanceof iH))return new iH(t,e);oH.call(this,e),m4e(this,"_read",function(){var r=t.call(this,e),n=this.emit.bind(this,"error");r.on("error",n),r.pipe(this)}),this.emit("readable")}function aH(t,e){if(!(this instanceof aH))return new aH(t,e);oH.call(this,e),m4e(this,"_write",function(){var r=t.call(this,e),n=this.emit.bind(this,"error");r.on("error",n),this.pipe(r)}),this.emit("writable")}});var Qst=ke((W3s,Xst)=>{function zst(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}zst.prototype.encode=function(){var t=new Buffer(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var e=0,r=3*this.width+this.extraBytes,n=0;n<this.height;n++){for(var s=0;s<this.width;s++){var i=this.pos+n*r+s*3;e++,t[i]=this.buffer[e++],t[i+1]=this.buffer[e++],t[i+2]=this.buffer[e++]}if(this.extraBytes>0){var a=this.pos+n*r+this.width*3;t.fill(0,a,a+this.extraBytes)}}return t};Xst.exports=function(t,e){typeof e>"u"&&(e=100);var r=new zst(t),n=r.encode();return{data:n,width:t.width,height:t.height}}});var Jst=ke((G3s,Yst)=>{function Dl(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),this.flag!="BM")throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}Dl.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++);this.palette[e]={red:s,green:n,blue:r,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)};Dl.prototype.parseRGBA=function(){var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[t]()};Dl.prototype.bit1=function(){for(var t=Math.ceil(this.width/8),e=t%4,r=this.height>=0?this.height-1:-this.height,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,s=0;s<t;s++)for(var i=this.buffer.readUInt8(this.pos++),a=n*this.width*4+s*8*4,o=0;o<8&&s*8+o<this.width;o++){var c=this.palette[i>>7-o&1];this.data[a+o*4]=0,this.data[a+o*4+1]=c.blue,this.data[a+o*4+2]=c.green,this.data[a+o*4+3]=c.red}e!=0&&(this.pos+=4-e)}};Dl.prototype.bit4=function(){if(this.compress==2){let _=function(y){var w=this.palette[y];this.data[t]=0,this.data[t+1]=w.blue,this.data[t+2]=w.green,this.data[t+3]=w.red,t+=4};var g=_;this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,r=!1;t<this.data.length;){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++);if(n==0)if(s==0){this.bottom_up?e--:e++,t=e*this.width*4,r=!1;continue}else{if(s==1)break;if(s==2){var i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=a:e+=a,t+=a*this.width*4+i*4}else{for(var o=this.buffer.readUInt8(this.pos++),c=0;c<s;c++)r?_.call(this,o&15):_.call(this,(o&240)>>4),c&1&&c+1<s&&(o=this.buffer.readUInt8(this.pos++)),r=!r;(s+1>>1&1)==1&&this.pos++}}else for(var c=0;c<n;c++)r?_.call(this,s&15):_.call(this,(s&240)>>4),r=!r}}else for(var d=Math.ceil(this.width/2),l=d%4,a=this.height-1;a>=0;a--){for(var u=this.bottom_up?a:this.height-1-a,i=0;i<d;i++){var s=this.buffer.readUInt8(this.pos++),t=u*this.width*4+i*2*4,m=s>>4,f=s&15,p=this.palette[m];if(this.data[t]=0,this.data[t+1]=p.blue,this.data[t+2]=p.green,this.data[t+3]=p.red,i*2+1>=this.width)break;p=this.palette[f],this.data[t+4]=0,this.data[t+4+1]=p.blue,this.data[t+4+2]=p.green,this.data[t+4+3]=p.red}l!=0&&(this.pos+=4-l)}};Dl.prototype.bit8=function(){if(this.compress==1){let m=function(f){var p=this.palette[f];this.data[t]=0,this.data[t+1]=p.blue,this.data[t+2]=p.green,this.data[t+3]=p.red,t+=4};var u=m;this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t<this.data.length;){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);if(r==0)if(n==0){this.bottom_up?e--:e++,t=e*this.width*4;continue}else{if(n==1)break;if(n==2){var s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=i:e+=i,t+=i*this.width*4+s*4}else{for(var a=0;a<n;a++){var o=this.buffer.readUInt8(this.pos++);m.call(this,o)}n&!0&&this.pos++}}else for(var a=0;a<r;a++)m.call(this,n)}}else for(var c=this.width%4,i=this.height-1;i>=0;i--){for(var d=this.bottom_up?i:this.height-1-i,s=0;s<this.width;s++){var n=this.buffer.readUInt8(this.pos++),t=d*this.width*4+s*4;if(n<this.palette.length){var l=this.palette[n];this.data[t]=0,this.data[t+1]=l.blue,this.data[t+2]=l.green,this.data[t+3]=l.red}else this.data[t]=0,this.data[t+1]=255,this.data[t+2]=255,this.data[t+3]=255}c!=0&&(this.pos+=4-c)}};Dl.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),r=e,n=this.height-1;n>=0;n--){for(var s=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(a&r)/r*255|0,c=(a>>5&r)/r*255|0,d=(a>>10&r)/r*255|0,l=a>>15?255:0,u=s*this.width*4+i*4;this.data[u]=l,this.data[u+1]=o,this.data[u+2]=c,this.data[u+3]=d}this.pos+=t}};Dl.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,this.compress==3&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],r=0;r<16;r++)this.maskRed>>r&1&&e[0]++,this.maskGreen>>r&1&&e[1]++,this.maskBlue>>r&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var n=this.height-1;n>=0;n--){for(var s=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(a&this.maskBlue)<<e[0],c=(a&this.maskGreen)>>e[1],d=(a&this.maskRed)>>e[2],l=s*this.width*4+i*4;this.data[l]=0,this.data[l+1]=o,this.data[l+2]=c,this.data[l+3]=d}this.pos+=t}};Dl.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=e*this.width*4+r*4;this.data[a]=0,this.data[a+1]=n,this.data[a+2]=s,this.data[a+3]=i}this.pos+=this.width%4}};Dl.prototype.bit32=function(){if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4;for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),o=e*this.width*4+r*4;this.data[o]=n,this.data[o+1]=s,this.data[o+2]=i,this.data[o+3]=a}}else for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var s=this.buffer.readUInt8(this.pos++),i=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=e*this.width*4+r*4;this.data[o]=n,this.data[o+1]=s,this.data[o+2]=i,this.data[o+3]=a}};Dl.prototype.getData=function(){return this.data};Yst.exports=function(t){var e=new Dl(t);return e}});var eit=ke((H3s,Zst)=>{var iYr=Qst(),aYr=Jst();Zst.exports={encode:iYr,decode:aYr}});var Wt=ke((sti,Nct)=>{Nct.exports={options:{usePureJavaScript:!1}}});var bct=ke((iti,vct)=>{var Wfe={};vct.exports=Wfe;var Sct={};Wfe.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=Zrn(t,e);else{var s=0,i=e.length,a=e.charAt(0),o=[0];for(s=0;s<t.length;++s){for(var c=0,d=t[s];c<o.length;++c)d+=o[c]<<8,o[c]=d%i,d=d/i|0;for(;d>0;)o.push(d%i),d=d/i|0}for(s=0;t[s]===0&&s<t.length-1;++s)n+=a;for(s=o.length-1;s>=0;--s)n+=e[o[s]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r
3
3
  `)}return n};Wfe.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=Sct[e];if(!r){r=Sct[e]=[];for(var n=0;n<e.length;++n)r[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<t.length;n++){var o=r[t.charCodeAt(n)];if(o===void 0)return;for(var c=0,d=o;c<a.length;++c)d+=a[c]*s,a[c]=d&255,d>>=8;for(;d>0;)a.push(d&255),d>>=8}for(var l=0;t[l]===i&&l<t.length-1;++l)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function Zrn(t,e){var r=0,n=e.length,s=e.charAt(0),i=[0];for(r=0;r<t.length();++r){for(var a=0,o=t.at(r);a<i.length;++a)o+=i[a]<<8,i[a]=o%n,o=o/n|0;for(;o>0;)i.push(o%n),o=o/n|0}var c="";for(r=0;t.at(r)===0&&r<t.length()-1;++r)c+=s;for(r=i.length-1;r>=0;--r)c+=e[i[r]];return c}});var xr=ke((ati,kct)=>{var Ict=Wt(),Ect=bct(),z=kct.exports=Ict.util=Ict.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){z.nextTick=process.nextTick,typeof setImmediate=="function"?z.setImmediate=setImmediate:z.setImmediate=z.nextTick;return}if(typeof setImmediate=="function"){z.setImmediate=function(){return setImmediate.apply(void 0,arguments)},z.nextTick=function(o){return setImmediate(o)};return}if(z.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(l){l()})}};var a=o,t="forge.setImmediate",e=[];z.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(d){d()})}).observe(s,{attributes:!0});var i=z.setImmediate;z.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),i(c)):(e.push(c),e.length===1&&s.setAttribute("a",n=!n))}}z.nextTick=z.setImmediate})();z.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;z.globalScope=(function(){return z.isNodejs?global:typeof self>"u"?window:self})();z.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};z.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};z.isArrayBufferView=function(t){return t&&z.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function $P(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}z.ByteBuffer=Gfe;function Gfe(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(z.isArrayBuffer(t)||z.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof Gfe||typeof t=="object"&&typeof t.data=="string"&&typeof t.read=="number")&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}z.ByteStringBuffer=Gfe;var enn=4096;z.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>enn&&(this.data.substr(0,1),this._constructedStringLength=0)};z.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};z.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};z.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};z.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};z.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};z.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(z.encodeUtf8(t))};z.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};z.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};z.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};z.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};z.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};z.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};z.ByteStringBuffer.prototype.putInt=function(t,e){$P(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};z.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)};z.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())};z.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};z.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t};z.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t};z.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t};z.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t};z.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t};z.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t};z.ByteStringBuffer.prototype.getInt=function(t){$P(t);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),t-=8;while(t>0);return e};z.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};z.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};z.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};z.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};z.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};z.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};z.ByteStringBuffer.prototype.copy=function(){var t=z.createBuffer(this.data);return t.read=this.read,t};z.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};z.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};z.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};z.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t};z.ByteStringBuffer.prototype.toString=function(){return z.decodeUtf8(this.bytes())};function tnn(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=z.isArrayBuffer(t),n=z.isArrayBufferView(t);if(r||n){r?this.data=new DataView(t):this.data=new DataView(t.buffer,t.byteOffset,t.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,t!=null&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}z.DataBuffer=tnn;z.DataBuffer.prototype.length=function(){return this.write-this.read};z.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};z.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};z.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};z.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this};z.DataBuffer.prototype.putBytes=function(t,e){if(z.isArrayBufferView(t)){var r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var s=new Uint8Array(this.data.buffer,this.write);return s.set(r),this.write+=n,this}if(z.isArrayBuffer(t)){var r=new Uint8Array(t);this.accommodate(r.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(r,this.write),this.write+=r.byteLength,this}if(t instanceof z.DataBuffer||typeof t=="object"&&typeof t.read=="number"&&typeof t.write=="number"&&z.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length());this.accommodate(r.byteLength);var s=new Uint8Array(t.data.byteLength,this.write);return s.set(r),this.write+=r.byteLength,this}if(t instanceof z.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary",typeof t=="string"){var i;if(e==="hex")return this.accommodate(Math.ceil(t.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=z.binary.hex.decode(t,i,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(t.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=z.binary.base64.decode(t,i,this.write),this;if(e==="utf8"&&(t=z.encodeUtf8(t),e="binary"),e==="binary"||e==="raw")return this.accommodate(t.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=z.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(t.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=z.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)};z.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this};z.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")};z.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this};z.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};z.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};z.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};z.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};z.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};z.DataBuffer.prototype.putInt=function(t,e){$P(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};z.DataBuffer.prototype.putSignedInt=function(t,e){return $P(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)};z.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};z.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t};z.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t};z.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t};z.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t};z.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t};z.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t};z.DataBuffer.prototype.getInt=function(t){$P(t);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),t-=8;while(t>0);return e};z.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};z.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};z.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};z.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};z.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};z.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};z.DataBuffer.prototype.copy=function(){return new z.DataBuffer(this)};z.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};z.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};z.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};z.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t};z.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if(t=t||"utf8",t==="binary"||t==="raw")return z.binary.raw.encode(e);if(t==="hex")return z.binary.hex.encode(e);if(t==="base64")return z.binary.base64.encode(e);if(t==="utf8")return z.text.utf8.decode(e);if(t==="utf16")return z.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)};z.createBuffer=function(t,e){return e=e||"raw",t!==void 0&&e==="utf8"&&(t=z.encodeUtf8(t)),new z.ByteBuffer(t)};z.fillString=function(t,e){for(var r="";e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};z.xorBytes=function(t,e,r){for(var n="",s="",i="",a=0,o=0;r>0;--r,++a)s=t.charCodeAt(a)^e.charCodeAt(a),o>=10&&(n+=i,i="",o=0),i+=String.fromCharCode(s),++o;return n+=i,n};z.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e};z.bytesToHex=function(t){return z.createBuffer(t).toHex()};z.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var Cg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",xg=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Tct="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";z.encode64=function(t,e){for(var r="",n="",s,i,a,o=0;o<t.length;)s=t.charCodeAt(o++),i=t.charCodeAt(o++),a=t.charCodeAt(o++),r+=Cg.charAt(s>>2),r+=Cg.charAt((s&3)<<4|i>>4),isNaN(i)?r+="==":(r+=Cg.charAt((i&15)<<2|a>>6),r+=isNaN(a)?"=":Cg.charAt(a&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
4
4
  `,r=r.substr(e));return n+=r,n};z.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,s,i,a=0;a<t.length;)r=xg[t.charCodeAt(a++)-43],n=xg[t.charCodeAt(a++)-43],s=xg[t.charCodeAt(a++)-43],i=xg[t.charCodeAt(a++)-43],e+=String.fromCharCode(r<<2|n>>4),s!==64&&(e+=String.fromCharCode((n&15)<<4|s>>2),i!==64&&(e+=String.fromCharCode((s&3)<<6|i)));return e};z.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};z.decodeUtf8=function(t){return decodeURIComponent(escape(t))};z.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Ect.encode,decode:Ect.decode}};z.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};z.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var s=r,i=0;i<t.length;++i)n[s++]=t.charCodeAt(i);return e?s-r:n};z.binary.hex.encode=z.bytesToHex;z.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2))),r=r||0;var s=0,i=r;for(t.length&1&&(s=1,n[i++]=parseInt(t[0],16));s<t.length;s+=2)n[i++]=parseInt(t.substr(s,2),16);return e?i-r:n};z.binary.base64.encode=function(t,e){for(var r="",n="",s,i,a,o=0;o<t.byteLength;)s=t[o++],i=t[o++],a=t[o++],r+=Cg.charAt(s>>2),r+=Cg.charAt((s&3)<<4|i>>4),isNaN(i)?r+="==":(r+=Cg.charAt((i&15)<<2|a>>6),r+=isNaN(a)?"=":Cg.charAt(a&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
5
5
  `,r=r.substr(e));return n+=r,n};z.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var s,i,a,o,c=0,d=r;c<t.length;)s=xg[t.charCodeAt(c++)-43],i=xg[t.charCodeAt(c++)-43],a=xg[t.charCodeAt(c++)-43],o=xg[t.charCodeAt(c++)-43],n[d++]=s<<2|i>>4,a!==64&&(n[d++]=(i&15)<<4|a>>2,o!==64&&(n[d++]=(a&3)<<6|o));return e?d-r:n.subarray(0,d)};z.binary.base58.encode=function(t,e){return z.binary.baseN.encode(t,Tct,e)};z.binary.base58.decode=function(t,e){return z.binary.baseN.decode(t,Tct,e)};z.text={utf8:{},utf16:{}};z.text.utf8.encode=function(t,e,r){t=z.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var s=r,i=0;i<t.length;++i)n[s++]=t.charCodeAt(i);return e?s-r:n};z.text.utf8.decode=function(t){return z.decodeUtf8(String.fromCharCode.apply(null,t))};z.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length*2));var s=new Uint16Array(n.buffer);r=r||0;for(var i=r,a=r,o=0;o<t.length;++o)s[a++]=t.charCodeAt(o),i+=2;return e?i-r:n};z.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))};z.deflate=function(t,e,r){if(e=z.decode64(t.deflate(z.encode64(e)).rval),r){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};z.inflate=function(t,e,r){var n=t.inflate(z.encode64(e)).rval;return n===null?null:z.decode64(n)};var Hfe=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(r===null?n=t.removeItem(e):(r=z.encode64(JSON.stringify(r)),n=t.setItem(e,r)),typeof n<"u"&&n.rval!==!0){var s=new Error(n.error.message);throw s.id=n.error.id,s.name=n.error.name,s}},$fe=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(z.decode64(r))),r},rnn=function(t,e,r,n){var s=$fe(t,e);s===null&&(s={}),s[r]=n,Hfe(t,e,s)},nnn=function(t,e,r){var n=$fe(t,e);return n!==null&&(n=r in n?n[r]:null),n},snn=function(t,e,r){var n=$fe(t,e);if(n!==null&&r in n){delete n[r];var s=!0;for(var i in n){s=!1;break}s&&(n=null),Hfe(t,e,n)}},inn=function(t,e){Hfe(t,e,null)},L4=function(t,e,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var s,i=!1,a=null;for(var o in r){s=r[o];try{if(s==="flash"||s==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),i=s==="flash"}(s==="web"||s==="both")&&(e[0]=localStorage,n=t.apply(this,e),i=!0)}catch(c){a=c}if(i)break}if(!i)throw a;return n};z.setItem=function(t,e,r,n,s){L4(rnn,arguments,s)};z.getItem=function(t,e,r,n){return L4(nnn,arguments,n)};z.removeItem=function(t,e,r,n){L4(snn,arguments,n)};z.clearItems=function(t,e,r){L4(inn,arguments,r)};z.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};z.format=function(t){for(var e=/%./g,r,n,s=0,i=[],a=0;r=e.exec(t);){n=t.substring(a,e.lastIndex-2),n.length>0&&i.push(n),a=e.lastIndex;var o=r[0][1];switch(o){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(t.substring(a)),i.join("")};z.formatNumber=function(t,e,r,n){var s=t,i=isNaN(e=Math.abs(e))?2:e,a=r===void 0?",":r,o=n===void 0?".":n,c=s<0?"-":"",d=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",l=d.length>3?d.length%3:0;return c+(l?d.substr(0,l)+o:"")+d.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?a+Math.abs(s-d).toFixed(i).slice(2):"")};z.formatSize=function(t){return t>=1073741824?t=z.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=z.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=z.formatNumber(t/1024,0)+" KiB":t=z.formatNumber(t,0)+" bytes",t};z.bytesFromIP=function(t){return t.indexOf(".")!==-1?z.bytesFromIPv4(t):t.indexOf(":")!==-1?z.bytesFromIPv6(t):null};z.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=z.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};z.bytesFromIPv6=function(t){var e=0;t=t.split(":").filter(function(a){return a.length===0&&++e,!0});for(var r=(8-t.length+e)*2,n=z.createBuffer(),s=0;s<8;++s){if(!t[s]||t[s].length===0){n.fillWithByte(0,r),r=0;continue}var i=z.hexToBytes(t[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};z.bytesToIP=function(t){return t.length===4?z.bytesToIPv4(t):t.length===16?z.bytesToIPv6(t):null};z.bytesToIPv4=function(t){if(t.length!==4)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")};z.bytesToIPv6=function(t){if(t.length!==16)return null;for(var e=[],r=[],n=0,s=0;s<t.length;s+=2){for(var i=z.bytesToHex(t[s]+t[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=r[r.length-1],o=e.length;!a||o!==a.end+1?r.push({start:o,end:o}):(a.end=o,a.end-a.start>r[n].end-r[n].start&&(n=r.length-1))}e.push(i)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};z.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in z&&!t.update)return e(null,z.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return z.cores=navigator.hardwareConcurrency,e(null,z.cores);if(typeof Worker>"u")return z.cores=1,e(null,z.cores);if(typeof Blob>"u")return z.cores=2,e(null,z.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){for(var o=Date.now(),c=o+4;Date.now()<c;);self.postMessage({st:o,et:c})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,o,c){if(o===0){var d=Math.floor(a.reduce(function(l,u){return l+u},0)/a.length);return z.cores=Math.max(1,d),URL.revokeObjectURL(r),e(null,z.cores)}s(c,function(l,u){a.push(i(c,u)),n(a,o-1,c)})}function s(a,o){for(var c=[],d=[],l=0;l<a;++l){var u=new Worker(r);u.addEventListener("message",function(m){if(d.push(m.data),d.length===a){for(var f=0;f<a;++f)c[f].terminate();o(null,d)}}),c.push(u)}for(var l=0;l<a;++l)c[l].postMessage(l)}function i(a,o){for(var c=[],d=0;d<a;++d)for(var l=o[d],u=c[d]=[],m=0;m<a;++m)if(d!==m){var f=o[m];(l.st>f.st&&l.st<f.et||f.st>l.st&&f.st<l.et)&&u.push(m)}return c.reduce(function(p,g){return Math.max(p,g.length)},0)}}});var D4=ke((oti,Rct)=>{var Bi=Wt();xr();Rct.exports=Bi.cipher=Bi.cipher||{};Bi.cipher.algorithms=Bi.cipher.algorithms||{};Bi.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Bi.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Bi.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Bi.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Bi.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Bi.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Bi.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Bi.cipher.algorithms[t]=e};Bi.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Bi.cipher.algorithms?Bi.cipher.algorithms[t]:null};var Kfe=Bi.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Kfe.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Bi.util.createBuffer(),this.output=t.output||Bi.util.createBuffer(),this.mode.start(e)};Kfe.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Kfe.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var zfe=ke((cti,Act)=>{var Fi=Wt();xr();Fi.cipher=Fi.cipher||{};var tr=Act.exports=Fi.cipher.modes=Fi.cipher.modes||{};tr.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};tr.ecb.prototype.start=function(t){};tr.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};tr.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};tr.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};tr.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};tr.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};tr.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=j4(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};tr.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};tr.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};tr.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};tr.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};tr.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Fi.util.createBuffer(),this._partialBytes=0};tr.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=j4(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};tr.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=t.getInt32()^this._outBlock[s],e.putInt32(this._inBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=t.getInt32()^this._outBlock[s],this._partialOutput.putInt32(this._partialBlock[s]);if(i>0)t.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};tr.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=t.getInt32(),e.putInt32(this._inBlock[s]^this._outBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[s]^this._outBlock[s]);if(i>0)t.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};tr.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Fi.util.createBuffer(),this._partialBytes=0};tr.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=j4(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};tr.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(t.getInt32()^this._outBlock[s]),this._inBlock[s]=this._outBlock[s];return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(t.getInt32()^this._outBlock[s]);if(i>0)t.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._outBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};tr.ofb.prototype.decrypt=tr.ofb.prototype.encrypt;tr.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Fi.util.createBuffer(),this._partialBytes=0};tr.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=j4(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};tr.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var s=0;s<this._ints;++s)e.putInt32(t.getInt32()^this._outBlock[s]);else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(t.getInt32()^this._outBlock[s]);if(i>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}U4(this._inBlock)};tr.ctr.prototype.decrypt=tr.ctr.prototype.encrypt;tr.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Fi.util.createBuffer(),this._partialBytes=0,this._R=3774873600};tr.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Fi.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Fi.util.createBuffer(t.additionalData):r=Fi.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Fi.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vfe(n*8)))}this._inBlock=this._j0.slice(0),U4(this._inBlock),this._partialBytes=0,r=Fi.util.createBuffer(r),this._aDataLength=Vfe(r.length()*8);var s=r.length()%this.blockSize;for(s&&r.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};tr.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^=t.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(t.getInt32()^this._outBlock[s]);if(i<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(var s=0;s<this._ints;++s)this._outBlock[s]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),U4(this._inBlock)};tr.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),U4(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^this._hashBlock[s]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};tr.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=Fi.util.createBuffer();var n=this._aDataLength.concat(Vfe(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var s=[];this.cipher.encrypt(this._j0,s);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^s[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};tr.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),s=0;s<128;++s){var i=t[s/32|0]&1<<31-s%32;i&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};tr.gcm.prototype.pow=function(t,e){for(var r=t[3]&1,n=3;n>0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};tr.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,s=t[n]>>>(7-r%8)*4&15,i=this._m[r][s];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e};tr.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};tr.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,s=16*r,i=new Array(s),a=0;a<s;++a){var o=[0,0,0,0],c=a/n|0,d=(n-1-a%n)*e;o[c]=1<<e-1<<d,i[a]=this.generateSubHashTable(this.multiply(o,t),e)}return i};tr.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,s=new Array(r);s[n]=t.slice(0);for(var i=n>>>1;i>0;)this.pow(s[2*i],s[i]=[]),i>>=1;for(i=2;i<n;){for(var a=1;a<i;++a){var o=s[i],c=s[a];s[i+a]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<r;++i){var d=s[i^n];s[i]=[t[0]^d[0],t[1]^d[1],t[2]^d[2],t[3]^d[3]]}return s};function j4(t,e){if(typeof t=="string"&&(t=Fi.util.createBuffer(t)),Fi.util.isArray(t)&&t.length>4){var r=t;t=Fi.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!Fi.util.isArray(t)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(t.getInt32());t=s}return t}function U4(t){t[t.length-1]=t[t.length-1]+1&4294967295}function Vfe(t){return[t/4294967296|0,t&4294967295]}});var Mg=ke((dti,Pct)=>{var Cn=Wt();D4();zfe();xr();Pct.exports=Cn.aes=Cn.aes||{};Cn.aes.startEncrypting=function(t,e,r,n){var s=B4({key:t,output:r,decrypt:!1,mode:n});return s.start(e),s};Cn.aes.createEncryptionCipher=function(t,e){return B4({key:t,output:null,decrypt:!1,mode:e})};Cn.aes.startDecrypting=function(t,e,r,n){var s=B4({key:t,output:r,decrypt:!0,mode:n});return s.start(e),s};Cn.aes.createDecryptionCipher=function(t,e){return B4({key:t,output:null,decrypt:!0,mode:e})};Cn.aes.Algorithm=function(t,e){Yfe||xct();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,s){return Qfe(r._w,n,s,!1)},decrypt:function(n,s){return Qfe(r._w,n,s,!0)}}}),r._init=!1};Cn.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Cn.util.createBuffer(e);else if(Cn.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Cn.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(!Cn.util.isArray(e)){r=e,e=[];var s=r.length();if(s===16||s===24||s===32){s=s>>>2;for(var n=0;n<s;++n)e.push(r.getInt32())}}if(!Cn.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,a=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=Mct(e,t.decrypt&&!a),this._init=!0}};Cn.aes._expandKey=function(t,e){return Yfe||xct(),Mct(t,e)};Cn.aes._updateBlock=Qfe;RE("AES-ECB",Cn.cipher.modes.ecb);RE("AES-CBC",Cn.cipher.modes.cbc);RE("AES-CFB",Cn.cipher.modes.cfb);RE("AES-OFB",Cn.cipher.modes.ofb);RE("AES-CTR",Cn.cipher.modes.ctr);RE("AES-GCM",Cn.cipher.modes.gcm);function RE(t,e){var r=function(){return new Cn.aes.Algorithm(t,e)};Cn.cipher.registerAlgorithm(t,r)}var Yfe=!1,kE=4,lo,Xfe,Cct,EN,Wl;function xct(){Yfe=!0,Cct=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;lo=new Array(256),Xfe=new Array(256),EN=new Array(4),Wl=new Array(4);for(var e=0;e<4;++e)EN[e]=new Array(256),Wl[e]=new Array(256);for(var r=0,n=0,s,i,a,o,c,d,l,e=0;e<256;++e){o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^o&255^99,lo[r]=o,Xfe[o]=r,c=t[o],s=t[r],i=t[s],a=t[i],d=c<<24^o<<16^o<<8^(o^c),l=(s^i^a)<<24^(r^a)<<16^(r^i^a)<<8^(r^s^a);for(var u=0;u<4;++u)EN[u][r]=d,Wl[u][o]=l,d=d<<24|d>>>8,l=l<<24|l>>>8;r===0?r=n=1:(r=s^t[t[t[s^a]]],n^=t[t[n]])}}function Mct(t,e){for(var r=t.slice(0),n,s=1,i=r.length,a=i+6+1,o=kE*a,c=i;c<o;++c)n=r[c-1],c%i===0?(n=lo[n>>>16&255]<<24^lo[n>>>8&255]<<16^lo[n&255]<<8^lo[n>>>24]^Cct[s]<<24,s++):i>6&&c%i===4&&(n=lo[n>>>24]<<24^lo[n>>>16&255]<<16^lo[n>>>8&255]<<8^lo[n&255]),r[c]=r[c-i]^n;if(e){var d,l=Wl[0],u=Wl[1],m=Wl[2],f=Wl[3],p=r.slice(0);o=r.length;for(var c=0,g=o-kE;c<o;c+=kE,g-=kE)if(c===0||c===o-kE)p[c]=r[g],p[c+1]=r[g+3],p[c+2]=r[g+2],p[c+3]=r[g+1];else for(var _=0;_<kE;++_)d=r[g+_],p[c+(3&-_)]=l[lo[d>>>24]]^u[lo[d>>>16&255]]^m[lo[d>>>8&255]]^f[lo[d&255]];r=p}return r}function Qfe(t,e,r,n){var s=t.length/4-1,i,a,o,c,d;n?(i=Wl[0],a=Wl[1],o=Wl[2],c=Wl[3],d=Xfe):(i=EN[0],a=EN[1],o=EN[2],c=EN[3],d=lo);var l,u,m,f,p,g,_;l=e[0]^t[0],u=e[n?3:1]^t[1],m=e[2]^t[2],f=e[n?1:3]^t[3];for(var y=3,w=1;w<s;++w)p=i[l>>>24]^a[u>>>16&255]^o[m>>>8&255]^c[f&255]^t[++y],g=i[u>>>24]^a[m>>>16&255]^o[f>>>8&255]^c[l&255]^t[++y],_=i[m>>>24]^a[f>>>16&255]^o[l>>>8&255]^c[u&255]^t[++y],f=i[f>>>24]^a[l>>>16&255]^o[u>>>8&255]^c[m&255]^t[++y],l=p,u=g,m=_;r[0]=d[l>>>24]<<24^d[u>>>16&255]<<16^d[m>>>8&255]<<8^d[f&255]^t[++y],r[n?3:1]=d[u>>>24]<<24^d[m>>>16&255]<<16^d[f>>>8&255]<<8^d[l&255]^t[++y],r[2]=d[m>>>24]<<24^d[f>>>16&255]<<16^d[l>>>8&255]<<8^d[u&255]^t[++y],r[n?1:3]=d[f>>>24]<<24^d[l>>>16&255]<<16^d[u>>>8&255]<<8^d[m&255]^t[++y]}function B4(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Cn.cipher.createDecipher(r,t.key):n=Cn.cipher.createCipher(r,t.key);var s=n.start;return n.start=function(i,a){var o=null;a instanceof Cn.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=i,s.call(n,a)},n}});var Pg=ke((lti,Oct)=>{var KP=Wt();KP.pki=KP.pki||{};var Jfe=Oct.exports=KP.pki.oids=KP.oids=KP.oids||{};function we(t,e){Jfe[t]=e,Jfe[e]=t}function Xr(t,e){Jfe[t]=e}we("1.2.840.113549.1.1.1","rsaEncryption");we("1.2.840.113549.1.1.4","md5WithRSAEncryption");we("1.2.840.113549.1.1.5","sha1WithRSAEncryption");we("1.2.840.113549.1.1.7","RSAES-OAEP");we("1.2.840.113549.1.1.8","mgf1");we("1.2.840.113549.1.1.9","pSpecified");we("1.2.840.113549.1.1.10","RSASSA-PSS");we("1.2.840.113549.1.1.11","sha256WithRSAEncryption");we("1.2.840.113549.1.1.12","sha384WithRSAEncryption");we("1.2.840.113549.1.1.13","sha512WithRSAEncryption");we("1.3.101.112","EdDSA25519");we("1.2.840.10040.4.3","dsa-with-sha1");we("1.3.14.3.2.7","desCBC");we("1.3.14.3.2.26","sha1");we("1.3.14.3.2.29","sha1WithRSASignature");we("2.16.840.1.101.3.4.2.1","sha256");we("2.16.840.1.101.3.4.2.2","sha384");we("2.16.840.1.101.3.4.2.3","sha512");we("2.16.840.1.101.3.4.2.4","sha224");we("2.16.840.1.101.3.4.2.5","sha512-224");we("2.16.840.1.101.3.4.2.6","sha512-256");we("1.2.840.113549.2.2","md2");we("1.2.840.113549.2.5","md5");we("1.2.840.113549.1.7.1","data");we("1.2.840.113549.1.7.2","signedData");we("1.2.840.113549.1.7.3","envelopedData");we("1.2.840.113549.1.7.4","signedAndEnvelopedData");we("1.2.840.113549.1.7.5","digestedData");we("1.2.840.113549.1.7.6","encryptedData");we("1.2.840.113549.1.9.1","emailAddress");we("1.2.840.113549.1.9.2","unstructuredName");we("1.2.840.113549.1.9.3","contentType");we("1.2.840.113549.1.9.4","messageDigest");we("1.2.840.113549.1.9.5","signingTime");we("1.2.840.113549.1.9.6","counterSignature");we("1.2.840.113549.1.9.7","challengePassword");we("1.2.840.113549.1.9.8","unstructuredAddress");we("1.2.840.113549.1.9.14","extensionRequest");we("1.2.840.113549.1.9.20","friendlyName");we("1.2.840.113549.1.9.21","localKeyId");we("1.2.840.113549.1.9.22.1","x509Certificate");we("1.2.840.113549.1.12.10.1.1","keyBag");we("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");we("1.2.840.113549.1.12.10.1.3","certBag");we("1.2.840.113549.1.12.10.1.4","crlBag");we("1.2.840.113549.1.12.10.1.5","secretBag");we("1.2.840.113549.1.12.10.1.6","safeContentsBag");we("1.2.840.113549.1.5.13","pkcs5PBES2");we("1.2.840.113549.1.5.12","pkcs5PBKDF2");we("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");we("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");we("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");we("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");we("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");we("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");we("1.2.840.113549.2.7","hmacWithSHA1");we("1.2.840.113549.2.8","hmacWithSHA224");we("1.2.840.113549.2.9","hmacWithSHA256");we("1.2.840.113549.2.10","hmacWithSHA384");we("1.2.840.113549.2.11","hmacWithSHA512");we("1.2.840.113549.3.7","des-EDE3-CBC");we("2.16.840.1.101.3.4.1.2","aes128-CBC");we("2.16.840.1.101.3.4.1.22","aes192-CBC");we("2.16.840.1.101.3.4.1.42","aes256-CBC");we("2.5.4.3","commonName");we("2.5.4.4","surname");we("2.5.4.5","serialNumber");we("2.5.4.6","countryName");we("2.5.4.7","localityName");we("2.5.4.8","stateOrProvinceName");we("2.5.4.9","streetAddress");we("2.5.4.10","organizationName");we("2.5.4.11","organizationalUnitName");we("2.5.4.12","title");we("2.5.4.13","description");we("2.5.4.15","businessCategory");we("2.5.4.17","postalCode");we("2.5.4.42","givenName");we("2.5.4.65","pseudonym");we("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");we("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");we("2.16.840.1.113730.1.1","nsCertType");we("2.16.840.1.113730.1.13","nsComment");Xr("2.5.29.1","authorityKeyIdentifier");Xr("2.5.29.2","keyAttributes");Xr("2.5.29.3","certificatePolicies");Xr("2.5.29.4","keyUsageRestriction");Xr("2.5.29.5","policyMapping");Xr("2.5.29.6","subtreesConstraint");Xr("2.5.29.7","subjectAltName");Xr("2.5.29.8","issuerAltName");Xr("2.5.29.9","subjectDirectoryAttributes");Xr("2.5.29.10","basicConstraints");Xr("2.5.29.11","nameConstraints");Xr("2.5.29.12","policyConstraints");Xr("2.5.29.13","basicConstraints");we("2.5.29.14","subjectKeyIdentifier");we("2.5.29.15","keyUsage");Xr("2.5.29.16","privateKeyUsagePeriod");we("2.5.29.17","subjectAltName");we("2.5.29.18","issuerAltName");we("2.5.29.19","basicConstraints");Xr("2.5.29.20","cRLNumber");Xr("2.5.29.21","cRLReason");Xr("2.5.29.22","expirationDate");Xr("2.5.29.23","instructionCode");Xr("2.5.29.24","invalidityDate");Xr("2.5.29.25","cRLDistributionPoints");Xr("2.5.29.26","issuingDistributionPoint");Xr("2.5.29.27","deltaCRLIndicator");Xr("2.5.29.28","issuingDistributionPoint");Xr("2.5.29.29","certificateIssuer");Xr("2.5.29.30","nameConstraints");we("2.5.29.31","cRLDistributionPoints");we("2.5.29.32","certificatePolicies");Xr("2.5.29.33","policyMappings");Xr("2.5.29.34","policyConstraints");we("2.5.29.35","authorityKeyIdentifier");Xr("2.5.29.36","policyConstraints");we("2.5.29.37","extKeyUsage");Xr("2.5.29.46","freshestCRL");Xr("2.5.29.54","inhibitAnyPolicy");we("1.3.6.1.4.1.11129.2.4.2","timestampList");we("1.3.6.1.5.5.7.1.1","authorityInfoAccess");we("1.3.6.1.5.5.7.3.1","serverAuth");we("1.3.6.1.5.5.7.3.2","clientAuth");we("1.3.6.1.5.5.7.3.3","codeSigning");we("1.3.6.1.5.5.7.3.4","emailProtection");we("1.3.6.1.5.5.7.3.8","timeStamping")});var Gl=ke((uti,Lct)=>{var Fn=Wt();xr();Pg();var qe=Lct.exports=Fn.asn1=Fn.asn1||{};qe.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};qe.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};qe.maxDepth=256;qe.create=function(t,e,r,n,s){if(Fn.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var o={tagClass:t,type:e,constructed:r,composed:r||Fn.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(o.bitStringContents=s.bitStringContents,o.original=qe.copy(o)),o};qe.copy=function(t,e){var r;if(Fn.util.isArray(t)){r=[];for(var n=0;n<t.length;++n)r.push(qe.copy(t[n],e));return r}return typeof t=="string"?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:qe.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)};qe.equals=function(t,e,r){if(Fn.util.isArray(t)){if(!Fn.util.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!qe.equals(t[n],e[n]))return!1;return!0}if(typeof t!=typeof e)return!1;if(typeof t=="string")return t===e;var s=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&qe.equals(t.value,e.value);return r&&r.includeBitStringContents&&(s=s&&t.bitStringContents===e.bitStringContents),s};qe.getBerValueLength=function(t){var e=t.getByte();if(e!==128){var r,n=e&128;return n?r=t.getInt((e&127)<<3):r=e,r}};function VP(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var ann=function(t,e){var r=t.getByte();if(e--,r!==128){var n,s=r&128;if(!s)n=r;else{var i=r&127;VP(t,e,i),n=t.getInt(i<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};qe.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=qe.maxDepth),typeof t=="string"&&(t=Fn.util.createBuffer(t));var r=t.length(),n=F4(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=t.length(),s}return n};function F4(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var s;VP(t,e,2);var i=t.getByte();e--;var a=i&192,o=i&31;s=t.length();var c=ann(t,e);if(e-=s-t.length(),c!==void 0&&c>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=c,d}c=e}var l,u,m=(i&32)===32;if(m)if(l=[],c===void 0)for(;;){if(VP(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}s=t.length(),l.push(F4(t,e,r+1,n)),e-=s-t.length()}else for(;c>0;)s=t.length(),l.push(F4(t,c,r+1,n)),e-=s-t.length(),c-=s-t.length();if(l===void 0&&a===qe.Class.UNIVERSAL&&o===qe.Type.BITSTRING&&(u=t.bytes(c)),l===void 0&&n.decodeBitStrings&&a===qe.Class.UNIVERSAL&&o===qe.Type.BITSTRING&&c>1){var f=t.read,p=e,g=0;if(o===qe.Type.BITSTRING&&(VP(t,e,1),g=t.getByte(),e--),g===0)try{s=t.length();var _={strict:!0,decodeBitStrings:!0},y=F4(t,e,r+1,_),w=s-t.length();e-=w,o==qe.Type.BITSTRING&&w++;var N=y.tagClass;w===c&&(N===qe.Class.UNIVERSAL||N===qe.Class.CONTEXT_SPECIFIC)&&(l=[y])}catch{}l===void 0&&(t.read=f,e=p)}if(l===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(o===qe.Type.BMPSTRING)for(l="";c>0;c-=2)VP(t,e,2),l+=String.fromCharCode(t.getInt16()),e-=2;else l=t.getBytes(c),e-=c}var v=u===void 0?null:{bitStringContents:u};return qe.create(a,o,m,l,v)}qe.toDer=function(t){var e=Fn.util.createBuffer(),r=t.tagClass|t.type,n=Fn.util.createBuffer(),s=!1;if("bitStringContents"in t&&(s=!0,t.original&&(s=qe.equals(t,t.original))),s)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var i=0;i<t.value.length;++i)t.value[i]!==void 0&&n.putBuffer(qe.toDer(t.value[i]))}else if(t.type===qe.Type.BMPSTRING)for(var i=0;i<t.value.length;++i)n.putInt16(t.value.charCodeAt(i));else t.type===qe.Type.INTEGER&&t.value.length>1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var a=n.length(),o="";do o+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(o.length|128);for(var i=o.length-1;i>=0;--i)e.putByte(o.charCodeAt(i))}return e.putBuffer(n),e};qe.oidToDer=function(t){var e=t.split("."),r=Fn.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,o=2;o<e.length;++o){if(n=!0,s=[],i=parseInt(e[o],10),i>4294967295)throw new Error("OID value too large; max is 32-bits.");do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var c=s.length-1;c>=0;--c)r.putByte(s[c])}return r};qe.derToOid=function(t){var e;typeof t=="string"&&(t=Fn.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};qe.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,s=parseInt(t.substr(4,2),10),i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),o=0;if(t.length>11){var c=t.charAt(10),d=10;c!=="+"&&c!=="-"&&(o=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,s),e.setUTCHours(i,a,o,0),d&&(c=t.charAt(d),c==="+"||c==="-")){var l=parseInt(t.substr(d+1,2),10),u=parseInt(t.substr(d+4,2),10),m=l*60+u;m*=6e4,c==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};qe.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,s=parseInt(t.substr(6,2),10),i=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),c=0,d=0,l=!1;t.charAt(t.length-1)==="Z"&&(l=!0);var u=t.length-5,m=t.charAt(u);if(m==="+"||m==="-"){var f=parseInt(t.substr(u+1,2),10),p=parseInt(t.substr(u+4,2),10);d=f*60+p,d*=6e4,m==="+"&&(d*=-1),l=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),l?(e.setUTCFullYear(r,n,s),e.setUTCHours(i,a,o,c),e.setTime(+e+d)):(e.setFullYear(r,n,s),e.setHours(i,a,o,c)),e};qe.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};qe.dateToGeneralizedTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};qe.integerToDer=function(t){var e=Fn.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};qe.derToInteger=function(t){typeof t=="string"&&(t=Fn.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};qe.validate=function(t,e,r,n){var s=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(s=!0,e.value&&Fn.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a){var o=e.value[a];s=!!o.optional;var c=t.value[i];if(!c){o.optional||(s=!1,n&&n.push("["+e.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var d=typeof o.tagClass<"u"&&typeof o.type<"u";if(d&&(c.tagClass!==o.tagClass||c.type!==o.type))if(o.optional){s=!0;continue}else{s=!1,n&&n.push("["+e.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+c.tagClass+","+c.type+")");break}var l=qe.validate(c,o,r,n);if(l)++i,s=!0;else if(o.optional)s=!0;else{s=!1;break}}if(s&&r&&(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)){var u;if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{var m=t.bitStringContents.charCodeAt(0);if(m!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');else n&&(t.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));return s};var qct=/[^\\u0000-\\u00ff]/;qe.prettyPrint=function(t,e,r){var n="";e=e||0,r=r||2,e>0&&(n+=`