@mapcatch/util 2.1.2-a → 2.1.2-b
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.
package/dist/catchUtil.min.js
CHANGED
|
@@ -205,7 +205,7 @@ Current state: `+u[s]+`
|
|
|
205
205
|
`)}for(H=0;H<m;++H){o=r[H];var Ye=o.match(/\S*/g),tt=[];for(x=0;x<Ye.length;++x)Ye[x]!==""&&tt.push(Ye[x]);if(tt.length!==0){for(x=0;x<u.length&&o.substr(0,u[x].length)!==u[x];++x);if(x<u.length){if(s=x,x===1&&(Ze=tt[1]),x===6)return{name:Ze,c:Ve,A:numeric.transpose(er),b:st,rows:Re,vars:Fe};continue}switch(s){case 0:case 1:Ke("Unexpected line");case 2:switch(tt[0]){case"N":F===0?F=tt[1]:Ke("Two or more N rows");break;case"L":Re[tt[1]]=Ue,He[Ue]=1,st[Ue]=0,++Ue;break;case"G":Re[tt[1]]=Ue,He[Ue]=-1,st[Ue]=0,++Ue;break;case"E":Re[tt[1]]=Ue,He[Ue]=0,st[Ue]=0,++Ue;break;default:Ke("Parse error "+numeric.prettyPrint(tt))}break;case 3:Fe.hasOwnProperty(tt[0])||(Fe[tt[0]]=nt,Ve[nt]=0,er[nt]=numeric.rep([Ue],0),++nt);var Je=Fe[tt[0]];for(x=1;x<tt.length;x+=2){if(tt[x]===F){Ve[Je]=parseFloat(tt[x+1]);continue}var rr=Re[tt[x]];er[Je][rr]=(He[rr]<0?-1:1)*parseFloat(tt[x+1])}break;case 4:for(x=1;x<tt.length;x+=2)st[Re[tt[x]]]=(He[Re[tt[x]]]<0?-1:1)*parseFloat(tt[x+1]);break;case 5:break;case 6:Ke("Internal error")}}}Ke("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(e,r,s,u,m,H,x){r.seedrandom=function(Fe,nt){var Ze=[],Ve;return Fe=Re(F(nt?[Fe,e]:arguments.length?Fe:[new Date().getTime(),e,window],3),Ze),Ve=new o(Ze),Re(Ve.S,e),r.random=function(){for(var st=Ve.g(u),Ke=x,Ye=0;st<m;)st=(st+Ye)*s,Ke*=s,Ye=Ve.g(1);for(;st>=H;)st/=2,Ke/=2,Ye>>>=1;return(st+Ye)/Ke},Fe};function o(Ue){var Fe,nt,Ze=this,Ve=Ue.length,er=0,st=Ze.i=Ze.j=Ze.m=0;for(Ze.S=[],Ze.c=[],Ve||(Ue=[Ve++]);er<s;)Ze.S[er]=er++;for(er=0;er<s;er++)Fe=Ze.S[er],st=He(st+Fe+Ue[er%Ve]),nt=Ze.S[st],Ze.S[er]=nt,Ze.S[st]=Fe;Ze.g=function(Ye){var tt=Ze.S,Je=He(Ze.i+1),rr=tt[Je],Rr=He(Ze.j+rr),ar=tt[Rr];tt[Je]=ar,tt[Rr]=rr;for(var Ar=tt[He(rr+ar)];--Ye;)Je=He(Je+1),rr=tt[Je],Rr=He(Rr+rr),ar=tt[Rr],tt[Je]=ar,tt[Rr]=rr,Ar=Ar*s+tt[He(rr+ar)];return Ze.i=Je,Ze.j=Rr,Ar},Ze.g(s)}function F(Ue,Fe,nt,Ze,Ve){if(nt=[],Ve=typeof Ue,Fe&&Ve=="object"){for(Ze in Ue)if(Ze.indexOf("S")<5)try{nt.push(F(Ue[Ze],Fe-1))}catch{}}return nt.length?nt:Ue+(Ve!="string"?"\0":"")}function Re(Ue,Fe,nt,Ze){for(Ue+="",nt=0,Ze=0;Ze<Ue.length;Ze++)Fe[He(Ze)]=He((nt^=Fe[He(Ze)]*19)+Ue.charCodeAt(Ze));Ue="";for(Ze in Fe)Ue+=String.fromCharCode(Fe[Ze]);return Ue}function He(Ue){return Ue&s-1}x=r.pow(s,u),m=r.pow(2,m),H=m*2,Re(r.random(),e)}([],numeric.seedrandom,256,6,52),function(e){function r(F){if(typeof F!="object")return F;var Re=[],He,Ue=F.length;for(He=0;He<Ue;He++)Re[He+1]=r(F[He]);return Re}function s(F){if(typeof F!="object")return F;var Re=[],He,Ue=F.length;for(He=1;He<Ue;He++)Re[He-1]=s(F[He]);return Re}function u(F,Re,He){var Ue,Fe,nt,Ze,Ve;for(nt=1;nt<=He;nt=nt+1){for(F[nt][nt]=1/F[nt][nt],Ve=-F[nt][nt],Ue=1;Ue<nt;Ue=Ue+1)F[Ue][nt]=Ve*F[Ue][nt];if(Ze=nt+1,He<Ze)break;for(Fe=Ze;Fe<=He;Fe=Fe+1)for(Ve=F[nt][Fe],F[nt][Fe]=0,Ue=1;Ue<=nt;Ue=Ue+1)F[Ue][Fe]=F[Ue][Fe]+Ve*F[Ue][nt]}}function m(F,Re,He,Ue){var Fe,nt,Ze,Ve;for(nt=1;nt<=He;nt=nt+1){for(Ve=0,Fe=1;Fe<nt;Fe=Fe+1)Ve=Ve+F[Fe][nt]*Ue[Fe];Ue[nt]=(Ue[nt]-Ve)/F[nt][nt]}for(Ze=1;Ze<=He;Ze=Ze+1)for(nt=He+1-Ze,Ue[nt]=Ue[nt]/F[nt][nt],Ve=-Ue[nt],Fe=1;Fe<nt;Fe=Fe+1)Ue[Fe]=Ue[Fe]+Ve*F[Fe][nt]}function H(F,Re,He,Ue){var Fe,nt,Ze,Ve,er,st;for(nt=1;nt<=He;nt=nt+1){if(Ue[1]=nt,st=0,Ze=nt-1,Ze<1){if(st=F[nt][nt]-st,st<=0)break;F[nt][nt]=Math.sqrt(st)}else{for(Ve=1;Ve<=Ze;Ve=Ve+1){for(er=F[Ve][nt],Fe=1;Fe<Ve;Fe=Fe+1)er=er-F[Fe][nt]*F[Fe][Ve];er=er/F[Ve][Ve],F[Ve][nt]=er,st=st+er*er}if(st=F[nt][nt]-st,st<=0)break;F[nt][nt]=Math.sqrt(st)}Ue[1]=0}}function x(F,Re,He,Ue,Fe,nt,Ze,Ve,er,st,Ke,Ye,tt,Je,rr,Rr){var ar,Ar,mr,Pr,Nr,Ra,ta,ha,Ea,fa,ga,Ja,Ba,Pn,_n,cn,ui,Vn,fn,kn,Ln,On,Ci,So,ii,ti,fi;Ba=Math.min(Ue,st),mr=2*Ue+Ba*(Ba+5)/2+2*st+1,So=1e-60;do So=So+So,ii=1+.1*So,ti=1+.2*So;while(ii<=1||ti<=1);for(ar=1;ar<=Ue;ar=ar+1)rr[ar]=Re[ar];for(ar=Ue+1;ar<=mr;ar=ar+1)rr[ar]=0;for(ar=1;ar<=st;ar=ar+1)Ye[ar]=0;if(Nr=[],Rr[1]===0){if(H(F,He,Ue,Nr),Nr[1]!==0){Rr[1]=2;return}m(F,He,Ue,Re),u(F,He,Ue)}else{for(Ar=1;Ar<=Ue;Ar=Ar+1)for(Fe[Ar]=0,ar=1;ar<=Ar;ar=ar+1)Fe[Ar]=Fe[Ar]+F[ar][Ar]*Re[ar];for(Ar=1;Ar<=Ue;Ar=Ar+1)for(Re[Ar]=0,ar=Ar;ar<=Ue;ar=ar+1)Re[Ar]=Re[Ar]+F[Ar][ar]*Fe[ar]}for(nt[1]=0,Ar=1;Ar<=Ue;Ar=Ar+1)for(Fe[Ar]=Re[Ar],nt[1]=nt[1]+rr[Ar]*Fe[Ar],rr[Ar]=0,ar=Ar+1;ar<=Ue;ar=ar+1)F[ar][Ar]=0;for(nt[1]=-nt[1]/2,Rr[1]=0,ta=Ue,ha=ta+Ue,ga=ha+Ba,Ea=ga+Ba+1,fa=Ea+Ba*(Ba+1)/2,Pn=fa+st,ar=1;ar<=st;ar=ar+1){for(cn=0,Ar=1;Ar<=Ue;Ar=Ar+1)cn=cn+Ze[Ar][ar]*Ze[Ar][ar];rr[Pn+ar]=Math.sqrt(cn)}tt=0,Je[1]=0,Je[2]=0;function Zi(){for(Je[1]=Je[1]+1,mr=fa,ar=1;ar<=st;ar=ar+1){for(mr=mr+1,cn=-Ve[ar],Ar=1;Ar<=Ue;Ar=Ar+1)cn=cn+Ze[Ar][ar]*Fe[Ar];if(Math.abs(cn)<So&&(cn=0),ar>Ke)rr[mr]=cn;else if(rr[mr]=-Math.abs(cn),cn>0){for(Ar=1;Ar<=Ue;Ar=Ar+1)Ze[Ar][ar]=-Ze[Ar][ar];Ve[ar]=-Ve[ar]}}for(ar=1;ar<=tt;ar=ar+1)rr[fa+Ye[ar]]=0;for(Ja=0,_n=0,ar=1;ar<=st;ar=ar+1)rr[fa+ar]<_n*rr[Pn+ar]&&(Ja=ar,_n=rr[fa+ar]/rr[Pn+ar]);return Ja===0?999:0}function $i(){for(ar=1;ar<=Ue;ar=ar+1){for(cn=0,Ar=1;Ar<=Ue;Ar=Ar+1)cn=cn+F[Ar][ar]*Ze[Ar][Ja];rr[ar]=cn}for(Pr=ta,ar=1;ar<=Ue;ar=ar+1)rr[Pr+ar]=0;for(Ar=tt+1;Ar<=Ue;Ar=Ar+1)for(ar=1;ar<=Ue;ar=ar+1)rr[Pr+ar]=rr[Pr+ar]+F[ar][Ar]*rr[Ar];for(On=!0,ar=tt;ar>=1;ar=ar-1){for(cn=rr[ar],mr=Ea+ar*(ar+3)/2,Pr=mr-ar,Ar=ar+1;Ar<=tt;Ar=Ar+1)cn=cn-rr[mr]*rr[ha+Ar],mr=mr+Ar;if(cn=cn/rr[Pr],rr[ha+ar]=cn,Ye[ar]<Ke||cn<0)break;On=!1,Ra=ar}if(!On)for(ui=rr[ga+Ra]/rr[ha+Ra],ar=1;ar<=tt&&!(Ye[ar]<Ke||rr[ha+ar]<0);ar=ar+1)_n=rr[ga+ar]/rr[ha+ar],_n<ui&&(ui=_n,Ra=ar);for(cn=0,ar=ta+1;ar<=ta+Ue;ar=ar+1)cn=cn+rr[ar]*rr[ar];if(Math.abs(cn)<=So){if(On)return Rr[1]=1,999;for(ar=1;ar<=tt;ar=ar+1)rr[ga+ar]=rr[ga+ar]-ui*rr[ha+ar];return rr[ga+tt+1]=rr[ga+tt+1]+ui,700}else{for(cn=0,ar=1;ar<=Ue;ar=ar+1)cn=cn+rr[ta+ar]*Ze[ar][Ja];for(Vn=-rr[fa+Ja]/cn,Ci=!0,On||ui<Vn&&(Vn=ui,Ci=!1),ar=1;ar<=Ue;ar=ar+1)Fe[ar]=Fe[ar]+Vn*rr[ta+ar],Math.abs(Fe[ar])<So&&(Fe[ar]=0);for(nt[1]=nt[1]+Vn*cn*(Vn/2+rr[ga+tt+1]),ar=1;ar<=tt;ar=ar+1)rr[ga+ar]=rr[ga+ar]-Vn*rr[ha+ar];if(rr[ga+tt+1]=rr[ga+tt+1]+Vn,Ci){for(tt=tt+1,Ye[tt]=Ja,mr=Ea+(tt-1)*tt/2+1,ar=1;ar<=tt-1;ar=ar+1)rr[mr]=rr[ar],mr=mr+1;if(tt===Ue)rr[mr]=rr[Ue];else{for(ar=Ue;ar>=tt+1&&!(rr[ar]===0||(fn=Math.max(Math.abs(rr[ar-1]),Math.abs(rr[ar])),kn=Math.min(Math.abs(rr[ar-1]),Math.abs(rr[ar])),rr[ar-1]>=0?_n=Math.abs(fn*Math.sqrt(1+kn*kn/(fn*fn))):_n=-Math.abs(fn*Math.sqrt(1+kn*kn/(fn*fn))),fn=rr[ar-1]/_n,kn=rr[ar]/_n,fn===1));ar=ar-1)if(fn===0)for(rr[ar-1]=kn*_n,Ar=1;Ar<=Ue;Ar=Ar+1)_n=F[Ar][ar-1],F[Ar][ar-1]=F[Ar][ar],F[Ar][ar]=_n;else for(rr[ar-1]=_n,Ln=kn/(1+fn),Ar=1;Ar<=Ue;Ar=Ar+1)_n=fn*F[Ar][ar-1]+kn*F[Ar][ar],F[Ar][ar]=Ln*(F[Ar][ar-1]+_n)-F[Ar][ar],F[Ar][ar-1]=_n;rr[mr]=rr[tt]}}else{for(cn=-Ve[Ja],Ar=1;Ar<=Ue;Ar=Ar+1)cn=cn+Fe[Ar]*Ze[Ar][Ja];if(Ja>Ke)rr[fa+Ja]=cn;else if(rr[fa+Ja]=-Math.abs(cn),cn>0){for(Ar=1;Ar<=Ue;Ar=Ar+1)Ze[Ar][Ja]=-Ze[Ar][Ja];Ve[Ja]=-Ve[Ja]}return 700}}return 0}function _o(){if(mr=Ea+Ra*(Ra+1)/2+1,Pr=mr+Ra,rr[Pr]===0||(fn=Math.max(Math.abs(rr[Pr-1]),Math.abs(rr[Pr])),kn=Math.min(Math.abs(rr[Pr-1]),Math.abs(rr[Pr])),rr[Pr-1]>=0?_n=Math.abs(fn*Math.sqrt(1+kn*kn/(fn*fn))):_n=-Math.abs(fn*Math.sqrt(1+kn*kn/(fn*fn))),fn=rr[Pr-1]/_n,kn=rr[Pr]/_n,fn===1))return 798;if(fn===0){for(ar=Ra+1;ar<=tt;ar=ar+1)_n=rr[Pr-1],rr[Pr-1]=rr[Pr],rr[Pr]=_n,Pr=Pr+ar;for(ar=1;ar<=Ue;ar=ar+1)_n=F[ar][Ra],F[ar][Ra]=F[ar][Ra+1],F[ar][Ra+1]=_n}else{for(Ln=kn/(1+fn),ar=Ra+1;ar<=tt;ar=ar+1)_n=fn*rr[Pr-1]+kn*rr[Pr],rr[Pr]=Ln*(rr[Pr-1]+_n)-rr[Pr],rr[Pr-1]=_n,Pr=Pr+ar;for(ar=1;ar<=Ue;ar=ar+1)_n=fn*F[ar][Ra]+kn*F[ar][Ra+1],F[ar][Ra+1]=Ln*(F[ar][Ra]+_n)-F[ar][Ra+1],F[ar][Ra]=_n}return 0}function Yi(){for(Pr=mr-Ra,ar=1;ar<=Ra;ar=ar+1)rr[Pr]=rr[mr],mr=mr+1,Pr=Pr+1;return rr[ga+Ra]=rr[ga+Ra+1],Ye[Ra]=Ye[Ra+1],Ra=Ra+1,Ra<tt?797:0}function ao(){return rr[ga+tt]=rr[ga+tt+1],rr[ga+tt+1]=0,Ye[tt]=0,tt=tt-1,Je[2]=Je[2]+1,0}for(fi=0;;){if(fi=Zi(),fi===999)return;for(;fi=$i(),fi!==0;){if(fi===999)return;if(fi===700)if(Ra===tt)ao();else{for(;_o(),fi=Yi(),fi===797;);ao()}}}}function o(F,Re,He,Ue,Fe,nt){F=r(F),Re=r(Re),He=r(He);var Ze,Ve,er,st,Ke,Ye=[],tt=[],Je=[],rr=[],Rr=[],ar;if(Fe=Fe||0,nt=nt?r(nt):[void 0,0],Ue=Ue?r(Ue):[],Ve=F.length-1,er=He[1].length-1,!Ue)for(Ze=1;Ze<=er;Ze=Ze+1)Ue[Ze]=0;for(Ze=1;Ze<=er;Ze=Ze+1)tt[Ze]=0;for(st=0,Ke=Math.min(Ve,er),Ze=1;Ze<=Ve;Ze=Ze+1)Je[Ze]=0;for(Ye[1]=0,Ze=1;Ze<=2*Ve+Ke*(Ke+5)/2+2*er+1;Ze=Ze+1)rr[Ze]=0;for(Ze=1;Ze<=2;Ze=Ze+1)Rr[Ze]=0;return x(F,Re,Ve,Ve,Je,Ye,He,Ue,Ve,er,Fe,tt,st,Rr,rr,nt),ar="",nt[1]===1&&(ar="constraints are inconsistent, no solution!"),nt[1]===2&&(ar="matrix D in quadratic function is not positive definite!"),{solution:s(Je),value:s(Ye),unconstrained_solution:s(Re),iterations:s(Rr),iact:s(tt),message:ar}}e.solveQP=o}(numeric),numeric.svd=function e(r){var s,u=numeric.epsilon,m=1e-64/u,H=50,x=0,o=0,F=0,Re=0,He=0,Ue=numeric.clone(r),Fe=Ue.length,nt=Ue[0].length;if(Fe<nt)throw"Need more rows than columns";var Ze=new Array(nt),Ve=new Array(nt);for(o=0;o<nt;o++)Ze[o]=Ve[o]=0;var er=numeric.rep([nt,nt],0);function st(Nr,Ra){return Nr=Math.abs(Nr),Ra=Math.abs(Ra),Nr>Ra?Nr*Math.sqrt(1+Ra*Ra/Nr/Nr):Ra==0?Nr:Ra*Math.sqrt(1+Nr*Nr/Ra/Ra)}var Ke=0,Ye=0,tt=0,Je=0,rr=0,Rr=0,ar=0;for(o=0;o<nt;o++){for(Ze[o]=Ye,ar=0,He=o+1,F=o;F<Fe;F++)ar+=Ue[F][o]*Ue[F][o];if(ar<=m)Ye=0;else for(Ke=Ue[o][o],Ye=Math.sqrt(ar),Ke>=0&&(Ye=-Ye),tt=Ke*Ye-ar,Ue[o][o]=Ke-Ye,F=He;F<nt;F++){for(ar=0,Re=o;Re<Fe;Re++)ar+=Ue[Re][o]*Ue[Re][F];for(Ke=ar/tt,Re=o;Re<Fe;Re++)Ue[Re][F]+=Ke*Ue[Re][o]}for(Ve[o]=Ye,ar=0,F=He;F<nt;F++)ar=ar+Ue[o][F]*Ue[o][F];if(ar<=m)Ye=0;else{for(Ke=Ue[o][o+1],Ye=Math.sqrt(ar),Ke>=0&&(Ye=-Ye),tt=Ke*Ye-ar,Ue[o][o+1]=Ke-Ye,F=He;F<nt;F++)Ze[F]=Ue[o][F]/tt;for(F=He;F<Fe;F++){for(ar=0,Re=He;Re<nt;Re++)ar+=Ue[F][Re]*Ue[o][Re];for(Re=He;Re<nt;Re++)Ue[F][Re]+=ar*Ze[Re]}}rr=Math.abs(Ve[o])+Math.abs(Ze[o]),rr>Je&&(Je=rr)}for(o=nt-1;o!=-1;o+=-1){if(Ye!=0){for(tt=Ye*Ue[o][o+1],F=He;F<nt;F++)er[F][o]=Ue[o][F]/tt;for(F=He;F<nt;F++){for(ar=0,Re=He;Re<nt;Re++)ar+=Ue[o][Re]*er[Re][F];for(Re=He;Re<nt;Re++)er[Re][F]+=ar*er[Re][o]}}for(F=He;F<nt;F++)er[o][F]=0,er[F][o]=0;er[o][o]=1,Ye=Ze[o],He=o}for(o=nt-1;o!=-1;o+=-1){for(He=o+1,Ye=Ve[o],F=He;F<nt;F++)Ue[o][F]=0;if(Ye!=0){for(tt=Ue[o][o]*Ye,F=He;F<nt;F++){for(ar=0,Re=He;Re<Fe;Re++)ar+=Ue[Re][o]*Ue[Re][F];for(Ke=ar/tt,Re=o;Re<Fe;Re++)Ue[Re][F]+=Ke*Ue[Re][o]}for(F=o;F<Fe;F++)Ue[F][o]=Ue[F][o]/Ye}else for(F=o;F<Fe;F++)Ue[F][o]=0;Ue[o][o]+=1}for(u=u*Je,Re=nt-1;Re!=-1;Re+=-1)for(var Ar=0;Ar<H;Ar++){var mr=!1;for(He=Re;He!=-1;He+=-1){if(Math.abs(Ze[He])<=u){mr=!0;break}if(Math.abs(Ve[He-1])<=u)break}if(!mr){x=0,ar=1;var Pr=He-1;for(o=He;o<Re+1&&(Ke=ar*Ze[o],Ze[o]=x*Ze[o],!(Math.abs(Ke)<=u));o++)for(Ye=Ve[o],tt=st(Ke,Ye),Ve[o]=tt,x=Ye/tt,ar=-Ke/tt,F=0;F<Fe;F++)rr=Ue[F][Pr],Rr=Ue[F][o],Ue[F][Pr]=rr*x+Rr*ar,Ue[F][o]=-rr*ar+Rr*x}if(Rr=Ve[Re],He==Re){if(Rr<0)for(Ve[Re]=-Rr,F=0;F<nt;F++)er[F][Re]=-er[F][Re];break}if(Ar>=H-1)throw"Error: no convergence.";for(Je=Ve[He],rr=Ve[Re-1],Ye=Ze[Re-1],tt=Ze[Re],Ke=((rr-Rr)*(rr+Rr)+(Ye-tt)*(Ye+tt))/(2*tt*rr),Ye=st(Ke,1),Ke<0?Ke=((Je-Rr)*(Je+Rr)+tt*(rr/(Ke-Ye)-tt))/Je:Ke=((Je-Rr)*(Je+Rr)+tt*(rr/(Ke+Ye)-tt))/Je,x=1,ar=1,o=He+1;o<Re+1;o++){for(Ye=Ze[o],rr=Ve[o],tt=ar*Ye,Ye=x*Ye,Rr=st(Ke,tt),Ze[o-1]=Rr,x=Ke/Rr,ar=tt/Rr,Ke=Je*x+Ye*ar,Ye=-Je*ar+Ye*x,tt=rr*ar,rr=rr*x,F=0;F<nt;F++)Je=er[F][o-1],Rr=er[F][o],er[F][o-1]=Je*x+Rr*ar,er[F][o]=-Je*ar+Rr*x;for(Rr=st(Ke,tt),Ve[o-1]=Rr,x=Ke/Rr,ar=tt/Rr,Ke=x*Ye+ar*rr,Je=-ar*Ye+x*rr,F=0;F<Fe;F++)rr=Ue[F][o-1],Rr=Ue[F][o],Ue[F][o-1]=rr*x+Rr*ar,Ue[F][o]=-rr*ar+Rr*x}Ze[He]=0,Ze[Re]=Ke,Ve[Re]=Je}for(o=0;o<Ve.length;o++)Ve[o]<u&&(Ve[o]=0);for(o=0;o<nt;o++)for(F=o-1;F>=0;F--)if(Ve[F]<Ve[o]){for(x=Ve[F],Ve[F]=Ve[o],Ve[o]=x,Re=0;Re<Ue.length;Re++)s=Ue[Re][o],Ue[Re][o]=Ue[Re][F],Ue[Re][F]=s;for(Re=0;Re<er.length;Re++)s=er[Re][o],er[Re][o]=er[Re][F],er[Re][F]=s;o=F}return{U:Ue,S:Ve,V:er}}});function _calc(e){if(e.length<4)return{gdop:"#",pdop:"#",vdop:"#",hdop:"#"};var r=numeric1_2_6.rep([e.length,4],0),s=[],u=[];e.forEach(function(Ue,Fe){s.push(Ue.az),u.push(Ue.el);var nt=[Math.cos(Ue.el*Math.PI/180)*Math.sin(Ue.az*Math.PI/180),Math.cos(Ue.el*Math.PI/180)*Math.cos(Ue.az*Math.PI/180),Math.sin(Ue.el*Math.PI/180),1];numeric1_2_6.setBlock(r,[Fe,0],[Fe,3],[nt])});var m=numeric1_2_6.dot(numeric1_2_6.transpose(r),r),H=numeric1_2_6.inv(m),x=2,o=Math.sqrt(H[0][0]+H[1][1]+H[2][2]).toFixed(x),F=Math.sqrt(H[0][0]+H[1][1]).toFixed(x),Re=Math.sqrt(H[0][0]+H[1][1]+H[2][2]+H[3][3]).toFixed(x),He=Math.sqrt(H[2][2]).toFixed(x);return{pdop:o,hdop:F,gdop:Re,vdop:He}}var dop={calc_dop:_calc},zero=315936e3,gpsLeapMS=[468288e5,78364801e3,109900802e3,173059203e3,252028804e3,315187205e3,346723206e3,393984007e3,425520008e3,457056009e3,50448961e4,551750411e3,599184012e3,820108813e3,914803214e3,1025136015e3,1119744016e3,1167264017e3],gpsLeapS=gpsLeapMS.map(function(e){return e/1e3});function w2uOrigin(e){var r=e.wn,s=e.tow,u=Number(r)*7*24*60*60+Number(s),m=0;return gpsLeapS.forEach(function(H){u>H&&m++}),zero+u-m}function u2wOrigin(e){for(var r=Number(e)-zero,s=0;s<gpsLeapS.length;s++)r+1>=gpsLeapS[s]&&r++;var u=Number((r/604800).toFixed(0)),m=r%604800;return{wn:u,tow:m}}var gpsweek={u2w:u2wOrigin,w2u:w2uOrigin},index={coordinateTransfer,mercator,dop,gpsweek};return index})})(bundle);const satellite_geo_calc=bundle.exports;function globals(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var r=1;r<=60;++r)e("EPSG:"+(32600+r),"+proj=utm +zone="+r+" +datum=WGS84 +units=m"),e("EPSG:"+(32700+r),"+proj=utm +zone="+r+" +south +datum=WGS84 +units=m");e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var PJD_3PARAM=1,PJD_7PARAM=2,PJD_GRIDSHIFT=3,PJD_WGS84=4,PJD_NODATUM=5,SRS_WGS84_SEMIMAJOR=6378137,SRS_WGS84_SEMIMINOR=6356752314e-3,SRS_WGS84_ESQUARED=.0066943799901413165,SEC_TO_RAD=484813681109536e-20,HALF_PI=Math.PI/2,SIXTH=.16666666666666666,RA4=.04722222222222222,RA6=.022156084656084655,EPSLN=1e-10,D2R$1=.017453292519943295,R2D=57.29577951308232,FORTPI=Math.PI/4,TWO_PI=Math.PI*2,SPI=3.14159265359,primeMeridian={};primeMeridian.greenwich=0,primeMeridian.lisbon=-9.131906111111,primeMeridian.paris=2.337229166667,primeMeridian.bogota=-74.080916666667,primeMeridian.madrid=-3.687938888889,primeMeridian.rome=12.452333333333,primeMeridian.bern=7.439583333333,primeMeridian.jakarta=106.807719444444,primeMeridian.ferro=-17.666666666667,primeMeridian.brussels=4.367975,primeMeridian.stockholm=18.058277777778,primeMeridian.athens=23.7163375,primeMeridian.oslo=10.722916666667;const units$1={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var ignoredChar=/[\s_\-\/\(\)]/g;function match(e,r){if(e[r])return e[r];for(var s=Object.keys(e),u=r.toLowerCase().replace(ignoredChar,""),m=-1,H,x;++m<s.length;)if(H=s[m],x=H.toLowerCase().replace(ignoredChar,""),x===u)return e[H]}function projStr(e){var r={},s=e.split("+").map(function(o){return o.trim()}).filter(function(o){return o}).reduce(function(o,F){var Re=F.split("=");return Re.push(!0),o[Re[0].toLowerCase()]=Re[1],o},{}),u,m,H,x={proj:"projName",datum:"datumCode",rf:function(o){r.rf=parseFloat(o)},lat_0:function(o){r.lat0=o*D2R$1},lat_1:function(o){r.lat1=o*D2R$1},lat_2:function(o){r.lat2=o*D2R$1},lat_ts:function(o){r.lat_ts=o*D2R$1},lon_0:function(o){r.long0=o*D2R$1},lon_1:function(o){r.long1=o*D2R$1},lon_2:function(o){r.long2=o*D2R$1},alpha:function(o){r.alpha=parseFloat(o)*D2R$1},gamma:function(o){r.rectified_grid_angle=parseFloat(o)*D2R$1},lonc:function(o){r.longc=o*D2R$1},x_0:function(o){r.x0=parseFloat(o)},y_0:function(o){r.y0=parseFloat(o)},k_0:function(o){r.k0=parseFloat(o)},k:function(o){r.k0=parseFloat(o)},a:function(o){r.a=parseFloat(o)},b:function(o){r.b=parseFloat(o)},r:function(o){r.a=r.b=parseFloat(o)},r_a:function(){r.R_A=!0},zone:function(o){r.zone=parseInt(o,10)},south:function(){r.utmSouth=!0},towgs84:function(o){r.datum_params=o.split(",").map(function(F){return parseFloat(F)})},to_meter:function(o){r.to_meter=parseFloat(o)},units:function(o){r.units=o;var F=match(units$1,o);F&&(r.to_meter=F.to_meter)},from_greenwich:function(o){r.from_greenwich=o*D2R$1},pm:function(o){var F=match(primeMeridian,o);r.from_greenwich=(F||parseFloat(o))*D2R$1},nadgrids:function(o){o==="@null"?r.datumCode="none":r.nadgrids=o},axis:function(o){var F="ewnsud";o.length===3&&F.indexOf(o.substr(0,1))!==-1&&F.indexOf(o.substr(1,1))!==-1&&F.indexOf(o.substr(2,1))!==-1&&(r.axis=o)},approx:function(){r.approx=!0}};for(u in s)m=s[u],u in x?(H=x[u],typeof H=="function"?H(m):r[H]=m):r[u]=m;return typeof r.datumCode=="string"&&r.datumCode!=="WGS84"&&(r.datumCode=r.datumCode.toLowerCase()),r}class PROJJSONBuilderBase{static getId(r){const s=r.find(u=>Array.isArray(u)&&u[0]==="ID");return s&&s.length>=3?{authority:s[1],code:parseInt(s[2],10)}:null}static convertUnit(r,s="unit"){if(!r||r.length<3)return{type:s,name:"unknown",conversion_factor:null};const u=r[1],m=parseFloat(r[2])||null,H=r.find(o=>Array.isArray(o)&&o[0]==="ID"),x=H?{authority:H[1],code:parseInt(H[2],10)}:null;return{type:s,name:u,conversion_factor:m,id:x}}static convertAxis(r){const s=r[1]||"Unknown";let u;const m=s.match(/^\((.)\)$/);if(m){const Re=m[1].toUpperCase();if(Re==="E")u="east";else if(Re==="N")u="north";else if(Re==="U")u="up";else throw new Error(`Unknown axis abbreviation: ${Re}`)}else u=r[2]?r[2].toLowerCase():"unknown";const H=r.find(Re=>Array.isArray(Re)&&Re[0]==="ORDER"),x=H?parseInt(H[1],10):null,o=r.find(Re=>Array.isArray(Re)&&(Re[0]==="LENGTHUNIT"||Re[0]==="ANGLEUNIT"||Re[0]==="SCALEUNIT")),F=this.convertUnit(o);return{name:s,direction:u,unit:F,order:x}}static extractAxes(r){return r.filter(s=>Array.isArray(s)&&s[0]==="AXIS").map(s=>this.convertAxis(s)).sort((s,u)=>(s.order||0)-(u.order||0))}static convert(r,s={}){switch(r[0]){case"PROJCRS":s.type="ProjectedCRS",s.name=r[1],s.base_crs=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="BASEGEOGCRS")?this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="BASEGEOGCRS")):null,s.conversion=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="CONVERSION")?this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="CONVERSION")):null;const u=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="CS");u&&(s.coordinate_system={type:u[1],axis:this.extractAxes(r)});const m=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="LENGTHUNIT");if(m){const Fe=this.convertUnit(m);s.coordinate_system.unit=Fe}s.id=this.getId(r);break;case"BASEGEOGCRS":case"GEOGCRS":s.type="GeographicCRS",s.name=r[1];const H=r.find(Fe=>Array.isArray(Fe)&&(Fe[0]==="DATUM"||Fe[0]==="ENSEMBLE"));if(H){const Fe=this.convert(H);H[0]==="ENSEMBLE"?s.datum_ensemble=Fe:s.datum=Fe;const nt=r.find(Ze=>Array.isArray(Ze)&&Ze[0]==="PRIMEM");nt&&nt[1]!=="Greenwich"&&(Fe.prime_meridian={name:nt[1],longitude:parseFloat(nt[2])})}s.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(r)},s.id=this.getId(r);break;case"DATUM":s.type="GeodeticReferenceFrame",s.name=r[1],s.ellipsoid=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="ELLIPSOID")?this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":s.type="DatumEnsemble",s.name=r[1],s.members=r.filter(Fe=>Array.isArray(Fe)&&Fe[0]==="MEMBER").map(Fe=>({type:"DatumEnsembleMember",name:Fe[1],id:this.getId(Fe)}));const x=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="ENSEMBLEACCURACY");x&&(s.accuracy=parseFloat(x[1]));const o=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="ELLIPSOID");o&&(s.ellipsoid=this.convert(o)),s.id=this.getId(r);break;case"ELLIPSOID":s.type="Ellipsoid",s.name=r[1],s.semi_major_axis=parseFloat(r[2]),s.inverse_flattening=parseFloat(r[3]),r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="LENGTHUNIT")&&this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="LENGTHUNIT"),s);break;case"CONVERSION":s.type="Conversion",s.name=r[1],s.method=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="METHOD")?this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="METHOD")):null,s.parameters=r.filter(Fe=>Array.isArray(Fe)&&Fe[0]==="PARAMETER").map(Fe=>this.convert(Fe));break;case"METHOD":s.type="Method",s.name=r[1],s.id=this.getId(r);break;case"PARAMETER":s.type="Parameter",s.name=r[1],s.value=parseFloat(r[2]),s.unit=this.convertUnit(r.find(Fe=>Array.isArray(Fe)&&(Fe[0]==="LENGTHUNIT"||Fe[0]==="ANGLEUNIT"||Fe[0]==="SCALEUNIT"))),s.id=this.getId(r);break;case"BOUNDCRS":s.type="BoundCRS";const F=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="SOURCECRS");if(F){const Fe=F.find(nt=>Array.isArray(nt));s.source_crs=Fe?this.convert(Fe):null}const Re=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="TARGETCRS");if(Re){const Fe=Re.find(nt=>Array.isArray(nt));s.target_crs=Fe?this.convert(Fe):null}const He=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="ABRIDGEDTRANSFORMATION");He?s.transformation=this.convert(He):s.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(s.type="Transformation",s.name=r[1],s.method=r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="METHOD")?this.convert(r.find(Fe=>Array.isArray(Fe)&&Fe[0]==="METHOD")):null,s.parameters=r.filter(Fe=>Array.isArray(Fe)&&(Fe[0]==="PARAMETER"||Fe[0]==="PARAMETERFILE")).map(Fe=>{if(Fe[0]==="PARAMETER")return this.convert(Fe);if(Fe[0]==="PARAMETERFILE")return{name:Fe[1],value:Fe[2],id:{authority:"EPSG",code:8656}}}),s.parameters.length===7){const Fe=s.parameters[6];Fe.name==="Scale difference"&&(Fe.value=Math.round((Fe.value-1)*1e12)/1e6)}s.id=this.getId(r);break;case"AXIS":s.coordinate_system||(s.coordinate_system={type:"unspecified",axis:[]}),s.coordinate_system.axis.push(this.convertAxis(r));break;case"LENGTHUNIT":const Ue=this.convertUnit(r,"LinearUnit");s.coordinate_system&&s.coordinate_system.axis&&s.coordinate_system.axis.forEach(Fe=>{Fe.unit||(Fe.unit=Ue)}),Ue.conversion_factor&&Ue.conversion_factor!==1&&s.semi_major_axis&&(s.semi_major_axis={value:s.semi_major_axis,unit:Ue});break;default:s.keyword=r[0];break}return s}}class PROJJSONBuilder2015 extends PROJJSONBuilderBase{static convert(r,s={}){return super.convert(r,s),s.coordinate_system&&s.coordinate_system.subtype==="Cartesian"&&delete s.coordinate_system,s.usage&&delete s.usage,s}}class PROJJSONBuilder2019 extends PROJJSONBuilderBase{static convert(r,s={}){super.convert(r,s);const u=r.find(H=>Array.isArray(H)&&H[0]==="CS");u&&(s.coordinate_system={subtype:u[1],axis:this.extractAxes(r)});const m=r.find(H=>Array.isArray(H)&&H[0]==="USAGE");if(m){const H=m.find(F=>Array.isArray(F)&&F[0]==="SCOPE"),x=m.find(F=>Array.isArray(F)&&F[0]==="AREA"),o=m.find(F=>Array.isArray(F)&&F[0]==="BBOX");s.usage={},H&&(s.usage.scope=H[1]),x&&(s.usage.area=x[1]),o&&(s.usage.bbox=o.slice(1))}return s}}function detectWKT2Version(e){return e.find(r=>Array.isArray(r)&&r[0]==="USAGE")?"2019":(e.find(r=>Array.isArray(r)&&r[0]==="CS")||e[0]==="BOUNDCRS"||e[0]==="PROJCRS"||e[0]==="GEOGCRS","2015")}function buildPROJJSON(e){return(detectWKT2Version(e)==="2019"?PROJJSONBuilder2019:PROJJSONBuilder2015).convert(e)}function detectWKTVersion(e){const r=e.toUpperCase();return r.includes("PROJCRS")||r.includes("GEOGCRS")||r.includes("BOUNDCRS")||r.includes("VERTCRS")||r.includes("LENGTHUNIT")||r.includes("ANGLEUNIT")||r.includes("SCALEUNIT")?"WKT2":(r.includes("PROJCS")||r.includes("GEOGCS")||r.includes("LOCAL_CS")||r.includes("VERT_CS")||r.includes("UNIT"),"WKT1")}var NEUTRAL=1,KEYWORD=2,NUMBER=3,QUOTED=4,AFTERQUOTE=5,ENDED=-1,whitespace=/\s/,latin=/[A-Za-z]/,keyword=/[A-Za-z84_]/,endThings=/[,\]]/,digets=/[\d\.E\-\+]/;function Parser(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=NEUTRAL}Parser.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==QUOTED)for(;whitespace.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case NEUTRAL:return this.neutral(e);case KEYWORD:return this.keyword(e);case QUOTED:return this.quoted(e);case AFTERQUOTE:return this.afterquote(e);case NUMBER:return this.number(e);case ENDED:return}},Parser.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=QUOTED;return}if(endThings.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)},Parser.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=NEUTRAL;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=NEUTRAL,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ENDED);return}},Parser.prototype.number=function(e){if(digets.test(e)){this.word+=e;return}if(endThings.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)},Parser.prototype.quoted=function(e){if(e==='"'){this.state=AFTERQUOTE;return}this.word+=e},Parser.prototype.keyword=function(e){if(keyword.test(e)){this.word+=e;return}if(e==="["){var r=[];r.push(this.word),this.level++,this.root===null?this.root=r:this.currentObject.push(r),this.stack.push(this.currentObject),this.currentObject=r,this.state=NEUTRAL;return}if(endThings.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)},Parser.prototype.neutral=function(e){if(latin.test(e)){this.word=e,this.state=KEYWORD;return}if(e==='"'){this.word="",this.state=QUOTED;return}if(digets.test(e)){this.word=e,this.state=NUMBER;return}if(endThings.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)},Parser.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ENDED)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function parseString(e){var r=new Parser(e);return r.output()}function mapit(e,r,s){Array.isArray(r)&&(s.unshift(r),r=null);var u=r?{}:e,m=s.reduce(function(H,x){return sExpr(x,H),H},u);r&&(e[r]=m)}function sExpr(e,r){if(!Array.isArray(e)){r[e]=!0;return}var s=e.shift();if(s==="PARAMETER"&&(s=e.shift()),e.length===1){if(Array.isArray(e[0])){r[s]={},sExpr(e[0],r[s]);return}r[s]=e[0];return}if(!e.length){r[s]=!0;return}if(s==="TOWGS84"){r[s]=e;return}if(s==="AXIS"){s in r||(r[s]=[]),r[s].push(e);return}Array.isArray(s)||(r[s]={});var u;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":r[s]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&sExpr(e[2],r[s]);return;case"SPHEROID":case"ELLIPSOID":r[s]={name:e[0],a:e[1],rf:e[2]},e.length===4&&sExpr(e[3],r[s]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":e[0]=["name",e[0]],mapit(r,s,e);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":e[0]=["name",e[0]],mapit(r,s,e),r[s].type=s;return;default:for(u=-1;++u<e.length;)if(!Array.isArray(e[u]))return sExpr(e,r[s]);return mapit(r,s,e)}}var D2R=.017453292519943295;function d2r(e){return e*D2R}function applyProjectionDefaults(e){const r=(e.projName||"").toLowerCase().replace(/_/g," ");!e.long0&&e.longc&&(r==="albers conic equal area"||r==="lambert azimuthal equal area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(r==="stereographic south pole"||r==="polar stereographic (variant b)")?(e.lat0=d2r(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(r==="polar stereographic"||r==="polar stereographic (variant a)")&&(e.lat_ts=e.lat0,e.lat0=d2r(e.lat0>0?90:-90),delete e.lat1)}function processUnit(e){let r={units:null,to_meter:void 0};return typeof e=="string"?(r.units=e.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.units==="meter"&&(r.to_meter=1)):e&&e.name&&(r.units=e.name.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.to_meter=e.conversion_factor),r}function toValue(e){return typeof e=="object"?e.value*e.unit.conversion_factor:e}function calculateEllipsoid(e,r){e.ellipsoid.radius?(r.a=e.ellipsoid.radius,r.rf=0):(r.a=toValue(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening!==void 0?r.rf=e.ellipsoid.inverse_flattening:e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(r.rf=r.a/(r.a-toValue(e.ellipsoid.semi_minor_axis))))}function transformPROJJSON(e,r={}){return!e||typeof e!="object"?e:e.type==="BoundCRS"?(transformPROJJSON(e.source_crs,r),e.transformation&&(e.transformation.method&&e.transformation.method.name==="NTv2"?r.nadgrids=e.transformation.parameters[0].value:r.datum_params=e.transformation.parameters.map(s=>s.value)),r):(Object.keys(e).forEach(s=>{const u=e[s];if(u!==null)switch(s){case"name":if(r.srsCode)break;r.name=u,r.srsCode=u;break;case"type":u==="GeographicCRS"?r.projName="longlat":u==="ProjectedCRS"&&e.conversion&&e.conversion.method&&(r.projName=e.conversion.method.name);break;case"datum":case"datum_ensemble":u.ellipsoid&&(r.ellps=u.ellipsoid.name,calculateEllipsoid(u,r)),u.prime_meridian&&(r.from_greenwich=u.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":r.ellps=u.name,calculateEllipsoid(u,r);break;case"prime_meridian":r.long0=(u.longitude||0)*Math.PI/180;break;case"coordinate_system":if(u.axis){if(r.axis=u.axis.map(m=>{const H=m.direction;if(H==="east")return"e";if(H==="north")return"n";if(H==="west")return"w";if(H==="south")return"s";throw new Error(`Unknown axis direction: ${H}`)}).join("")+"u",u.unit){const{units:m,to_meter:H}=processUnit(u.unit);r.units=m,r.to_meter=H}else if(u.axis[0]&&u.axis[0].unit){const{units:m,to_meter:H}=processUnit(u.axis[0].unit);r.units=m,r.to_meter=H}}break;case"id":u.authority&&u.code&&(r.title=u.authority+":"+u.code);break;case"conversion":u.method&&u.method.name&&(r.projName=u.method.name),u.parameters&&u.parameters.forEach(m=>{const H=m.name.toLowerCase().replace(/\s+/g,"_"),x=m.value;m.unit&&m.unit.conversion_factor?r[H]=x*m.unit.conversion_factor:m.unit==="degree"?r[H]=x*Math.PI/180:r[H]=x});break;case"unit":u.name&&(r.units=u.name.toLowerCase(),r.units==="metre"&&(r.units="meter")),u.conversion_factor&&(r.to_meter=u.conversion_factor);break;case"base_crs":transformPROJJSON(u,r),r.datumCode=u.id?u.id.authority+"_"+u.id.code:u.name;break}}),r.latitude_of_false_origin!==void 0&&(r.lat0=r.latitude_of_false_origin),r.longitude_of_false_origin!==void 0&&(r.long0=r.longitude_of_false_origin),r.latitude_of_standard_parallel!==void 0&&(r.lat0=r.latitude_of_standard_parallel,r.lat1=r.latitude_of_standard_parallel),r.latitude_of_1st_standard_parallel!==void 0&&(r.lat1=r.latitude_of_1st_standard_parallel),r.latitude_of_2nd_standard_parallel!==void 0&&(r.lat2=r.latitude_of_2nd_standard_parallel),r.latitude_of_projection_centre!==void 0&&(r.lat0=r.latitude_of_projection_centre),r.longitude_of_projection_centre!==void 0&&(r.longc=r.longitude_of_projection_centre),r.easting_at_false_origin!==void 0&&(r.x0=r.easting_at_false_origin),r.northing_at_false_origin!==void 0&&(r.y0=r.northing_at_false_origin),r.latitude_of_natural_origin!==void 0&&(r.lat0=r.latitude_of_natural_origin),r.longitude_of_natural_origin!==void 0&&(r.long0=r.longitude_of_natural_origin),r.longitude_of_origin!==void 0&&(r.long0=r.longitude_of_origin),r.false_easting!==void 0&&(r.x0=r.false_easting),r.easting_at_projection_centre&&(r.x0=r.easting_at_projection_centre),r.false_northing!==void 0&&(r.y0=r.false_northing),r.northing_at_projection_centre&&(r.y0=r.northing_at_projection_centre),r.standard_parallel_1!==void 0&&(r.lat1=r.standard_parallel_1),r.standard_parallel_2!==void 0&&(r.lat2=r.standard_parallel_2),r.scale_factor_at_natural_origin!==void 0&&(r.k0=r.scale_factor_at_natural_origin),r.scale_factor_at_projection_centre!==void 0&&(r.k0=r.scale_factor_at_projection_centre),r.scale_factor_on_pseudo_standard_parallel!==void 0&&(r.k0=r.scale_factor_on_pseudo_standard_parallel),r.azimuth!==void 0&&(r.alpha=r.azimuth),r.azimuth_at_projection_centre!==void 0&&(r.alpha=r.azimuth_at_projection_centre),r.angle_from_rectified_to_skew_grid&&(r.rectified_grid_angle=r.angle_from_rectified_to_skew_grid),applyProjectionDefaults(r),r)}var knownTypes=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function rename(e,r){var s=r[0],u=r[1];!(s in e)&&u in e&&(e[s]=e[u],r.length===3&&(e[s]=r[2](e[s])))}function cleanWKT(e){for(var r=Object.keys(e),s=0,u=r.length;s<u;++s){var m=r[s];knownTypes.indexOf(m)!==-1&&setPropertiesFromWkt(e[m]),typeof e[m]=="object"&&cleanWKT(e[m])}}function setPropertiesFromWkt(e){if(e.AUTHORITY){var r=Object.keys(e.AUTHORITY)[0];r&&r in e.AUTHORITY&&(e.title=r+":"+e.AUTHORITY[r])}if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var s="",u=0,m=e.AXIS.length;u<m;++u){var H=[e.AXIS[u][0].toLowerCase(),e.AXIS[u][1].toLowerCase()];H[0].indexOf("north")!==-1||(H[0]==="y"||H[0]==="lat")&&H[1]==="north"?s+="n":H[0].indexOf("south")!==-1||(H[0]==="y"||H[0]==="lat")&&H[1]==="south"?s+="s":H[0].indexOf("east")!==-1||(H[0]==="x"||H[0]==="lon")&&H[1]==="east"?s+="e":(H[0].indexOf("west")!==-1||(H[0]==="x"||H[0]==="lon")&&H[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(e.axis=s)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var x=e.GEOGCS;e.type==="GEOGCS"&&(x=e),x&&(x.DATUM?e.datumCode=x.DATUM.name.toLowerCase():e.datumCode=x.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),e.datumCode==="new_zealand_1949"&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode==="belge_1972"&&(e.datumCode="rnb72"),x.DATUM&&x.DATUM.SPHEROID&&(e.ellps=x.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=x.DATUM.SPHEROID.a,e.rf=parseFloat(x.DATUM.SPHEROID.rf,10)),x.DATUM&&x.DATUM.TOWGS84&&(e.datum_params=x.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&(e.rectified_grid_angle=d2r(e.rectified_grid_angle));function o(He){var Ue=e.to_meter||1;return He*Ue}var F=function(He){return rename(e,He)},Re=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",d2r],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",d2r],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",d2r],["lat0","latitude_of_origin",d2r],["lat0","standard_parallel_1",d2r],["lat1","standard_parallel_1",d2r],["lat2","standard_parallel_2",d2r],["azimuth","Azimuth"],["alpha","azimuth",d2r],["srsCode","name"]];Re.forEach(F),applyProjectionDefaults(e)}function wkt(e){if(typeof e=="object")return transformPROJJSON(e);const r=detectWKTVersion(e);var s=parseString(e);if(r==="WKT2"){const H=buildPROJJSON(s);return transformPROJJSON(H)}var u=s[0],m={};return sExpr(s,m),cleanWKT(m),m[u]}function defs(e){var r=this;if(arguments.length===2){var s=arguments[1];typeof s=="string"?s.charAt(0)==="+"?defs[e]=projStr(arguments[1]):defs[e]=wkt(arguments[1]):defs[e]=s}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(u){return Array.isArray(u)?defs.apply(r,u):defs(u)});if(typeof e=="string"){if(e in defs)return defs[e]}else"EPSG"in e?defs["EPSG:"+e.EPSG]=e:"ESRI"in e?defs["ESRI:"+e.ESRI]=e:"IAU2000"in e?defs["IAU2000:"+e.IAU2000]=e:console.log(e);return}}globals(defs);function testObj(e){return typeof e=="string"}function testDef(e){return e in defs}function testWKT(e){return e.indexOf("+")!==0&&e.indexOf("[")!==-1||typeof e=="object"&&!("srsCode"in e)}var codes=["3857","900913","3785","102113"];function checkMercator(e){var r=match(e,"authority");if(!!r){var s=match(r,"epsg");return s&&codes.indexOf(s)>-1}}function checkProjStr(e){var r=match(e,"extension");if(!!r)return match(r,"proj4")}function testProj(e){return e[0]==="+"}function parse$4(e){if(testObj(e)){if(testDef(e))return defs[e];if(testWKT(e)){var r=wkt(e);if(checkMercator(r))return defs["EPSG:3857"];var s=checkProjStr(r);return s?projStr(s):r}if(testProj(e))return projStr(e)}else return"projName"in e?e:wkt(e)}function extend$2(e,r){e=e||{};var s,u;if(!r)return e;for(u in r)s=r[u],s!==void 0&&(e[u]=s);return e}function msfnz(e,r,s){var u=e*r;return s/Math.sqrt(1-u*u)}function sign$1(e){return e<0?-1:1}function adjust_lon(e){return Math.abs(e)<=SPI?e:e-sign$1(e)*TWO_PI}function tsfnz(e,r,s){var u=e*s,m=.5*e;return u=Math.pow((1-u)/(1+u),m),Math.tan(.5*(HALF_PI-r))/u}function phi2z(e,r){for(var s=.5*e,u,m,H=HALF_PI-2*Math.atan(r),x=0;x<=15;x++)if(u=e*Math.sin(H),m=HALF_PI-2*Math.atan(r*Math.pow((1-u)/(1+u),s))-H,H+=m,Math.abs(m)<=1e-10)return H;return-9999}function init$x(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function forward$v(e){var r=e.x,s=e.y;if(s*R2D>90&&s*R2D<-90&&r*R2D>180&&r*R2D<-180)return null;var u,m;if(Math.abs(Math.abs(s)-HALF_PI)<=EPSLN)return null;if(this.sphere)u=this.x0+this.a*this.k0*adjust_lon(r-this.long0),m=this.y0+this.a*this.k0*Math.log(Math.tan(FORTPI+.5*s));else{var H=Math.sin(s),x=tsfnz(this.e,s,H);u=this.x0+this.a*this.k0*adjust_lon(r-this.long0),m=this.y0-this.a*this.k0*Math.log(x)}return e.x=u,e.y=m,e}function inverse$v(e){var r=e.x-this.x0,s=e.y-this.y0,u,m;if(this.sphere)m=HALF_PI-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var H=Math.exp(-s/(this.a*this.k0));if(m=phi2z(this.e,H),m===-9999)return null}return u=adjust_lon(this.long0+r/(this.a*this.k0)),e.x=u,e.y=m,e}var names$y=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const merc={init:init$x,forward:forward$v,inverse:inverse$v,names:names$y};function init$w(){}function identity$1(e){return e}var names$x=["longlat","identity"];const longlat={init:init$w,forward:identity$1,inverse:identity$1,names:names$x};var projs=[merc,longlat],names$w={},projStore=[];function add$2(e,r){var s=projStore.length;return e.names?(projStore[s]=e,e.names.forEach(function(u){names$w[u.toLowerCase()]=s}),this):(console.log(r),!0)}function getNormalizedProjName(e){return e.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function get(e){if(!e)return!1;var r=e.toLowerCase();if(typeof names$w[r]<"u"&&projStore[names$w[r]]||(r=getNormalizedProjName(r),r in names$w&&projStore[names$w[r]]))return projStore[names$w[r]]}function start(){projs.forEach(add$2)}const projections={start,add:add$2,get};var ellipsoids={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const WGS84=ellipsoids.WGS84;function eccentricity(e,r,s,u){var m=e*e,H=r*r,x=(m-H)/m,o=0;u?(e*=1-x*(SIXTH+x*(RA4+x*RA6)),m=e*e,x=0):o=Math.sqrt(x);var F=(m-H)/H;return{es:x,e:o,ep2:F}}function sphere(e,r,s,u,m){if(!e){var H=match(ellipsoids,u);H||(H=WGS84),e=H.a,r=H.b,s=H.rf}return s&&!r&&(r=(1-1/s)*e),(s===0||Math.abs(e-r)<EPSLN)&&(m=!0,r=e),{a:e,b:r,rf:s,sphere:m}}var datums={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var key$1 in datums){var datum$1=datums[key$1];!datum$1.datumName||(datums[datum$1.datumName]=datum$1)}function datum(e,r,s,u,m,H,x){var o={};return e===void 0||e==="none"?o.datum_type=PJD_NODATUM:o.datum_type=PJD_WGS84,r&&(o.datum_params=r.map(parseFloat),(o.datum_params[0]!==0||o.datum_params[1]!==0||o.datum_params[2]!==0)&&(o.datum_type=PJD_3PARAM),o.datum_params.length>3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=PJD_7PARAM,o.datum_params[3]*=SEC_TO_RAD,o.datum_params[4]*=SEC_TO_RAD,o.datum_params[5]*=SEC_TO_RAD,o.datum_params[6]=o.datum_params[6]/1e6+1)),x&&(o.datum_type=PJD_GRIDSHIFT,o.grids=x),o.a=s,o.b=u,o.es=m,o.ep2=H,o}var loadedNadgrids={};function nadgrid(e,r,s){return r instanceof ArrayBuffer?readNTV2Grid(e,r,s):{ready:readGeotiffGrid(e,r)}}function readNTV2Grid(e,r,s){var u=!0;s!==void 0&&s.includeErrorFields===!1&&(u=!1);var m=new DataView(r),H=detectLittleEndian(m),x=readHeader(m,H),o=readSubgrids(m,x,H,u),F={header:x,subgrids:o};return loadedNadgrids[e]=F,F}async function readGeotiffGrid(e,r){for(var s=[],u=await r.getImageCount(),m=u-1;m>=0;m--){var H=await r.getImage(m),x=await H.readRasters(),o=x,F=[H.getWidth(),H.getHeight()],Re=H.getBoundingBox().map(degreesToRadians),He=[H.fileDirectory.ModelPixelScale[0],H.fileDirectory.ModelPixelScale[1]].map(degreesToRadians),Ue=Re[0]+(F[0]-1)*He[0],Fe=Re[3]-(F[1]-1)*He[1],nt=o[0],Ze=o[1],Ve=[];for(let Ke=F[1]-1;Ke>=0;Ke--)for(let Ye=F[0]-1;Ye>=0;Ye--){var er=Ke*F[0]+Ye;Ve.push([-secondsToRadians(Ze[er]),secondsToRadians(nt[er])])}s.push({del:He,lim:F,ll:[-Ue,Fe],cvs:Ve})}var st={header:{nSubgrids:u},subgrids:s};return loadedNadgrids[e]=st,st}function getNadgrids(e){if(e===void 0)return null;var r=e.split(",");return r.map(parseNadgridString)}function parseNadgridString(e){if(e.length===0)return null;var r=e[0]==="@";return r&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!r,grid:null,isNull:!0}:{name:e,mandatory:!r,grid:loadedNadgrids[e]||null,isNull:!1}}function degreesToRadians(e){return e*Math.PI/180}function secondsToRadians(e){return e/3600*Math.PI/180}function detectLittleEndian(e){var r=e.getInt32(8,!1);return r===11?!1:(r=e.getInt32(8,!0),r!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function readHeader(e,r){return{nFields:e.getInt32(8,r),nSubgridFields:e.getInt32(24,r),nSubgrids:e.getInt32(40,r),shiftType:decodeString(e,56,56+8).trim(),fromSemiMajorAxis:e.getFloat64(120,r),fromSemiMinorAxis:e.getFloat64(136,r),toSemiMajorAxis:e.getFloat64(152,r),toSemiMinorAxis:e.getFloat64(168,r)}}function decodeString(e,r,s){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(r,s)))}function readSubgrids(e,r,s,u){for(var m=176,H=[],x=0;x<r.nSubgrids;x++){var o=readGridHeader(e,m,s),F=readGridNodes(e,m,o,s,u),Re=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),He=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);H.push({ll:[secondsToRadians(o.lowerLongitude),secondsToRadians(o.lowerLatitude)],del:[secondsToRadians(o.longitudeInterval),secondsToRadians(o.latitudeInterval)],lim:[Re,He],count:o.gridNodeCount,cvs:mapNodes(F)});var Ue=16;u===!1&&(Ue=8),m+=176+o.gridNodeCount*Ue}return H}function mapNodes(e){return e.map(function(r){return[secondsToRadians(r.longitudeShift),secondsToRadians(r.latitudeShift)]})}function readGridHeader(e,r,s){return{name:decodeString(e,r+8,r+16).trim(),parent:decodeString(e,r+24,r+24+8).trim(),lowerLatitude:e.getFloat64(r+72,s),upperLatitude:e.getFloat64(r+88,s),lowerLongitude:e.getFloat64(r+104,s),upperLongitude:e.getFloat64(r+120,s),latitudeInterval:e.getFloat64(r+136,s),longitudeInterval:e.getFloat64(r+152,s),gridNodeCount:e.getInt32(r+168,s)}}function readGridNodes(e,r,s,u,m){var H=r+176,x=16;m===!1&&(x=8);for(var o=[],F=0;F<s.gridNodeCount;F++){var Re={latitudeShift:e.getFloat32(H+F*x,u),longitudeShift:e.getFloat32(H+F*x+4,u)};m!==!1&&(Re.latitudeAccuracy=e.getFloat32(H+F*x+8,u),Re.longitudeAccuracy=e.getFloat32(H+F*x+12,u)),o.push(Re)}return o}function Projection(e,r){if(!(this instanceof Projection))return new Projection(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,r=r||function(Re){if(Re)throw Re};var s=parse$4(e);if(typeof s!="object"){r("Could not parse to valid json: "+e);return}var u=Projection.projections.get(s.projName);if(!u){r("Could not get projection name from: "+e);return}if(s.datumCode&&s.datumCode!=="none"){var m=match(datums,s.datumCode);m&&(s.datum_params=s.datum_params||(m.towgs84?m.towgs84.split(","):null),s.ellps=m.ellipse,s.datumName=m.datumName?m.datumName:s.datumCode)}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var H=sphere(s.a,s.b,s.rf,s.ellps,s.sphere),x=eccentricity(H.a,H.b,H.rf,s.R_A),o=getNadgrids(s.nadgrids),F=s.datum||datum(s.datumCode,s.datum_params,H.a,H.b,x.es,x.ep2,o);extend$2(this,s),extend$2(this,u),this.a=H.a,this.b=H.b,this.rf=H.rf,this.sphere=H.sphere,this.es=x.es,this.e=x.e,this.ep2=x.ep2,this.datum=F,"init"in this&&typeof this.init=="function"&&this.init(),r(null,this)}Projection.projections=projections,Projection.projections.start();function compareDatums(e,r){return e.datum_type!==r.datum_type||e.a!==r.a||Math.abs(e.es-r.es)>5e-11?!1:e.datum_type===PJD_3PARAM?e.datum_params[0]===r.datum_params[0]&&e.datum_params[1]===r.datum_params[1]&&e.datum_params[2]===r.datum_params[2]:e.datum_type===PJD_7PARAM?e.datum_params[0]===r.datum_params[0]&&e.datum_params[1]===r.datum_params[1]&&e.datum_params[2]===r.datum_params[2]&&e.datum_params[3]===r.datum_params[3]&&e.datum_params[4]===r.datum_params[4]&&e.datum_params[5]===r.datum_params[5]&&e.datum_params[6]===r.datum_params[6]:!0}function geodeticToGeocentric(e,r,s){var u=e.x,m=e.y,H=e.z?e.z:0,x,o,F,Re;if(m<-HALF_PI&&m>-1.001*HALF_PI)m=-HALF_PI;else if(m>HALF_PI&&m<1.001*HALF_PI)m=HALF_PI;else{if(m<-HALF_PI)return{x:-1/0,y:-1/0,z:e.z};if(m>HALF_PI)return{x:1/0,y:1/0,z:e.z}}return u>Math.PI&&(u-=2*Math.PI),o=Math.sin(m),Re=Math.cos(m),F=o*o,x=s/Math.sqrt(1-r*F),{x:(x+H)*Re*Math.cos(u),y:(x+H)*Re*Math.sin(u),z:(x*(1-r)+H)*o}}function geocentricToGeodetic(e,r,s,u){var m=1e-12,H=m*m,x=30,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er,st,Ke,Ye,tt=e.x,Je=e.y,rr=e.z?e.z:0,Rr,ar,Ar;if(o=Math.sqrt(tt*tt+Je*Je),F=Math.sqrt(tt*tt+Je*Je+rr*rr),o/s<m){if(Rr=0,F/s<m)return ar=HALF_PI,Ar=-u,{x:e.x,y:e.y,z:e.z}}else Rr=Math.atan2(Je,tt);Re=rr/F,He=o/F,Ue=1/Math.sqrt(1-r*(2-r)*He*He),Ze=He*(1-r)*Ue,Ve=Re*Ue,Ye=0;do Ye++,nt=s/Math.sqrt(1-r*Ve*Ve),Ar=o*Ze+rr*Ve-nt*(1-r*Ve*Ve),Fe=r*nt/(nt+Ar),Ue=1/Math.sqrt(1-Fe*(2-Fe)*He*He),er=He*(1-Fe)*Ue,st=Re*Ue,Ke=st*Ze-er*Ve,Ze=er,Ve=st;while(Ke*Ke>H&&Ye<x);return ar=Math.atan(st/Math.abs(er)),{x:Rr,y:ar,z:Ar}}function geocentricToWgs84(e,r,s){if(r===PJD_3PARAM)return{x:e.x+s[0],y:e.y+s[1],z:e.z+s[2]};if(r===PJD_7PARAM){var u=s[0],m=s[1],H=s[2],x=s[3],o=s[4],F=s[5],Re=s[6];return{x:Re*(e.x-F*e.y+o*e.z)+u,y:Re*(F*e.x+e.y-x*e.z)+m,z:Re*(-o*e.x+x*e.y+e.z)+H}}}function geocentricFromWgs84(e,r,s){if(r===PJD_3PARAM)return{x:e.x-s[0],y:e.y-s[1],z:e.z-s[2]};if(r===PJD_7PARAM){var u=s[0],m=s[1],H=s[2],x=s[3],o=s[4],F=s[5],Re=s[6],He=(e.x-u)/Re,Ue=(e.y-m)/Re,Fe=(e.z-H)/Re;return{x:He+F*Ue-o*Fe,y:-F*He+Ue+x*Fe,z:o*He-x*Ue+Fe}}}function checkParams(e){return e===PJD_3PARAM||e===PJD_7PARAM}function datum_transform(e,r,s){if(compareDatums(e,r)||e.datum_type===PJD_NODATUM||r.datum_type===PJD_NODATUM)return s;var u=e.a,m=e.es;if(e.datum_type===PJD_GRIDSHIFT){var H=applyGridShift(e,!1,s);if(H!==0)return;u=SRS_WGS84_SEMIMAJOR,m=SRS_WGS84_ESQUARED}var x=r.a,o=r.b,F=r.es;if(r.datum_type===PJD_GRIDSHIFT&&(x=SRS_WGS84_SEMIMAJOR,o=SRS_WGS84_SEMIMINOR,F=SRS_WGS84_ESQUARED),m===F&&u===x&&!checkParams(e.datum_type)&&!checkParams(r.datum_type))return s;if(s=geodeticToGeocentric(s,m,u),checkParams(e.datum_type)&&(s=geocentricToWgs84(s,e.datum_type,e.datum_params)),checkParams(r.datum_type)&&(s=geocentricFromWgs84(s,r.datum_type,r.datum_params)),s=geocentricToGeodetic(s,F,x,o),r.datum_type===PJD_GRIDSHIFT){var Re=applyGridShift(r,!0,s);if(Re!==0)return}return s}function applyGridShift(e,r,s){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;var u={x:-s.x,y:s.y},m={x:Number.NaN,y:Number.NaN},H=[];e:for(var x=0;x<e.grids.length;x++){var o=e.grids[x];if(H.push(o.name),o.isNull){m=u;break}if(o.grid===null){if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1;continue}for(var F=o.grid.subgrids,Re=0,He=F.length;Re<He;Re++){var Ue=F[Re],Fe=(Math.abs(Ue.del[1])+Math.abs(Ue.del[0]))/1e4,nt=Ue.ll[0]-Fe,Ze=Ue.ll[1]-Fe,Ve=Ue.ll[0]+(Ue.lim[0]-1)*Ue.del[0]+Fe,er=Ue.ll[1]+(Ue.lim[1]-1)*Ue.del[1]+Fe;if(!(Ze>u.y||nt>u.x||er<u.y||Ve<u.x)&&(m=applySubgridShift(u,r,Ue),!isNaN(m.x)))break e}}return isNaN(m.x)?(console.log("Failed to find a grid shift table for location '"+-u.x*R2D+" "+u.y*R2D+" tried: '"+H+"'"),-1):(s.x=-m.x,s.y=m.y,0)}function applySubgridShift(e,r,s){var u={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return u;var m={x:e.x,y:e.y};m.x-=s.ll[0],m.y-=s.ll[1],m.x=adjust_lon(m.x-Math.PI)+Math.PI;var H=nadInterpolate(m,s);if(r){if(isNaN(H.x))return u;H.x=m.x-H.x,H.y=m.y-H.y;var x=9,o=1e-12,F,Re;do{if(Re=nadInterpolate(H,s),isNaN(Re.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}F={x:m.x-(Re.x+H.x),y:m.y-(Re.y+H.y)},H.x+=F.x,H.y+=F.y}while(x--&&Math.abs(F.x)>o&&Math.abs(F.y)>o);if(x<0)return console.log("Inverse grid shift iterator failed to converge."),u;u.x=adjust_lon(H.x+s.ll[0]),u.y=H.y+s.ll[1]}else isNaN(H.x)||(u.x=e.x+H.x,u.y=e.y+H.y);return u}function nadInterpolate(e,r){var s={x:e.x/r.del[0],y:e.y/r.del[1]},u={x:Math.floor(s.x),y:Math.floor(s.y)},m={x:s.x-1*u.x,y:s.y-1*u.y},H={x:Number.NaN,y:Number.NaN},x;if(u.x<0||u.x>=r.lim[0]||u.y<0||u.y>=r.lim[1])return H;x=u.y*r.lim[0]+u.x;var o={x:r.cvs[x][0],y:r.cvs[x][1]};x++;var F={x:r.cvs[x][0],y:r.cvs[x][1]};x+=r.lim[0];var Re={x:r.cvs[x][0],y:r.cvs[x][1]};x--;var He={x:r.cvs[x][0],y:r.cvs[x][1]},Ue=m.x*m.y,Fe=m.x*(1-m.y),nt=(1-m.x)*(1-m.y),Ze=(1-m.x)*m.y;return H.x=nt*o.x+Fe*F.x+Ze*He.x+Ue*Re.x,H.y=nt*o.y+Fe*F.y+Ze*He.y+Ue*Re.y,H}function adjust_axis(e,r,s){var u=s.x,m=s.y,H=s.z||0,x,o,F,Re={};for(F=0;F<3;F++)if(!(r&&F===2&&s.z===void 0))switch(F===0?(x=u,"ew".indexOf(e.axis[F])!==-1?o="x":o="y"):F===1?(x=m,"ns".indexOf(e.axis[F])!==-1?o="y":o="x"):(x=H,o="z"),e.axis[F]){case"e":Re[o]=x;break;case"w":Re[o]=-x;break;case"n":Re[o]=x;break;case"s":Re[o]=-x;break;case"u":s[o]!==void 0&&(Re.z=x);break;case"d":s[o]!==void 0&&(Re.z=-x);break;default:return null}return Re}function common$1(e){var r={x:e[0],y:e[1]};return e.length>2&&(r.z=e[2]),e.length>3&&(r.m=e[3]),r}function checkSanity(e){checkCoord(e.x),checkCoord(e.y)}function checkCoord(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function checkNotWGS(e,r){return(e.datum.datum_type===PJD_3PARAM||e.datum.datum_type===PJD_7PARAM||e.datum.datum_type===PJD_GRIDSHIFT)&&r.datumCode!=="WGS84"||(r.datum.datum_type===PJD_3PARAM||r.datum.datum_type===PJD_7PARAM||r.datum.datum_type===PJD_GRIDSHIFT)&&e.datumCode!=="WGS84"}function transform$1(e,r,s,u){var m;Array.isArray(s)?s=common$1(s):s={x:s.x,y:s.y,z:s.z,m:s.m};var H=s.z!==void 0;if(checkSanity(s),e.datum&&r.datum&&checkNotWGS(e,r)&&(m=new Projection("WGS84"),s=transform$1(e,m,s,u),e=m),u&&e.axis!=="enu"&&(s=adjust_axis(e,!1,s)),e.projName==="longlat")s={x:s.x*D2R$1,y:s.y*D2R$1,z:s.z||0};else if(e.to_meter&&(s={x:s.x*e.to_meter,y:s.y*e.to_meter,z:s.z||0}),s=e.inverse(s),!s)return;if(e.from_greenwich&&(s.x+=e.from_greenwich),s=datum_transform(e.datum,r.datum,s),!!s)return s=s,r.from_greenwich&&(s={x:s.x-r.from_greenwich,y:s.y,z:s.z||0}),r.projName==="longlat"?s={x:s.x*R2D,y:s.y*R2D,z:s.z||0}:(s=r.forward(s),r.to_meter&&(s={x:s.x/r.to_meter,y:s.y/r.to_meter,z:s.z||0})),u&&r.axis!=="enu"?adjust_axis(r,!0,s):(s&&!H&&delete s.z,s)}var wgs84=Projection("WGS84");function transformer(e,r,s,u){var m,H,x;return Array.isArray(s)?(m=transform$1(e,r,s,u)||{x:NaN,y:NaN},s.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof r.name<"u"&&r.name==="geocent"?typeof m.z=="number"?[m.x,m.y,m.z].concat(s.slice(3)):[m.x,m.y,s[2]].concat(s.slice(3)):[m.x,m.y].concat(s.slice(2)):[m.x,m.y]):(H=transform$1(e,r,s,u),x=Object.keys(s),x.length===2||x.forEach(function(o){if(typeof e.name<"u"&&e.name==="geocent"||typeof r.name<"u"&&r.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;H[o]=s[o]}),H)}function checkProj(e){return e instanceof Projection?e:typeof e=="object"&&"oProj"in e?e.oProj:Projection(e)}function proj4$1(e,r,s){var u,m,H=!1,x;return typeof r>"u"?(m=checkProj(e),u=wgs84,H=!0):(typeof r.x<"u"||Array.isArray(r))&&(s=r,m=checkProj(e),u=wgs84,H=!0),u||(u=checkProj(e)),m||(m=checkProj(r)),s?transformer(u,m,s):(x={forward:function(o,F){return transformer(u,m,o,F)},inverse:function(o,F){return transformer(m,u,o,F)}},H&&(x.oProj=m),x)}var NUM_100K_SETS=6,SET_ORIGIN_COLUMN_LETTERS="AJSAJS",SET_ORIGIN_ROW_LETTERS="AFAFAF",A=65,I=73,O$1=79,V$1=86,Z$1=90;const mgrs={forward:forward$u,inverse:inverse$u,toPoint};function forward$u(e,r){return r=r||5,encode(LLtoUTM({lat:e[1],lon:e[0]}),r)}function inverse$u(e){var r=UTMtoLL(decode(e.toUpperCase()));return r.lat&&r.lon?[r.lon,r.lat,r.lon,r.lat]:[r.left,r.bottom,r.right,r.top]}function toPoint(e){var r=UTMtoLL(decode(e.toUpperCase()));return r.lat&&r.lon?[r.lon,r.lat]:[(r.left+r.right)/2,(r.top+r.bottom)/2]}function degToRad(e){return e*(Math.PI/180)}function radToDeg(e){return 180*(e/Math.PI)}function LLtoUTM(e){var r=e.lat,s=e.lon,u=6378137,m=.00669438,H=.9996,x,o,F,Re,He,Ue,Fe,nt=degToRad(r),Ze=degToRad(s),Ve,er;er=Math.floor((s+180)/6)+1,s===180&&(er=60),r>=56&&r<64&&s>=3&&s<12&&(er=32),r>=72&&r<84&&(s>=0&&s<9?er=31:s>=9&&s<21?er=33:s>=21&&s<33?er=35:s>=33&&s<42&&(er=37)),x=(er-1)*6-180+3,Ve=degToRad(x),o=m/(1-m),F=u/Math.sqrt(1-m*Math.sin(nt)*Math.sin(nt)),Re=Math.tan(nt)*Math.tan(nt),He=o*Math.cos(nt)*Math.cos(nt),Ue=Math.cos(nt)*(Ze-Ve),Fe=u*((1-m/4-3*m*m/64-5*m*m*m/256)*nt-(3*m/8+3*m*m/32+45*m*m*m/1024)*Math.sin(2*nt)+(15*m*m/256+45*m*m*m/1024)*Math.sin(4*nt)-35*m*m*m/3072*Math.sin(6*nt));var st=H*F*(Ue+(1-Re+He)*Ue*Ue*Ue/6+(5-18*Re+Re*Re+72*He-58*o)*Ue*Ue*Ue*Ue*Ue/120)+5e5,Ke=H*(Fe+F*Math.tan(nt)*(Ue*Ue/2+(5-Re+9*He+4*He*He)*Ue*Ue*Ue*Ue/24+(61-58*Re+Re*Re+600*He-330*o)*Ue*Ue*Ue*Ue*Ue*Ue/720));return r<0&&(Ke+=1e7),{northing:Math.round(Ke),easting:Math.round(st),zoneNumber:er,zoneLetter:getLetterDesignator(r)}}function UTMtoLL(e){var r=e.northing,s=e.easting,u=e.zoneLetter,m=e.zoneNumber;if(m<0||m>60)return null;var H=.9996,x=6378137,o=.00669438,F,Re=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),He,Ue,Fe,nt,Ze,Ve,er,st,Ke,Ye=s-5e5,tt=r;u<"N"&&(tt-=1e7),er=(m-1)*6-180+3,F=o/(1-o),Ve=tt/H,st=Ve/(x*(1-o/4-3*o*o/64-5*o*o*o/256)),Ke=st+(3*Re/2-27*Re*Re*Re/32)*Math.sin(2*st)+(21*Re*Re/16-55*Re*Re*Re*Re/32)*Math.sin(4*st)+151*Re*Re*Re/96*Math.sin(6*st),He=x/Math.sqrt(1-o*Math.sin(Ke)*Math.sin(Ke)),Ue=Math.tan(Ke)*Math.tan(Ke),Fe=F*Math.cos(Ke)*Math.cos(Ke),nt=x*(1-o)/Math.pow(1-o*Math.sin(Ke)*Math.sin(Ke),1.5),Ze=Ye/(He*H);var Je=Ke-He*Math.tan(Ke)/nt*(Ze*Ze/2-(5+3*Ue+10*Fe-4*Fe*Fe-9*F)*Ze*Ze*Ze*Ze/24+(61+90*Ue+298*Fe+45*Ue*Ue-252*F-3*Fe*Fe)*Ze*Ze*Ze*Ze*Ze*Ze/720);Je=radToDeg(Je);var rr=(Ze-(1+2*Ue+Fe)*Ze*Ze*Ze/6+(5-2*Fe+28*Ue-3*Fe*Fe+8*F+24*Ue*Ue)*Ze*Ze*Ze*Ze*Ze/120)/Math.cos(Ke);rr=er+radToDeg(rr);var Rr;if(e.accuracy){var ar=UTMtoLL({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});Rr={top:ar.lat,right:ar.lon,bottom:Je,left:rr}}else Rr={lat:Je,lon:rr};return Rr}function getLetterDesignator(e){var r="Z";return 84>=e&&e>=72?r="X":72>e&&e>=64?r="W":64>e&&e>=56?r="V":56>e&&e>=48?r="U":48>e&&e>=40?r="T":40>e&&e>=32?r="S":32>e&&e>=24?r="R":24>e&&e>=16?r="Q":16>e&&e>=8?r="P":8>e&&e>=0?r="N":0>e&&e>=-8?r="M":-8>e&&e>=-16?r="L":-16>e&&e>=-24?r="K":-24>e&&e>=-32?r="J":-32>e&&e>=-40?r="H":-40>e&&e>=-48?r="G":-48>e&&e>=-56?r="F":-56>e&&e>=-64?r="E":-64>e&&e>=-72?r="D":-72>e&&e>=-80&&(r="C"),r}function encode(e,r){var s="00000"+e.easting,u="00000"+e.northing;return e.zoneNumber+e.zoneLetter+get100kID(e.easting,e.northing,e.zoneNumber)+s.substr(s.length-5,r)+u.substr(u.length-5,r)}function get100kID(e,r,s){var u=get100kSetForZone(s),m=Math.floor(e/1e5),H=Math.floor(r/1e5)%20;return getLetter100kID(m,H,u)}function get100kSetForZone(e){var r=e%NUM_100K_SETS;return r===0&&(r=NUM_100K_SETS),r}function getLetter100kID(e,r,s){var u=s-1,m=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(u),H=SET_ORIGIN_ROW_LETTERS.charCodeAt(u),x=m+e-1,o=H+r,F=!1;x>Z$1&&(x=x-Z$1+A-1,F=!0),(x===I||m<I&&x>I||(x>I||m<I)&&F)&&x++,(x===O$1||m<O$1&&x>O$1||(x>O$1||m<O$1)&&F)&&(x++,x===I&&x++),x>Z$1&&(x=x-Z$1+A-1),o>V$1?(o=o-V$1+A-1,F=!0):F=!1,(o===I||H<I&&o>I||(o>I||H<I)&&F)&&o++,(o===O$1||H<O$1&&o>O$1||(o>O$1||H<O$1)&&F)&&(o++,o===I&&o++),o>V$1&&(o=o-V$1+A-1);var Re=String.fromCharCode(x)+String.fromCharCode(o);return Re}function decode(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var r=e.length,s=null,u="",m,H=0;!/[A-Z]/.test(m=e.charAt(H));){if(H>=2)throw"MGRSPoint bad conversion from: "+e;u+=m,H++}var x=parseInt(u,10);if(H===0||H+3>r)throw"MGRSPoint bad conversion from: "+e;var o=e.charAt(H++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+e;s=e.substring(H,H+=2);for(var F=get100kSetForZone(x),Re=getEastingFromChar(s.charAt(0),F),He=getNorthingFromChar(s.charAt(1),F);He<getMinNorthing(o);)He+=2e6;var Ue=r-H;if(Ue%2!==0)throw`MGRSPoint has to have an even number
|
|
206
206
|
of digits after the zone letter and two 100km letters - front
|
|
207
207
|
half for easting meters, second half for
|
|
208
|
-
northing meters`+e;var Fe=Ue/2,nt=0,Ze=0,Ve,er,st,Ke,Ye;return Fe>0&&(Ve=1e5/Math.pow(10,Fe),er=e.substring(H,H+Fe),nt=parseFloat(er)*Ve,st=e.substring(H+Fe),Ze=parseFloat(st)*Ve),Ke=nt+Re,Ye=Ze+He,{easting:Ke,northing:Ye,zoneLetter:o,zoneNumber:x,accuracy:Ve}}function getEastingFromChar(e,r){for(var s=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(r-1),u=1e5,m=!1;s!==e.charCodeAt(0);){if(s++,s===I&&s++,s===O$1&&s++,s>Z$1){if(m)throw"Bad character: "+e;s=A,m=!0}u+=1e5}return u}function getNorthingFromChar(e,r){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var s=SET_ORIGIN_ROW_LETTERS.charCodeAt(r-1),u=0,m=!1;s!==e.charCodeAt(0);){if(s++,s===I&&s++,s===O$1&&s++,s>V$1){if(m)throw"Bad character: "+e;s=A,m=!0}u+=1e5}return u}function getMinNorthing(e){var r;switch(e){case"C":r=11e5;break;case"D":r=2e6;break;case"E":r=28e5;break;case"F":r=37e5;break;case"G":r=46e5;break;case"H":r=55e5;break;case"J":r=64e5;break;case"K":r=73e5;break;case"L":r=82e5;break;case"M":r=91e5;break;case"N":r=0;break;case"P":r=8e5;break;case"Q":r=17e5;break;case"R":r=26e5;break;case"S":r=35e5;break;case"T":r=44e5;break;case"U":r=53e5;break;case"V":r=62e5;break;case"W":r=7e6;break;case"X":r=79e5;break;default:r=-1}if(r>=0)return r;throw"Invalid zone letter: "+e}function Point(e,r,s){if(!(this instanceof Point))return new Point(e,r,s);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof r>"u"){var u=e.split(",");this.x=parseFloat(u[0]),this.y=parseFloat(u[1]),this.z=parseFloat(u[2])||0}else this.x=e,this.y=r,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(e){return new Point(toPoint(e))},Point.prototype.toMGRS=function(e){return forward$u([this.x,this.y],e)};var C00=1,C02=.25,C04=.046875,C06=.01953125,C08=.01068115234375,C22=.75,C44=.46875,C46=.013020833333333334,C48=.007120768229166667,C66=.3645833333333333,C68=.005696614583333333,C88=.3076171875;function pj_enfn(e){var r=[];r[0]=C00-e*(C02+e*(C04+e*(C06+e*C08))),r[1]=e*(C22-e*(C04+e*(C06+e*C08)));var s=e*e;return r[2]=s*(C44-e*(C46+e*C48)),s*=e,r[3]=s*(C66-e*C68),r[4]=s*e*C88,r}function pj_mlfn(e,r,s,u){return s*=r,r*=r,u[0]*e-s*(u[1]+r*(u[2]+r*(u[3]+r*u[4])))}var MAX_ITER$3=20;function pj_inv_mlfn(e,r,s){for(var u=1/(1-r),m=e,H=MAX_ITER$3;H;--H){var x=Math.sin(m),o=1-r*x*x;if(o=(pj_mlfn(m,x,Math.cos(m),s)-e)*(o*Math.sqrt(o))*u,m-=o,Math.abs(o)<EPSLN)return m}return m}function init$v(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=pj_enfn(this.es),this.ml0=pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function forward$t(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m,H,x,o=Math.sin(s),F=Math.cos(s);if(this.es){var He=F*u,Ue=Math.pow(He,2),Fe=this.ep2*Math.pow(F,2),nt=Math.pow(Fe,2),Ze=Math.abs(F)>EPSLN?Math.tan(s):0,Ve=Math.pow(Ze,2),er=Math.pow(Ve,2);m=1-this.es*Math.pow(o,2),He=He/Math.sqrt(m);var st=pj_mlfn(s,o,F,this.en);H=this.a*(this.k0*He*(1+Ue/6*(1-Ve+Fe+Ue/20*(5-18*Ve+er+14*Fe-58*Ve*Fe+Ue/42*(61+179*er-er*Ve-479*Ve)))))+this.x0,x=this.a*(this.k0*(st-this.ml0+o*u*He/2*(1+Ue/12*(5-Ve+9*Fe+4*nt+Ue/30*(61+er-58*Ve+270*Fe-330*Ve*Fe+Ue/56*(1385+543*er-er*Ve-3111*Ve))))))+this.y0}else{var Re=F*Math.sin(u);if(Math.abs(Math.abs(Re)-1)<EPSLN)return 93;if(H=.5*this.a*this.k0*Math.log((1+Re)/(1-Re))+this.x0,x=F*Math.cos(u)/Math.sqrt(1-Math.pow(Re,2)),Re=Math.abs(x),Re>=1){if(Re-1>EPSLN)return 93;x=0}else x=Math.acos(x);s<0&&(x=-x),x=this.a*this.k0*(x-this.lat0)+this.y0}return e.x=H,e.y=x,e}function inverse$t(e){var r,s,u,m,H=(e.x-this.x0)*(1/this.a),x=(e.y-this.y0)*(1/this.a);if(this.es)if(r=this.ml0+x/this.k0,s=pj_inv_mlfn(r,this.es,this.en),Math.abs(s)<HALF_PI){var Ue=Math.sin(s),Fe=Math.cos(s),nt=Math.abs(Fe)>EPSLN?Math.tan(s):0,Ze=this.ep2*Math.pow(Fe,2),Ve=Math.pow(Ze,2),er=Math.pow(nt,2),st=Math.pow(er,2);r=1-this.es*Math.pow(Ue,2);var Ke=H*Math.sqrt(r)/this.k0,Ye=Math.pow(Ke,2);r=r*nt,u=s-r*Ye/(1-this.es)*.5*(1-Ye/12*(5+3*er-9*Ze*er+Ze-4*Ve-Ye/30*(61+90*er-252*Ze*er+45*st+46*Ze-Ye/56*(1385+3633*er+4095*st+1574*st*er)))),m=adjust_lon(this.long0+Ke*(1-Ye/6*(1+2*er+Ze-Ye/20*(5+28*er+24*st+8*Ze*er+6*Ze-Ye/42*(61+662*er+1320*st+720*st*er))))/Fe)}else u=HALF_PI*sign$1(x),m=0;else{var o=Math.exp(H/this.k0),F=.5*(o-1/o),Re=this.lat0+x/this.k0,He=Math.cos(Re);r=Math.sqrt((1-Math.pow(He,2))/(1+Math.pow(F,2))),u=Math.asin(r),x<0&&(u=-u),F===0&&He===0?m=0:m=adjust_lon(Math.atan2(F,He)+this.long0)}return e.x=m,e.y=u,e}var names$v=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const tmerc={init:init$v,forward:forward$t,inverse:inverse$t,names:names$v};function sinh$2(e){var r=Math.exp(e);return r=(r-1/r)/2,r}function hypot$2(e,r){e=Math.abs(e),r=Math.abs(r);var s=Math.max(e,r),u=Math.min(e,r)/(s||1);return s*Math.sqrt(1+Math.pow(u,2))}function log1py(e){var r=1+e,s=r-1;return s===0?e:e*Math.log(r)/s}function asinhy(e){var r=Math.abs(e);return r=log1py(r*(1+r/(hypot$2(1,r)+1))),e<0?-r:r}function gatg(e,r){for(var s=2*Math.cos(2*r),u=e.length-1,m=e[u],H=0,x;--u>=0;)x=-H+s*m+e[u],H=m,m=x;return r+x*Math.sin(2*r)}function clens(e,r){for(var s=2*Math.cos(r),u=e.length-1,m=e[u],H=0,x;--u>=0;)x=-H+s*m+e[u],H=m,m=x;return Math.sin(r)*x}function cosh$2(e){var r=Math.exp(e);return r=(r+1/r)/2,r}function clens_cmplx(e,r,s){for(var u=Math.sin(r),m=Math.cos(r),H=sinh$2(s),x=cosh$2(s),o=2*m*x,F=-2*u*H,Re=e.length-1,He=e[Re],Ue=0,Fe=0,nt=0,Ze,Ve;--Re>=0;)Ze=Fe,Ve=Ue,Fe=He,Ue=nt,He=-Ze+o*Fe-F*Ue+e[Re],nt=-Ve+F*Fe+o*Ue;return o=u*x,F=m*H,[o*He-F*nt,o*nt+F*He]}function init$u(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tmerc.init.apply(this),this.forward=tmerc.forward,this.inverse=tmerc.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),r=e/(2-e),s=r;this.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),this.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),s=s*r,this.cgb[1]=s*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),this.cbg[1]=s*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),s=s*r,this.cgb[2]=s*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),this.cbg[2]=s*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),s=s*r,this.cgb[3]=s*(4279/630+r*(-332/35+r*(-399572/14175))),this.cbg[3]=s*(1237/630+r*(-12/5+r*(-24832/14175))),s=s*r,this.cgb[4]=s*(4174/315+r*(-144838/6237)),this.cbg[4]=s*(-734/315+r*(109598/31185)),s=s*r,this.cgb[5]=s*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(r,2),this.Qn=this.k0/(1+r)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),this.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),this.utg[1]=s*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),this.gtu[1]=s*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),s=s*r,this.utg[2]=s*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),this.gtu[2]=s*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),s=s*r,this.utg[3]=s*(-4397/161280+r*(11/504+r*(830251/7257600))),this.gtu[3]=s*(49561/161280+r*(-179/168+r*(6601661/7257600))),s=s*r,this.utg[4]=s*(-4583/161280+r*(108847/3991680)),this.gtu[4]=s*(34729/80640+r*(-3418889/1995840)),s=s*r,this.utg[5]=s*(-20648693/638668800),this.gtu[5]=s*(212378941/319334400);var u=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(u+clens(this.gtu,2*u))}function forward$s(e){var r=adjust_lon(e.x-this.long0),s=e.y;s=gatg(this.cbg,s);var u=Math.sin(s),m=Math.cos(s),H=Math.sin(r),x=Math.cos(r);s=Math.atan2(u,x*m),r=Math.atan2(H*m,hypot$2(u,m*x)),r=asinhy(Math.tan(r));var o=clens_cmplx(this.gtu,2*s,2*r);s=s+o[0],r=r+o[1];var F,Re;return Math.abs(r)<=2.623395162778?(F=this.a*(this.Qn*r)+this.x0,Re=this.a*(this.Qn*s+this.Zb)+this.y0):(F=1/0,Re=1/0),e.x=F,e.y=Re,e}function inverse$s(e){var r=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn,r=r/this.Qn;var u,m;if(Math.abs(r)<=2.623395162778){var H=clens_cmplx(this.utg,2*s,2*r);s=s+H[0],r=r+H[1],r=Math.atan(sinh$2(r));var x=Math.sin(s),o=Math.cos(s),F=Math.sin(r),Re=Math.cos(r);s=Math.atan2(x*Re,hypot$2(F,Re*o)),r=Math.atan2(F,Re*o),u=adjust_lon(r+this.long0),m=gatg(this.cgb,s)}else u=1/0,m=1/0;return e.x=u,e.y=m,e}var names$u=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const etmerc={init:init$u,forward:forward$s,inverse:inverse$s,names:names$u};function adjust_zone(e,r){if(e===void 0){if(e=Math.floor((adjust_lon(r)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var dependsOn="etmerc";function init$t(){var e=adjust_zone(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*D2R$1,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,etmerc.init.apply(this),this.forward=etmerc.forward,this.inverse=etmerc.inverse}var names$t=["Universal Transverse Mercator System","utm"];const utm={init:init$t,names:names$t,dependsOn};function srat(e,r){return Math.pow((1-e)/(1+e),r)}var MAX_ITER$2=20;function init$s(){var e=Math.sin(this.lat0),r=Math.cos(this.lat0);r*=r,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*r*r/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+FORTPI)/(Math.pow(Math.tan(.5*this.lat0+FORTPI),this.C)*srat(this.e*e,this.ratexp))}function forward$r(e){var r=e.x,s=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+FORTPI),this.C)*srat(this.e*Math.sin(s),this.ratexp))-HALF_PI,e.x=this.C*r,e}function inverse$r(e){for(var r=1e-14,s=e.x/this.C,u=e.y,m=Math.pow(Math.tan(.5*u+FORTPI)/this.K,1/this.C),H=MAX_ITER$2;H>0&&(u=2*Math.atan(m*srat(this.e*Math.sin(e.y),-.5*this.e))-HALF_PI,!(Math.abs(u-e.y)<r));--H)e.y=u;return H?(e.x=s,e.y=u,e):null}var names$s=["gauss"];const gauss={init:init$s,forward:forward$r,inverse:inverse$r,names:names$s};function init$r(){gauss.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function forward$q(e){var r,s,u,m;return e.x=adjust_lon(e.x-this.long0),gauss.forward.apply(this,[e]),r=Math.sin(e.y),s=Math.cos(e.y),u=Math.cos(e.x),m=this.k0*this.R2/(1+this.sinc0*r+this.cosc0*s*u),e.x=m*s*Math.sin(e.x),e.y=m*(this.cosc0*r-this.sinc0*s*u),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function inverse$q(e){var r,s,u,m,H;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,H=hypot$2(e.x,e.y)){var x=2*Math.atan2(H,this.R2);r=Math.sin(x),s=Math.cos(x),m=Math.asin(s*this.sinc0+e.y*r*this.cosc0/H),u=Math.atan2(e.x*r,H*this.cosc0*s-e.y*this.sinc0*r)}else m=this.phic0,u=0;return e.x=u,e.y=m,gauss.inverse.apply(this,[e]),e.x=adjust_lon(e.x+this.long0),e}var names$r=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const sterea={init:init$r,forward:forward$q,inverse:inverse$q,names:names$r};function ssfn_(e,r,s){return r*=s,Math.tan(.5*(HALF_PI+e))*Math.pow((1-r)/(1+r),.5*s)}function init$q(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&(this.k0=.5*(1+sign$1(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=EPSLN&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&Math.abs(Math.cos(this.lat_ts))>EPSLN&&(this.k0=.5*this.cons*msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tsfnz(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=msfnz(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(ssfn_(this.lat0,this.sinlat0,this.e))-HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function forward$p(e){var r=e.x,s=e.y,u=Math.sin(s),m=Math.cos(s),H,x,o,F,Re,He,Ue=adjust_lon(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=EPSLN&&Math.abs(s+this.lat0)<=EPSLN?(e.x=NaN,e.y=NaN,e):this.sphere?(H=2*this.k0/(1+this.sinlat0*u+this.coslat0*m*Math.cos(Ue)),e.x=this.a*H*m*Math.sin(Ue)+this.x0,e.y=this.a*H*(this.coslat0*u-this.sinlat0*m*Math.cos(Ue))+this.y0,e):(x=2*Math.atan(ssfn_(s,u,this.e))-HALF_PI,F=Math.cos(x),o=Math.sin(x),Math.abs(this.coslat0)<=EPSLN?(Re=tsfnz(this.e,s*this.con,this.con*u),He=2*this.a*this.k0*Re/this.cons,e.x=this.x0+He*Math.sin(r-this.long0),e.y=this.y0-this.con*He*Math.cos(r-this.long0),e):(Math.abs(this.sinlat0)<EPSLN?(H=2*this.a*this.k0/(1+F*Math.cos(Ue)),e.y=H*o):(H=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*F*Math.cos(Ue))),e.y=H*(this.cosX0*o-this.sinX0*F*Math.cos(Ue))+this.y0),e.x=H*F*Math.sin(Ue)+this.x0,e))}function inverse$p(e){e.x-=this.x0,e.y-=this.y0;var r,s,u,m,H,x=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var o=2*Math.atan(x/(2*this.a*this.k0));return r=this.long0,s=this.lat0,x<=EPSLN?(e.x=r,e.y=s,e):(s=Math.asin(Math.cos(o)*this.sinlat0+e.y*Math.sin(o)*this.coslat0/x),Math.abs(this.coslat0)<EPSLN?this.lat0>0?r=adjust_lon(this.long0+Math.atan2(e.x,-1*e.y)):r=adjust_lon(this.long0+Math.atan2(e.x,e.y)):r=adjust_lon(this.long0+Math.atan2(e.x*Math.sin(o),x*this.coslat0*Math.cos(o)-e.y*this.sinlat0*Math.sin(o))),e.x=r,e.y=s,e)}else if(Math.abs(this.coslat0)<=EPSLN){if(x<=EPSLN)return s=this.lat0,r=this.long0,e.x=r,e.y=s,e;e.x*=this.con,e.y*=this.con,u=x*this.cons/(2*this.a*this.k0),s=this.con*phi2z(this.e,u),r=this.con*adjust_lon(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else m=2*Math.atan(x*this.cosX0/(2*this.a*this.k0*this.ms1)),r=this.long0,x<=EPSLN?H=this.X0:(H=Math.asin(Math.cos(m)*this.sinX0+e.y*Math.sin(m)*this.cosX0/x),r=adjust_lon(this.long0+Math.atan2(e.x*Math.sin(m),x*this.cosX0*Math.cos(m)-e.y*this.sinX0*Math.sin(m)))),s=-1*phi2z(this.e,Math.tan(.5*(HALF_PI+H)));return e.x=r,e.y=s,e}var names$q=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const stere={init:init$q,forward:forward$p,inverse:inverse$p,names:names$q,ssfn_};function init$p(){var e=this.lat0;this.lambda0=this.long0;var r=Math.sin(e),s=this.a,u=this.rf,m=1/u,H=2*m-Math.pow(m,2),x=this.e=Math.sqrt(H);this.R=this.k0*s*Math.sqrt(1-H)/(1-H*Math.pow(r,2)),this.alpha=Math.sqrt(1+H/(1-H)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(r/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),F=Math.log(Math.tan(Math.PI/4+e/2)),Re=Math.log((1+x*r)/(1-x*r));this.K=o-this.alpha*F+this.alpha*x/2*Re}function forward$o(e){var r=Math.log(Math.tan(Math.PI/4-e.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),u=-this.alpha*(r+s)+this.K,m=2*(Math.atan(Math.exp(u))-Math.PI/4),H=this.alpha*(e.x-this.lambda0),x=Math.atan(Math.sin(H)/(Math.sin(this.b0)*Math.tan(m)+Math.cos(this.b0)*Math.cos(H))),o=Math.asin(Math.cos(this.b0)*Math.sin(m)-Math.sin(this.b0)*Math.cos(m)*Math.cos(H));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*x+this.x0,e}function inverse$o(e){for(var r=e.x-this.x0,s=e.y-this.y0,u=r/this.R,m=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),H=Math.asin(Math.cos(this.b0)*Math.sin(m)+Math.sin(this.b0)*Math.cos(m)*Math.cos(u)),x=Math.atan(Math.sin(u)/(Math.cos(this.b0)*Math.cos(u)-Math.sin(this.b0)*Math.tan(m))),o=this.lambda0+x/this.alpha,F=0,Re=H,He=-1e3,Ue=0;Math.abs(Re-He)>1e-7;){if(++Ue>20)return;F=1/this.alpha*(Math.log(Math.tan(Math.PI/4+H/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(Re))/2)),He=Re,Re=2*Math.atan(Math.exp(F))-Math.PI/2}return e.x=o,e.y=Re,e}var names$p=["somerc"];const somerc={init:init$p,forward:forward$o,inverse:inverse$o,names:names$p};var TOL=1e-7;function isTypeA(e){var r=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],s=typeof e.projName=="object"?Object.keys(e.projName)[0]:e.projName;return"no_uoff"in e||"no_off"in e||r.indexOf(s)!==-1||r.indexOf(getNormalizedProjName(s))!==-1}function init$o(){var e,r,s,u,m,H,x,o,F,Re,He=0,Ue,Fe=0,nt=0,Ze=0,Ve=0,er=0,st=0;this.no_off=isTypeA(this),this.no_rot="no_rot"in this;var Ke=!1;"alpha"in this&&(Ke=!0);var Ye=!1;if("rectified_grid_angle"in this&&(Ye=!0),Ke&&(st=this.alpha),Ye&&(He=this.rectified_grid_angle),Ke||Ye)Fe=this.longc;else if(nt=this.long1,Ve=this.lat1,Ze=this.long2,er=this.lat2,Math.abs(Ve-er)<=TOL||(e=Math.abs(Ve))<=TOL||Math.abs(e-HALF_PI)<=TOL||Math.abs(Math.abs(this.lat0)-HALF_PI)<=TOL||Math.abs(Math.abs(er)-HALF_PI)<=TOL)throw new Error;var tt=1-this.es;r=Math.sqrt(tt),Math.abs(this.lat0)>EPSLN?(o=Math.sin(this.lat0),s=Math.cos(this.lat0),e=1-this.es*o*o,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/tt),this.A=this.B*this.k0*r/e,u=this.B*r/(s*Math.sqrt(e)),m=u*u-1,m<=0?m=0:(m=Math.sqrt(m),this.lat0<0&&(m=-m)),this.E=m+=u,this.E*=Math.pow(tsfnz(this.e,this.lat0,o),this.B)):(this.B=1/r,this.A=this.k0,this.E=u=m=1),Ke||Ye?(Ke?(Ue=Math.asin(Math.sin(st)/u),Ye||(He=st)):(Ue=He,st=Math.asin(u*Math.sin(Ue))),this.lam0=Fe-Math.asin(.5*(m-1/m)*Math.tan(Ue))/this.B):(H=Math.pow(tsfnz(this.e,Ve,Math.sin(Ve)),this.B),x=Math.pow(tsfnz(this.e,er,Math.sin(er)),this.B),m=this.E/H,F=(x-H)/(x+H),Re=this.E*this.E,Re=(Re-x*H)/(Re+x*H),e=nt-Ze,e<-Math.PI?Ze-=TWO_PI:e>Math.PI&&(Ze+=TWO_PI),this.lam0=adjust_lon(.5*(nt+Ze)-Math.atan(Re*Math.tan(.5*this.B*(nt-Ze))/F)/this.B),Ue=Math.atan(2*Math.sin(this.B*adjust_lon(nt-this.lam0))/(m-1/m)),He=st=Math.asin(u*Math.sin(Ue))),this.singam=Math.sin(Ue),this.cosgam=Math.cos(Ue),this.sinrot=Math.sin(He),this.cosrot=Math.cos(He),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(u*u-1)/Math.cos(st))),this.lat0<0&&(this.u_0=-this.u_0)),m=.5*Ue,this.v_pole_n=this.ArB*Math.log(Math.tan(FORTPI-m)),this.v_pole_s=this.ArB*Math.log(Math.tan(FORTPI+m))}function forward$n(e){var r={},s,u,m,H,x,o,F,Re;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-HALF_PI)>EPSLN){if(x=this.E/Math.pow(tsfnz(this.e,e.y,Math.sin(e.y)),this.B),o=1/x,s=.5*(x-o),u=.5*(x+o),H=Math.sin(this.B*e.x),m=(s*this.singam-H*this.cosgam)/u,Math.abs(Math.abs(m)-1)<EPSLN)throw new Error;Re=.5*this.ArB*Math.log((1-m)/(1+m)),o=Math.cos(this.B*e.x),Math.abs(o)<TOL?F=this.A*e.x:F=this.ArB*Math.atan2(s*this.cosgam+H*this.singam,o)}else Re=e.y>0?this.v_pole_n:this.v_pole_s,F=this.ArB*e.y;return this.no_rot?(r.x=F,r.y=Re):(F-=this.u_0,r.x=Re*this.cosrot+F*this.sinrot,r.y=F*this.cosrot-Re*this.sinrot),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function inverse$n(e){var r,s,u,m,H,x,o,F={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(s=e.y,r=e.x):(s=e.x*this.cosrot-e.y*this.sinrot,r=e.y*this.cosrot+e.x*this.sinrot+this.u_0),u=Math.exp(-this.BrA*s),m=.5*(u-1/u),H=.5*(u+1/u),x=Math.sin(this.BrA*r),o=(x*this.cosgam+m*this.singam)/H,Math.abs(Math.abs(o)-1)<EPSLN)F.x=0,F.y=o<0?-HALF_PI:HALF_PI;else{if(F.y=this.E/Math.sqrt((1+o)/(1-o)),F.y=phi2z(this.e,Math.pow(F.y,1/this.B)),F.y===1/0)throw new Error;F.x=-this.rB*Math.atan2(m*this.cosgam-x*this.singam,Math.cos(this.BrA*r))}return F.x+=this.lam0,F}var names$o=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const omerc={init:init$o,forward:forward$n,inverse:inverse$n,names:names$o};function init$n(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<EPSLN)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var r=Math.sin(this.lat1),s=Math.cos(this.lat1),u=msfnz(this.e,r,s),m=tsfnz(this.e,this.lat1,r),H=Math.sin(this.lat2),x=Math.cos(this.lat2),o=msfnz(this.e,H,x),F=tsfnz(this.e,this.lat2,H),Re=Math.abs(Math.abs(this.lat0)-HALF_PI)<EPSLN?0:tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>EPSLN?this.ns=Math.log(u/o)/Math.log(m/F):this.ns=r,isNaN(this.ns)&&(this.ns=r),this.f0=u/(this.ns*Math.pow(m,this.ns)),this.rh=this.a*this.f0*Math.pow(Re,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function forward$m(e){var r=e.x,s=e.y;Math.abs(2*Math.abs(s)-Math.PI)<=EPSLN&&(s=sign$1(s)*(HALF_PI-2*EPSLN));var u=Math.abs(Math.abs(s)-HALF_PI),m,H;if(u>EPSLN)m=tsfnz(this.e,s,Math.sin(s)),H=this.a*this.f0*Math.pow(m,this.ns);else{if(u=s*this.ns,u<=0)return null;H=0}var x=this.ns*adjust_lon(r-this.long0);return e.x=this.k0*(H*Math.sin(x))+this.x0,e.y=this.k0*(this.rh-H*Math.cos(x))+this.y0,e}function inverse$m(e){var r,s,u,m,H,x=(e.x-this.x0)/this.k0,o=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(r=Math.sqrt(x*x+o*o),s=1):(r=-Math.sqrt(x*x+o*o),s=-1);var F=0;if(r!==0&&(F=Math.atan2(s*x,s*o)),r!==0||this.ns>0){if(s=1/this.ns,u=Math.pow(r/(this.a*this.f0),s),m=phi2z(this.e,u),m===-9999)return null}else m=-HALF_PI;return H=adjust_lon(F/this.ns+this.long0),e.x=H,e.y=m,e}var names$n=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const lcc={init:init$n,forward:forward$m,inverse:inverse$m,names:names$n};function init$m(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function forward$l(e){var r,s,u,m,H,x,o,F=e.x,Re=e.y,He=adjust_lon(F-this.long0);return r=Math.pow((1+this.e*Math.sin(Re))/(1-this.e*Math.sin(Re)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(Re/2+this.s45),this.alfa)/r)-this.s45),u=-He*this.alfa,m=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(u)),H=Math.asin(Math.cos(s)*Math.sin(u)/Math.cos(m)),x=this.n*H,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(m/2+this.s45),this.n),e.y=o*Math.cos(x)/1,e.x=o*Math.sin(x)/1,this.czech||(e.y*=-1,e.x*=-1),e}function inverse$l(e){var r,s,u,m,H,x,o,F,Re=e.x;e.x=e.y,e.y=Re,this.czech||(e.y*=-1,e.x*=-1),x=Math.sqrt(e.x*e.x+e.y*e.y),H=Math.atan2(e.y,e.x),m=H/Math.sin(this.s0),u=2*(Math.atan(Math.pow(this.ro0/x,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),r=Math.asin(Math.cos(this.ad)*Math.sin(u)-Math.sin(this.ad)*Math.cos(u)*Math.cos(m)),s=Math.asin(Math.cos(u)*Math.sin(m)/Math.cos(r)),e.x=this.long0-s/this.alfa,o=r,F=0;var He=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(r/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(F=1),o=e.y,He+=1;while(F===0&&He<15);return He>=15?null:e}var names$m=["Krovak","krovak"];const krovak={init:init$m,forward:forward$l,inverse:inverse$l,names:names$m};function mlfn(e,r,s,u,m){return e*m-r*Math.sin(2*m)+s*Math.sin(4*m)-u*Math.sin(6*m)}function e0fn(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function e1fn(e){return .375*e*(1+.25*e*(1+.46875*e))}function e2fn(e){return .05859375*e*e*(1+.75*e)}function e3fn(e){return e*e*e*(35/3072)}function gN(e,r,s){var u=r*s;return e/Math.sqrt(1-u*u)}function adjust_lat(e){return Math.abs(e)<HALF_PI?e:e-sign$1(e)*Math.PI}function imlfn(e,r,s,u,m){var H,x;H=e/r;for(var o=0;o<15;o++)if(x=(e-(r*H-s*Math.sin(2*H)+u*Math.sin(4*H)-m*Math.sin(6*H)))/(r-2*s*Math.cos(2*H)+4*u*Math.cos(4*H)-6*m*Math.cos(6*H)),H+=x,Math.abs(x)<=1e-10)return H;return NaN}function init$l(){this.sphere||(this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0))}function forward$k(e){var r,s,u=e.x,m=e.y;if(u=adjust_lon(u-this.long0),this.sphere)r=this.a*Math.asin(Math.cos(m)*Math.sin(u)),s=this.a*(Math.atan2(Math.tan(m),Math.cos(u))-this.lat0);else{var H=Math.sin(m),x=Math.cos(m),o=gN(this.a,this.e,H),F=Math.tan(m)*Math.tan(m),Re=u*Math.cos(m),He=Re*Re,Ue=this.es*x*x/(1-this.es),Fe=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,m);r=o*Re*(1-He*F*(1/6-(8-F+8*Ue)*He/120)),s=Fe-this.ml0+o*H/x*He*(.5+(5-F+6*Ue)*He/24)}return e.x=r+this.x0,e.y=s+this.y0,e}function inverse$k(e){e.x-=this.x0,e.y-=this.y0;var r=e.x/this.a,s=e.y/this.a,u,m;if(this.sphere){var H=s+this.lat0;u=Math.asin(Math.sin(H)*Math.cos(r)),m=Math.atan2(Math.tan(r),Math.cos(H))}else{var x=this.ml0/this.a+s,o=imlfn(x,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-HALF_PI)<=EPSLN)return e.x=this.long0,e.y=HALF_PI,s<0&&(e.y*=-1),e;var F=gN(this.a,this.e,Math.sin(o)),Re=F*F*F/this.a/this.a*(1-this.es),He=Math.pow(Math.tan(o),2),Ue=r*this.a/F,Fe=Ue*Ue;u=o-F*Math.tan(o)/Re*Ue*Ue*(.5-(1+3*He)*Ue*Ue/24),m=Ue*(1-Fe*(He/3+(1+3*He)*He*Fe/15))/Math.cos(o)}return e.x=adjust_lon(m+this.long0),e.y=adjust_lat(u),e}var names$l=["Cassini","Cassini_Soldner","cass"];const cass={init:init$l,forward:forward$k,inverse:inverse$k,names:names$l};function qsfnz(e,r){var s;return e>1e-7?(s=e*r,(1-e*e)*(r/(1-s*s)-.5/e*Math.log((1-s)/(1+s)))):2*r}var S_POLE=1,N_POLE=2,EQUIT=3,OBLIQ=4;function init$k(){var e=Math.abs(this.lat0);if(Math.abs(e-HALF_PI)<EPSLN?this.mode=this.lat0<0?S_POLE:N_POLE:Math.abs(e)<EPSLN?this.mode=EQUIT:this.mode=OBLIQ,this.es>0){var r;switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=authset(this.es),this.mode){case N_POLE:this.dd=1;break;case S_POLE:this.dd=1;break;case EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case OBLIQ:this.rq=Math.sqrt(.5*this.qp),r=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,r)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*r*r)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function forward$j(e){var r,s,u,m,H,x,o,F,Re,He,Ue=e.x,Fe=e.y;if(Ue=adjust_lon(Ue-this.long0),this.sphere){if(H=Math.sin(Fe),He=Math.cos(Fe),u=Math.cos(Ue),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s=this.mode===this.EQUIT?1+He*u:1+this.sinph0*H+this.cosph0*He*u,s<=EPSLN)return null;s=Math.sqrt(2/s),r=s*He*Math.sin(Ue),s*=this.mode===this.EQUIT?H:this.cosph0*H-this.sinph0*He*u}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),Math.abs(Fe+this.lat0)<EPSLN)return null;s=FORTPI-Fe*.5,s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)),r=s*Math.sin(Ue),s*=u}}else{switch(o=0,F=0,Re=0,u=Math.cos(Ue),m=Math.sin(Ue),H=Math.sin(Fe),x=qsfnz(this.e,H),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=x/this.qp,F=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:Re=1+this.sinb1*o+this.cosb1*F*u;break;case this.EQUIT:Re=1+F*u;break;case this.N_POLE:Re=HALF_PI+Fe,x=this.qp-x;break;case this.S_POLE:Re=Fe-HALF_PI,x=this.qp+x;break}if(Math.abs(Re)<EPSLN)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:Re=Math.sqrt(2/Re),this.mode===this.OBLIQ?s=this.ymf*Re*(this.cosb1*o-this.sinb1*F*u):s=(Re=Math.sqrt(2/(1+F*u)))*o*this.ymf,r=this.xmf*Re*F*m;break;case this.N_POLE:case this.S_POLE:x>=0?(r=(Re=Math.sqrt(x))*m,s=u*(this.mode===this.S_POLE?Re:-Re)):r=s=0;break}}return e.x=this.a*r+this.x0,e.y=this.a*s+this.y0,e}function inverse$j(e){e.x-=this.x0,e.y-=this.y0;var r=e.x/this.a,s=e.y/this.a,u,m,H,x,o,F,Re;if(this.sphere){var He=0,Ue,Fe=0;if(Ue=Math.sqrt(r*r+s*s),m=Ue*.5,m>1)return null;switch(m=2*Math.asin(m),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(Fe=Math.sin(m),He=Math.cos(m)),this.mode){case this.EQUIT:m=Math.abs(Ue)<=EPSLN?0:Math.asin(s*Fe/Ue),r*=Fe,s=He*Ue;break;case this.OBLIQ:m=Math.abs(Ue)<=EPSLN?this.lat0:Math.asin(He*this.sinph0+s*Fe*this.cosph0/Ue),r*=Fe*this.cosph0,s=(He-Math.sin(m)*this.sinph0)*Ue;break;case this.N_POLE:s=-s,m=HALF_PI-m;break;case this.S_POLE:m-=HALF_PI;break}u=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(r,s)}else{if(Re=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r/=this.dd,s*=this.dd,F=Math.sqrt(r*r+s*s),F<EPSLN)return e.x=this.long0,e.y=this.lat0,e;x=2*Math.asin(.5*F/this.rq),H=Math.cos(x),r*=x=Math.sin(x),this.mode===this.OBLIQ?(Re=H*this.sinb1+s*x*this.cosb1/F,o=this.qp*Re,s=F*this.cosb1*H-s*this.sinb1*x):(Re=s*x/F,o=this.qp*Re,s=F*H)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),o=r*r+s*s,!o)return e.x=this.long0,e.y=this.lat0,e;Re=1-o/this.qp,this.mode===this.S_POLE&&(Re=-Re)}u=Math.atan2(r,s),m=authlat(Math.asin(Re),this.apa)}return e.x=adjust_lon(this.long0+u),e.y=m,e}var P00=.3333333333333333,P01=.17222222222222222,P02=.10257936507936508,P10=.06388888888888888,P11=.0664021164021164,P20=.016415012942191543;function authset(e){var r,s=[];return s[0]=e*P00,r=e*e,s[0]+=r*P01,s[1]=r*P10,r*=e,s[0]+=r*P02,s[1]+=r*P11,s[2]=r*P20,s}function authlat(e,r){var s=e+e;return e+r[0]*Math.sin(s)+r[1]*Math.sin(s+s)+r[2]*Math.sin(s+s+s)}var names$k=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const laea={init:init$k,forward:forward$j,inverse:inverse$j,names:names$k,S_POLE,N_POLE,EQUIT,OBLIQ};function asinz(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function init$j(){Math.abs(this.lat1+this.lat2)<EPSLN||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=msfnz(this.e3,this.sin_po,this.cos_po),this.qs1=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=msfnz(this.e3,this.sin_po,this.cos_po),this.qs2=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qsfnz(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>EPSLN?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function forward$i(e){var r=e.x,s=e.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var u=qsfnz(this.e3,this.sin_phi),m=this.a*Math.sqrt(this.c-this.ns0*u)/this.ns0,H=this.ns0*adjust_lon(r-this.long0),x=m*Math.sin(H)+this.x0,o=this.rh-m*Math.cos(H)+this.y0;return e.x=x,e.y=o,e}function inverse$i(e){var r,s,u,m,H,x;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),u=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),u=-1),m=0,r!==0&&(m=Math.atan2(u*e.x,u*e.y)),u=r*this.ns0/this.a,this.sphere?x=Math.asin((this.c-u*u)/(2*this.ns0)):(s=(this.c-u*u)/this.ns0,x=this.phi1z(this.e3,s)),H=adjust_lon(m/this.ns0+this.long0),e.x=H,e.y=x,e}function phi1z(e,r){var s,u,m,H,x,o=asinz(.5*r);if(e<EPSLN)return o;for(var F=e*e,Re=1;Re<=25;Re++)if(s=Math.sin(o),u=Math.cos(o),m=e*s,H=1-m*m,x=.5*H*H/u*(r/(1-F)-s/H+.5/e*Math.log((1-m)/(1+m))),o=o+x,Math.abs(x)<=1e-7)return o;return null}var names$j=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const aea={init:init$j,forward:forward$i,inverse:inverse$i,names:names$j,phi1z};function init$i(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function forward$h(e){var r,s,u,m,H,x,o,F,Re=e.x,He=e.y;return u=adjust_lon(Re-this.long0),r=Math.sin(He),s=Math.cos(He),m=Math.cos(u),x=this.sin_p14*r+this.cos_p14*s*m,H=1,x>0||Math.abs(x)<=EPSLN?(o=this.x0+this.a*H*s*Math.sin(u)/x,F=this.y0+this.a*H*(this.cos_p14*r-this.sin_p14*s*m)/x):(o=this.x0+this.infinity_dist*s*Math.sin(u),F=this.y0+this.infinity_dist*(this.cos_p14*r-this.sin_p14*s*m)),e.x=o,e.y=F,e}function inverse$h(e){var r,s,u,m,H,x;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(r=Math.sqrt(e.x*e.x+e.y*e.y))?(m=Math.atan2(r,this.rc),s=Math.sin(m),u=Math.cos(m),x=asinz(u*this.sin_p14+e.y*s*this.cos_p14/r),H=Math.atan2(e.x*s,r*this.cos_p14*u-e.y*this.sin_p14*s),H=adjust_lon(this.long0+H)):(x=this.phic0,H=0),e.x=H,e.y=x,e}var names$i=["gnom"];const gnom={init:init$i,forward:forward$h,inverse:inverse$h,names:names$i};function iqsfnz(e,r){var s=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(r)-s)<1e-6)return r<0?-1*HALF_PI:HALF_PI;for(var u=Math.asin(.5*r),m,H,x,o,F=0;F<30;F++)if(H=Math.sin(u),x=Math.cos(u),o=e*H,m=Math.pow(1-o*o,2)/(2*x)*(r/(1-e*e)-H/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),u+=m,Math.abs(m)<=1e-10)return u;return NaN}function init$h(){this.sphere||(this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function forward$g(e){var r=e.x,s=e.y,u,m,H=adjust_lon(r-this.long0);if(this.sphere)u=this.x0+this.a*H*Math.cos(this.lat_ts),m=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var x=qsfnz(this.e,Math.sin(s));u=this.x0+this.a*this.k0*H,m=this.y0+this.a*x*.5/this.k0}return e.x=u,e.y=m,e}function inverse$g(e){e.x-=this.x0,e.y-=this.y0;var r,s;return this.sphere?(r=adjust_lon(this.long0+e.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(s=iqsfnz(this.e,2*e.y*this.k0/this.a),r=adjust_lon(this.long0+e.x/(this.a*this.k0))),e.x=r,e.y=s,e}var names$h=["cea"];const cea={init:init$h,forward:forward$g,inverse:inverse$g,names:names$h};function init$g(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function forward$f(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=adjust_lat(s-this.lat0);return e.x=this.x0+this.a*u*this.rc,e.y=this.y0+this.a*m,e}function inverse$f(e){var r=e.x,s=e.y;return e.x=adjust_lon(this.long0+(r-this.x0)/(this.a*this.rc)),e.y=adjust_lat(this.lat0+(s-this.y0)/this.a),e}var names$g=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const eqc={init:init$g,forward:forward$f,inverse:inverse$f,names:names$g};var MAX_ITER$1=20;function init$f(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)}function forward$e(e){var r=e.x,s=e.y,u,m,H,x=adjust_lon(r-this.long0);if(H=x*Math.sin(s),this.sphere)Math.abs(s)<=EPSLN?(u=this.a*x,m=-1*this.a*this.lat0):(u=this.a*Math.sin(H)/Math.tan(s),m=this.a*(adjust_lat(s-this.lat0)+(1-Math.cos(H))/Math.tan(s)));else if(Math.abs(s)<=EPSLN)u=this.a*x,m=-1*this.ml0;else{var o=gN(this.a,this.e,Math.sin(s))/Math.tan(s);u=o*Math.sin(H),m=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*(1-Math.cos(H))}return e.x=u+this.x0,e.y=m+this.y0,e}function inverse$e(e){var r,s,u,m,H,x,o,F,Re;if(u=e.x-this.x0,m=e.y-this.y0,this.sphere)if(Math.abs(m+this.a*this.lat0)<=EPSLN)r=adjust_lon(u/this.a+this.long0),s=0;else{x=this.lat0+m/this.a,o=u*u/this.a/this.a+x*x,F=x;var He;for(H=MAX_ITER$1;H;--H)if(He=Math.tan(F),Re=-1*(x*(F*He+1)-F-.5*(F*F+o)*He)/((F-x)/He-1),F+=Re,Math.abs(Re)<=EPSLN){s=F;break}r=adjust_lon(this.long0+Math.asin(u*Math.tan(F)/this.a)/Math.sin(s))}else if(Math.abs(m+this.ml0)<=EPSLN)s=0,r=adjust_lon(this.long0+u/this.a);else{x=(this.ml0+m)/this.a,o=u*u/this.a/this.a+x*x,F=x;var Ue,Fe,nt,Ze,Ve;for(H=MAX_ITER$1;H;--H)if(Ve=this.e*Math.sin(F),Ue=Math.sqrt(1-Ve*Ve)*Math.tan(F),Fe=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,F),nt=this.e0-2*this.e1*Math.cos(2*F)+4*this.e2*Math.cos(4*F)-6*this.e3*Math.cos(6*F),Ze=Fe/this.a,Re=(x*(Ue*Ze+1)-Ze-.5*Ue*(Ze*Ze+o))/(this.es*Math.sin(2*F)*(Ze*Ze+o-2*x*Ze)/(4*Ue)+(x-Ze)*(Ue*nt-2/Math.sin(2*F))-nt),F-=Re,Math.abs(Re)<=EPSLN){s=F;break}Ue=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),r=adjust_lon(this.long0+Math.asin(u*Ue/this.a)/Math.sin(s))}return e.x=r,e.y=s,e}var names$f=["Polyconic","American_Polyconic","poly"];const poly={init:init$f,forward:forward$e,inverse:inverse$e,names:names$f};function init$e(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function forward$d(e){var r,s=e.x,u=e.y,m=u-this.lat0,H=s-this.long0,x=m/SEC_TO_RAD*1e-5,o=H,F=1,Re=0;for(r=1;r<=10;r++)F=F*x,Re=Re+this.A[r]*F;var He=Re,Ue=o,Fe=1,nt=0,Ze,Ve,er=0,st=0;for(r=1;r<=6;r++)Ze=Fe*He-nt*Ue,Ve=nt*He+Fe*Ue,Fe=Ze,nt=Ve,er=er+this.B_re[r]*Fe-this.B_im[r]*nt,st=st+this.B_im[r]*Fe+this.B_re[r]*nt;return e.x=st*this.a+this.x0,e.y=er*this.a+this.y0,e}function inverse$d(e){var r,s=e.x,u=e.y,m=s-this.x0,H=u-this.y0,x=H/this.a,o=m/this.a,F=1,Re=0,He,Ue,Fe=0,nt=0;for(r=1;r<=6;r++)He=F*x-Re*o,Ue=Re*x+F*o,F=He,Re=Ue,Fe=Fe+this.C_re[r]*F-this.C_im[r]*Re,nt=nt+this.C_im[r]*F+this.C_re[r]*Re;for(var Ze=0;Ze<this.iterations;Ze++){var Ve=Fe,er=nt,st,Ke,Ye=x,tt=o;for(r=2;r<=6;r++)st=Ve*Fe-er*nt,Ke=er*Fe+Ve*nt,Ve=st,er=Ke,Ye=Ye+(r-1)*(this.B_re[r]*Ve-this.B_im[r]*er),tt=tt+(r-1)*(this.B_im[r]*Ve+this.B_re[r]*er);Ve=1,er=0;var Je=this.B_re[1],rr=this.B_im[1];for(r=2;r<=6;r++)st=Ve*Fe-er*nt,Ke=er*Fe+Ve*nt,Ve=st,er=Ke,Je=Je+r*(this.B_re[r]*Ve-this.B_im[r]*er),rr=rr+r*(this.B_im[r]*Ve+this.B_re[r]*er);var Rr=Je*Je+rr*rr;Fe=(Ye*Je+tt*rr)/Rr,nt=(tt*Je-Ye*rr)/Rr}var ar=Fe,Ar=nt,mr=1,Pr=0;for(r=1;r<=9;r++)mr=mr*ar,Pr=Pr+this.D[r]*mr;var Nr=this.lat0+Pr*SEC_TO_RAD*1e5,Ra=this.long0+Ar;return e.x=Ra,e.y=Nr,e}var names$e=["New_Zealand_Map_Grid","nzmg"];const nzmg={init:init$e,forward:forward$d,inverse:inverse$d,names:names$e};function init$d(){}function forward$c(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=this.x0+this.a*u,H=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;return e.x=m,e.y=H,e}function inverse$c(e){e.x-=this.x0,e.y-=this.y0;var r=adjust_lon(this.long0+e.x/this.a),s=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=r,e.y=s,e}var names$d=["Miller_Cylindrical","mill"];const mill={init:init$d,forward:forward$c,inverse:inverse$c,names:names$d};var MAX_ITER=20;function init$c(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pj_enfn(this.es)}function forward$b(e){var r,s,u=e.x,m=e.y;if(u=adjust_lon(u-this.long0),this.sphere){if(!this.m)m=this.n!==1?Math.asin(this.n*Math.sin(m)):m;else for(var H=this.n*Math.sin(m),x=MAX_ITER;x;--x){var o=(this.m*m+Math.sin(m)-H)/(this.m+Math.cos(m));if(m-=o,Math.abs(o)<EPSLN)break}r=this.a*this.C_x*u*(this.m+Math.cos(m)),s=this.a*this.C_y*m}else{var F=Math.sin(m),Re=Math.cos(m);s=this.a*pj_mlfn(m,F,Re,this.en),r=this.a*u*Re/Math.sqrt(1-this.es*F*F)}return e.x=r,e.y=s,e}function inverse$b(e){var r,s,u,m;return e.x-=this.x0,u=e.x/this.a,e.y-=this.y0,r=e.y/this.a,this.sphere?(r/=this.C_y,u=u/(this.C_x*(this.m+Math.cos(r))),this.m?r=asinz((this.m*r+Math.sin(r))/this.n):this.n!==1&&(r=asinz(Math.sin(r)/this.n)),u=adjust_lon(u+this.long0),r=adjust_lat(r)):(r=pj_inv_mlfn(e.y/this.a,this.es,this.en),m=Math.abs(r),m<HALF_PI?(m=Math.sin(r),s=this.long0+e.x*Math.sqrt(1-this.es*m*m)/(this.a*Math.cos(r)),u=adjust_lon(s)):m-EPSLN<HALF_PI&&(u=this.long0)),e.x=u,e.y=r,e}var names$c=["Sinusoidal","sinu"];const sinu={init:init$c,forward:forward$b,inverse:inverse$b,names:names$c};function init$b(){}function forward$a(e){for(var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=s,H=Math.PI*Math.sin(s);;){var x=-(m+Math.sin(m)-H)/(1+Math.cos(m));if(m+=x,Math.abs(x)<EPSLN)break}m/=2,Math.PI/2-Math.abs(s)<EPSLN&&(u=0);var o=.900316316158*this.a*u*Math.cos(m)+this.x0,F=1.4142135623731*this.a*Math.sin(m)+this.y0;return e.x=o,e.y=F,e}function inverse$a(e){var r,s;e.x-=this.x0,e.y-=this.y0,s=e.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),r=Math.asin(s);var u=adjust_lon(this.long0+e.x/(.900316316158*this.a*Math.cos(r)));u<-Math.PI&&(u=-Math.PI),u>Math.PI&&(u=Math.PI),s=(2*r+Math.sin(2*r))/Math.PI,Math.abs(s)>1&&(s=1);var m=Math.asin(s);return e.x=u,e.y=m,e}var names$b=["Mollweide","moll"];const moll={init:init$b,forward:forward$a,inverse:inverse$a,names:names$b};function init$a(){Math.abs(this.lat1+this.lat2)<EPSLN||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<EPSLN?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml2=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function forward$9(e){var r=e.x,s=e.y,u;if(this.sphere)u=this.a*(this.g-s);else{var m=mlfn(this.e0,this.e1,this.e2,this.e3,s);u=this.a*(this.g-m)}var H=this.ns*adjust_lon(r-this.long0),x=this.x0+u*Math.sin(H),o=this.y0+this.rh-u*Math.cos(H);return e.x=x,e.y=o,e}function inverse$9(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var r,s,u,m;this.ns>=0?(s=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(s=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1);var H=0;if(s!==0&&(H=Math.atan2(r*e.x,r*e.y)),this.sphere)return m=adjust_lon(this.long0+H/this.ns),u=adjust_lat(this.g-s/this.a),e.x=m,e.y=u,e;var x=this.g-s/this.a;return u=imlfn(x,this.e0,this.e1,this.e2,this.e3),m=adjust_lon(this.long0+H/this.ns),e.x=m,e.y=u,e}var names$a=["Equidistant_Conic","eqdc"];const eqdc={init:init$a,forward:forward$9,inverse:inverse$9,names:names$a};function init$9(){this.R=this.a}function forward$8(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m,H;Math.abs(s)<=EPSLN&&(m=this.x0+this.R*u,H=this.y0);var x=asinz(2*Math.abs(s/Math.PI));(Math.abs(u)<=EPSLN||Math.abs(Math.abs(s)-HALF_PI)<=EPSLN)&&(m=this.x0,s>=0?H=this.y0+Math.PI*this.R*Math.tan(.5*x):H=this.y0+Math.PI*this.R*-Math.tan(.5*x));var o=.5*Math.abs(Math.PI/u-u/Math.PI),F=o*o,Re=Math.sin(x),He=Math.cos(x),Ue=He/(Re+He-1),Fe=Ue*Ue,nt=Ue*(2/Re-1),Ze=nt*nt,Ve=Math.PI*this.R*(o*(Ue-Ze)+Math.sqrt(F*(Ue-Ze)*(Ue-Ze)-(Ze+F)*(Fe-Ze)))/(Ze+F);u<0&&(Ve=-Ve),m=this.x0+Ve;var er=F+Ue;return Ve=Math.PI*this.R*(nt*er-o*Math.sqrt((Ze+F)*(F+1)-er*er))/(Ze+F),s>=0?H=this.y0+Ve:H=this.y0-Ve,e.x=m,e.y=H,e}function inverse$8(e){var r,s,u,m,H,x,o,F,Re,He,Ue,Fe,nt;return e.x-=this.x0,e.y-=this.y0,Ue=Math.PI*this.R,u=e.x/Ue,m=e.y/Ue,H=u*u+m*m,x=-Math.abs(m)*(1+H),o=x-2*m*m+u*u,F=-2*x+1+2*m*m+H*H,nt=m*m/F+(2*o*o*o/F/F/F-9*x*o/F/F)/27,Re=(x-o*o/3/F)/F,He=2*Math.sqrt(-Re/3),Ue=3*nt/Re/He,Math.abs(Ue)>1&&(Ue>=0?Ue=1:Ue=-1),Fe=Math.acos(Ue)/3,e.y>=0?s=(-He*Math.cos(Fe+Math.PI/3)-o/3/F)*Math.PI:s=-(-He*Math.cos(Fe+Math.PI/3)-o/3/F)*Math.PI,Math.abs(u)<EPSLN?r=this.long0:r=adjust_lon(this.long0+Math.PI*(H-1+Math.sqrt(1+2*(u*u-m*m)+H*H))/2/u),e.x=r,e.y=s,e}var names$9=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const vandg={init:init$9,forward:forward$8,inverse:inverse$8,names:names$9};function vincentyInverse(e,r,s,u,m,H){const x=u-r,o=Math.atan((1-H)*Math.tan(e)),F=Math.atan((1-H)*Math.tan(s)),Re=Math.sin(o),He=Math.cos(o),Ue=Math.sin(F),Fe=Math.cos(F);let nt=x,Ze,Ve=100,er,st,Ke,Ye,tt,Je,rr,Rr,ar,Ar,mr,Pr,Nr,Ra;do{if(er=Math.sin(nt),st=Math.cos(nt),Ke=Math.sqrt(Fe*er*(Fe*er)+(He*Ue-Re*Fe*st)*(He*Ue-Re*Fe*st)),Ke===0)return{azi1:0,s12:0};Ye=Re*Ue+He*Fe*st,tt=Math.atan2(Ke,Ye),Je=He*Fe*er/Ke,rr=1-Je*Je,Rr=rr!==0?Ye-2*Re*Ue/rr:0,ar=H/16*rr*(4+H*(4-3*rr)),Ze=nt,nt=x+(1-ar)*H*Je*(tt+ar*Ke*(Rr+ar*Ye*(-1+2*Rr*Rr)))}while(Math.abs(nt-Ze)>1e-12&&--Ve>0);return Ve===0?{azi1:NaN,s12:NaN}:(Ar=rr*(m*m-m*(1-H)*(m*(1-H)))/(m*(1-H)*(m*(1-H))),mr=1+Ar/16384*(4096+Ar*(-768+Ar*(320-175*Ar))),Pr=Ar/1024*(256+Ar*(-128+Ar*(74-47*Ar))),Nr=Pr*Ke*(Rr+Pr/4*(Ye*(-1+2*Rr*Rr)-Pr/6*Rr*(-3+4*Ke*Ke)*(-3+4*Rr*Rr))),Ra=m*(1-H)*mr*(tt-Nr),{azi1:Math.atan2(Fe*er,He*Ue-Re*Fe*st),s12:Ra})}function vincentyDirect(e,r,s,u,m,H){const x=Math.atan((1-H)*Math.tan(e)),o=Math.sin(x),F=Math.cos(x),Re=Math.sin(s),He=Math.cos(s),Ue=Math.atan2(o,F*He),Fe=F*Re,nt=1-Fe*Fe,Ze=nt*(m*m-m*(1-H)*(m*(1-H)))/(m*(1-H)*(m*(1-H))),Ve=1+Ze/16384*(4096+Ze*(-768+Ze*(320-175*Ze))),er=Ze/1024*(256+Ze*(-128+Ze*(74-47*Ze)));let st=u/(m*(1-H)*Ve),Ke,Ye=100,tt,Je,rr,Rr;do tt=Math.cos(2*Ue+st),Je=Math.sin(st),rr=Math.cos(st),Rr=er*Je*(tt+er/4*(rr*(-1+2*tt*tt)-er/6*tt*(-3+4*Je*Je)*(-3+4*tt*tt))),Ke=st,st=u/(m*(1-H)*Ve)+Rr;while(Math.abs(st-Ke)>1e-12&&--Ye>0);if(Ye===0)return{lat2:NaN,lon2:NaN};const ar=o*Je-F*rr*He,Ar=Math.atan2(o*rr+F*Je*He,(1-H)*Math.sqrt(Fe*Fe+ar*ar)),mr=Math.atan2(Je*Re,F*rr-o*Je*He),Pr=H/16*nt*(4+H*(4-3*nt)),Nr=mr-(1-Pr)*H*Fe*(st+Pr*Je*(tt+Pr*rr*(-1+2*tt*tt))),Ra=r+Nr;return{lat2:Ar,lon2:Ra}}function init$8(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function forward$7(e){var r=e.x,s=e.y,u=Math.sin(e.y),m=Math.cos(e.y),H=adjust_lon(r-this.long0),x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er;return this.sphere?Math.abs(this.sin_p12-1)<=EPSLN?(e.x=this.x0+this.a*(HALF_PI-s)*Math.sin(H),e.y=this.y0-this.a*(HALF_PI-s)*Math.cos(H),e):Math.abs(this.sin_p12+1)<=EPSLN?(e.x=this.x0+this.a*(HALF_PI+s)*Math.sin(H),e.y=this.y0+this.a*(HALF_PI+s)*Math.cos(H),e):(Ze=this.sin_p12*u+this.cos_p12*m*Math.cos(H),Fe=Math.acos(Ze),nt=Fe?Fe/Math.sin(Fe):1,e.x=this.x0+this.a*nt*m*Math.sin(H),e.y=this.y0+this.a*nt*(this.cos_p12*u-this.sin_p12*m*Math.cos(H)),e):(x=e0fn(this.es),o=e1fn(this.es),F=e2fn(this.es),Re=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(He=this.a*mlfn(x,o,F,Re,HALF_PI),Ue=this.a*mlfn(x,o,F,Re,s),e.x=this.x0+(He-Ue)*Math.sin(H),e.y=this.y0-(He-Ue)*Math.cos(H),e):Math.abs(this.sin_p12+1)<=EPSLN?(He=this.a*mlfn(x,o,F,Re,HALF_PI),Ue=this.a*mlfn(x,o,F,Re,s),e.x=this.x0+(He+Ue)*Math.sin(H),e.y=this.y0+(He+Ue)*Math.cos(H),e):Math.abs(r)<EPSLN&&Math.abs(s-this.lat0)<EPSLN?(e.x=e.y=0,e):(Ve=vincentyInverse(this.lat0,this.long0,s,r,this.a,this.f),er=Ve.azi1,e.x=Ve.s12*Math.sin(er),e.y=Ve.s12*Math.cos(er),e))}function inverse$7(e){e.x-=this.x0,e.y-=this.y0;var r,s,u,m,H,x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er;return this.sphere?(r=Math.sqrt(e.x*e.x+e.y*e.y),r>2*HALF_PI*this.a?void 0:(s=r/this.a,u=Math.sin(s),m=Math.cos(s),H=this.long0,Math.abs(r)<=EPSLN?x=this.lat0:(x=asinz(m*this.sin_p12+e.y*u*this.cos_p12/r),o=Math.abs(this.lat0)-HALF_PI,Math.abs(o)<=EPSLN?this.lat0>=0?H=adjust_lon(this.long0+Math.atan2(e.x,-e.y)):H=adjust_lon(this.long0-Math.atan2(-e.x,e.y)):H=adjust_lon(this.long0+Math.atan2(e.x*u,r*this.cos_p12*m-e.y*this.sin_p12*u))),e.x=H,e.y=x,e)):(F=e0fn(this.es),Re=e1fn(this.es),He=e2fn(this.es),Ue=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(Fe=this.a*mlfn(F,Re,He,Ue,HALF_PI),r=Math.sqrt(e.x*e.x+e.y*e.y),nt=Fe-r,x=imlfn(nt/this.a,F,Re,He,Ue),H=adjust_lon(this.long0+Math.atan2(e.x,-1*e.y)),e.x=H,e.y=x,e):Math.abs(this.sin_p12+1)<=EPSLN?(Fe=this.a*mlfn(F,Re,He,Ue,HALF_PI),r=Math.sqrt(e.x*e.x+e.y*e.y),nt=r-Fe,x=imlfn(nt/this.a,F,Re,He,Ue),H=adjust_lon(this.long0+Math.atan2(e.x,e.y)),e.x=H,e.y=x,e):(Ze=Math.atan2(e.x,e.y),Ve=Math.sqrt(e.x*e.x+e.y*e.y),er=vincentyDirect(this.lat0,this.long0,Ze,Ve,this.a,this.f),e.x=er.lon2,e.y=er.lat2,e))}var names$8=["Azimuthal_Equidistant","aeqd"];const aeqd={init:init$8,forward:forward$7,inverse:inverse$7,names:names$8};function init$7(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function forward$6(e){var r,s,u,m,H,x,o,F,Re=e.x,He=e.y;return u=adjust_lon(Re-this.long0),r=Math.sin(He),s=Math.cos(He),m=Math.cos(u),x=this.sin_p14*r+this.cos_p14*s*m,H=1,(x>0||Math.abs(x)<=EPSLN)&&(o=this.a*H*s*Math.sin(u),F=this.y0+this.a*H*(this.cos_p14*r-this.sin_p14*s*m)),e.x=o,e.y=F,e}function inverse$6(e){var r,s,u,m,H,x,o;return e.x-=this.x0,e.y-=this.y0,r=Math.sqrt(e.x*e.x+e.y*e.y),s=asinz(r/this.a),u=Math.sin(s),m=Math.cos(s),x=this.long0,Math.abs(r)<=EPSLN?(o=this.lat0,e.x=x,e.y=o,e):(o=asinz(m*this.sin_p14+e.y*u*this.cos_p14/r),H=Math.abs(this.lat0)-HALF_PI,Math.abs(H)<=EPSLN?(this.lat0>=0?x=adjust_lon(this.long0+Math.atan2(e.x,-e.y)):x=adjust_lon(this.long0-Math.atan2(-e.x,e.y)),e.x=x,e.y=o,e):(x=adjust_lon(this.long0+Math.atan2(e.x*u,r*this.cos_p14*m-e.y*this.sin_p14*u)),e.x=x,e.y=o,e))}var names$7=["ortho"];const ortho={init:init$7,forward:forward$6,inverse:inverse$6,names:names$7};var FACE_ENUM={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},AREA_ENUM={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function init$6(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=HALF_PI-FORTPI/2?this.face=FACE_ENUM.TOP:this.lat0<=-(HALF_PI-FORTPI/2)?this.face=FACE_ENUM.BOTTOM:Math.abs(this.long0)<=FORTPI?this.face=FACE_ENUM.FRONT:Math.abs(this.long0)<=HALF_PI+FORTPI?this.face=this.long0>0?FACE_ENUM.RIGHT:FACE_ENUM.LEFT:this.face=FACE_ENUM.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function forward$5(e){var r={x:0,y:0},s,u,m,H,x,o,F={value:0};if(e.x-=this.long0,this.es!==0?s=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):s=e.y,u=e.x,this.face===FACE_ENUM.TOP)H=HALF_PI-s,u>=FORTPI&&u<=HALF_PI+FORTPI?(F.value=AREA_ENUM.AREA_0,m=u-HALF_PI):u>HALF_PI+FORTPI||u<=-(HALF_PI+FORTPI)?(F.value=AREA_ENUM.AREA_1,m=u>0?u-SPI:u+SPI):u>-(HALF_PI+FORTPI)&&u<=-FORTPI?(F.value=AREA_ENUM.AREA_2,m=u+HALF_PI):(F.value=AREA_ENUM.AREA_3,m=u);else if(this.face===FACE_ENUM.BOTTOM)H=HALF_PI+s,u>=FORTPI&&u<=HALF_PI+FORTPI?(F.value=AREA_ENUM.AREA_0,m=-u+HALF_PI):u<FORTPI&&u>=-FORTPI?(F.value=AREA_ENUM.AREA_1,m=-u):u<-FORTPI&&u>=-(HALF_PI+FORTPI)?(F.value=AREA_ENUM.AREA_2,m=-u-HALF_PI):(F.value=AREA_ENUM.AREA_3,m=u>0?-u+SPI:-u-SPI);else{var Re,He,Ue,Fe,nt,Ze,Ve;this.face===FACE_ENUM.RIGHT?u=qsc_shift_lon_origin(u,+HALF_PI):this.face===FACE_ENUM.BACK?u=qsc_shift_lon_origin(u,+SPI):this.face===FACE_ENUM.LEFT&&(u=qsc_shift_lon_origin(u,-HALF_PI)),Fe=Math.sin(s),nt=Math.cos(s),Ze=Math.sin(u),Ve=Math.cos(u),Re=nt*Ve,He=nt*Ze,Ue=Fe,this.face===FACE_ENUM.FRONT?(H=Math.acos(Re),m=qsc_fwd_equat_face_theta(H,Ue,He,F)):this.face===FACE_ENUM.RIGHT?(H=Math.acos(He),m=qsc_fwd_equat_face_theta(H,Ue,-Re,F)):this.face===FACE_ENUM.BACK?(H=Math.acos(-Re),m=qsc_fwd_equat_face_theta(H,Ue,-He,F)):this.face===FACE_ENUM.LEFT?(H=Math.acos(-He),m=qsc_fwd_equat_face_theta(H,Ue,Re,F)):(H=m=0,F.value=AREA_ENUM.AREA_0)}return o=Math.atan(12/SPI*(m+Math.acos(Math.sin(m)*Math.cos(FORTPI))-HALF_PI)),x=Math.sqrt((1-Math.cos(H))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(m))))),F.value===AREA_ENUM.AREA_1?o+=HALF_PI:F.value===AREA_ENUM.AREA_2?o+=SPI:F.value===AREA_ENUM.AREA_3&&(o+=1.5*SPI),r.x=x*Math.cos(o),r.y=x*Math.sin(o),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,e.x=r.x,e.y=r.y,e}function inverse$5(e){var r={lam:0,phi:0},s,u,m,H,x,o,F,Re,He,Ue={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,u=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),s=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?Ue.value=AREA_ENUM.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(Ue.value=AREA_ENUM.AREA_1,s-=HALF_PI):e.x<0&&-e.x>=Math.abs(e.y)?(Ue.value=AREA_ENUM.AREA_2,s=s<0?s+SPI:s-SPI):(Ue.value=AREA_ENUM.AREA_3,s+=HALF_PI),He=SPI/12*Math.tan(s),x=Math.sin(He)/(Math.cos(He)-1/Math.sqrt(2)),o=Math.atan(x),m=Math.cos(s),H=Math.tan(u),F=1-m*m*H*H*(1-Math.cos(Math.atan(1/Math.cos(o)))),F<-1?F=-1:F>1&&(F=1),this.face===FACE_ENUM.TOP)Re=Math.acos(F),r.phi=HALF_PI-Re,Ue.value===AREA_ENUM.AREA_0?r.lam=o+HALF_PI:Ue.value===AREA_ENUM.AREA_1?r.lam=o<0?o+SPI:o-SPI:Ue.value===AREA_ENUM.AREA_2?r.lam=o-HALF_PI:r.lam=o;else if(this.face===FACE_ENUM.BOTTOM)Re=Math.acos(F),r.phi=Re-HALF_PI,Ue.value===AREA_ENUM.AREA_0?r.lam=-o+HALF_PI:Ue.value===AREA_ENUM.AREA_1?r.lam=-o:Ue.value===AREA_ENUM.AREA_2?r.lam=-o-HALF_PI:r.lam=o<0?-o-SPI:-o+SPI;else{var Fe,nt,Ze;Fe=F,He=Fe*Fe,He>=1?Ze=0:Ze=Math.sqrt(1-He)*Math.sin(o),He+=Ze*Ze,He>=1?nt=0:nt=Math.sqrt(1-He),Ue.value===AREA_ENUM.AREA_1?(He=nt,nt=-Ze,Ze=He):Ue.value===AREA_ENUM.AREA_2?(nt=-nt,Ze=-Ze):Ue.value===AREA_ENUM.AREA_3&&(He=nt,nt=Ze,Ze=-He),this.face===FACE_ENUM.RIGHT?(He=Fe,Fe=-nt,nt=He):this.face===FACE_ENUM.BACK?(Fe=-Fe,nt=-nt):this.face===FACE_ENUM.LEFT&&(He=Fe,Fe=nt,nt=-He),r.phi=Math.acos(-Ze)-HALF_PI,r.lam=Math.atan2(nt,Fe),this.face===FACE_ENUM.RIGHT?r.lam=qsc_shift_lon_origin(r.lam,-HALF_PI):this.face===FACE_ENUM.BACK?r.lam=qsc_shift_lon_origin(r.lam,-SPI):this.face===FACE_ENUM.LEFT&&(r.lam=qsc_shift_lon_origin(r.lam,+HALF_PI))}if(this.es!==0){var Ve,er,st;Ve=r.phi<0?1:0,er=Math.tan(r.phi),st=this.b/Math.sqrt(er*er+this.one_minus_f_squared),r.phi=Math.atan(Math.sqrt(this.a*this.a-st*st)/(this.one_minus_f*st)),Ve&&(r.phi=-r.phi)}return r.lam+=this.long0,e.x=r.lam,e.y=r.phi,e}function qsc_fwd_equat_face_theta(e,r,s,u){var m;return e<EPSLN?(u.value=AREA_ENUM.AREA_0,m=0):(m=Math.atan2(r,s),Math.abs(m)<=FORTPI?u.value=AREA_ENUM.AREA_0:m>FORTPI&&m<=HALF_PI+FORTPI?(u.value=AREA_ENUM.AREA_1,m-=HALF_PI):m>HALF_PI+FORTPI||m<=-(HALF_PI+FORTPI)?(u.value=AREA_ENUM.AREA_2,m=m>=0?m-SPI:m+SPI):(u.value=AREA_ENUM.AREA_3,m+=HALF_PI)),m}function qsc_shift_lon_origin(e,r){var s=e+r;return s<-SPI?s+=TWO_PI:s>+SPI&&(s-=TWO_PI),s}var names$6=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const qsc={init:init$6,forward:forward$5,inverse:inverse$5,names:names$6};var COEFS_X=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],COEFS_Y=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],FXC=.8487,FYC=1.3523,C1=R2D/5,RC1=1/C1,NODES=18,poly3_val=function(e,r){return e[0]+r*(e[1]+r*(e[2]+r*e[3]))},poly3_der=function(e,r){return e[1]+r*(2*e[2]+r*3*e[3])};function newton_rapshon(e,r,s,u){for(var m=r;u;--u){var H=e(m);if(m-=H,Math.abs(H)<s)break}return m}function init$5(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function forward$4(e){var r=adjust_lon(e.x-this.long0),s=Math.abs(e.y),u=Math.floor(s*C1);u<0?u=0:u>=NODES&&(u=NODES-1),s=R2D*(s-RC1*u);var m={x:poly3_val(COEFS_X[u],s)*r,y:poly3_val(COEFS_Y[u],s)};return e.y<0&&(m.y=-m.y),m.x=m.x*this.a*FXC+this.x0,m.y=m.y*this.a*FYC+this.y0,m}function inverse$4(e){var r={x:(e.x-this.x0)/(this.a*FXC),y:Math.abs(e.y-this.y0)/(this.a*FYC)};if(r.y>=1)r.x/=COEFS_X[NODES][0],r.y=e.y<0?-HALF_PI:HALF_PI;else{var s=Math.floor(r.y*NODES);for(s<0?s=0:s>=NODES&&(s=NODES-1);;)if(COEFS_Y[s][0]>r.y)--s;else if(COEFS_Y[s+1][0]<=r.y)++s;else break;var u=COEFS_Y[s],m=5*(r.y-u[0])/(COEFS_Y[s+1][0]-u[0]);m=newton_rapshon(function(H){return(poly3_val(u,H)-r.y)/poly3_der(u,H)},m,EPSLN,100),r.x/=poly3_val(COEFS_X[s],m),r.y=(5*s+m)*D2R$1,e.y<0&&(r.y=-r.y)}return r.x=adjust_lon(r.x+this.long0),r}var names$5=["Robinson","robin"];const robin={init:init$5,forward:forward$4,inverse:inverse$4,names:names$5};function init$4(){this.name="geocent"}function forward$3(e){var r=geodeticToGeocentric(e,this.es,this.a);return r}function inverse$3(e){var r=geocentricToGeodetic(e,this.es,this.a,this.b);return r}var names$4=["Geocentric","geocentric","geocent","Geocent"];const geocent={init:init$4,forward:forward$3,inverse:inverse$3,names:names$4};var mode={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},params={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function init$3(){if(Object.keys(params).forEach(function(s){if(typeof this[s]>"u")this[s]=params[s].def;else{if(params[s].num&&isNaN(this[s]))throw new Error("Invalid parameter value, must be numeric "+s+" = "+this[s]);params[s].num&&(this[s]=parseFloat(this[s]))}params[s].degrees&&(this[s]=this[s]*D2R$1)}.bind(this)),Math.abs(Math.abs(this.lat0)-HALF_PI)<EPSLN?this.mode=this.lat0<0?mode.S_POLE:mode.N_POLE:Math.abs(this.lat0)<EPSLN?this.mode=mode.EQUIT:(this.mode=mode.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,r=this.azi;this.cg=Math.cos(r),this.sg=Math.sin(r),this.cw=Math.cos(e),this.sw=Math.sin(e)}function forward$2(e){e.x-=this.long0;var r=Math.sin(e.y),s=Math.cos(e.y),u=Math.cos(e.x),m,H;switch(this.mode){case mode.OBLIQ:H=this.sinph0*r+this.cosph0*s*u;break;case mode.EQUIT:H=s*u;break;case mode.S_POLE:H=-r;break;case mode.N_POLE:H=r;break}switch(H=this.pn1/(this.p-H),m=H*s*Math.sin(e.x),this.mode){case mode.OBLIQ:H*=this.cosph0*r-this.sinph0*s*u;break;case mode.EQUIT:H*=r;break;case mode.N_POLE:H*=-(s*u);break;case mode.S_POLE:H*=s*u;break}var x,o;return x=H*this.cg+m*this.sg,o=1/(x*this.sw*this.h1+this.cw),m=(m*this.cg-H*this.sg)*this.cw*o,H=x*o,e.x=m*this.a,e.y=H*this.a,e}function inverse$2(e){e.x/=this.a,e.y/=this.a;var r={x:e.x,y:e.y},s,u,m;m=1/(this.pn1-e.y*this.sw),s=this.pn1*e.x*m,u=this.pn1*e.y*this.cw*m,e.x=s*this.cg+u*this.sg,e.y=u*this.cg-s*this.sg;var H=hypot$2(e.x,e.y);if(Math.abs(H)<EPSLN)r.x=0,r.y=e.y;else{var x,o;switch(o=1-H*H*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/H+H/this.pn1),x=Math.sqrt(1-o*o),this.mode){case mode.OBLIQ:r.y=Math.asin(x*this.sinph0+e.y*o*this.cosph0/H),e.y=(x-this.sinph0*Math.sin(r.y))*H,e.x*=o*this.cosph0;break;case mode.EQUIT:r.y=Math.asin(e.y*o/H),e.y=x*H,e.x*=o;break;case mode.N_POLE:r.y=Math.asin(x),e.y=-e.y;break;case mode.S_POLE:r.y=-Math.asin(x);break}r.x=Math.atan2(e.x,e.y)}return e.x=r.x+this.long0,e.y=r.y,e}var names$3=["Tilted_Perspective","tpers"];const tpers={init:init$3,forward:forward$2,inverse:inverse$2,names:names$3};function init$2(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,r=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=r,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function forward$1(e){var r=e.x,s=e.y,u,m,H,x;if(r=r-this.long0,this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var o=this.radius_p/hypot$2(this.radius_p*Math.cos(s),Math.sin(s));if(m=o*Math.cos(r)*Math.cos(s),H=o*Math.sin(r)*Math.cos(s),x=o*Math.sin(s),(this.radius_g-m)*m-H*H-x*x*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;u=this.radius_g-m,this.flip_axis?(e.x=this.radius_g_1*Math.atan(H/hypot$2(x,u)),e.y=this.radius_g_1*Math.atan(x/u)):(e.x=this.radius_g_1*Math.atan(H/u),e.y=this.radius_g_1*Math.atan(x/hypot$2(H,u)))}else this.shape==="sphere"&&(u=Math.cos(s),m=Math.cos(r)*u,H=Math.sin(r)*u,x=Math.sin(s),u=this.radius_g-m,this.flip_axis?(e.x=this.radius_g_1*Math.atan(H/hypot$2(x,u)),e.y=this.radius_g_1*Math.atan(x/u)):(e.x=this.radius_g_1*Math.atan(H/u),e.y=this.radius_g_1*Math.atan(x/hypot$2(H,u))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function inverse$1(e){var r=-1,s=0,u=0,m,H,x,o;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(u=Math.tan(e.y/this.radius_g_1),s=Math.tan(e.x/this.radius_g_1)*hypot$2(1,u)):(s=Math.tan(e.x/this.radius_g_1),u=Math.tan(e.y/this.radius_g_1)*hypot$2(1,s));var F=u/this.radius_p;if(m=s*s+F*F+r*r,H=2*this.radius_g*r,x=H*H-4*m*this.C,x<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-H-Math.sqrt(x))/(2*m),r=this.radius_g+o*r,s*=o,u*=o,e.x=Math.atan2(s,r),e.y=Math.atan(u*Math.cos(e.x)/r),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(u=Math.tan(e.y/this.radius_g_1),s=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+u*u)):(s=Math.tan(e.x/this.radius_g_1),u=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+s*s)),m=s*s+u*u+r*r,H=2*this.radius_g*r,x=H*H-4*m*this.C,x<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-H-Math.sqrt(x))/(2*m),r=this.radius_g+o*r,s*=o,u*=o,e.x=Math.atan2(s,r),e.y=Math.atan(u*Math.cos(e.x)/r)}return e.x=e.x+this.long0,e}var names$2=["Geostationary Satellite View","Geostationary_Satellite","geos"];const geos={init:init$2,forward:forward$1,inverse:inverse$1,names:names$2};var A1=1.340264,A2=-.081106,A3=893e-6,A4=.003796,M=Math.sqrt(3)/2;function init$1(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function forward(e){var r=adjust_lon(e.x-this.long0),s=e.y,u=Math.asin(M*Math.sin(s)),m=u*u,H=m*m*m;return e.x=r*Math.cos(u)/(M*(A1+3*A2*m+H*(7*A3+9*A4*m))),e.y=u*(A1+A2*m+H*(A3+A4*m)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function inverse(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var r=1e-9,s=12,u=e.y,m,H,x,o,F,Re;for(Re=0;Re<s&&(m=u*u,H=m*m*m,x=u*(A1+A2*m+H*(A3+A4*m))-e.y,o=A1+3*A2*m+H*(7*A3+9*A4*m),u-=F=x/o,!(Math.abs(F)<r));++Re);return m=u*u,H=m*m*m,e.x=M*e.x*(A1+3*A2*m+H*(7*A3+9*A4*m))/Math.cos(u),e.y=Math.asin(Math.sin(u)/M),e.x=adjust_lon(e.x+this.long0),e}var names$1=["eqearth","Equal Earth","Equal_Earth"];const eqearth={init:init$1,forward,inverse,names:names$1};var EPS10=1e-10;function init(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<EPS10)throw new Error;this.es?(this.en=pj_enfn(this.es),this.m1=pj_mlfn(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=e_inv,this.forward=e_fwd):(Math.abs(this.phi1)+EPS10>=HALF_PI?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=s_inv,this.forward=s_fwd)}function e_fwd(e){var r=adjust_lon(e.x-(this.long0||0)),s=e.y,u,m,H;return u=this.am1+this.m1-pj_mlfn(s,m=Math.sin(s),H=Math.cos(s),this.en),m=H*r/(u*Math.sqrt(1-this.es*m*m)),e.x=u*Math.sin(m),e.y=this.am1-u*Math.cos(m),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function e_inv(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var r,s,u,m;if(s=hypot$2(e.x,e.y=this.am1-e.y),m=pj_inv_mlfn(this.am1+this.m1-s,this.es,this.en),(r=Math.abs(m))<HALF_PI)r=Math.sin(m),u=s*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*r*r)/Math.cos(m);else if(Math.abs(r-HALF_PI)<=EPS10)u=0;else throw new Error;return e.x=adjust_lon(u+(this.long0||0)),e.y=adjust_lat(m),e}function s_fwd(e){var r=adjust_lon(e.x-(this.long0||0)),s=e.y,u,m;return m=this.cphi1+this.phi1-s,Math.abs(m)>EPS10?(e.x=m*Math.sin(u=r*Math.cos(s)/m),e.y=this.cphi1-m*Math.cos(u)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function s_inv(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var r,s,u=hypot$2(e.x,e.y=this.cphi1-e.y);if(s=this.cphi1+this.phi1-u,Math.abs(s)>HALF_PI)throw new Error;return Math.abs(Math.abs(s)-HALF_PI)<=EPS10?r=0:r=u*Math.atan2(e.x,e.y)/Math.cos(s),e.x=adjust_lon(r+(this.long0||0)),e.y=adjust_lat(s),e}var names=["bonne","Bonne (Werner lat_1=90)"];const bonne={init,names};function includedProjections(e){e.Proj.projections.add(tmerc),e.Proj.projections.add(etmerc),e.Proj.projections.add(utm),e.Proj.projections.add(sterea),e.Proj.projections.add(stere),e.Proj.projections.add(somerc),e.Proj.projections.add(omerc),e.Proj.projections.add(lcc),e.Proj.projections.add(krovak),e.Proj.projections.add(cass),e.Proj.projections.add(laea),e.Proj.projections.add(aea),e.Proj.projections.add(gnom),e.Proj.projections.add(cea),e.Proj.projections.add(eqc),e.Proj.projections.add(poly),e.Proj.projections.add(nzmg),e.Proj.projections.add(mill),e.Proj.projections.add(sinu),e.Proj.projections.add(moll),e.Proj.projections.add(eqdc),e.Proj.projections.add(vandg),e.Proj.projections.add(aeqd),e.Proj.projections.add(ortho),e.Proj.projections.add(qsc),e.Proj.projections.add(robin),e.Proj.projections.add(geocent),e.Proj.projections.add(tpers),e.Proj.projections.add(geos),e.Proj.projections.add(eqearth),e.Proj.projections.add(bonne)}const proj4=Object.assign(proj4$1,{defaultDatum:"WGS84",Proj:Projection,WGS84:new Projection("WGS84"),Point,toPoint:common$1,defs,nadgrid,transform:transform$1,mgrs,version:"__VERSION__"});includedProjections(proj4);function getWKTString(e){let{type:r,epsg_code:s}=e;for(let u=0;u<crsList.length;u++){if(!crsTypes[crsList[u].type]||crsTypes[crsList[u].type].code!==r)continue;let{authCode:H,wkt:x,children:o}=crsList[u];if(H==s)return x;if(o?.length){for(let F=0;F<o.length;F++)if(o[F].children){for(let Re=0;Re<o[F].children.length;Re++)if(o[F].children[Re].authCode==s)return o[F].children[Re].wkt}else if(o[F].authCode==s)return o[F].wkt}}return null}function project(e,r=12){let[s,u]=e,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:m*Math.pow(2,r)*512,y:H*Math.pow(2,r)*512}}function getTileCoord(e,r){let[s,u]=r,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:Math.floor(m*Math.pow(2,e)),y:Math.floor(H*Math.pow(2,e)),z:e}}function getTilePixelCoord(e,r){let[s,u]=r,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:Math.round(m*Math.pow(2,e)*512)%512,y:Math.round(H*Math.pow(2,e)*512)%512}}function getUTMProjection(e){let r=32600,s=Math.ceil((e+180)/6);return{type:3,type_name:"Projected",label:`WGS 84 / UTM zone ${s}N`,epsg_code:r+s}}function transformCoordinate(e,r,s){if(!e)return null;if(e=[...e],e[2]||(e[2]=0),r.offset&&(e=e.map((m,H)=>m+r.offset[H])),!s)return e;let u=null;if(s.type===1&&r.type===1)u=e;else{if(s.type===1||r.type===1)return e;if(r.type===0&&s.type===0){let m=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:r.origin_point[0],lat:r.origin_point[1],alt:r.origin_point[2]},{lon:s.origin_point[0],lat:s.origin_point[1],alt:s.origin_point[2]});u=[m.x+e[0],m.y+e[1],m.z+e[2]]}else if(r.type===0){let m=satellite_geo_calc.coordinateTransfer.enu_to_lla({x:e[0],y:e[1],z:e[2]},{lon:r.origin_point[0],lat:r.origin_point[1],alt:r.origin_point[2]}),H=[m.lon,m.lat,m.alt],{wkt:x,epsg_code:o}=s;if(!x&&o&&(x=getWKTString(s)),!x)return null;u=proj4("EPSG:4326",x,H)}else if(s.type===0){let{wkt:m,epsg_code:H}=r;if(!m&&H&&(m=getWKTString(r)),!m)return null;let x=proj4(m,"EPSG:4326",e),o=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:x[0],lat:x[1],alt:x[2]},{lon:s.origin_point[0],lat:s.origin_point[1],alt:s.origin_point[2]});u=[o.x,o.y,o.z]}else{let m=r.wkt,H=s.wkt;if(!m&&r.epsg_code&&(m=getWKTString(r)),!H&&s.epsg_code&&(H=getWKTString(s)),!m||!H)return null;u=proj4(m,H,e)}}return s.offset?u.map((m,H)=>m-s.offset[H]):u}function transformCoordinateToLngLat(e,r){return transformCoordinate(e,r,{type:2,type_name:"Geographic",epsg_code:4326,wkt:"+proj=longlat +datum=WGS84"})}function transformLnglat(e,r){return transformCoordinate(e,{type:2,type_name:"Geographic",epsg_code:4326,wkt:"+proj=longlat +datum=WGS84"},r)}function geographicToCartesian(e){return proj4("+proj=longlat +datum=WGS84","+proj=geocent +datum=WGS84",e)}const transform=Object.freeze(Object.defineProperty({__proto__:null,getWKTString,project,getTileCoord,getTilePixelCoord,getUTMProjection,transformCoordinate,transformCoordinateToLngLat,transformLnglat,geographicToCartesian},Symbol.toStringTag,{value:"Module"})),types$1=["point","line","polygon","volume"];function generateId(){return v4()}function formatDate(e){return e?hooks(e).format("YYYY-MM-DD HH:mm:ss"):"-"}function formatLocalDate(){return hooks().format("YYYY/M/D HH:mm:ss")}function formatFileSize(e){e=parseInt(e);let r=Math.floor(Math.log(e)/Math.log(1024)),s=["B","KB","MB","GB","TB","PB"];return _$1.round(e/Math.pow(1024,r),2)+s[r]}function getGeoCoordOperator(e){return e==="N"||e==="E"?1:-1}function toRadian(e){return e[0]+e[1]/60+e[2]/3600}function diffLayers(e,r=[]){e=_formatTree(e),r=_formatTree(r);let s=[];for(let u of e){let{visible:m}=u;for(let H of u.items||[]){let{id:x,type:o,opacity:F,visible:Re}=H;if(m||(Re=!1),types$1.some(nt=>nt===o)&&s.find(nt=>nt[0]==="updateAnnotations"))continue;let He=findNodeInTree(x,r);if(!He&&!Re)continue;if(!He){types$1.some(nt=>nt===o)?s.push(["updateAnnotations",H]):s.push(["addLayer",H]);continue}let{opacity:Ue,visible:Fe}=He;_$1.isEqual(H,He)||(types$1.some(nt=>nt===o)?s.push(["updateAnnotations",H]):F!==Ue||!_$1.isEqual(H.metadata,He.metadata)?s.push(["updateLayer",H]):Re!==Fe&&s.push([Re?"addLayer":"removeLayer",H]))}}for(let u of r)for(let m of u.items||[]){let{id:H,type:x}=m;findNodeInTree(H,e)||(types$1.some(F=>F===x)?s.find(F=>F[0]==="updateAnnotations")||s.push(["updateAnnotations",m]):s.push(["removeLayer",m]))}return s}function findNodeInTree(e,r){for(let s of r){if(s.id===e)return s;if(s.items?.length){let u=findNodeInTree(e,s.items);if(u)return u}}return null}function _formatTree(e){let r=_$1.cloneDeep(e);for(let s of r){let u=[];for(let m of s.items||[])if(s.visible||(m.visible=!1),m.items?.length)for(let H of m.items)(!H.visible||!m.metadata?.visible||!s.visible)&&(H.visible=!1),u.push(H);else m.type!=="catalog"&&u.push(m);s.items=u}return r}function getBeforeId(e,r){let s=e.style._layers,u=e.style.order,{layerType:m}=r.metadata;return u.find(o=>{let F=s[o].metadata;return _$1.isEmpty(F)&&(F={layerType:"dsm"}),x(m,r.id)<x(F.layerType,o)})||"";function x(o,F){const Re=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let He=-1;return F.startsWith("gl-draw")?He=5:He=Re.findIndex(Ue=>Ue.includes(o)),He===-1?100:He}}function isTokenExpired(e){if(!e)return!1;let{message:r="",msg:s=""}=e.data;return e.status==401&&(s.toLowerCase().includes("expired")||r.toLowerCase().includes("expired"))}function getDataType$2(e){for(let r in cameras)if(cameras[r].includes(e))return r;return"normal"}function downloadImage(e){let r=`${i18n.t("util.snapshot")}${hooks().format("YYYYMMDD")}${new Date().getTime()}.png`,s=document.createElement("a");s.href=e,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s)}function getGeometryType(e){let r=e.properties?.type;if(r)return r;let s=getType$1(e);return["Point","MultiPoint"].includes(s)?"point":["LineString","MultiLineString"].includes(s)?"line":"polygon"}function rgbaToFloat(e){let r=e[3]>128?0:1,s=-1*(1-r)+r,u=Math.floor((e[3]+.1)%128)*2+Math.floor((e[2]+.1)/128)-127,m=e[0]+e[1]*256+Math.floor((e[2]+.1)%128)*256*256;return s*(1+m/8388607)*Math.pow(2,u)}function getAnnotationFeature(e){let{geometry:r}=e,s=_$1.cloneDeep(e);return delete s.geometry,{id:s.id,type:"Feature",properties:s,geometry:_$1.cloneDeep(r)}}function getAnnotationName(e,r){let s=[];const u=i18n.t(`annotation.${r}`);e.forEach(m=>{if(m.name===u){s.push(0);return}if(m.name.startsWith(`${u} `)){let H=Number(m.name.split(" ").pop());Number.isNaN(H)||s.push(H)}}),s=s.sort((m,H)=>m-H);for(let m=0;m<s.length;m++)if(s[m]!==m)return m===0?u:`${u} ${m}`;return s.length===0?u:`${u} ${s.length}`}function getLineLabelFeature(e){let r=e.geometry.coordinates,s=[];for(let F=1;F<r.length;F++)distance(r[F-1],r[F],{units:"meters"})>30&&s.push([r[F-1],r[F]]);let u=[];if(s.length){let F=Math.floor(s.length/2);u=s[F]}else{let F=Math.floor(r.length/2-1);u=[r[F],r[F+1]]}let m=project(u[0]),H=project(u[1]),x=360-Math.atan((m.y-H.y)/(H.x-m.x))*180/Math.PI,o=midpoint(u[0],u[1]);return o.properties=e.properties,o.properties.angle=x,o.geometry.coordinates.push(((u[0][2]||0)+(u[1][2]||0))/2),o}function addIcons2Map(e,r){return new Promise((s,u)=>{let m=r.length;r.forEach(({url:H,sdf:x})=>{e.loadImage(H,(o,F)=>{m--;let Re=H.split("/").pop().split(".")[0];if(!e.hasImage(Re)){if(o){u(o);return}e.addImage(Re,F,{sdf:x}),m<=0&&s(!0)}})})})}function getTaskTreeList(e,r,s,u){let m=_$1.cloneDeep(e.metadata?.groups||layerGroups$1);if(m.forEach(x=>x.items=[]),u?.length){let x=new Map,o=new Map;r.forEach(Re=>x.set(Re.id,Re)),u.sort((Re,He)=>Re.metadata.index-He.metadata.index),u.forEach(Re=>{let He=Re.type==="catalog",Ue;if(He?Ue={id:Re.catalog_id,name:Re.name,type:"catalog",metadata:Re.metadata,items:[]}:Ue=x.get(Re.res_id),Ue&&(o.set(Re.catalog_id,Ue),Re.parent_id&&o.has(Re.parent_id))){let Fe=o.get(Re.parent_id);Ue.parent_id=Re.parent_id,Fe.items.push(Ue),o.set(Re.parent_id,Fe),o.delete(Re.catalog_id)}});let F=m.find(Re=>Re.id==="annotation");for(let Re of o.entries())F.items.push(Re[1])}else r.forEach(x=>{let o=_$1.cloneDeep(x);o.group||o.group,m.find(Re=>Re.id===o.group).items.push(o)});return(e.status==="complete"?s:[]).forEach(x=>{let{group:o}=x,F=m.find(Re=>Re.id===o);!F||F.items.push(x)}),m}function hasNaN(e){for(let r=0;r<e.length;r++)if(Number.isNaN(e[r]))return!0;return!1}function flatObject(e){let r={};for(let s in e)s.startsWith("xmlns")||Array.isArray(e[s])||(typeof e[s]=="object"?Object.assign(r,flatObject(e[s])):r[s]=e[s]);return r}function getRotationMatrix(e,r,s){let u=[],m=fromValues$2(0,1,0,0,1,0,0,0,0,0,-1,0,0,0,0,1),H=fromValues$2(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),x=fromZRotation(create$3(),s*Math.PI/180),o=fromYRotation(create$3(),e*Math.PI/180),F=fromXRotation(create$3(),r*Math.PI/180),Re=multiply$1(create$3(),multiply$1(create$3(),x,o),F),He=multiply$1(create$3(),multiply$1(create$3(),H,transpose$1(create$3(),Re)),m);for(let Ue=0;Ue<3;Ue++)for(let Fe=0;Fe<3;Fe++)u[Ue*3+Fe]=He[Ue+Fe*4];return u}function transformRoi(e,r){let{boundary:s,min_z:u,max_z:m}=e,{type:H,origin_point:x}=r;if(H===0){let o=[];return s.forEach(F=>{let Re=transformCoordinateToLngLat([...F,0],r);o.push(Re)}),u+=x[2],m+=x[2],{boundary:o,min_z:u,max_z:m}}return e}function getPosSigma(e){return e==="high"?[.03,.03,.06]:e==="low"?[2,2,5]:[.5,.5,1]}function photoPos2Geojson(e){let r=[],s=e.find(H=>H.meta_data.pos);if(s){let H=_$1.cloneDeep(s.meta_data.coordinate_system);e.forEach(x=>{let{meta_data:o={}}=x,{pos:F}=o,Re=transformCoordinateToLngLat(F,H);if(!Re)return;let He=_$1.cloneDeep(x);He.type="photo",r.push(point(Re,He))})}let u=featureCollection(r),m=null;return r.length&&(m=bbox(u)),{geojson:u,bbox:m}}function getDistance(e,r){return Math.sqrt((e[0]-r[0])*(e[0]-r[0])+(e[1]-r[1])*(e[1]-r[1]))}function getMaxValue(e,r){let s=-1/0;return e.forEach(u=>{s=Math.max(u[r],s)}),s}function getAverageValue(e,r){let s=0;return e.forEach(u=>{s+=u[r]}),s/e.length}function getAppVersion(e){let{appVersion:r,environment:s}=e.metadata;return r||(s?`${s.platform}(${s.appVersion})`:i18n.t("util.none"))}function getResolutionLevelByQuality(e){switch(e){case"low":return 3;case"high":return 1;case"medium":default:return 2}}function getQualityAliasByLevel(e){let r=i18n.t("util.high");return e===1?r=i18n.t("util.ultra_high"):e===3&&(r=i18n.t("util.medium")),r}function getImageTypeByDataType(e){switch(e){case"normal":return 1;case"multispectral":return 2;case"infrared":default:return 3}}function getDataTypeAliasByImageType(e){return e==="infrared"?i18n.t("util.thermal_infrared"):e==="multispectral"?i18n.t("util.multispectral"):i18n.t("util.visible_light")}function getTaskStatusAlias(e){return e==="complete"?i18n.t("util.modeling_completed"):e==="error"?i18n.t("util.modeling_error"):e==="none"?i18n.t("util.not_started"):e==="waiting"?i18n.t("util.in_queue"):e==="aerotriangulation"?i18n.t("util.aerial_triangulation_completed"):e.startsWith("processing")?i18n.t("util.processing"):e==="stop"?i18n.t("util.task_terminated"):i18n.t("util.unknown_status")}function include3d(e=[]){return!!(e.length&&e.includes("mesh3d"))}function extend$1(e,...r){for(const s of r)for(const u in s)e[u]=s[u];return e}function endsWith(e,r){return e.indexOf(r,e.length-r.length)!==-1}function convertLength(e,r){return r==="m"?e:r==="ft"?e*3.28084:e}function convertArea(e,r){return r==="m2"?e:r==="km2"?e/1e6:r==="mu"?e/666.6667:r==="hm2"?e/1e4:e}function convertVolume(e,r){return r==="m3"?e:r==="yd3"?e*1.30795062:r==="ft3"?e*35.3146667:r==="usft3"?e*35.3147248:e}let clickPoint=null;function _addEventListener(e,r,s){s[e]=s[e]||[],s[e].push(r)}function _removeEventListener(e,r,s){if(s&&s[e]){if(!r){delete s[e];return}const u=s[e].indexOf(r);u!==-1&&s[e].splice(u,1)}}class Event$1{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(r,s){return this._listeners=this._listeners||{},_addEventListener(r,s,this._listeners),this}off(r,s){return _removeEventListener(r,s,this._listeners),_removeEventListener(r,s,this._oneTimeListeners),this}once(r,s){return this._oneTimeListeners=this._oneTimeListeners||{},_addEventListener(r,s,this._oneTimeListeners),this}fire(r,s){if(this.listens(r)){if(s=extend$1({},s,{type:r,target:this}),clickPoint){if(s.point&&clickPoint===s.point.x+s.point.y){if(clickPoint===s.point.x+s.point.y)return;clickPoint=s.point.x+s.point.y}else if(s.feature){if(clickPoint===s.x+s.y)return;clickPoint=s.x+s.y}}else s.point?clickPoint=s.point.x+s.point.y:s.feature&&(clickPoint=s.x+s.y);const u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let H=0;H<u.length;H++)u[H].call(this,s);const m=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let H=0;H<m.length;H++)m[H].call(this,s),_removeEventListener(r,m[H],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(r,extend$1({},s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else endsWith(r,"error")&&console.error(s&&s.error||s||"Empty error event");return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,s){return this._eventedParent=r,this._eventedParentData=s,this}}const emitter=new Event$1,defaultOptions={tileFormat:"float32",tileSize:256,colorScale:[],sentinelValues:[],transitions:!1,transitionTimeMs:800,debug:!1,extraPixelLayers:0,colorscaleMaxLength:16,sentinelMaxLength:16,minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,glOperation:"none",multiLayers:0,operationUrlA:"",operationUrlB:"",operationUrlC:"",operationUrlD:"",operationUrlE:"",operationUrlF:"",filterLowA:0,filterHighA:1e5,filterLowB:0,filterHighB:1e5,filterLowC:0,filterHighC:1e5,filterLowD:0,filterHighD:1e5,filterLowE:0,filterHighE:1e5,filterLowF:0,filterHighF:1e5,multiplierA:1,multiplierB:1,multiplierC:1,multiplierD:1,multiplierE:1,multiplierF:1,hillshadeType:"none",hsSimpleZoomdelta:0,hsSimpleSlopescale:3,hsSimpleAzimuth:315,hsSimpleAltitude:70,hsAdvValueScale:1,hsAdvPixelScale:"auto",hsAdvSoftIterations:10,hsAdvAmbientIterations:10,hsAdvSunRadiusMultiplier:100,hsAdvFinalSoftMultiplier:1,hsAdvFinalAmbientMultiplier:.25,hsAdvBaselayerUrl:"",hsAdvSmoothInput:!1,hsAdvSmoothInputKernel:3,hsPregenUrl:"",_hillshadeOptions:{hillshadeType:"none"},contourType:"none",contourSmoothLines:!1,contourSmoothInput:!1,contourSmoothInputKernel:7,contourScaleFactor:1,contourInterval:25,contourIndexInterval:100,contourLineColor:"#000000",contourIlluminatedHighlightColor:"rgba(177,174,164,.5)",contourIlluminatedShadowColor:"#5b5143",contourIlluminatedShadowSize:2,contourLineWeight:.5,contourLineIndexWeight:2,contourIndexLabels:!1,contourLabelFont:"12px Arial",contourLabelDistance:250,contourHypso:!1,contourHypsoDomain:[0,1e3,2e3],contourHypsoColors:["#486341","#e5d9c9","#dddddd"],contourBathy:!1,contourBathyDomain:[-2e3,0],contourBathyColors:["#315d9b","#d5f2ff"],contourBathyShadowColor:"#4e5c66",contourBathyHighlightColor:"rgba(224, 242, 255, .5)"};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var UPNG={exports:{}},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,function(e){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function s(H,x){return Object.prototype.hasOwnProperty.call(H,x)}e.assign=function(H){for(var x=Array.prototype.slice.call(arguments,1);x.length;){var o=x.shift();if(!!o){if(typeof o!="object")throw new TypeError(o+"must be non-object");for(var F in o)s(o,F)&&(H[F]=o[F])}}return H},e.shrinkBuf=function(H,x){return H.length===x?H:H.subarray?H.subarray(0,x):(H.length=x,H)};var u={arraySet:function(H,x,o,F,Re){if(x.subarray&&H.subarray){H.set(x.subarray(o,o+F),Re);return}for(var He=0;He<F;He++)H[Re+He]=x[o+He]},flattenChunks:function(H){var x,o,F,Re,He,Ue;for(F=0,x=0,o=H.length;x<o;x++)F+=H[x].length;for(Ue=new Uint8Array(F),Re=0,x=0,o=H.length;x<o;x++)He=H[x],Ue.set(He,Re),Re+=He.length;return Ue}},m={arraySet:function(H,x,o,F,Re){for(var He=0;He<F;He++)H[Re+He]=x[o+He]},flattenChunks:function(H){return[].concat.apply([],H)}};e.setTyped=function(H){H?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,u)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,m))},e.setTyped(r)}(common)),common}var deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;var e=requireCommon(),r=4,s=0,u=1,m=2;function H(Zr){for(var Wa=Zr.length;--Wa>=0;)Zr[Wa]=0}var x=0,o=1,F=2,Re=3,He=258,Ue=29,Fe=256,nt=Fe+1+Ue,Ze=30,Ve=19,er=2*nt+1,st=15,Ke=16,Ye=7,tt=256,Je=16,rr=17,Rr=18,ar=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ar=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],mr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Pr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Nr=512,Ra=new Array((nt+2)*2);H(Ra);var ta=new Array(Ze*2);H(ta);var ha=new Array(Nr);H(ha);var Ea=new Array(He-Re+1);H(Ea);var fa=new Array(Ue);H(fa);var ga=new Array(Ze);H(ga);function Ja(Zr,Wa,zn,di,wa){this.static_tree=Zr,this.extra_bits=Wa,this.extra_base=zn,this.elems=di,this.max_length=wa,this.has_stree=Zr&&Zr.length}var Ba,Pn,_n;function cn(Zr,Wa){this.dyn_tree=Zr,this.max_code=0,this.stat_desc=Wa}function ui(Zr){return Zr<256?ha[Zr]:ha[256+(Zr>>>7)]}function Vn(Zr,Wa){Zr.pending_buf[Zr.pending++]=Wa&255,Zr.pending_buf[Zr.pending++]=Wa>>>8&255}function fn(Zr,Wa,zn){Zr.bi_valid>Ke-zn?(Zr.bi_buf|=Wa<<Zr.bi_valid&65535,Vn(Zr,Zr.bi_buf),Zr.bi_buf=Wa>>Ke-Zr.bi_valid,Zr.bi_valid+=zn-Ke):(Zr.bi_buf|=Wa<<Zr.bi_valid&65535,Zr.bi_valid+=zn)}function kn(Zr,Wa,zn){fn(Zr,zn[Wa*2],zn[Wa*2+1])}function Ln(Zr,Wa){var zn=0;do zn|=Zr&1,Zr>>>=1,zn<<=1;while(--Wa>0);return zn>>>1}function On(Zr){Zr.bi_valid===16?(Vn(Zr,Zr.bi_buf),Zr.bi_buf=0,Zr.bi_valid=0):Zr.bi_valid>=8&&(Zr.pending_buf[Zr.pending++]=Zr.bi_buf&255,Zr.bi_buf>>=8,Zr.bi_valid-=8)}function Ci(Zr,Wa){var zn=Wa.dyn_tree,di=Wa.max_code,wa=Wa.stat_desc.static_tree,gn=Wa.stat_desc.has_stree,Qr=Wa.stat_desc.extra_bits,Cn=Wa.stat_desc.extra_base,Ao=Wa.stat_desc.max_length,hr,hn,bn,Aa,La,Ma,lo=0;for(Aa=0;Aa<=st;Aa++)Zr.bl_count[Aa]=0;for(zn[Zr.heap[Zr.heap_max]*2+1]=0,hr=Zr.heap_max+1;hr<er;hr++)hn=Zr.heap[hr],Aa=zn[zn[hn*2+1]*2+1]+1,Aa>Ao&&(Aa=Ao,lo++),zn[hn*2+1]=Aa,!(hn>di)&&(Zr.bl_count[Aa]++,La=0,hn>=Cn&&(La=Qr[hn-Cn]),Ma=zn[hn*2],Zr.opt_len+=Ma*(Aa+La),gn&&(Zr.static_len+=Ma*(wa[hn*2+1]+La)));if(lo!==0){do{for(Aa=Ao-1;Zr.bl_count[Aa]===0;)Aa--;Zr.bl_count[Aa]--,Zr.bl_count[Aa+1]+=2,Zr.bl_count[Ao]--,lo-=2}while(lo>0);for(Aa=Ao;Aa!==0;Aa--)for(hn=Zr.bl_count[Aa];hn!==0;)bn=Zr.heap[--hr],!(bn>di)&&(zn[bn*2+1]!==Aa&&(Zr.opt_len+=(Aa-zn[bn*2+1])*zn[bn*2],zn[bn*2+1]=Aa),hn--)}}function So(Zr,Wa,zn){var di=new Array(st+1),wa=0,gn,Qr;for(gn=1;gn<=st;gn++)di[gn]=wa=wa+zn[gn-1]<<1;for(Qr=0;Qr<=Wa;Qr++){var Cn=Zr[Qr*2+1];Cn!==0&&(Zr[Qr*2]=Ln(di[Cn]++,Cn))}}function ii(){var Zr,Wa,zn,di,wa,gn=new Array(st+1);for(zn=0,di=0;di<Ue-1;di++)for(fa[di]=zn,Zr=0;Zr<1<<ar[di];Zr++)Ea[zn++]=di;for(Ea[zn-1]=di,wa=0,di=0;di<16;di++)for(ga[di]=wa,Zr=0;Zr<1<<Ar[di];Zr++)ha[wa++]=di;for(wa>>=7;di<Ze;di++)for(ga[di]=wa<<7,Zr=0;Zr<1<<Ar[di]-7;Zr++)ha[256+wa++]=di;for(Wa=0;Wa<=st;Wa++)gn[Wa]=0;for(Zr=0;Zr<=143;)Ra[Zr*2+1]=8,Zr++,gn[8]++;for(;Zr<=255;)Ra[Zr*2+1]=9,Zr++,gn[9]++;for(;Zr<=279;)Ra[Zr*2+1]=7,Zr++,gn[7]++;for(;Zr<=287;)Ra[Zr*2+1]=8,Zr++,gn[8]++;for(So(Ra,nt+1,gn),Zr=0;Zr<Ze;Zr++)ta[Zr*2+1]=5,ta[Zr*2]=Ln(Zr,5);Ba=new Ja(Ra,ar,Fe+1,nt,st),Pn=new Ja(ta,Ar,0,Ze,st),_n=new Ja(new Array(0),mr,0,Ve,Ye)}function ti(Zr){var Wa;for(Wa=0;Wa<nt;Wa++)Zr.dyn_ltree[Wa*2]=0;for(Wa=0;Wa<Ze;Wa++)Zr.dyn_dtree[Wa*2]=0;for(Wa=0;Wa<Ve;Wa++)Zr.bl_tree[Wa*2]=0;Zr.dyn_ltree[tt*2]=1,Zr.opt_len=Zr.static_len=0,Zr.last_lit=Zr.matches=0}function fi(Zr){Zr.bi_valid>8?Vn(Zr,Zr.bi_buf):Zr.bi_valid>0&&(Zr.pending_buf[Zr.pending++]=Zr.bi_buf),Zr.bi_buf=0,Zr.bi_valid=0}function Zi(Zr,Wa,zn,di){fi(Zr),di&&(Vn(Zr,zn),Vn(Zr,~zn)),e.arraySet(Zr.pending_buf,Zr.window,Wa,zn,Zr.pending),Zr.pending+=zn}function $i(Zr,Wa,zn,di){var wa=Wa*2,gn=zn*2;return Zr[wa]<Zr[gn]||Zr[wa]===Zr[gn]&&di[Wa]<=di[zn]}function _o(Zr,Wa,zn){for(var di=Zr.heap[zn],wa=zn<<1;wa<=Zr.heap_len&&(wa<Zr.heap_len&&$i(Wa,Zr.heap[wa+1],Zr.heap[wa],Zr.depth)&&wa++,!$i(Wa,di,Zr.heap[wa],Zr.depth));)Zr.heap[zn]=Zr.heap[wa],zn=wa,wa<<=1;Zr.heap[zn]=di}function Yi(Zr,Wa,zn){var di,wa,gn=0,Qr,Cn;if(Zr.last_lit!==0)do di=Zr.pending_buf[Zr.d_buf+gn*2]<<8|Zr.pending_buf[Zr.d_buf+gn*2+1],wa=Zr.pending_buf[Zr.l_buf+gn],gn++,di===0?kn(Zr,wa,Wa):(Qr=Ea[wa],kn(Zr,Qr+Fe+1,Wa),Cn=ar[Qr],Cn!==0&&(wa-=fa[Qr],fn(Zr,wa,Cn)),di--,Qr=ui(di),kn(Zr,Qr,zn),Cn=Ar[Qr],Cn!==0&&(di-=ga[Qr],fn(Zr,di,Cn)));while(gn<Zr.last_lit);kn(Zr,tt,Wa)}function ao(Zr,Wa){var zn=Wa.dyn_tree,di=Wa.stat_desc.static_tree,wa=Wa.stat_desc.has_stree,gn=Wa.stat_desc.elems,Qr,Cn,Ao=-1,hr;for(Zr.heap_len=0,Zr.heap_max=er,Qr=0;Qr<gn;Qr++)zn[Qr*2]!==0?(Zr.heap[++Zr.heap_len]=Ao=Qr,Zr.depth[Qr]=0):zn[Qr*2+1]=0;for(;Zr.heap_len<2;)hr=Zr.heap[++Zr.heap_len]=Ao<2?++Ao:0,zn[hr*2]=1,Zr.depth[hr]=0,Zr.opt_len--,wa&&(Zr.static_len-=di[hr*2+1]);for(Wa.max_code=Ao,Qr=Zr.heap_len>>1;Qr>=1;Qr--)_o(Zr,zn,Qr);hr=gn;do Qr=Zr.heap[1],Zr.heap[1]=Zr.heap[Zr.heap_len--],_o(Zr,zn,1),Cn=Zr.heap[1],Zr.heap[--Zr.heap_max]=Qr,Zr.heap[--Zr.heap_max]=Cn,zn[hr*2]=zn[Qr*2]+zn[Cn*2],Zr.depth[hr]=(Zr.depth[Qr]>=Zr.depth[Cn]?Zr.depth[Qr]:Zr.depth[Cn])+1,zn[Qr*2+1]=zn[Cn*2+1]=hr,Zr.heap[1]=hr++,_o(Zr,zn,1);while(Zr.heap_len>=2);Zr.heap[--Zr.heap_max]=Zr.heap[1],Ci(Zr,Wa),So(zn,Ao,Zr.bl_count)}function Co(Zr,Wa,zn){var di,wa=-1,gn,Qr=Wa[0*2+1],Cn=0,Ao=7,hr=4;for(Qr===0&&(Ao=138,hr=3),Wa[(zn+1)*2+1]=65535,di=0;di<=zn;di++)gn=Qr,Qr=Wa[(di+1)*2+1],!(++Cn<Ao&&gn===Qr)&&(Cn<hr?Zr.bl_tree[gn*2]+=Cn:gn!==0?(gn!==wa&&Zr.bl_tree[gn*2]++,Zr.bl_tree[Je*2]++):Cn<=10?Zr.bl_tree[rr*2]++:Zr.bl_tree[Rr*2]++,Cn=0,wa=gn,Qr===0?(Ao=138,hr=3):gn===Qr?(Ao=6,hr=3):(Ao=7,hr=4))}function yo(Zr,Wa,zn){var di,wa=-1,gn,Qr=Wa[0*2+1],Cn=0,Ao=7,hr=4;for(Qr===0&&(Ao=138,hr=3),di=0;di<=zn;di++)if(gn=Qr,Qr=Wa[(di+1)*2+1],!(++Cn<Ao&&gn===Qr)){if(Cn<hr)do kn(Zr,gn,Zr.bl_tree);while(--Cn!==0);else gn!==0?(gn!==wa&&(kn(Zr,gn,Zr.bl_tree),Cn--),kn(Zr,Je,Zr.bl_tree),fn(Zr,Cn-3,2)):Cn<=10?(kn(Zr,rr,Zr.bl_tree),fn(Zr,Cn-3,3)):(kn(Zr,Rr,Zr.bl_tree),fn(Zr,Cn-11,7));Cn=0,wa=gn,Qr===0?(Ao=138,hr=3):gn===Qr?(Ao=6,hr=3):(Ao=7,hr=4)}}function Jo(Zr){var Wa;for(Co(Zr,Zr.dyn_ltree,Zr.l_desc.max_code),Co(Zr,Zr.dyn_dtree,Zr.d_desc.max_code),ao(Zr,Zr.bl_desc),Wa=Ve-1;Wa>=3&&Zr.bl_tree[Pr[Wa]*2+1]===0;Wa--);return Zr.opt_len+=3*(Wa+1)+5+5+4,Wa}function fr(Zr,Wa,zn,di){var wa;for(fn(Zr,Wa-257,5),fn(Zr,zn-1,5),fn(Zr,di-4,4),wa=0;wa<di;wa++)fn(Zr,Zr.bl_tree[Pr[wa]*2+1],3);yo(Zr,Zr.dyn_ltree,Wa-1),yo(Zr,Zr.dyn_dtree,zn-1)}function Xa(Zr){var Wa=4093624447,zn;for(zn=0;zn<=31;zn++,Wa>>>=1)if(Wa&1&&Zr.dyn_ltree[zn*2]!==0)return s;if(Zr.dyn_ltree[9*2]!==0||Zr.dyn_ltree[10*2]!==0||Zr.dyn_ltree[13*2]!==0)return u;for(zn=32;zn<Fe;zn++)if(Zr.dyn_ltree[zn*2]!==0)return u;return s}var tn=!1;function mn(Zr){tn||(ii(),tn=!0),Zr.l_desc=new cn(Zr.dyn_ltree,Ba),Zr.d_desc=new cn(Zr.dyn_dtree,Pn),Zr.bl_desc=new cn(Zr.bl_tree,_n),Zr.bi_buf=0,Zr.bi_valid=0,ti(Zr)}function Mn(Zr,Wa,zn,di){fn(Zr,(x<<1)+(di?1:0),3),Zi(Zr,Wa,zn,!0)}function un(Zr){fn(Zr,o<<1,3),kn(Zr,tt,Ra),On(Zr)}function vi(Zr,Wa,zn,di){var wa,gn,Qr=0;Zr.level>0?(Zr.strm.data_type===m&&(Zr.strm.data_type=Xa(Zr)),ao(Zr,Zr.l_desc),ao(Zr,Zr.d_desc),Qr=Jo(Zr),wa=Zr.opt_len+3+7>>>3,gn=Zr.static_len+3+7>>>3,gn<=wa&&(wa=gn)):wa=gn=zn+5,zn+4<=wa&&Wa!==-1?Mn(Zr,Wa,zn,di):Zr.strategy===r||gn===wa?(fn(Zr,(o<<1)+(di?1:0),3),Yi(Zr,Ra,ta)):(fn(Zr,(F<<1)+(di?1:0),3),fr(Zr,Zr.l_desc.max_code+1,Zr.d_desc.max_code+1,Qr+1),Yi(Zr,Zr.dyn_ltree,Zr.dyn_dtree)),ti(Zr),di&&fi(Zr)}function ci(Zr,Wa,zn){return Zr.pending_buf[Zr.d_buf+Zr.last_lit*2]=Wa>>>8&255,Zr.pending_buf[Zr.d_buf+Zr.last_lit*2+1]=Wa&255,Zr.pending_buf[Zr.l_buf+Zr.last_lit]=zn&255,Zr.last_lit++,Wa===0?Zr.dyn_ltree[zn*2]++:(Zr.matches++,Wa--,Zr.dyn_ltree[(Ea[zn]+Fe+1)*2]++,Zr.dyn_dtree[ui(Wa)*2]++),Zr.last_lit===Zr.lit_bufsize-1}return trees._tr_init=mn,trees._tr_stored_block=Mn,trees._tr_flush_block=vi,trees._tr_tally=ci,trees._tr_align=un,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){if(hasRequiredAdler32)return adler32_1;hasRequiredAdler32=1;function e(r,s,u,m){for(var H=r&65535|0,x=r>>>16&65535|0,o=0;u!==0;){o=u>2e3?2e3:u,u-=o;do H=H+s[m++]|0,x=x+H|0;while(--o);H%=65521,x%=65521}return H|x<<16|0}return adler32_1=e,adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;function e(){for(var u,m=[],H=0;H<256;H++){u=H;for(var x=0;x<8;x++)u=u&1?3988292384^u>>>1:u>>>1;m[H]=u}return m}var r=e();function s(u,m,H,x){var o=r,F=x+H;u^=-1;for(var Re=x;Re<F;Re++)u=u>>>8^o[(u^m[Re])&255];return u^-1}return crc32_1=s,crc32_1}var messages,hasRequiredMessages;function requireMessages(){return hasRequiredMessages||(hasRequiredMessages=1,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),messages}var hasRequiredDeflate$1;function requireDeflate$1(){if(hasRequiredDeflate$1)return deflate;hasRequiredDeflate$1=1;var e=requireCommon(),r=requireTrees(),s=requireAdler32(),u=requireCrc32(),m=requireMessages(),H=0,x=1,o=3,F=4,Re=5,He=0,Ue=1,Fe=-2,nt=-3,Ze=-5,Ve=-1,er=1,st=2,Ke=3,Ye=4,tt=0,Je=2,rr=8,Rr=9,ar=15,Ar=8,mr=29,Pr=256,Nr=Pr+1+mr,Ra=30,ta=19,ha=2*Nr+1,Ea=15,fa=3,ga=258,Ja=ga+fa+1,Ba=32,Pn=42,_n=69,cn=73,ui=91,Vn=103,fn=113,kn=666,Ln=1,On=2,Ci=3,So=4,ii=3;function ti(hr,hn){return hr.msg=m[hn],hn}function fi(hr){return(hr<<1)-(hr>4?9:0)}function Zi(hr){for(var hn=hr.length;--hn>=0;)hr[hn]=0}function $i(hr){var hn=hr.state,bn=hn.pending;bn>hr.avail_out&&(bn=hr.avail_out),bn!==0&&(e.arraySet(hr.output,hn.pending_buf,hn.pending_out,bn,hr.next_out),hr.next_out+=bn,hn.pending_out+=bn,hr.total_out+=bn,hr.avail_out-=bn,hn.pending-=bn,hn.pending===0&&(hn.pending_out=0))}function _o(hr,hn){r._tr_flush_block(hr,hr.block_start>=0?hr.block_start:-1,hr.strstart-hr.block_start,hn),hr.block_start=hr.strstart,$i(hr.strm)}function Yi(hr,hn){hr.pending_buf[hr.pending++]=hn}function ao(hr,hn){hr.pending_buf[hr.pending++]=hn>>>8&255,hr.pending_buf[hr.pending++]=hn&255}function Co(hr,hn,bn,Aa){var La=hr.avail_in;return La>Aa&&(La=Aa),La===0?0:(hr.avail_in-=La,e.arraySet(hn,hr.input,hr.next_in,La,bn),hr.state.wrap===1?hr.adler=s(hr.adler,hn,La,bn):hr.state.wrap===2&&(hr.adler=u(hr.adler,hn,La,bn)),hr.next_in+=La,hr.total_in+=La,La)}function yo(hr,hn){var bn=hr.max_chain_length,Aa=hr.strstart,La,Ma,lo=hr.prev_length,Xi=hr.nice_match,no=hr.strstart>hr.w_size-Ja?hr.strstart-(hr.w_size-Ja):0,ji=hr.window,xa=hr.w_mask,dr=hr.prev,Cr=hr.strstart+ga,Vr=ji[Aa+lo-1],Pa=ji[Aa+lo];hr.prev_length>=hr.good_match&&(bn>>=2),Xi>hr.lookahead&&(Xi=hr.lookahead);do if(La=hn,!(ji[La+lo]!==Pa||ji[La+lo-1]!==Vr||ji[La]!==ji[Aa]||ji[++La]!==ji[Aa+1])){Aa+=2,La++;do;while(ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&Aa<Cr);if(Ma=ga-(Cr-Aa),Aa=Cr-ga,Ma>lo){if(hr.match_start=hn,lo=Ma,Ma>=Xi)break;Vr=ji[Aa+lo-1],Pa=ji[Aa+lo]}}while((hn=dr[hn&xa])>no&&--bn!==0);return lo<=hr.lookahead?lo:hr.lookahead}function Jo(hr){var hn=hr.w_size,bn,Aa,La,Ma,lo;do{if(Ma=hr.window_size-hr.lookahead-hr.strstart,hr.strstart>=hn+(hn-Ja)){e.arraySet(hr.window,hr.window,hn,hn,0),hr.match_start-=hn,hr.strstart-=hn,hr.block_start-=hn,Aa=hr.hash_size,bn=Aa;do La=hr.head[--bn],hr.head[bn]=La>=hn?La-hn:0;while(--Aa);Aa=hn,bn=Aa;do La=hr.prev[--bn],hr.prev[bn]=La>=hn?La-hn:0;while(--Aa);Ma+=hn}if(hr.strm.avail_in===0)break;if(Aa=Co(hr.strm,hr.window,hr.strstart+hr.lookahead,Ma),hr.lookahead+=Aa,hr.lookahead+hr.insert>=fa)for(lo=hr.strstart-hr.insert,hr.ins_h=hr.window[lo],hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[lo+1])&hr.hash_mask;hr.insert&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[lo+fa-1])&hr.hash_mask,hr.prev[lo&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=lo,lo++,hr.insert--,!(hr.lookahead+hr.insert<fa)););}while(hr.lookahead<Ja&&hr.strm.avail_in!==0)}function fr(hr,hn){var bn=65535;for(bn>hr.pending_buf_size-5&&(bn=hr.pending_buf_size-5);;){if(hr.lookahead<=1){if(Jo(hr),hr.lookahead===0&&hn===H)return Ln;if(hr.lookahead===0)break}hr.strstart+=hr.lookahead,hr.lookahead=0;var Aa=hr.block_start+bn;if((hr.strstart===0||hr.strstart>=Aa)&&(hr.lookahead=hr.strstart-Aa,hr.strstart=Aa,_o(hr,!1),hr.strm.avail_out===0)||hr.strstart-hr.block_start>=hr.w_size-Ja&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):(hr.strstart>hr.block_start&&(_o(hr,!1),hr.strm.avail_out===0),Ln)}function Xa(hr,hn){for(var bn,Aa;;){if(hr.lookahead<Ja){if(Jo(hr),hr.lookahead<Ja&&hn===H)return Ln;if(hr.lookahead===0)break}if(bn=0,hr.lookahead>=fa&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart),bn!==0&&hr.strstart-bn<=hr.w_size-Ja&&(hr.match_length=yo(hr,bn)),hr.match_length>=fa)if(Aa=r._tr_tally(hr,hr.strstart-hr.match_start,hr.match_length-fa),hr.lookahead-=hr.match_length,hr.match_length<=hr.max_lazy_match&&hr.lookahead>=fa){hr.match_length--;do hr.strstart++,hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart;while(--hr.match_length!==0);hr.strstart++}else hr.strstart+=hr.match_length,hr.match_length=0,hr.ins_h=hr.window[hr.strstart],hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+1])&hr.hash_mask;else Aa=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++;if(Aa&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=hr.strstart<fa-1?hr.strstart:fa-1,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function tn(hr,hn){for(var bn,Aa,La;;){if(hr.lookahead<Ja){if(Jo(hr),hr.lookahead<Ja&&hn===H)return Ln;if(hr.lookahead===0)break}if(bn=0,hr.lookahead>=fa&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart),hr.prev_length=hr.match_length,hr.prev_match=hr.match_start,hr.match_length=fa-1,bn!==0&&hr.prev_length<hr.max_lazy_match&&hr.strstart-bn<=hr.w_size-Ja&&(hr.match_length=yo(hr,bn),hr.match_length<=5&&(hr.strategy===er||hr.match_length===fa&&hr.strstart-hr.match_start>4096)&&(hr.match_length=fa-1)),hr.prev_length>=fa&&hr.match_length<=hr.prev_length){La=hr.strstart+hr.lookahead-fa,Aa=r._tr_tally(hr,hr.strstart-1-hr.prev_match,hr.prev_length-fa),hr.lookahead-=hr.prev_length-1,hr.prev_length-=2;do++hr.strstart<=La&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart);while(--hr.prev_length!==0);if(hr.match_available=0,hr.match_length=fa-1,hr.strstart++,Aa&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}else if(hr.match_available){if(Aa=r._tr_tally(hr,0,hr.window[hr.strstart-1]),Aa&&_o(hr,!1),hr.strstart++,hr.lookahead--,hr.strm.avail_out===0)return Ln}else hr.match_available=1,hr.strstart++,hr.lookahead--}return hr.match_available&&(Aa=r._tr_tally(hr,0,hr.window[hr.strstart-1]),hr.match_available=0),hr.insert=hr.strstart<fa-1?hr.strstart:fa-1,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function mn(hr,hn){for(var bn,Aa,La,Ma,lo=hr.window;;){if(hr.lookahead<=ga){if(Jo(hr),hr.lookahead<=ga&&hn===H)return Ln;if(hr.lookahead===0)break}if(hr.match_length=0,hr.lookahead>=fa&&hr.strstart>0&&(La=hr.strstart-1,Aa=lo[La],Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La])){Ma=hr.strstart+ga;do;while(Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&La<Ma);hr.match_length=ga-(Ma-La),hr.match_length>hr.lookahead&&(hr.match_length=hr.lookahead)}if(hr.match_length>=fa?(bn=r._tr_tally(hr,1,hr.match_length-fa),hr.lookahead-=hr.match_length,hr.strstart+=hr.match_length,hr.match_length=0):(bn=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++),bn&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function Mn(hr,hn){for(var bn;;){if(hr.lookahead===0&&(Jo(hr),hr.lookahead===0)){if(hn===H)return Ln;break}if(hr.match_length=0,bn=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++,bn&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function un(hr,hn,bn,Aa,La){this.good_length=hr,this.max_lazy=hn,this.nice_length=bn,this.max_chain=Aa,this.func=La}var vi;vi=[new un(0,0,0,0,fr),new un(4,4,8,4,Xa),new un(4,5,16,8,Xa),new un(4,6,32,32,Xa),new un(4,4,16,16,tn),new un(8,16,32,32,tn),new un(8,16,128,128,tn),new un(8,32,128,256,tn),new un(32,128,258,1024,tn),new un(32,258,258,4096,tn)];function ci(hr){hr.window_size=2*hr.w_size,Zi(hr.head),hr.max_lazy_match=vi[hr.level].max_lazy,hr.good_match=vi[hr.level].good_length,hr.nice_match=vi[hr.level].nice_length,hr.max_chain_length=vi[hr.level].max_chain,hr.strstart=0,hr.block_start=0,hr.lookahead=0,hr.insert=0,hr.match_length=hr.prev_length=fa-1,hr.match_available=0,hr.ins_h=0}function Zr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(ha*2),this.dyn_dtree=new e.Buf16((2*Ra+1)*2),this.bl_tree=new e.Buf16((2*ta+1)*2),Zi(this.dyn_ltree),Zi(this.dyn_dtree),Zi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(Ea+1),this.heap=new e.Buf16(2*Nr+1),Zi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*Nr+1),Zi(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Wa(hr){var hn;return!hr||!hr.state?ti(hr,Fe):(hr.total_in=hr.total_out=0,hr.data_type=Je,hn=hr.state,hn.pending=0,hn.pending_out=0,hn.wrap<0&&(hn.wrap=-hn.wrap),hn.status=hn.wrap?Pn:fn,hr.adler=hn.wrap===2?0:1,hn.last_flush=H,r._tr_init(hn),He)}function zn(hr){var hn=Wa(hr);return hn===He&&ci(hr.state),hn}function di(hr,hn){return!hr||!hr.state||hr.state.wrap!==2?Fe:(hr.state.gzhead=hn,He)}function wa(hr,hn,bn,Aa,La,Ma){if(!hr)return Fe;var lo=1;if(hn===Ve&&(hn=6),Aa<0?(lo=0,Aa=-Aa):Aa>15&&(lo=2,Aa-=16),La<1||La>Rr||bn!==rr||Aa<8||Aa>15||hn<0||hn>9||Ma<0||Ma>Ye)return ti(hr,Fe);Aa===8&&(Aa=9);var Xi=new Zr;return hr.state=Xi,Xi.strm=hr,Xi.wrap=lo,Xi.gzhead=null,Xi.w_bits=Aa,Xi.w_size=1<<Xi.w_bits,Xi.w_mask=Xi.w_size-1,Xi.hash_bits=La+7,Xi.hash_size=1<<Xi.hash_bits,Xi.hash_mask=Xi.hash_size-1,Xi.hash_shift=~~((Xi.hash_bits+fa-1)/fa),Xi.window=new e.Buf8(Xi.w_size*2),Xi.head=new e.Buf16(Xi.hash_size),Xi.prev=new e.Buf16(Xi.w_size),Xi.lit_bufsize=1<<La+6,Xi.pending_buf_size=Xi.lit_bufsize*4,Xi.pending_buf=new e.Buf8(Xi.pending_buf_size),Xi.d_buf=1*Xi.lit_bufsize,Xi.l_buf=(1+2)*Xi.lit_bufsize,Xi.level=hn,Xi.strategy=Ma,Xi.method=bn,zn(hr)}function gn(hr,hn){return wa(hr,hn,rr,ar,Ar,tt)}function Qr(hr,hn){var bn,Aa,La,Ma;if(!hr||!hr.state||hn>Re||hn<0)return hr?ti(hr,Fe):Fe;if(Aa=hr.state,!hr.output||!hr.input&&hr.avail_in!==0||Aa.status===kn&&hn!==F)return ti(hr,hr.avail_out===0?Ze:Fe);if(Aa.strm=hr,bn=Aa.last_flush,Aa.last_flush=hn,Aa.status===Pn)if(Aa.wrap===2)hr.adler=0,Yi(Aa,31),Yi(Aa,139),Yi(Aa,8),Aa.gzhead?(Yi(Aa,(Aa.gzhead.text?1:0)+(Aa.gzhead.hcrc?2:0)+(Aa.gzhead.extra?4:0)+(Aa.gzhead.name?8:0)+(Aa.gzhead.comment?16:0)),Yi(Aa,Aa.gzhead.time&255),Yi(Aa,Aa.gzhead.time>>8&255),Yi(Aa,Aa.gzhead.time>>16&255),Yi(Aa,Aa.gzhead.time>>24&255),Yi(Aa,Aa.level===9?2:Aa.strategy>=st||Aa.level<2?4:0),Yi(Aa,Aa.gzhead.os&255),Aa.gzhead.extra&&Aa.gzhead.extra.length&&(Yi(Aa,Aa.gzhead.extra.length&255),Yi(Aa,Aa.gzhead.extra.length>>8&255)),Aa.gzhead.hcrc&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending,0)),Aa.gzindex=0,Aa.status=_n):(Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,Aa.level===9?2:Aa.strategy>=st||Aa.level<2?4:0),Yi(Aa,ii),Aa.status=fn);else{var lo=rr+(Aa.w_bits-8<<4)<<8,Xi=-1;Aa.strategy>=st||Aa.level<2?Xi=0:Aa.level<6?Xi=1:Aa.level===6?Xi=2:Xi=3,lo|=Xi<<6,Aa.strstart!==0&&(lo|=Ba),lo+=31-lo%31,Aa.status=fn,ao(Aa,lo),Aa.strstart!==0&&(ao(Aa,hr.adler>>>16),ao(Aa,hr.adler&65535)),hr.adler=1}if(Aa.status===_n)if(Aa.gzhead.extra){for(La=Aa.pending;Aa.gzindex<(Aa.gzhead.extra.length&65535)&&!(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size));)Yi(Aa,Aa.gzhead.extra[Aa.gzindex]&255),Aa.gzindex++;Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Aa.gzindex===Aa.gzhead.extra.length&&(Aa.gzindex=0,Aa.status=cn)}else Aa.status=cn;if(Aa.status===cn)if(Aa.gzhead.name){La=Aa.pending;do{if(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size)){Ma=1;break}Aa.gzindex<Aa.gzhead.name.length?Ma=Aa.gzhead.name.charCodeAt(Aa.gzindex++)&255:Ma=0,Yi(Aa,Ma)}while(Ma!==0);Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Ma===0&&(Aa.gzindex=0,Aa.status=ui)}else Aa.status=ui;if(Aa.status===ui)if(Aa.gzhead.comment){La=Aa.pending;do{if(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size)){Ma=1;break}Aa.gzindex<Aa.gzhead.comment.length?Ma=Aa.gzhead.comment.charCodeAt(Aa.gzindex++)&255:Ma=0,Yi(Aa,Ma)}while(Ma!==0);Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Ma===0&&(Aa.status=Vn)}else Aa.status=Vn;if(Aa.status===Vn&&(Aa.gzhead.hcrc?(Aa.pending+2>Aa.pending_buf_size&&$i(hr),Aa.pending+2<=Aa.pending_buf_size&&(Yi(Aa,hr.adler&255),Yi(Aa,hr.adler>>8&255),hr.adler=0,Aa.status=fn)):Aa.status=fn),Aa.pending!==0){if($i(hr),hr.avail_out===0)return Aa.last_flush=-1,He}else if(hr.avail_in===0&&fi(hn)<=fi(bn)&&hn!==F)return ti(hr,Ze);if(Aa.status===kn&&hr.avail_in!==0)return ti(hr,Ze);if(hr.avail_in!==0||Aa.lookahead!==0||hn!==H&&Aa.status!==kn){var no=Aa.strategy===st?Mn(Aa,hn):Aa.strategy===Ke?mn(Aa,hn):vi[Aa.level].func(Aa,hn);if((no===Ci||no===So)&&(Aa.status=kn),no===Ln||no===Ci)return hr.avail_out===0&&(Aa.last_flush=-1),He;if(no===On&&(hn===x?r._tr_align(Aa):hn!==Re&&(r._tr_stored_block(Aa,0,0,!1),hn===o&&(Zi(Aa.head),Aa.lookahead===0&&(Aa.strstart=0,Aa.block_start=0,Aa.insert=0))),$i(hr),hr.avail_out===0))return Aa.last_flush=-1,He}return hn!==F?He:Aa.wrap<=0?Ue:(Aa.wrap===2?(Yi(Aa,hr.adler&255),Yi(Aa,hr.adler>>8&255),Yi(Aa,hr.adler>>16&255),Yi(Aa,hr.adler>>24&255),Yi(Aa,hr.total_in&255),Yi(Aa,hr.total_in>>8&255),Yi(Aa,hr.total_in>>16&255),Yi(Aa,hr.total_in>>24&255)):(ao(Aa,hr.adler>>>16),ao(Aa,hr.adler&65535)),$i(hr),Aa.wrap>0&&(Aa.wrap=-Aa.wrap),Aa.pending!==0?He:Ue)}function Cn(hr){var hn;return!hr||!hr.state?Fe:(hn=hr.state.status,hn!==Pn&&hn!==_n&&hn!==cn&&hn!==ui&&hn!==Vn&&hn!==fn&&hn!==kn?ti(hr,Fe):(hr.state=null,hn===fn?ti(hr,nt):He))}function Ao(hr,hn){var bn=hn.length,Aa,La,Ma,lo,Xi,no,ji,xa;if(!hr||!hr.state||(Aa=hr.state,lo=Aa.wrap,lo===2||lo===1&&Aa.status!==Pn||Aa.lookahead))return Fe;for(lo===1&&(hr.adler=s(hr.adler,hn,bn,0)),Aa.wrap=0,bn>=Aa.w_size&&(lo===0&&(Zi(Aa.head),Aa.strstart=0,Aa.block_start=0,Aa.insert=0),xa=new e.Buf8(Aa.w_size),e.arraySet(xa,hn,bn-Aa.w_size,Aa.w_size,0),hn=xa,bn=Aa.w_size),Xi=hr.avail_in,no=hr.next_in,ji=hr.input,hr.avail_in=bn,hr.next_in=0,hr.input=hn,Jo(Aa);Aa.lookahead>=fa;){La=Aa.strstart,Ma=Aa.lookahead-(fa-1);do Aa.ins_h=(Aa.ins_h<<Aa.hash_shift^Aa.window[La+fa-1])&Aa.hash_mask,Aa.prev[La&Aa.w_mask]=Aa.head[Aa.ins_h],Aa.head[Aa.ins_h]=La,La++;while(--Ma);Aa.strstart=La,Aa.lookahead=fa-1,Jo(Aa)}return Aa.strstart+=Aa.lookahead,Aa.block_start=Aa.strstart,Aa.insert=Aa.lookahead,Aa.lookahead=0,Aa.match_length=Aa.prev_length=fa-1,Aa.match_available=0,hr.next_in=no,hr.input=ji,hr.avail_in=Xi,Aa.wrap=lo,He}return deflate.deflateInit=gn,deflate.deflateInit2=wa,deflate.deflateReset=zn,deflate.deflateResetKeep=Wa,deflate.deflateSetHeader=di,deflate.deflate=Qr,deflate.deflateEnd=Cn,deflate.deflateSetDictionary=Ao,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var strings={},hasRequiredStrings;function requireStrings(){if(hasRequiredStrings)return strings;hasRequiredStrings=1;var e=requireCommon(),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var u=new e.Buf8(256),m=0;m<256;m++)u[m]=m>=252?6:m>=248?5:m>=240?4:m>=224?3:m>=192?2:1;u[254]=u[254]=1,strings.string2buf=function(x){var o,F,Re,He,Ue,Fe=x.length,nt=0;for(He=0;He<Fe;He++)F=x.charCodeAt(He),(F&64512)===55296&&He+1<Fe&&(Re=x.charCodeAt(He+1),(Re&64512)===56320&&(F=65536+(F-55296<<10)+(Re-56320),He++)),nt+=F<128?1:F<2048?2:F<65536?3:4;for(o=new e.Buf8(nt),Ue=0,He=0;Ue<nt;He++)F=x.charCodeAt(He),(F&64512)===55296&&He+1<Fe&&(Re=x.charCodeAt(He+1),(Re&64512)===56320&&(F=65536+(F-55296<<10)+(Re-56320),He++)),F<128?o[Ue++]=F:F<2048?(o[Ue++]=192|F>>>6,o[Ue++]=128|F&63):F<65536?(o[Ue++]=224|F>>>12,o[Ue++]=128|F>>>6&63,o[Ue++]=128|F&63):(o[Ue++]=240|F>>>18,o[Ue++]=128|F>>>12&63,o[Ue++]=128|F>>>6&63,o[Ue++]=128|F&63);return o};function H(x,o){if(o<65534&&(x.subarray&&s||!x.subarray&&r))return String.fromCharCode.apply(null,e.shrinkBuf(x,o));for(var F="",Re=0;Re<o;Re++)F+=String.fromCharCode(x[Re]);return F}return strings.buf2binstring=function(x){return H(x,x.length)},strings.binstring2buf=function(x){for(var o=new e.Buf8(x.length),F=0,Re=o.length;F<Re;F++)o[F]=x.charCodeAt(F);return o},strings.buf2string=function(x,o){var F,Re,He,Ue,Fe=o||x.length,nt=new Array(Fe*2);for(Re=0,F=0;F<Fe;){if(He=x[F++],He<128){nt[Re++]=He;continue}if(Ue=u[He],Ue>4){nt[Re++]=65533,F+=Ue-1;continue}for(He&=Ue===2?31:Ue===3?15:7;Ue>1&&F<Fe;)He=He<<6|x[F++]&63,Ue--;if(Ue>1){nt[Re++]=65533;continue}He<65536?nt[Re++]=He:(He-=65536,nt[Re++]=55296|He>>10&1023,nt[Re++]=56320|He&1023)}return H(nt,Re)},strings.utf8border=function(x,o){var F;for(o=o||x.length,o>x.length&&(o=x.length),F=o-1;F>=0&&(x[F]&192)===128;)F--;return F<0||F===0?o:F+u[x[F]]>o?F:o},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return zstream=e,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;var e=requireDeflate$1(),r=requireCommon(),s=requireStrings(),u=requireMessages(),m=requireZstream(),H=Object.prototype.toString,x=0,o=4,F=0,Re=1,He=2,Ue=-1,Fe=0,nt=8;function Ze(Ke){if(!(this instanceof Ze))return new Ze(Ke);this.options=r.assign({level:Ue,method:nt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fe,to:""},Ke||{});var Ye=this.options;Ye.raw&&Ye.windowBits>0?Ye.windowBits=-Ye.windowBits:Ye.gzip&&Ye.windowBits>0&&Ye.windowBits<16&&(Ye.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var tt=e.deflateInit2(this.strm,Ye.level,Ye.method,Ye.windowBits,Ye.memLevel,Ye.strategy);if(tt!==F)throw new Error(u[tt]);if(Ye.header&&e.deflateSetHeader(this.strm,Ye.header),Ye.dictionary){var Je;if(typeof Ye.dictionary=="string"?Je=s.string2buf(Ye.dictionary):H.call(Ye.dictionary)==="[object ArrayBuffer]"?Je=new Uint8Array(Ye.dictionary):Je=Ye.dictionary,tt=e.deflateSetDictionary(this.strm,Je),tt!==F)throw new Error(u[tt]);this._dict_set=!0}}Ze.prototype.push=function(Ke,Ye){var tt=this.strm,Je=this.options.chunkSize,rr,Rr;if(this.ended)return!1;Rr=Ye===~~Ye?Ye:Ye===!0?o:x,typeof Ke=="string"?tt.input=s.string2buf(Ke):H.call(Ke)==="[object ArrayBuffer]"?tt.input=new Uint8Array(Ke):tt.input=Ke,tt.next_in=0,tt.avail_in=tt.input.length;do{if(tt.avail_out===0&&(tt.output=new r.Buf8(Je),tt.next_out=0,tt.avail_out=Je),rr=e.deflate(tt,Rr),rr!==Re&&rr!==F)return this.onEnd(rr),this.ended=!0,!1;(tt.avail_out===0||tt.avail_in===0&&(Rr===o||Rr===He))&&(this.options.to==="string"?this.onData(s.buf2binstring(r.shrinkBuf(tt.output,tt.next_out))):this.onData(r.shrinkBuf(tt.output,tt.next_out)))}while((tt.avail_in>0||tt.avail_out===0)&&rr!==Re);return Rr===o?(rr=e.deflateEnd(this.strm),this.onEnd(rr),this.ended=!0,rr===F):(Rr===He&&(this.onEnd(F),tt.avail_out=0),!0)},Ze.prototype.onData=function(Ke){this.chunks.push(Ke)},Ze.prototype.onEnd=function(Ke){Ke===F&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=Ke,this.msg=this.strm.msg};function Ve(Ke,Ye){var tt=new Ze(Ye);if(tt.push(Ke,!0),tt.err)throw tt.msg||u[tt.err];return tt.result}function er(Ke,Ye){return Ye=Ye||{},Ye.raw=!0,Ve(Ke,Ye)}function st(Ke,Ye){return Ye=Ye||{},Ye.gzip=!0,Ve(Ke,Ye)}return deflate$1.Deflate=Ze,deflate$1.deflate=Ve,deflate$1.deflateRaw=er,deflate$1.gzip=st,deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;var e=30,r=12;return inffast=function(u,m){var H,x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er,st,Ke,Ye,tt,Je,rr,Rr,ar,Ar,mr,Pr,Nr,Ra;H=u.state,x=u.next_in,Nr=u.input,o=x+(u.avail_in-5),F=u.next_out,Ra=u.output,Re=F-(m-u.avail_out),He=F+(u.avail_out-257),Ue=H.dmax,Fe=H.wsize,nt=H.whave,Ze=H.wnext,Ve=H.window,er=H.hold,st=H.bits,Ke=H.lencode,Ye=H.distcode,tt=(1<<H.lenbits)-1,Je=(1<<H.distbits)-1;e:do{st<15&&(er+=Nr[x++]<<st,st+=8,er+=Nr[x++]<<st,st+=8),rr=Ke[er&tt];t:for(;;){if(Rr=rr>>>24,er>>>=Rr,st-=Rr,Rr=rr>>>16&255,Rr===0)Ra[F++]=rr&65535;else if(Rr&16){ar=rr&65535,Rr&=15,Rr&&(st<Rr&&(er+=Nr[x++]<<st,st+=8),ar+=er&(1<<Rr)-1,er>>>=Rr,st-=Rr),st<15&&(er+=Nr[x++]<<st,st+=8,er+=Nr[x++]<<st,st+=8),rr=Ye[er&Je];r:for(;;){if(Rr=rr>>>24,er>>>=Rr,st-=Rr,Rr=rr>>>16&255,Rr&16){if(Ar=rr&65535,Rr&=15,st<Rr&&(er+=Nr[x++]<<st,st+=8,st<Rr&&(er+=Nr[x++]<<st,st+=8)),Ar+=er&(1<<Rr)-1,Ar>Ue){u.msg="invalid distance too far back",H.mode=e;break e}if(er>>>=Rr,st-=Rr,Rr=F-Re,Ar>Rr){if(Rr=Ar-Rr,Rr>nt&&H.sane){u.msg="invalid distance too far back",H.mode=e;break e}if(mr=0,Pr=Ve,Ze===0){if(mr+=Fe-Rr,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}}else if(Ze<Rr){if(mr+=Fe+Ze-Rr,Rr-=Ze,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);if(mr=0,Ze<ar){Rr=Ze,ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}}}else if(mr+=Ze-Rr,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}for(;ar>2;)Ra[F++]=Pr[mr++],Ra[F++]=Pr[mr++],Ra[F++]=Pr[mr++],ar-=3;ar&&(Ra[F++]=Pr[mr++],ar>1&&(Ra[F++]=Pr[mr++]))}else{mr=F-Ar;do Ra[F++]=Ra[mr++],Ra[F++]=Ra[mr++],Ra[F++]=Ra[mr++],ar-=3;while(ar>2);ar&&(Ra[F++]=Ra[mr++],ar>1&&(Ra[F++]=Ra[mr++]))}}else if((Rr&64)===0){rr=Ye[(rr&65535)+(er&(1<<Rr)-1)];continue r}else{u.msg="invalid distance code",H.mode=e;break e}break}}else if((Rr&64)===0){rr=Ke[(rr&65535)+(er&(1<<Rr)-1)];continue t}else if(Rr&32){H.mode=r;break e}else{u.msg="invalid literal/length code",H.mode=e;break e}break}}while(x<o&&F<He);ar=st>>3,x-=ar,st-=ar<<3,er&=(1<<st)-1,u.next_in=x,u.next_out=F,u.avail_in=x<o?5+(o-x):5-(x-o),u.avail_out=F<He?257+(He-F):257-(F-He),H.hold=er,H.bits=st},inffast}var inftrees,hasRequiredInftrees;function requireInftrees(){if(hasRequiredInftrees)return inftrees;hasRequiredInftrees=1;var e=requireCommon(),r=15,s=852,u=592,m=0,H=1,x=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],F=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Re=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],He=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return inftrees=function(Fe,nt,Ze,Ve,er,st,Ke,Ye){var tt=Ye.bits,Je=0,rr=0,Rr=0,ar=0,Ar=0,mr=0,Pr=0,Nr=0,Ra=0,ta=0,ha,Ea,fa,ga,Ja,Ba=null,Pn=0,_n,cn=new e.Buf16(r+1),ui=new e.Buf16(r+1),Vn=null,fn=0,kn,Ln,On;for(Je=0;Je<=r;Je++)cn[Je]=0;for(rr=0;rr<Ve;rr++)cn[nt[Ze+rr]]++;for(Ar=tt,ar=r;ar>=1&&cn[ar]===0;ar--);if(Ar>ar&&(Ar=ar),ar===0)return er[st++]=1<<24|64<<16|0,er[st++]=1<<24|64<<16|0,Ye.bits=1,0;for(Rr=1;Rr<ar&&cn[Rr]===0;Rr++);for(Ar<Rr&&(Ar=Rr),Nr=1,Je=1;Je<=r;Je++)if(Nr<<=1,Nr-=cn[Je],Nr<0)return-1;if(Nr>0&&(Fe===m||ar!==1))return-1;for(ui[1]=0,Je=1;Je<r;Je++)ui[Je+1]=ui[Je]+cn[Je];for(rr=0;rr<Ve;rr++)nt[Ze+rr]!==0&&(Ke[ui[nt[Ze+rr]]++]=rr);if(Fe===m?(Ba=Vn=Ke,_n=19):Fe===H?(Ba=o,Pn-=257,Vn=F,fn-=257,_n=256):(Ba=Re,Vn=He,_n=-1),ta=0,rr=0,Je=Rr,Ja=st,mr=Ar,Pr=0,fa=-1,Ra=1<<Ar,ga=Ra-1,Fe===H&&Ra>s||Fe===x&&Ra>u)return 1;for(;;){kn=Je-Pr,Ke[rr]<_n?(Ln=0,On=Ke[rr]):Ke[rr]>_n?(Ln=Vn[fn+Ke[rr]],On=Ba[Pn+Ke[rr]]):(Ln=32+64,On=0),ha=1<<Je-Pr,Ea=1<<mr,Rr=Ea;do Ea-=ha,er[Ja+(ta>>Pr)+Ea]=kn<<24|Ln<<16|On|0;while(Ea!==0);for(ha=1<<Je-1;ta&ha;)ha>>=1;if(ha!==0?(ta&=ha-1,ta+=ha):ta=0,rr++,--cn[Je]===0){if(Je===ar)break;Je=nt[Ze+Ke[rr]]}if(Je>Ar&&(ta&ga)!==fa){for(Pr===0&&(Pr=Ar),Ja+=Rr,mr=Je-Pr,Nr=1<<mr;mr+Pr<ar&&(Nr-=cn[mr+Pr],!(Nr<=0));)mr++,Nr<<=1;if(Ra+=1<<mr,Fe===H&&Ra>s||Fe===x&&Ra>u)return 1;fa=ta&ga,er[fa]=Ar<<24|mr<<16|Ja-st|0}}return ta!==0&&(er[Ja+ta]=Je-Pr<<24|64<<16|0),Ye.bits=Ar,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;var e=requireCommon(),r=requireAdler32(),s=requireCrc32(),u=requireInffast(),m=requireInftrees(),H=0,x=1,o=2,F=4,Re=5,He=6,Ue=0,Fe=1,nt=2,Ze=-2,Ve=-3,er=-4,st=-5,Ke=8,Ye=1,tt=2,Je=3,rr=4,Rr=5,ar=6,Ar=7,mr=8,Pr=9,Nr=10,Ra=11,ta=12,ha=13,Ea=14,fa=15,ga=16,Ja=17,Ba=18,Pn=19,_n=20,cn=21,ui=22,Vn=23,fn=24,kn=25,Ln=26,On=27,Ci=28,So=29,ii=30,ti=31,fi=32,Zi=852,$i=592,_o=15,Yi=_o;function ao(wa){return(wa>>>24&255)+(wa>>>8&65280)+((wa&65280)<<8)+((wa&255)<<24)}function Co(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function yo(wa){var gn;return!wa||!wa.state?Ze:(gn=wa.state,wa.total_in=wa.total_out=gn.total=0,wa.msg="",gn.wrap&&(wa.adler=gn.wrap&1),gn.mode=Ye,gn.last=0,gn.havedict=0,gn.dmax=32768,gn.head=null,gn.hold=0,gn.bits=0,gn.lencode=gn.lendyn=new e.Buf32(Zi),gn.distcode=gn.distdyn=new e.Buf32($i),gn.sane=1,gn.back=-1,Ue)}function Jo(wa){var gn;return!wa||!wa.state?Ze:(gn=wa.state,gn.wsize=0,gn.whave=0,gn.wnext=0,yo(wa))}function fr(wa,gn){var Qr,Cn;return!wa||!wa.state||(Cn=wa.state,gn<0?(Qr=0,gn=-gn):(Qr=(gn>>4)+1,gn<48&&(gn&=15)),gn&&(gn<8||gn>15))?Ze:(Cn.window!==null&&Cn.wbits!==gn&&(Cn.window=null),Cn.wrap=Qr,Cn.wbits=gn,Jo(wa))}function Xa(wa,gn){var Qr,Cn;return wa?(Cn=new Co,wa.state=Cn,Cn.window=null,Qr=fr(wa,gn),Qr!==Ue&&(wa.state=null),Qr):Ze}function tn(wa){return Xa(wa,Yi)}var mn=!0,Mn,un;function vi(wa){if(mn){var gn;for(Mn=new e.Buf32(512),un=new e.Buf32(32),gn=0;gn<144;)wa.lens[gn++]=8;for(;gn<256;)wa.lens[gn++]=9;for(;gn<280;)wa.lens[gn++]=7;for(;gn<288;)wa.lens[gn++]=8;for(m(x,wa.lens,0,288,Mn,0,wa.work,{bits:9}),gn=0;gn<32;)wa.lens[gn++]=5;m(o,wa.lens,0,32,un,0,wa.work,{bits:5}),mn=!1}wa.lencode=Mn,wa.lenbits=9,wa.distcode=un,wa.distbits=5}function ci(wa,gn,Qr,Cn){var Ao,hr=wa.state;return hr.window===null&&(hr.wsize=1<<hr.wbits,hr.wnext=0,hr.whave=0,hr.window=new e.Buf8(hr.wsize)),Cn>=hr.wsize?(e.arraySet(hr.window,gn,Qr-hr.wsize,hr.wsize,0),hr.wnext=0,hr.whave=hr.wsize):(Ao=hr.wsize-hr.wnext,Ao>Cn&&(Ao=Cn),e.arraySet(hr.window,gn,Qr-Cn,Ao,hr.wnext),Cn-=Ao,Cn?(e.arraySet(hr.window,gn,Qr-Cn,Cn,0),hr.wnext=Cn,hr.whave=hr.wsize):(hr.wnext+=Ao,hr.wnext===hr.wsize&&(hr.wnext=0),hr.whave<hr.wsize&&(hr.whave+=Ao))),0}function Zr(wa,gn){var Qr,Cn,Ao,hr,hn,bn,Aa,La,Ma,lo,Xi,no,ji,xa,dr=0,Cr,Vr,Pa,oa,Ua,ya,ua,Da,$a=new e.Buf8(4),ka,Un,Ai=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!wa||!wa.state||!wa.output||!wa.input&&wa.avail_in!==0)return Ze;Qr=wa.state,Qr.mode===ta&&(Qr.mode=ha),hn=wa.next_out,Ao=wa.output,Aa=wa.avail_out,hr=wa.next_in,Cn=wa.input,bn=wa.avail_in,La=Qr.hold,Ma=Qr.bits,lo=bn,Xi=Aa,Da=Ue;e:for(;;)switch(Qr.mode){case Ye:if(Qr.wrap===0){Qr.mode=ha;break}for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.wrap&2&&La===35615){Qr.check=0,$a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0),La=0,Ma=0,Qr.mode=tt;break}if(Qr.flags=0,Qr.head&&(Qr.head.done=!1),!(Qr.wrap&1)||(((La&255)<<8)+(La>>8))%31){wa.msg="incorrect header check",Qr.mode=ii;break}if((La&15)!==Ke){wa.msg="unknown compression method",Qr.mode=ii;break}if(La>>>=4,Ma-=4,ua=(La&15)+8,Qr.wbits===0)Qr.wbits=ua;else if(ua>Qr.wbits){wa.msg="invalid window size",Qr.mode=ii;break}Qr.dmax=1<<ua,wa.adler=Qr.check=1,Qr.mode=La&512?Nr:ta,La=0,Ma=0;break;case tt:for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.flags=La,(Qr.flags&255)!==Ke){wa.msg="unknown compression method",Qr.mode=ii;break}if(Qr.flags&57344){wa.msg="unknown header flags set",Qr.mode=ii;break}Qr.head&&(Qr.head.text=La>>8&1),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0,Qr.mode=Je;case Je:for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.head&&(Qr.head.time=La),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,$a[2]=La>>>16&255,$a[3]=La>>>24&255,Qr.check=s(Qr.check,$a,4,0)),La=0,Ma=0,Qr.mode=rr;case rr:for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.head&&(Qr.head.xflags=La&255,Qr.head.os=La>>8),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0,Qr.mode=Rr;case Rr:if(Qr.flags&1024){for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.length=La,Qr.head&&(Qr.head.extra_len=La),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0}else Qr.head&&(Qr.head.extra=null);Qr.mode=ar;case ar:if(Qr.flags&1024&&(no=Qr.length,no>bn&&(no=bn),no&&(Qr.head&&(ua=Qr.head.extra_len-Qr.length,Qr.head.extra||(Qr.head.extra=new Array(Qr.head.extra_len)),e.arraySet(Qr.head.extra,Cn,hr,no,ua)),Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,Qr.length-=no),Qr.length))break e;Qr.length=0,Qr.mode=Ar;case Ar:if(Qr.flags&2048){if(bn===0)break e;no=0;do ua=Cn[hr+no++],Qr.head&&ua&&Qr.length<65536&&(Qr.head.name+=String.fromCharCode(ua));while(ua&&no<bn);if(Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,ua)break e}else Qr.head&&(Qr.head.name=null);Qr.length=0,Qr.mode=mr;case mr:if(Qr.flags&4096){if(bn===0)break e;no=0;do ua=Cn[hr+no++],Qr.head&&ua&&Qr.length<65536&&(Qr.head.comment+=String.fromCharCode(ua));while(ua&&no<bn);if(Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,ua)break e}else Qr.head&&(Qr.head.comment=null);Qr.mode=Pr;case Pr:if(Qr.flags&512){for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La!==(Qr.check&65535)){wa.msg="header crc mismatch",Qr.mode=ii;break}La=0,Ma=0}Qr.head&&(Qr.head.hcrc=Qr.flags>>9&1,Qr.head.done=!0),wa.adler=Qr.check=0,Qr.mode=ta;break;case Nr:for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}wa.adler=Qr.check=ao(La),La=0,Ma=0,Qr.mode=Ra;case Ra:if(Qr.havedict===0)return wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,nt;wa.adler=Qr.check=1,Qr.mode=ta;case ta:if(gn===Re||gn===He)break e;case ha:if(Qr.last){La>>>=Ma&7,Ma-=Ma&7,Qr.mode=On;break}for(;Ma<3;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}switch(Qr.last=La&1,La>>>=1,Ma-=1,La&3){case 0:Qr.mode=Ea;break;case 1:if(vi(Qr),Qr.mode=_n,gn===He){La>>>=2,Ma-=2;break e}break;case 2:Qr.mode=Ja;break;case 3:wa.msg="invalid block type",Qr.mode=ii}La>>>=2,Ma-=2;break;case Ea:for(La>>>=Ma&7,Ma-=Ma&7;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if((La&65535)!==(La>>>16^65535)){wa.msg="invalid stored block lengths",Qr.mode=ii;break}if(Qr.length=La&65535,La=0,Ma=0,Qr.mode=fa,gn===He)break e;case fa:Qr.mode=ga;case ga:if(no=Qr.length,no){if(no>bn&&(no=bn),no>Aa&&(no=Aa),no===0)break e;e.arraySet(Ao,Cn,hr,no,hn),bn-=no,hr+=no,Aa-=no,hn+=no,Qr.length-=no;break}Qr.mode=ta;break;case Ja:for(;Ma<14;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.nlen=(La&31)+257,La>>>=5,Ma-=5,Qr.ndist=(La&31)+1,La>>>=5,Ma-=5,Qr.ncode=(La&15)+4,La>>>=4,Ma-=4,Qr.nlen>286||Qr.ndist>30){wa.msg="too many length or distance symbols",Qr.mode=ii;break}Qr.have=0,Qr.mode=Ba;case Ba:for(;Qr.have<Qr.ncode;){for(;Ma<3;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.lens[Ai[Qr.have++]]=La&7,La>>>=3,Ma-=3}for(;Qr.have<19;)Qr.lens[Ai[Qr.have++]]=0;if(Qr.lencode=Qr.lendyn,Qr.lenbits=7,ka={bits:Qr.lenbits},Da=m(H,Qr.lens,0,19,Qr.lencode,0,Qr.work,ka),Qr.lenbits=ka.bits,Da){wa.msg="invalid code lengths set",Qr.mode=ii;break}Qr.have=0,Qr.mode=Pn;case Pn:for(;Qr.have<Qr.nlen+Qr.ndist;){for(;dr=Qr.lencode[La&(1<<Qr.lenbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Pa<16)La>>>=Cr,Ma-=Cr,Qr.lens[Qr.have++]=Pa;else{if(Pa===16){for(Un=Cr+2;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La>>>=Cr,Ma-=Cr,Qr.have===0){wa.msg="invalid bit length repeat",Qr.mode=ii;break}ua=Qr.lens[Qr.have-1],no=3+(La&3),La>>>=2,Ma-=2}else if(Pa===17){for(Un=Cr+3;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=Cr,Ma-=Cr,ua=0,no=3+(La&7),La>>>=3,Ma-=3}else{for(Un=Cr+7;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=Cr,Ma-=Cr,ua=0,no=11+(La&127),La>>>=7,Ma-=7}if(Qr.have+no>Qr.nlen+Qr.ndist){wa.msg="invalid bit length repeat",Qr.mode=ii;break}for(;no--;)Qr.lens[Qr.have++]=ua}}if(Qr.mode===ii)break;if(Qr.lens[256]===0){wa.msg="invalid code -- missing end-of-block",Qr.mode=ii;break}if(Qr.lenbits=9,ka={bits:Qr.lenbits},Da=m(x,Qr.lens,0,Qr.nlen,Qr.lencode,0,Qr.work,ka),Qr.lenbits=ka.bits,Da){wa.msg="invalid literal/lengths set",Qr.mode=ii;break}if(Qr.distbits=6,Qr.distcode=Qr.distdyn,ka={bits:Qr.distbits},Da=m(o,Qr.lens,Qr.nlen,Qr.ndist,Qr.distcode,0,Qr.work,ka),Qr.distbits=ka.bits,Da){wa.msg="invalid distances set",Qr.mode=ii;break}if(Qr.mode=_n,gn===He)break e;case _n:Qr.mode=cn;case cn:if(bn>=6&&Aa>=258){wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,u(wa,Xi),hn=wa.next_out,Ao=wa.output,Aa=wa.avail_out,hr=wa.next_in,Cn=wa.input,bn=wa.avail_in,La=Qr.hold,Ma=Qr.bits,Qr.mode===ta&&(Qr.back=-1);break}for(Qr.back=0;dr=Qr.lencode[La&(1<<Qr.lenbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Vr&&(Vr&240)===0){for(oa=Cr,Ua=Vr,ya=Pa;dr=Qr.lencode[ya+((La&(1<<oa+Ua)-1)>>oa)],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(oa+Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=oa,Ma-=oa,Qr.back+=oa}if(La>>>=Cr,Ma-=Cr,Qr.back+=Cr,Qr.length=Pa,Vr===0){Qr.mode=Ln;break}if(Vr&32){Qr.back=-1,Qr.mode=ta;break}if(Vr&64){wa.msg="invalid literal/length code",Qr.mode=ii;break}Qr.extra=Vr&15,Qr.mode=ui;case ui:if(Qr.extra){for(Un=Qr.extra;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.length+=La&(1<<Qr.extra)-1,La>>>=Qr.extra,Ma-=Qr.extra,Qr.back+=Qr.extra}Qr.was=Qr.length,Qr.mode=Vn;case Vn:for(;dr=Qr.distcode[La&(1<<Qr.distbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if((Vr&240)===0){for(oa=Cr,Ua=Vr,ya=Pa;dr=Qr.distcode[ya+((La&(1<<oa+Ua)-1)>>oa)],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(oa+Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=oa,Ma-=oa,Qr.back+=oa}if(La>>>=Cr,Ma-=Cr,Qr.back+=Cr,Vr&64){wa.msg="invalid distance code",Qr.mode=ii;break}Qr.offset=Pa,Qr.extra=Vr&15,Qr.mode=fn;case fn:if(Qr.extra){for(Un=Qr.extra;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.offset+=La&(1<<Qr.extra)-1,La>>>=Qr.extra,Ma-=Qr.extra,Qr.back+=Qr.extra}if(Qr.offset>Qr.dmax){wa.msg="invalid distance too far back",Qr.mode=ii;break}Qr.mode=kn;case kn:if(Aa===0)break e;if(no=Xi-Aa,Qr.offset>no){if(no=Qr.offset-no,no>Qr.whave&&Qr.sane){wa.msg="invalid distance too far back",Qr.mode=ii;break}no>Qr.wnext?(no-=Qr.wnext,ji=Qr.wsize-no):ji=Qr.wnext-no,no>Qr.length&&(no=Qr.length),xa=Qr.window}else xa=Ao,ji=hn-Qr.offset,no=Qr.length;no>Aa&&(no=Aa),Aa-=no,Qr.length-=no;do Ao[hn++]=xa[ji++];while(--no);Qr.length===0&&(Qr.mode=cn);break;case Ln:if(Aa===0)break e;Ao[hn++]=Qr.length,Aa--,Qr.mode=cn;break;case On:if(Qr.wrap){for(;Ma<32;){if(bn===0)break e;bn--,La|=Cn[hr++]<<Ma,Ma+=8}if(Xi-=Aa,wa.total_out+=Xi,Qr.total+=Xi,Xi&&(wa.adler=Qr.check=Qr.flags?s(Qr.check,Ao,Xi,hn-Xi):r(Qr.check,Ao,Xi,hn-Xi)),Xi=Aa,(Qr.flags?La:ao(La))!==Qr.check){wa.msg="incorrect data check",Qr.mode=ii;break}La=0,Ma=0}Qr.mode=Ci;case Ci:if(Qr.wrap&&Qr.flags){for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La!==(Qr.total&4294967295)){wa.msg="incorrect length check",Qr.mode=ii;break}La=0,Ma=0}Qr.mode=So;case So:Da=Fe;break e;case ii:Da=Ve;break e;case ti:return er;case fi:default:return Ze}return wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,(Qr.wsize||Xi!==wa.avail_out&&Qr.mode<ii&&(Qr.mode<On||gn!==F))&&ci(wa,wa.output,wa.next_out,Xi-wa.avail_out),lo-=wa.avail_in,Xi-=wa.avail_out,wa.total_in+=lo,wa.total_out+=Xi,Qr.total+=Xi,Qr.wrap&&Xi&&(wa.adler=Qr.check=Qr.flags?s(Qr.check,Ao,Xi,wa.next_out-Xi):r(Qr.check,Ao,Xi,wa.next_out-Xi)),wa.data_type=Qr.bits+(Qr.last?64:0)+(Qr.mode===ta?128:0)+(Qr.mode===_n||Qr.mode===fa?256:0),(lo===0&&Xi===0||gn===F)&&Da===Ue&&(Da=st),Da}function Wa(wa){if(!wa||!wa.state)return Ze;var gn=wa.state;return gn.window&&(gn.window=null),wa.state=null,Ue}function zn(wa,gn){var Qr;return!wa||!wa.state||(Qr=wa.state,(Qr.wrap&2)===0)?Ze:(Qr.head=gn,gn.done=!1,Ue)}function di(wa,gn){var Qr=gn.length,Cn,Ao,hr;return!wa||!wa.state||(Cn=wa.state,Cn.wrap!==0&&Cn.mode!==Ra)?Ze:Cn.mode===Ra&&(Ao=1,Ao=r(Ao,gn,Qr,0),Ao!==Cn.check)?Ve:(hr=ci(wa,gn,Qr,Qr),hr?(Cn.mode=ti,er):(Cn.havedict=1,Ue))}return inflate.inflateReset=Jo,inflate.inflateReset2=fr,inflate.inflateResetKeep=yo,inflate.inflateInit=tn,inflate.inflateInit2=Xa,inflate.inflate=Zr,inflate.inflateEnd=Wa,inflate.inflateGetHeader=zn,inflate.inflateSetDictionary=di,inflate.inflateInfo="pako inflate (from Nodeca project)",inflate}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),constants}var gzheader,hasRequiredGzheader;function requireGzheader(){if(hasRequiredGzheader)return gzheader;hasRequiredGzheader=1;function e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return gzheader=e,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;var e=requireInflate$1(),r=requireCommon(),s=requireStrings(),u=requireConstants(),m=requireMessages(),H=requireZstream(),x=requireGzheader(),o=Object.prototype.toString;function F(Ue){if(!(this instanceof F))return new F(Ue);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},Ue||{});var Fe=this.options;Fe.raw&&Fe.windowBits>=0&&Fe.windowBits<16&&(Fe.windowBits=-Fe.windowBits,Fe.windowBits===0&&(Fe.windowBits=-15)),Fe.windowBits>=0&&Fe.windowBits<16&&!(Ue&&Ue.windowBits)&&(Fe.windowBits+=32),Fe.windowBits>15&&Fe.windowBits<48&&(Fe.windowBits&15)===0&&(Fe.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new H,this.strm.avail_out=0;var nt=e.inflateInit2(this.strm,Fe.windowBits);if(nt!==u.Z_OK)throw new Error(m[nt]);if(this.header=new x,e.inflateGetHeader(this.strm,this.header),Fe.dictionary&&(typeof Fe.dictionary=="string"?Fe.dictionary=s.string2buf(Fe.dictionary):o.call(Fe.dictionary)==="[object ArrayBuffer]"&&(Fe.dictionary=new Uint8Array(Fe.dictionary)),Fe.raw&&(nt=e.inflateSetDictionary(this.strm,Fe.dictionary),nt!==u.Z_OK)))throw new Error(m[nt])}F.prototype.push=function(Ue,Fe){var nt=this.strm,Ze=this.options.chunkSize,Ve=this.options.dictionary,er,st,Ke,Ye,tt,Je=!1;if(this.ended)return!1;st=Fe===~~Fe?Fe:Fe===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof Ue=="string"?nt.input=s.binstring2buf(Ue):o.call(Ue)==="[object ArrayBuffer]"?nt.input=new Uint8Array(Ue):nt.input=Ue,nt.next_in=0,nt.avail_in=nt.input.length;do{if(nt.avail_out===0&&(nt.output=new r.Buf8(Ze),nt.next_out=0,nt.avail_out=Ze),er=e.inflate(nt,u.Z_NO_FLUSH),er===u.Z_NEED_DICT&&Ve&&(er=e.inflateSetDictionary(this.strm,Ve)),er===u.Z_BUF_ERROR&&Je===!0&&(er=u.Z_OK,Je=!1),er!==u.Z_STREAM_END&&er!==u.Z_OK)return this.onEnd(er),this.ended=!0,!1;nt.next_out&&(nt.avail_out===0||er===u.Z_STREAM_END||nt.avail_in===0&&(st===u.Z_FINISH||st===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(Ke=s.utf8border(nt.output,nt.next_out),Ye=nt.next_out-Ke,tt=s.buf2string(nt.output,Ke),nt.next_out=Ye,nt.avail_out=Ze-Ye,Ye&&r.arraySet(nt.output,nt.output,Ke,Ye,0),this.onData(tt)):this.onData(r.shrinkBuf(nt.output,nt.next_out))),nt.avail_in===0&&nt.avail_out===0&&(Je=!0)}while((nt.avail_in>0||nt.avail_out===0)&&er!==u.Z_STREAM_END);return er===u.Z_STREAM_END&&(st=u.Z_FINISH),st===u.Z_FINISH?(er=e.inflateEnd(this.strm),this.onEnd(er),this.ended=!0,er===u.Z_OK):(st===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),nt.avail_out=0),!0)},F.prototype.onData=function(Ue){this.chunks.push(Ue)},F.prototype.onEnd=function(Ue){Ue===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=Ue,this.msg=this.strm.msg};function Re(Ue,Fe){var nt=new F(Fe);if(nt.push(Ue,!0),nt.err)throw nt.msg||m[nt.err];return nt.result}function He(Ue,Fe){return Fe=Fe||{},Fe.raw=!0,Re(Ue,Fe)}return inflate$1.Inflate=F,inflate$1.inflate=Re,inflate$1.inflateRaw=He,inflate$1.ungzip=Re,inflate$1}var pako_1,hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako_1;hasRequiredPako=1;var e=requireCommon().assign,r=requireDeflate(),s=requireInflate(),u=requireConstants(),m={};return e(m,r,s,u),pako_1=m,pako_1}(function(e){(function(){var r={},s;e.exports=r,typeof commonjsRequire=="function"?s=requirePako():s=window.pako,function(u,m){u.toRGBA8=function(H){var x=H.width,o=H.height;if(H.tabs.acTL==null)return[u.toRGBA8.decodeImage(H.data,x,o,H).buffer];var F=[];H.frames[0].data==null&&(H.frames[0].data=H.data);for(var Re,He=new Uint8Array(x*o*4),Ue=0;Ue<H.frames.length;Ue++){var Fe=H.frames[Ue],nt=Fe.rect.x,Ze=Fe.rect.y,Ve=Fe.rect.width,er=Fe.rect.height,st=u.toRGBA8.decodeImage(Fe.data,Ve,er,H);if(Ue==0?Re=st:Fe.blend==0?u._copyTile(st,Ve,er,Re,x,o,nt,Ze,0):Fe.blend==1&&u._copyTile(st,Ve,er,Re,x,o,nt,Ze,1),F.push(Re.buffer),Re=Re.slice(0),Fe.dispose!=0){if(Fe.dispose==1)u._copyTile(He,Ve,er,Re,x,o,nt,Ze,0);else if(Fe.dispose==2){for(var Ke=Ue-1;H.frames[Ke].dispose==2;)Ke--;Re=new Uint8Array(F[Ke]).slice(0)}}}return F},u.toRGBA8.decodeImage=function(H,x,o,F){var Re=x*o,He=u.decode._getBPP(F),Ue=Math.ceil(x*He/8),Fe=new Uint8Array(Re*4),nt=new Uint32Array(Fe.buffer),Ze=F.ctype,Ve=F.depth,er=u._bin.readUshort;if(Ze==6){var st=Re<<2;if(Ve==8)for(var Ke=0;Ke<st;Ke++)Fe[Ke]=H[Ke];if(Ve==16)for(var Ke=0;Ke<st;Ke++)Fe[Ke]=H[Ke<<1]}else if(Ze==2){var Ye=F.tabs.tRNS,tt=-1,Je=-1,rr=-1;if(Ye&&(tt=Ye[0],Je=Ye[1],rr=Ye[2]),Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ar=Ke*3;Fe[Rr]=H[ar],Fe[Rr+1]=H[ar+1],Fe[Rr+2]=H[ar+2],Fe[Rr+3]=255,tt!=-1&&H[ar]==tt&&H[ar+1]==Je&&H[ar+2]==rr&&(Fe[Rr+3]=0)}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ar=Ke*6;Fe[Rr]=H[ar],Fe[Rr+1]=H[ar+2],Fe[Rr+2]=H[ar+4],Fe[Rr+3]=255,tt!=-1&&er(H,ar)==tt&&er(H,ar+2)==Je&&er(H,ar+4)==rr&&(Fe[Rr+3]=0)}}else if(Ze==3){var Ar=F.tabs.PLTE,mr=F.tabs.tRNS,Pr=mr?mr.length:0;if(Ve==1)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>3)]>>7-((Ke&7)<<0)&1,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==2)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>2)]>>6-((Ke&3)<<1)&3,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==4)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>1)]>>4-((Ke&1)<<2)&15,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ha=H[Ke],Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}}else if(Ze==4){if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,fa=Ke<<1,ga=H[fa];Fe[Rr]=ga,Fe[Rr+1]=ga,Fe[Rr+2]=ga,Fe[Rr+3]=H[fa+1]}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,fa=Ke<<2,ga=H[fa];Fe[Rr]=ga,Fe[Rr+1]=ga,Fe[Rr+2]=ga,Fe[Rr+3]=H[fa+2]}}else if(Ze==0){var tt=F.tabs.tRNS?F.tabs.tRNS:-1;if(Ve==1)for(var Ke=0;Ke<Re;Ke++){var ga=255*(H[Ke>>3]>>7-(Ke&7)&1),Ja=ga==tt*255?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==2)for(var Ke=0;Ke<Re;Ke++){var ga=85*(H[Ke>>2]>>6-((Ke&3)<<1)&3),Ja=ga==tt*85?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==4)for(var Ke=0;Ke<Re;Ke++){var ga=17*(H[Ke>>1]>>4-((Ke&1)<<2)&15),Ja=ga==tt*17?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var ga=H[Ke],Ja=ga==tt?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var ga=H[Ke<<1],Ja=er(H,Ke<<1)==tt?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}}return Fe},u.decode=function(H){for(var x=new Uint8Array(H),o=8,F=u._bin,Re=F.readUshort,He=F.readUint,Ue={tabs:{},frames:[]},Fe=new Uint8Array(x.length),nt=0,Ze,Ve=0,er=[137,80,78,71,13,10,26,10],st=0;st<8;st++)if(x[st]!=er[st])throw"The input is not a PNG file!";for(;o<x.length;){var Ke=F.readUint(x,o);o+=4;var Ye=F.readASCII(x,o,4);if(o+=4,Ye=="IHDR")u.decode._IHDR(x,o,Ue);else if(Ye=="IDAT"){for(var st=0;st<Ke;st++)Fe[nt+st]=x[o+st];nt+=Ke}else if(Ye=="acTL")Ue.tabs[Ye]={num_frames:He(x,o),num_plays:He(x,o+4)},Ze=new Uint8Array(x.length);else if(Ye=="fcTL"){if(Ve!=0){var tt=Ue.frames[Ue.frames.length-1];tt.data=u.decode._decompress(Ue,Ze.slice(0,Ve),tt.rect.width,tt.rect.height),Ve=0}var Je={x:He(x,o+12),y:He(x,o+16),width:He(x,o+4),height:He(x,o+8)},rr=Re(x,o+22);rr=Re(x,o+20)/(rr==0?100:rr);var Rr={rect:Je,delay:Math.round(rr*1e3),dispose:x[o+24],blend:x[o+25]};Ue.frames.push(Rr)}else if(Ye=="fdAT"){for(var st=0;st<Ke-4;st++)Ze[Ve+st]=x[o+st+4];Ve+=Ke-4}else if(Ye=="pHYs")Ue.tabs[Ye]=[F.readUint(x,o),F.readUint(x,o+4),x[o+8]];else if(Ye=="cHRM"){Ue.tabs[Ye]=[];for(var st=0;st<8;st++)Ue.tabs[Ye].push(F.readUint(x,o+st*4))}else if(Ye=="tEXt"){Ue.tabs[Ye]==null&&(Ue.tabs[Ye]={});var ar=F.nextZero(x,o),Ar=F.readASCII(x,o,ar-o),mr=F.readASCII(x,ar+1,o+Ke-ar-1);Ue.tabs[Ye][Ar]=mr}else if(Ye=="iTXt"){Ue.tabs[Ye]==null&&(Ue.tabs[Ye]={});var ar=0,Pr=o;ar=F.nextZero(x,Pr);var Ar=F.readASCII(x,Pr,ar-Pr);Pr=ar+1,x[Pr],x[Pr+1],Pr+=2,ar=F.nextZero(x,Pr),F.readASCII(x,Pr,ar-Pr),Pr=ar+1,ar=F.nextZero(x,Pr),F.readUTF8(x,Pr,ar-Pr),Pr=ar+1;var mr=F.readUTF8(x,Pr,Ke-(Pr-o));Ue.tabs[Ye][Ar]=mr}else if(Ye=="PLTE")Ue.tabs[Ye]=F.readBytes(x,o,Ke);else if(Ye=="hIST"){var Nr=Ue.tabs.PLTE.length/3;Ue.tabs[Ye]=[];for(var st=0;st<Nr;st++)Ue.tabs[Ye].push(Re(x,o+st*2))}else if(Ye=="tRNS")Ue.ctype==3?Ue.tabs[Ye]=F.readBytes(x,o,Ke):Ue.ctype==0?Ue.tabs[Ye]=Re(x,o):Ue.ctype==2&&(Ue.tabs[Ye]=[Re(x,o),Re(x,o+2),Re(x,o+4)]);else if(Ye=="gAMA")Ue.tabs[Ye]=F.readUint(x,o)/1e5;else if(Ye=="sRGB")Ue.tabs[Ye]=x[o];else if(Ye=="bKGD")Ue.ctype==0||Ue.ctype==4?Ue.tabs[Ye]=[Re(x,o)]:Ue.ctype==2||Ue.ctype==6?Ue.tabs[Ye]=[Re(x,o),Re(x,o+2),Re(x,o+4)]:Ue.ctype==3&&(Ue.tabs[Ye]=x[o]);else if(Ye=="IEND"){if(Ve!=0){var tt=Ue.frames[Ue.frames.length-1];tt.data=u.decode._decompress(Ue,Ze.slice(0,Ve),tt.rect.width,tt.rect.height),Ve=0}Ue.data=u.decode._decompress(Ue,Fe,Ue.width,Ue.height);break}o+=Ke,F.readUint(x,o),o+=4}return delete Ue.compress,delete Ue.interlace,delete Ue.filter,Ue},u.decode._decompress=function(H,x,o,F){return H.compress==0&&(x=u.decode._inflate(x)),H.interlace==0?x=u.decode._filterZero(x,H,0,o,F):H.interlace==1&&(x=u.decode._readInterlace(x,H)),x},u.decode._inflate=function(H){return m.inflate(H)},u.decode._readInterlace=function(H,x){for(var o=x.width,F=x.height,Re=u.decode._getBPP(x),He=Re>>3,Ue=Math.ceil(o*Re/8),Fe=new Uint8Array(F*Ue),nt=0,Ze=[0,0,4,0,2,0,1],Ve=[0,4,0,2,0,1,0],er=[8,8,8,4,4,2,2],st=[8,8,4,4,2,2,1],Ke=0;Ke<7;){for(var Ye=er[Ke],tt=st[Ke],Je=0,rr=0,Rr=Ze[Ke];Rr<F;)Rr+=Ye,rr++;for(var ar=Ve[Ke];ar<o;)ar+=tt,Je++;var Ar=Math.ceil(Je*Re/8);u.decode._filterZero(H,x,nt,Je,rr);for(var mr=0,Pr=Ze[Ke];Pr<F;){for(var Nr=Ve[Ke],Ra=nt+mr*Ar<<3;Nr<o;){if(Re==1){var ta=H[Ra>>3];ta=ta>>7-(Ra&7)&1,Fe[Pr*Ue+(Nr>>3)]|=ta<<7-((Nr&3)<<0)}if(Re==2){var ta=H[Ra>>3];ta=ta>>6-(Ra&7)&3,Fe[Pr*Ue+(Nr>>2)]|=ta<<6-((Nr&3)<<1)}if(Re==4){var ta=H[Ra>>3];ta=ta>>4-(Ra&7)&15,Fe[Pr*Ue+(Nr>>1)]|=ta<<4-((Nr&1)<<2)}if(Re>=8)for(var ha=Pr*Ue+Nr*He,Ea=0;Ea<He;Ea++)Fe[ha+Ea]=H[(Ra>>3)+Ea];Ra+=Re,Nr+=tt}mr++,Pr+=Ye}Je*rr!=0&&(nt+=rr*(1+Ar)),Ke=Ke+1}return Fe},u.decode._getBPP=function(H){var x=[1,null,3,1,2,null,4][H.ctype];return x*H.depth},u.decode._filterZero=function(H,x,o,F,Re){var He=u.decode._getBPP(x),Ue=Math.ceil(F*He/8),Fe=u.decode._paeth;He=Math.ceil(He/8);for(var nt=0;nt<Re;nt++){var Ze=o+nt*Ue,Ve=Ze+nt+1,er=H[Ve-1];if(er==0)for(var st=0;st<Ue;st++)H[Ze+st]=H[Ve+st];else if(er==1){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st];for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+H[Ze+st-He]&255}else if(nt==0){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st];if(er==2)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]&255;if(er==3)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-He]>>1)&255;if(er==4)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+Fe(H[Ze+st-He],0,0)&255}else{if(er==2)for(var st=0;st<Ue;st++)H[Ze+st]=H[Ve+st]+H[Ze+st-Ue]&255;if(er==3){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-Ue]>>1)&255;for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-Ue]+H[Ze+st-He]>>1)&255}if(er==4){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st]+Fe(0,H[Ze+st-Ue],0)&255;for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+Fe(H[Ze+st-He],H[Ze+st-Ue],H[Ze+st-He-Ue])&255}}}return H},u.decode._paeth=function(H,x,o){var F=H+x-o,Re=Math.abs(F-H),He=Math.abs(F-x),Ue=Math.abs(F-o);return Re<=He&&Re<=Ue?H:He<=Ue?x:o},u.decode._IHDR=function(H,x,o){var F=u._bin;o.width=F.readUint(H,x),x+=4,o.height=F.readUint(H,x),x+=4,o.depth=H[x],x++,o.ctype=H[x],x++,o.compress=H[x],x++,o.filter=H[x],x++,o.interlace=H[x],x++},u._bin={nextZero:function(H,x){for(;H[x]!=0;)x++;return x},readUshort:function(H,x){return H[x]<<8|H[x+1]},writeUshort:function(H,x,o){H[x]=o>>8&255,H[x+1]=o&255},readUint:function(H,x){return H[x]*(256*256*256)+(H[x+1]<<16|H[x+2]<<8|H[x+3])},writeUint:function(H,x,o){H[x]=o>>24&255,H[x+1]=o>>16&255,H[x+2]=o>>8&255,H[x+3]=o&255},readASCII:function(H,x,o){for(var F="",Re=0;Re<o;Re++)F+=String.fromCharCode(H[x+Re]);return F},writeASCII:function(H,x,o){for(var F=0;F<o.length;F++)H[x+F]=o.charCodeAt(F)},readBytes:function(H,x,o){for(var F=[],Re=0;Re<o;Re++)F.push(H[x+Re]);return F},pad:function(H){return H.length<2?"0"+H:H},readUTF8:function(H,x,o){for(var F="",Re,He=0;He<o;He++)F+="%"+u._bin.pad(H[x+He].toString(16));try{Re=decodeURIComponent(F)}catch{return u._bin.readASCII(H,x,o)}return Re}},u._copyTile=function(H,x,o,F,Re,He,Ue,Fe,nt){for(var Ze=Math.min(x,Re),Ve=Math.min(o,He),er=0,st=0,Ke=0;Ke<Ve;Ke++)for(var Ye=0;Ye<Ze;Ye++)if(Ue>=0&&Fe>=0?(er=Ke*x+Ye<<2,st=(Fe+Ke)*Re+Ue+Ye<<2):(er=(-Fe+Ke)*x-Ue+Ye<<2,st=Ke*Re+Ye<<2),nt==0)F[st]=H[er],F[st+1]=H[er+1],F[st+2]=H[er+2],F[st+3]=H[er+3];else if(nt==1){var tt=H[er+3]*.00392156862745098,Je=H[er]*tt,rr=H[er+1]*tt,Rr=H[er+2]*tt,ar=F[st+3]*(1/255),Ar=F[st]*ar,mr=F[st+1]*ar,Pr=F[st+2]*ar,Nr=1-tt,Ra=tt+ar*Nr,ta=Ra==0?0:1/Ra;F[st+3]=255*Ra,F[st+0]=(Je+Ar*Nr)*ta,F[st+1]=(rr+mr*Nr)*ta,F[st+2]=(Rr+Pr*Nr)*ta}else if(nt==2){var tt=H[er+3],Je=H[er],rr=H[er+1],Rr=H[er+2],ar=F[st+3],Ar=F[st],mr=F[st+1],Pr=F[st+2];tt==ar&&Je==Ar&&rr==mr&&Rr==Pr?(F[st]=0,F[st+1]=0,F[st+2]=0,F[st+3]=0):(F[st]=Je,F[st+1]=rr,F[st+2]=Rr,F[st+3]=tt)}else if(nt==3){var tt=H[er+3],Je=H[er],rr=H[er+1],Rr=H[er+2],ar=F[st+3],Ar=F[st],mr=F[st+1],Pr=F[st+2];if(tt==ar&&Je==Ar&&rr==mr&&Rr==Pr)continue;if(tt<220&&ar>20)return!1}return!0},u.encode=function(H,x,o,F,Re,He){F==null&&(F=0),He==null&&(He=!1);for(var Ue=new Uint8Array(H[0].byteLength*H.length+100),Fe=[137,80,78,71,13,10,26,10],nt=0;nt<8;nt++)Ue[nt]=Fe[nt];var Ze=8,Ve=u._bin,er=u.crc.crc,st=Ve.writeUint,Ke=Ve.writeUshort,Ye=Ve.writeASCII,tt=u.encode.compressPNG(H,x,o,F,He);st(Ue,Ze,13),Ze+=4,Ye(Ue,Ze,"IHDR"),Ze+=4,st(Ue,Ze,x),Ze+=4,st(Ue,Ze,o),Ze+=4,Ue[Ze]=tt.depth,Ze++,Ue[Ze]=tt.ctype,Ze++,Ue[Ze]=0,Ze++,Ue[Ze]=0,Ze++,Ue[Ze]=0,Ze++,st(Ue,Ze,er(Ue,Ze-17,17)),Ze+=4,st(Ue,Ze,1),Ze+=4,Ye(Ue,Ze,"sRGB"),Ze+=4,Ue[Ze]=1,Ze++,st(Ue,Ze,er(Ue,Ze-5,5)),Ze+=4;var Je=H.length>1;if(Je&&(st(Ue,Ze,8),Ze+=4,Ye(Ue,Ze,"acTL"),Ze+=4,st(Ue,Ze,H.length),Ze+=4,st(Ue,Ze,0),Ze+=4,st(Ue,Ze,er(Ue,Ze-12,12)),Ze+=4),tt.ctype==3){var rr=tt.plte.length;st(Ue,Ze,rr*3),Ze+=4,Ye(Ue,Ze,"PLTE"),Ze+=4;for(var nt=0;nt<rr;nt++){var Rr=nt*3,ar=tt.plte[nt],Ar=ar&255,mr=ar>>8&255,Pr=ar>>16&255;Ue[Ze+Rr+0]=Ar,Ue[Ze+Rr+1]=mr,Ue[Ze+Rr+2]=Pr}if(Ze+=rr*3,st(Ue,Ze,er(Ue,Ze-rr*3-4,rr*3+4)),Ze+=4,tt.gotAlpha){st(Ue,Ze,rr),Ze+=4,Ye(Ue,Ze,"tRNS"),Ze+=4;for(var nt=0;nt<rr;nt++)Ue[Ze+nt]=tt.plte[nt]>>24&255;Ze+=rr,st(Ue,Ze,er(Ue,Ze-rr-4,rr+4)),Ze+=4}}for(var Nr=0,Ra=0;Ra<tt.frames.length;Ra++){var ta=tt.frames[Ra];Je&&(st(Ue,Ze,26),Ze+=4,Ye(Ue,Ze,"fcTL"),Ze+=4,st(Ue,Ze,Nr++),Ze+=4,st(Ue,Ze,ta.rect.width),Ze+=4,st(Ue,Ze,ta.rect.height),Ze+=4,st(Ue,Ze,ta.rect.x),Ze+=4,st(Ue,Ze,ta.rect.y),Ze+=4,Ke(Ue,Ze,Re[Ra]),Ze+=2,Ke(Ue,Ze,1e3),Ze+=2,Ue[Ze]=ta.dispose,Ze++,Ue[Ze]=ta.blend,Ze++,st(Ue,Ze,er(Ue,Ze-30,30)),Ze+=4);var ha=ta.cimg,rr=ha.length;st(Ue,Ze,rr+(Ra==0?0:4)),Ze+=4;var Ea=Ze;Ye(Ue,Ze,Ra==0?"IDAT":"fdAT"),Ze+=4,Ra!=0&&(st(Ue,Ze,Nr++),Ze+=4);for(var nt=0;nt<rr;nt++)Ue[Ze+nt]=ha[nt];Ze+=rr,st(Ue,Ze,er(Ue,Ea,Ze-Ea)),Ze+=4}return st(Ue,Ze,0),Ze+=4,Ye(Ue,Ze,"IEND"),Ze+=4,st(Ue,Ze,er(Ue,Ze-4,4)),Ze+=4,Ue.buffer.slice(0,Ze)},u.encode.compressPNG=function(H,x,o,F,Re){for(var He=u.encode.compress(H,x,o,F,!1,Re),Ue=0;Ue<H.length;Ue++){var Fe=He.frames[Ue];Fe.rect.width;var nt=Fe.rect.height,Ze=Fe.bpl,Ve=Fe.bpp,er=new Uint8Array(nt*Ze+nt);Fe.cimg=u.encode._filterZero(Fe.img,nt,Ve,Ze,er)}return He},u.encode.compress=function(H,x,o,F,Re,He){He==null&&(He=!1);for(var Ue=6,Fe=8,nt=4,Ze=255,Ve=0;Ve<H.length;Ve++)for(var er=new Uint8Array(H[Ve]),st=er.length,Ke=0;Ke<st;Ke+=4)Ze&=er[Ke+3];var Ye=Ze!=255,tt={},Je=[];if(H.length!=0&&(tt[0]=0,Je.push(0),F!=0&&F--),F!=0){var rr=u.quantize(H,F,Re);H=rr.bufs;for(var Ke=0;Ke<rr.plte.length;Ke++){var Rr=rr.plte[Ke].est.rgba;tt[Rr]==null&&(tt[Rr]=Je.length,Je.push(Rr))}}else for(var Ve=0;Ve<H.length;Ve++)for(var ar=new Uint32Array(H[Ve]),st=ar.length,Ke=0;Ke<st;Ke++){var Rr=ar[Ke];if((Ke<x||Rr!=ar[Ke-1]&&Rr!=ar[Ke-x])&&tt[Rr]==null&&(tt[Rr]=Je.length,Je.push(Rr),Je.length>=300))break}var Ar=Ye?Re:!1,mr=Je.length;mr<=256&&He==!1&&(mr<=2?Fe=1:mr<=4?Fe=2:mr<=16?Fe=4:Fe=8,Re&&(Fe=8),Ye=!0);for(var Pr=[],Ve=0;Ve<H.length;Ve++){var Nr=new Uint8Array(H[Ve]),Ra=new Uint32Array(Nr.buffer),ta=0,ha=0,Ea=x,fa=o,ga=0;if(Ve!=0&&!Ar){for(var Ja=Re||Ve==1||Pr[Pr.length-2].dispose==2?1:2,Ba=0,Pn=1e9,_n=0;_n<Ja;_n++){for(var So=new Uint8Array(H[Ve-1-_n]),cn=new Uint32Array(H[Ve-1-_n]),ui=x,Vn=o,fn=-1,kn=-1,Ln=0;Ln<o;Ln++)for(var On=0;On<x;On++){var Ke=Ln*x+On;Ra[Ke]!=cn[Ke]&&(On<ui&&(ui=On),On>fn&&(fn=On),Ln<Vn&&(Vn=Ln),Ln>kn&&(kn=Ln))}var Ci=fn==-1?1:(fn-ui+1)*(kn-Vn+1);Ci<Pn&&(Pn=Ci,Ba=_n,fn==-1?(ta=ha=0,Ea=fa=1):(ta=ui,ha=Vn,Ea=fn-ui+1,fa=kn-Vn+1))}var So=new Uint8Array(H[Ve-1-Ba]);Ba==1&&(Pr[Pr.length-1].dispose=2);var ii=new Uint8Array(Ea*fa*4);new Uint32Array(ii.buffer),u._copyTile(So,x,o,ii,Ea,fa,-ta,-ha,0),u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,3)?(u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,2),ga=1):(u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,0),ga=0),Nr=ii,Ra=new Uint32Array(Nr.buffer)}var ti=4*Ea;if(mr<=256&&He==!1){ti=Math.ceil(Fe*Ea/8);for(var ii=new Uint8Array(ti*fa),Ln=0;Ln<fa;Ln++){var Ke=Ln*ti,fi=Ln*Ea;if(Fe==8)for(var On=0;On<Ea;On++)ii[Ke+On]=tt[Ra[fi+On]];else if(Fe==4)for(var On=0;On<Ea;On++)ii[Ke+(On>>1)]|=tt[Ra[fi+On]]<<4-(On&1)*4;else if(Fe==2)for(var On=0;On<Ea;On++)ii[Ke+(On>>2)]|=tt[Ra[fi+On]]<<6-(On&3)*2;else if(Fe==1)for(var On=0;On<Ea;On++)ii[Ke+(On>>3)]|=tt[Ra[fi+On]]<<7-(On&7)*1}Nr=ii,Ue=3,nt=1}else if(Ye==!1&&H.length==1){for(var ii=new Uint8Array(Ea*fa*3),Zi=Ea*fa,Ke=0;Ke<Zi;Ke++){var $i=Ke*3,_o=Ke*4;ii[$i]=Nr[_o],ii[$i+1]=Nr[_o+1],ii[$i+2]=Nr[_o+2]}Nr=ii,Ue=2,nt=3,ti=3*Ea}Pr.push({rect:{x:ta,y:ha,width:Ea,height:fa},img:Nr,bpl:ti,bpp:nt,blend:ga,dispose:Ar?1:0})}return{ctype:Ue,depth:Fe,plte:Je,gotAlpha:Ye,frames:Pr}},u.encode._filterZero=function(H,x,o,F,Re){for(var He=[],Ue=0;Ue<5;Ue++)if(!(x*F>5e5&&(Ue==2||Ue==3||Ue==4))){for(var Fe=0;Fe<x;Fe++)u.encode._filterLine(Re,H,Fe,F,o,Ue);if(He.push(m.deflate(Re)),o==1)break}for(var nt,Ze=1e9,Ve=0;Ve<He.length;Ve++)He[Ve].length<Ze&&(nt=Ve,Ze=He[Ve].length);return He[nt]},u.encode._filterLine=function(H,x,o,F,Re,He){var Ue=o*F,Fe=Ue+o,nt=u.decode._paeth;if(H[Fe]=He,Fe++,He==0)for(var Ze=0;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze];else if(He==1){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze];for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-x[Ue+Ze-Re]+256&255}else if(o==0){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze];if(He==2)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze];if(He==3)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-(x[Ue+Ze-Re]>>1)+256&255;if(He==4)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-nt(x[Ue+Ze-Re],0,0)+256&255}else{if(He==2)for(var Ze=0;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-x[Ue+Ze-F]&255;if(He==3){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-(x[Ue+Ze-F]>>1)&255;for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-(x[Ue+Ze-F]+x[Ue+Ze-Re]>>1)&255}if(He==4){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-nt(0,x[Ue+Ze-F],0)&255;for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-nt(x[Ue+Ze-Re],x[Ue+Ze-F],x[Ue+Ze-Re-F])&255}}},u.crc={table:function(){for(var H=new Uint32Array(256),x=0;x<256;x++){for(var o=x,F=0;F<8;F++)o&1?o=3988292384^o>>>1:o=o>>>1;H[x]=o}return H}(),update:function(H,x,o,F){for(var Re=0;Re<F;Re++)H=u.crc.table[(H^x[o+Re])&255]^H>>>8;return H},crc:function(H,x,o){return u.crc.update(4294967295,H,x,o)^4294967295}},u.quantize=function(H,x,o){for(var F=[],Re=0,He=0;He<H.length;He++)F.push(u.encode.alphaMul(new Uint8Array(H[He]),o)),Re+=H[He].byteLength;for(var Ue=new Uint8Array(Re),Fe=new Uint32Array(Ue.buffer),nt=0,He=0;He<F.length;He++){for(var Ze=F[He],Ve=Ze.length,er=0;er<Ve;er++)Ue[nt+er]=Ze[er];nt+=Ve}var st={i0:0,i1:Ue.length,bst:null,est:null,tdst:0,left:null,right:null};st.bst=u.quantize.stats(Ue,st.i0,st.i1),st.est=u.quantize.estats(st.bst);for(var Ke=[st];Ke.length<x;){for(var Ye=0,tt=0,He=0;He<Ke.length;He++)Ke[He].est.L>Ye&&(Ye=Ke[He].est.L,tt=He);if(Ye<.001)break;var Je=Ke[tt],rr=u.quantize.splitPixels(Ue,Fe,Je.i0,Je.i1,Je.est.e,Je.est.eMq255),Rr={i0:Je.i0,i1:rr,bst:null,est:null,tdst:0,left:null,right:null};Rr.bst=u.quantize.stats(Ue,Rr.i0,Rr.i1),Rr.est=u.quantize.estats(Rr.bst);var ar={i0:rr,i1:Je.i1,bst:null,est:null,tdst:0,left:null,right:null};ar.bst={R:[],m:[],N:Je.bst.N-Rr.bst.N};for(var He=0;He<16;He++)ar.bst.R[He]=Je.bst.R[He]-Rr.bst.R[He];for(var He=0;He<4;He++)ar.bst.m[He]=Je.bst.m[He]-Rr.bst.m[He];ar.est=u.quantize.estats(ar.bst),Je.left=Rr,Je.right=ar,Ke[tt]=Rr,Ke.push(ar)}Ke.sort(function(Ja,Ba){return Ba.bst.N-Ja.bst.N});for(var Ar=0;Ar<F.length;Ar++){for(var mr=u.quantize.planeDst,Pr=new Uint8Array(F[Ar].buffer),Nr=new Uint32Array(F[Ar].buffer),Ra=Pr.length,He=0;He<Ra;He+=4){for(var ta=Pr[He]*.00392156862745098,ha=Pr[He+1]*(1/255),Ea=Pr[He+2]*(1/255),fa=Pr[He+3]*(1/255),ga=st;ga.left;)ga=mr(ga.est,ta,ha,Ea,fa)<=0?ga.left:ga.right;Nr[He>>2]=ga.est.rgba}F[Ar]=Nr.buffer}return{bufs:F,plte:Ke}},u.quantize.getNearest=function(H,x,o,F,Re){if(H.left==null)return H.tdst=u.quantize.dist(H.est.q,x,o,F,Re),H;var He=u.quantize.planeDst(H.est,x,o,F,Re),Ue=H.left,Fe=H.right;He>0&&(Ue=H.right,Fe=H.left);var nt=u.quantize.getNearest(Ue,x,o,F,Re);if(nt.tdst<=He*He)return nt;var Ze=u.quantize.getNearest(Fe,x,o,F,Re);return Ze.tdst<nt.tdst?Ze:nt},u.quantize.planeDst=function(H,x,o,F,Re){var He=H.e;return He[0]*x+He[1]*o+He[2]*F+He[3]*Re-H.eMq},u.quantize.dist=function(H,x,o,F,Re){var He=x-H[0],Ue=o-H[1],Fe=F-H[2],nt=Re-H[3];return He*He+Ue*Ue+Fe*Fe+nt*nt},u.quantize.splitPixels=function(H,x,o,F,Re,He){var Ue=u.quantize.vecDot;for(F-=4;o<F;){for(;Ue(H,o,Re)<=He;)o+=4;for(;Ue(H,F,Re)>He;)F-=4;if(o>=F)break;var Fe=x[o>>2];x[o>>2]=x[F>>2],x[F>>2]=Fe,o+=4,F-=4}for(;Ue(H,o,Re)>He;)o-=4;return o+4},u.quantize.vecDot=function(H,x,o){return H[x]*o[0]+H[x+1]*o[1]+H[x+2]*o[2]+H[x+3]*o[3]},u.quantize.stats=function(H,x,o){for(var F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Re=[0,0,0,0],He=o-x>>2,Ue=x;Ue<o;Ue+=4){var Fe=H[Ue]*.00392156862745098,nt=H[Ue+1]*(1/255),Ze=H[Ue+2]*(1/255),Ve=H[Ue+3]*(1/255);Re[0]+=Fe,Re[1]+=nt,Re[2]+=Ze,Re[3]+=Ve,F[0]+=Fe*Fe,F[1]+=Fe*nt,F[2]+=Fe*Ze,F[3]+=Fe*Ve,F[5]+=nt*nt,F[6]+=nt*Ze,F[7]+=nt*Ve,F[10]+=Ze*Ze,F[11]+=Ze*Ve,F[15]+=Ve*Ve}return F[4]=F[1],F[8]=F[2],F[12]=F[3],F[9]=F[6],F[13]=F[7],F[14]=F[11],{R:F,m:Re,N:He}},u.quantize.estats=function(H){var x=H.R,o=H.m,F=H.N,Re=o[0],He=o[1],Ue=o[2],Fe=o[3],nt=F==0?0:1/F,Ze=[x[0]-Re*Re*nt,x[1]-Re*He*nt,x[2]-Re*Ue*nt,x[3]-Re*Fe*nt,x[4]-He*Re*nt,x[5]-He*He*nt,x[6]-He*Ue*nt,x[7]-He*Fe*nt,x[8]-Ue*Re*nt,x[9]-Ue*He*nt,x[10]-Ue*Ue*nt,x[11]-Ue*Fe*nt,x[12]-Fe*Re*nt,x[13]-Fe*He*nt,x[14]-Fe*Ue*nt,x[15]-Fe*Fe*nt],Ve=Ze,er=u.M4,st=[.5,.5,.5,.5],Ke=0,Ye=0;if(F!=0)for(var tt=0;tt<10&&(st=er.multVec(Ve,st),Ye=Math.sqrt(er.dot(st,st)),st=er.sml(1/Ye,st),!(Math.abs(Ye-Ke)<1e-9));tt++)Ke=Ye;var Je=[Re*nt,He*nt,Ue*nt,Fe*nt],rr=er.dot(er.sml(255,Je),st),Rr=Je[3]<.001?0:1/Je[3];return{Cov:Ze,q:Je,e:st,L:Ke,eMq255:rr,eMq:er.dot(st,Je),rgba:(Math.round(255*Je[3])<<24|Math.round(255*Je[2]*Rr)<<16|Math.round(255*Je[1]*Rr)<<8|Math.round(255*Je[0]*Rr)<<0)>>>0}},u.M4={multVec:function(H,x){return[H[0]*x[0]+H[1]*x[1]+H[2]*x[2]+H[3]*x[3],H[4]*x[0]+H[5]*x[1]+H[6]*x[2]+H[7]*x[3],H[8]*x[0]+H[9]*x[1]+H[10]*x[2]+H[11]*x[3],H[12]*x[0]+H[13]*x[1]+H[14]*x[2]+H[15]*x[3]]},dot:function(H,x){return H[0]*x[0]+H[1]*x[1]+H[2]*x[2]+H[3]*x[3]},sml:function(H,x){return[H*x[0],H*x[1],H*x[2],H*x[3]]}},u.encode.alphaMul=function(H,x){for(var o=new Uint8Array(H.length),F=H.length>>2,Re=0;Re<F;Re++){var He=Re<<2,Ue=H[He+3];x&&(Ue=Ue<128?0:255);var Fe=Ue*(1/255);o[He+0]=H[He+0]*Fe,o[He+1]=H[He+1]*Fe,o[He+2]=H[He+2]*Fe,o[He+3]=Ue}return o}}(r,s)})()})(UPNG);const CLEAR_COLOR=[0,0,0,0],MAX_TEXTURE_DIMENSION=1024,EARTH_SUN_DISTANCE=1496e8,EARTH_CIRCUMFERENCE=40075016686e-3,SUN_RADIUS=695508e3,DEG2RAD=.017453292519943295,SLOPEFACTOR=.0333334,RGB_REGEX=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,HEX_REGEX=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig;function machineIsLittleEndian(){const e=new Uint8Array([170,187]);return new Uint16Array(e.buffer)[0]===48042}function range(...e){if(e.length===1){const[r]=e;return new Array(r).fill(void 0).map((s,u)=>u)}else{const[r,s,u=1]=e;if(u===0)throw new Error("Argument step must be nonzero.");const m=[];for(let H=r;u>0?H<s:H>s;H+=u)m.push(H);return m}}async function fetchPNGData(e,r,s){return new Promise((u,m)=>{const H=new XMLHttpRequest;H.open("GET",e,!0),H.responseType="arraybuffer",H.addEventListener("load",()=>{u(H.response)}),H.addEventListener("error",m),H.send(null)}).then(u=>{const m=UPNG.exports.decode(u),H=UPNG.exports.toRGBA8(m)[0];return new Uint8Array(H)}).catch(()=>createNoDataTile(r,s))}function typedArraysAreEqual(e,r){return e.byteLength!==r.byteLength?!1:e.every((s,u)=>s===r[u])}function getTransformMatrix(e,r){const s=2/e,u=-2/r;return[s,0,0,0,0,u,0,0,0,0,1,0,-1,1,0,1]}function getTexCoordVerticesTriangleStripQuad(e){const[{x:r,y:s},{x:u,y:m}]=e;return[[r,s],[u,s],[r,m],[u,m]]}const createNoDataTile=lodash.exports.memoize((e,r=256)=>{const s=new Float32Array(r*r);return s.fill(e),new Uint8Array(s.buffer)});function defineMacros(e,r){return`${Object.keys(r).map(u=>`#define ${u} ${r[u]}
|
|
208
|
+
northing meters`+e;var Fe=Ue/2,nt=0,Ze=0,Ve,er,st,Ke,Ye;return Fe>0&&(Ve=1e5/Math.pow(10,Fe),er=e.substring(H,H+Fe),nt=parseFloat(er)*Ve,st=e.substring(H+Fe),Ze=parseFloat(st)*Ve),Ke=nt+Re,Ye=Ze+He,{easting:Ke,northing:Ye,zoneLetter:o,zoneNumber:x,accuracy:Ve}}function getEastingFromChar(e,r){for(var s=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(r-1),u=1e5,m=!1;s!==e.charCodeAt(0);){if(s++,s===I&&s++,s===O$1&&s++,s>Z$1){if(m)throw"Bad character: "+e;s=A,m=!0}u+=1e5}return u}function getNorthingFromChar(e,r){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var s=SET_ORIGIN_ROW_LETTERS.charCodeAt(r-1),u=0,m=!1;s!==e.charCodeAt(0);){if(s++,s===I&&s++,s===O$1&&s++,s>V$1){if(m)throw"Bad character: "+e;s=A,m=!0}u+=1e5}return u}function getMinNorthing(e){var r;switch(e){case"C":r=11e5;break;case"D":r=2e6;break;case"E":r=28e5;break;case"F":r=37e5;break;case"G":r=46e5;break;case"H":r=55e5;break;case"J":r=64e5;break;case"K":r=73e5;break;case"L":r=82e5;break;case"M":r=91e5;break;case"N":r=0;break;case"P":r=8e5;break;case"Q":r=17e5;break;case"R":r=26e5;break;case"S":r=35e5;break;case"T":r=44e5;break;case"U":r=53e5;break;case"V":r=62e5;break;case"W":r=7e6;break;case"X":r=79e5;break;default:r=-1}if(r>=0)return r;throw"Invalid zone letter: "+e}function Point(e,r,s){if(!(this instanceof Point))return new Point(e,r,s);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof r>"u"){var u=e.split(",");this.x=parseFloat(u[0]),this.y=parseFloat(u[1]),this.z=parseFloat(u[2])||0}else this.x=e,this.y=r,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(e){return new Point(toPoint(e))},Point.prototype.toMGRS=function(e){return forward$u([this.x,this.y],e)};var C00=1,C02=.25,C04=.046875,C06=.01953125,C08=.01068115234375,C22=.75,C44=.46875,C46=.013020833333333334,C48=.007120768229166667,C66=.3645833333333333,C68=.005696614583333333,C88=.3076171875;function pj_enfn(e){var r=[];r[0]=C00-e*(C02+e*(C04+e*(C06+e*C08))),r[1]=e*(C22-e*(C04+e*(C06+e*C08)));var s=e*e;return r[2]=s*(C44-e*(C46+e*C48)),s*=e,r[3]=s*(C66-e*C68),r[4]=s*e*C88,r}function pj_mlfn(e,r,s,u){return s*=r,r*=r,u[0]*e-s*(u[1]+r*(u[2]+r*(u[3]+r*u[4])))}var MAX_ITER$3=20;function pj_inv_mlfn(e,r,s){for(var u=1/(1-r),m=e,H=MAX_ITER$3;H;--H){var x=Math.sin(m),o=1-r*x*x;if(o=(pj_mlfn(m,x,Math.cos(m),s)-e)*(o*Math.sqrt(o))*u,m-=o,Math.abs(o)<EPSLN)return m}return m}function init$v(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=pj_enfn(this.es),this.ml0=pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function forward$t(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m,H,x,o=Math.sin(s),F=Math.cos(s);if(this.es){var He=F*u,Ue=Math.pow(He,2),Fe=this.ep2*Math.pow(F,2),nt=Math.pow(Fe,2),Ze=Math.abs(F)>EPSLN?Math.tan(s):0,Ve=Math.pow(Ze,2),er=Math.pow(Ve,2);m=1-this.es*Math.pow(o,2),He=He/Math.sqrt(m);var st=pj_mlfn(s,o,F,this.en);H=this.a*(this.k0*He*(1+Ue/6*(1-Ve+Fe+Ue/20*(5-18*Ve+er+14*Fe-58*Ve*Fe+Ue/42*(61+179*er-er*Ve-479*Ve)))))+this.x0,x=this.a*(this.k0*(st-this.ml0+o*u*He/2*(1+Ue/12*(5-Ve+9*Fe+4*nt+Ue/30*(61+er-58*Ve+270*Fe-330*Ve*Fe+Ue/56*(1385+543*er-er*Ve-3111*Ve))))))+this.y0}else{var Re=F*Math.sin(u);if(Math.abs(Math.abs(Re)-1)<EPSLN)return 93;if(H=.5*this.a*this.k0*Math.log((1+Re)/(1-Re))+this.x0,x=F*Math.cos(u)/Math.sqrt(1-Math.pow(Re,2)),Re=Math.abs(x),Re>=1){if(Re-1>EPSLN)return 93;x=0}else x=Math.acos(x);s<0&&(x=-x),x=this.a*this.k0*(x-this.lat0)+this.y0}return e.x=H,e.y=x,e}function inverse$t(e){var r,s,u,m,H=(e.x-this.x0)*(1/this.a),x=(e.y-this.y0)*(1/this.a);if(this.es)if(r=this.ml0+x/this.k0,s=pj_inv_mlfn(r,this.es,this.en),Math.abs(s)<HALF_PI){var Ue=Math.sin(s),Fe=Math.cos(s),nt=Math.abs(Fe)>EPSLN?Math.tan(s):0,Ze=this.ep2*Math.pow(Fe,2),Ve=Math.pow(Ze,2),er=Math.pow(nt,2),st=Math.pow(er,2);r=1-this.es*Math.pow(Ue,2);var Ke=H*Math.sqrt(r)/this.k0,Ye=Math.pow(Ke,2);r=r*nt,u=s-r*Ye/(1-this.es)*.5*(1-Ye/12*(5+3*er-9*Ze*er+Ze-4*Ve-Ye/30*(61+90*er-252*Ze*er+45*st+46*Ze-Ye/56*(1385+3633*er+4095*st+1574*st*er)))),m=adjust_lon(this.long0+Ke*(1-Ye/6*(1+2*er+Ze-Ye/20*(5+28*er+24*st+8*Ze*er+6*Ze-Ye/42*(61+662*er+1320*st+720*st*er))))/Fe)}else u=HALF_PI*sign$1(x),m=0;else{var o=Math.exp(H/this.k0),F=.5*(o-1/o),Re=this.lat0+x/this.k0,He=Math.cos(Re);r=Math.sqrt((1-Math.pow(He,2))/(1+Math.pow(F,2))),u=Math.asin(r),x<0&&(u=-u),F===0&&He===0?m=0:m=adjust_lon(Math.atan2(F,He)+this.long0)}return e.x=m,e.y=u,e}var names$v=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const tmerc={init:init$v,forward:forward$t,inverse:inverse$t,names:names$v};function sinh$2(e){var r=Math.exp(e);return r=(r-1/r)/2,r}function hypot$2(e,r){e=Math.abs(e),r=Math.abs(r);var s=Math.max(e,r),u=Math.min(e,r)/(s||1);return s*Math.sqrt(1+Math.pow(u,2))}function log1py(e){var r=1+e,s=r-1;return s===0?e:e*Math.log(r)/s}function asinhy(e){var r=Math.abs(e);return r=log1py(r*(1+r/(hypot$2(1,r)+1))),e<0?-r:r}function gatg(e,r){for(var s=2*Math.cos(2*r),u=e.length-1,m=e[u],H=0,x;--u>=0;)x=-H+s*m+e[u],H=m,m=x;return r+x*Math.sin(2*r)}function clens(e,r){for(var s=2*Math.cos(r),u=e.length-1,m=e[u],H=0,x;--u>=0;)x=-H+s*m+e[u],H=m,m=x;return Math.sin(r)*x}function cosh$2(e){var r=Math.exp(e);return r=(r+1/r)/2,r}function clens_cmplx(e,r,s){for(var u=Math.sin(r),m=Math.cos(r),H=sinh$2(s),x=cosh$2(s),o=2*m*x,F=-2*u*H,Re=e.length-1,He=e[Re],Ue=0,Fe=0,nt=0,Ze,Ve;--Re>=0;)Ze=Fe,Ve=Ue,Fe=He,Ue=nt,He=-Ze+o*Fe-F*Ue+e[Re],nt=-Ve+F*Fe+o*Ue;return o=u*x,F=m*H,[o*He-F*nt,o*nt+F*He]}function init$u(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tmerc.init.apply(this),this.forward=tmerc.forward,this.inverse=tmerc.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),r=e/(2-e),s=r;this.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),this.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),s=s*r,this.cgb[1]=s*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),this.cbg[1]=s*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),s=s*r,this.cgb[2]=s*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),this.cbg[2]=s*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),s=s*r,this.cgb[3]=s*(4279/630+r*(-332/35+r*(-399572/14175))),this.cbg[3]=s*(1237/630+r*(-12/5+r*(-24832/14175))),s=s*r,this.cgb[4]=s*(4174/315+r*(-144838/6237)),this.cbg[4]=s*(-734/315+r*(109598/31185)),s=s*r,this.cgb[5]=s*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(r,2),this.Qn=this.k0/(1+r)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),this.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),this.utg[1]=s*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),this.gtu[1]=s*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),s=s*r,this.utg[2]=s*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),this.gtu[2]=s*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),s=s*r,this.utg[3]=s*(-4397/161280+r*(11/504+r*(830251/7257600))),this.gtu[3]=s*(49561/161280+r*(-179/168+r*(6601661/7257600))),s=s*r,this.utg[4]=s*(-4583/161280+r*(108847/3991680)),this.gtu[4]=s*(34729/80640+r*(-3418889/1995840)),s=s*r,this.utg[5]=s*(-20648693/638668800),this.gtu[5]=s*(212378941/319334400);var u=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(u+clens(this.gtu,2*u))}function forward$s(e){var r=adjust_lon(e.x-this.long0),s=e.y;s=gatg(this.cbg,s);var u=Math.sin(s),m=Math.cos(s),H=Math.sin(r),x=Math.cos(r);s=Math.atan2(u,x*m),r=Math.atan2(H*m,hypot$2(u,m*x)),r=asinhy(Math.tan(r));var o=clens_cmplx(this.gtu,2*s,2*r);s=s+o[0],r=r+o[1];var F,Re;return Math.abs(r)<=2.623395162778?(F=this.a*(this.Qn*r)+this.x0,Re=this.a*(this.Qn*s+this.Zb)+this.y0):(F=1/0,Re=1/0),e.x=F,e.y=Re,e}function inverse$s(e){var r=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn,r=r/this.Qn;var u,m;if(Math.abs(r)<=2.623395162778){var H=clens_cmplx(this.utg,2*s,2*r);s=s+H[0],r=r+H[1],r=Math.atan(sinh$2(r));var x=Math.sin(s),o=Math.cos(s),F=Math.sin(r),Re=Math.cos(r);s=Math.atan2(x*Re,hypot$2(F,Re*o)),r=Math.atan2(F,Re*o),u=adjust_lon(r+this.long0),m=gatg(this.cgb,s)}else u=1/0,m=1/0;return e.x=u,e.y=m,e}var names$u=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const etmerc={init:init$u,forward:forward$s,inverse:inverse$s,names:names$u};function adjust_zone(e,r){if(e===void 0){if(e=Math.floor((adjust_lon(r)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var dependsOn="etmerc";function init$t(){var e=adjust_zone(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*D2R$1,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,etmerc.init.apply(this),this.forward=etmerc.forward,this.inverse=etmerc.inverse}var names$t=["Universal Transverse Mercator System","utm"];const utm={init:init$t,names:names$t,dependsOn};function srat(e,r){return Math.pow((1-e)/(1+e),r)}var MAX_ITER$2=20;function init$s(){var e=Math.sin(this.lat0),r=Math.cos(this.lat0);r*=r,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*r*r/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+FORTPI)/(Math.pow(Math.tan(.5*this.lat0+FORTPI),this.C)*srat(this.e*e,this.ratexp))}function forward$r(e){var r=e.x,s=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+FORTPI),this.C)*srat(this.e*Math.sin(s),this.ratexp))-HALF_PI,e.x=this.C*r,e}function inverse$r(e){for(var r=1e-14,s=e.x/this.C,u=e.y,m=Math.pow(Math.tan(.5*u+FORTPI)/this.K,1/this.C),H=MAX_ITER$2;H>0&&(u=2*Math.atan(m*srat(this.e*Math.sin(e.y),-.5*this.e))-HALF_PI,!(Math.abs(u-e.y)<r));--H)e.y=u;return H?(e.x=s,e.y=u,e):null}var names$s=["gauss"];const gauss={init:init$s,forward:forward$r,inverse:inverse$r,names:names$s};function init$r(){gauss.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function forward$q(e){var r,s,u,m;return e.x=adjust_lon(e.x-this.long0),gauss.forward.apply(this,[e]),r=Math.sin(e.y),s=Math.cos(e.y),u=Math.cos(e.x),m=this.k0*this.R2/(1+this.sinc0*r+this.cosc0*s*u),e.x=m*s*Math.sin(e.x),e.y=m*(this.cosc0*r-this.sinc0*s*u),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function inverse$q(e){var r,s,u,m,H;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,H=hypot$2(e.x,e.y)){var x=2*Math.atan2(H,this.R2);r=Math.sin(x),s=Math.cos(x),m=Math.asin(s*this.sinc0+e.y*r*this.cosc0/H),u=Math.atan2(e.x*r,H*this.cosc0*s-e.y*this.sinc0*r)}else m=this.phic0,u=0;return e.x=u,e.y=m,gauss.inverse.apply(this,[e]),e.x=adjust_lon(e.x+this.long0),e}var names$r=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const sterea={init:init$r,forward:forward$q,inverse:inverse$q,names:names$r};function ssfn_(e,r,s){return r*=s,Math.tan(.5*(HALF_PI+e))*Math.pow((1-r)/(1+r),.5*s)}function init$q(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&(this.k0=.5*(1+sign$1(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=EPSLN&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&Math.abs(Math.cos(this.lat_ts))>EPSLN&&(this.k0=.5*this.cons*msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tsfnz(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=msfnz(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(ssfn_(this.lat0,this.sinlat0,this.e))-HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function forward$p(e){var r=e.x,s=e.y,u=Math.sin(s),m=Math.cos(s),H,x,o,F,Re,He,Ue=adjust_lon(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=EPSLN&&Math.abs(s+this.lat0)<=EPSLN?(e.x=NaN,e.y=NaN,e):this.sphere?(H=2*this.k0/(1+this.sinlat0*u+this.coslat0*m*Math.cos(Ue)),e.x=this.a*H*m*Math.sin(Ue)+this.x0,e.y=this.a*H*(this.coslat0*u-this.sinlat0*m*Math.cos(Ue))+this.y0,e):(x=2*Math.atan(ssfn_(s,u,this.e))-HALF_PI,F=Math.cos(x),o=Math.sin(x),Math.abs(this.coslat0)<=EPSLN?(Re=tsfnz(this.e,s*this.con,this.con*u),He=2*this.a*this.k0*Re/this.cons,e.x=this.x0+He*Math.sin(r-this.long0),e.y=this.y0-this.con*He*Math.cos(r-this.long0),e):(Math.abs(this.sinlat0)<EPSLN?(H=2*this.a*this.k0/(1+F*Math.cos(Ue)),e.y=H*o):(H=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*F*Math.cos(Ue))),e.y=H*(this.cosX0*o-this.sinX0*F*Math.cos(Ue))+this.y0),e.x=H*F*Math.sin(Ue)+this.x0,e))}function inverse$p(e){e.x-=this.x0,e.y-=this.y0;var r,s,u,m,H,x=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var o=2*Math.atan(x/(2*this.a*this.k0));return r=this.long0,s=this.lat0,x<=EPSLN?(e.x=r,e.y=s,e):(s=Math.asin(Math.cos(o)*this.sinlat0+e.y*Math.sin(o)*this.coslat0/x),Math.abs(this.coslat0)<EPSLN?this.lat0>0?r=adjust_lon(this.long0+Math.atan2(e.x,-1*e.y)):r=adjust_lon(this.long0+Math.atan2(e.x,e.y)):r=adjust_lon(this.long0+Math.atan2(e.x*Math.sin(o),x*this.coslat0*Math.cos(o)-e.y*this.sinlat0*Math.sin(o))),e.x=r,e.y=s,e)}else if(Math.abs(this.coslat0)<=EPSLN){if(x<=EPSLN)return s=this.lat0,r=this.long0,e.x=r,e.y=s,e;e.x*=this.con,e.y*=this.con,u=x*this.cons/(2*this.a*this.k0),s=this.con*phi2z(this.e,u),r=this.con*adjust_lon(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else m=2*Math.atan(x*this.cosX0/(2*this.a*this.k0*this.ms1)),r=this.long0,x<=EPSLN?H=this.X0:(H=Math.asin(Math.cos(m)*this.sinX0+e.y*Math.sin(m)*this.cosX0/x),r=adjust_lon(this.long0+Math.atan2(e.x*Math.sin(m),x*this.cosX0*Math.cos(m)-e.y*this.sinX0*Math.sin(m)))),s=-1*phi2z(this.e,Math.tan(.5*(HALF_PI+H)));return e.x=r,e.y=s,e}var names$q=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const stere={init:init$q,forward:forward$p,inverse:inverse$p,names:names$q,ssfn_};function init$p(){var e=this.lat0;this.lambda0=this.long0;var r=Math.sin(e),s=this.a,u=this.rf,m=1/u,H=2*m-Math.pow(m,2),x=this.e=Math.sqrt(H);this.R=this.k0*s*Math.sqrt(1-H)/(1-H*Math.pow(r,2)),this.alpha=Math.sqrt(1+H/(1-H)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(r/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),F=Math.log(Math.tan(Math.PI/4+e/2)),Re=Math.log((1+x*r)/(1-x*r));this.K=o-this.alpha*F+this.alpha*x/2*Re}function forward$o(e){var r=Math.log(Math.tan(Math.PI/4-e.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),u=-this.alpha*(r+s)+this.K,m=2*(Math.atan(Math.exp(u))-Math.PI/4),H=this.alpha*(e.x-this.lambda0),x=Math.atan(Math.sin(H)/(Math.sin(this.b0)*Math.tan(m)+Math.cos(this.b0)*Math.cos(H))),o=Math.asin(Math.cos(this.b0)*Math.sin(m)-Math.sin(this.b0)*Math.cos(m)*Math.cos(H));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*x+this.x0,e}function inverse$o(e){for(var r=e.x-this.x0,s=e.y-this.y0,u=r/this.R,m=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),H=Math.asin(Math.cos(this.b0)*Math.sin(m)+Math.sin(this.b0)*Math.cos(m)*Math.cos(u)),x=Math.atan(Math.sin(u)/(Math.cos(this.b0)*Math.cos(u)-Math.sin(this.b0)*Math.tan(m))),o=this.lambda0+x/this.alpha,F=0,Re=H,He=-1e3,Ue=0;Math.abs(Re-He)>1e-7;){if(++Ue>20)return;F=1/this.alpha*(Math.log(Math.tan(Math.PI/4+H/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(Re))/2)),He=Re,Re=2*Math.atan(Math.exp(F))-Math.PI/2}return e.x=o,e.y=Re,e}var names$p=["somerc"];const somerc={init:init$p,forward:forward$o,inverse:inverse$o,names:names$p};var TOL=1e-7;function isTypeA(e){var r=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],s=typeof e.projName=="object"?Object.keys(e.projName)[0]:e.projName;return"no_uoff"in e||"no_off"in e||r.indexOf(s)!==-1||r.indexOf(getNormalizedProjName(s))!==-1}function init$o(){var e,r,s,u,m,H,x,o,F,Re,He=0,Ue,Fe=0,nt=0,Ze=0,Ve=0,er=0,st=0;this.no_off=isTypeA(this),this.no_rot="no_rot"in this;var Ke=!1;"alpha"in this&&(Ke=!0);var Ye=!1;if("rectified_grid_angle"in this&&(Ye=!0),Ke&&(st=this.alpha),Ye&&(He=this.rectified_grid_angle),Ke||Ye)Fe=this.longc;else if(nt=this.long1,Ve=this.lat1,Ze=this.long2,er=this.lat2,Math.abs(Ve-er)<=TOL||(e=Math.abs(Ve))<=TOL||Math.abs(e-HALF_PI)<=TOL||Math.abs(Math.abs(this.lat0)-HALF_PI)<=TOL||Math.abs(Math.abs(er)-HALF_PI)<=TOL)throw new Error;var tt=1-this.es;r=Math.sqrt(tt),Math.abs(this.lat0)>EPSLN?(o=Math.sin(this.lat0),s=Math.cos(this.lat0),e=1-this.es*o*o,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/tt),this.A=this.B*this.k0*r/e,u=this.B*r/(s*Math.sqrt(e)),m=u*u-1,m<=0?m=0:(m=Math.sqrt(m),this.lat0<0&&(m=-m)),this.E=m+=u,this.E*=Math.pow(tsfnz(this.e,this.lat0,o),this.B)):(this.B=1/r,this.A=this.k0,this.E=u=m=1),Ke||Ye?(Ke?(Ue=Math.asin(Math.sin(st)/u),Ye||(He=st)):(Ue=He,st=Math.asin(u*Math.sin(Ue))),this.lam0=Fe-Math.asin(.5*(m-1/m)*Math.tan(Ue))/this.B):(H=Math.pow(tsfnz(this.e,Ve,Math.sin(Ve)),this.B),x=Math.pow(tsfnz(this.e,er,Math.sin(er)),this.B),m=this.E/H,F=(x-H)/(x+H),Re=this.E*this.E,Re=(Re-x*H)/(Re+x*H),e=nt-Ze,e<-Math.PI?Ze-=TWO_PI:e>Math.PI&&(Ze+=TWO_PI),this.lam0=adjust_lon(.5*(nt+Ze)-Math.atan(Re*Math.tan(.5*this.B*(nt-Ze))/F)/this.B),Ue=Math.atan(2*Math.sin(this.B*adjust_lon(nt-this.lam0))/(m-1/m)),He=st=Math.asin(u*Math.sin(Ue))),this.singam=Math.sin(Ue),this.cosgam=Math.cos(Ue),this.sinrot=Math.sin(He),this.cosrot=Math.cos(He),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(u*u-1)/Math.cos(st))),this.lat0<0&&(this.u_0=-this.u_0)),m=.5*Ue,this.v_pole_n=this.ArB*Math.log(Math.tan(FORTPI-m)),this.v_pole_s=this.ArB*Math.log(Math.tan(FORTPI+m))}function forward$n(e){var r={},s,u,m,H,x,o,F,Re;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-HALF_PI)>EPSLN){if(x=this.E/Math.pow(tsfnz(this.e,e.y,Math.sin(e.y)),this.B),o=1/x,s=.5*(x-o),u=.5*(x+o),H=Math.sin(this.B*e.x),m=(s*this.singam-H*this.cosgam)/u,Math.abs(Math.abs(m)-1)<EPSLN)throw new Error;Re=.5*this.ArB*Math.log((1-m)/(1+m)),o=Math.cos(this.B*e.x),Math.abs(o)<TOL?F=this.A*e.x:F=this.ArB*Math.atan2(s*this.cosgam+H*this.singam,o)}else Re=e.y>0?this.v_pole_n:this.v_pole_s,F=this.ArB*e.y;return this.no_rot?(r.x=F,r.y=Re):(F-=this.u_0,r.x=Re*this.cosrot+F*this.sinrot,r.y=F*this.cosrot-Re*this.sinrot),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function inverse$n(e){var r,s,u,m,H,x,o,F={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(s=e.y,r=e.x):(s=e.x*this.cosrot-e.y*this.sinrot,r=e.y*this.cosrot+e.x*this.sinrot+this.u_0),u=Math.exp(-this.BrA*s),m=.5*(u-1/u),H=.5*(u+1/u),x=Math.sin(this.BrA*r),o=(x*this.cosgam+m*this.singam)/H,Math.abs(Math.abs(o)-1)<EPSLN)F.x=0,F.y=o<0?-HALF_PI:HALF_PI;else{if(F.y=this.E/Math.sqrt((1+o)/(1-o)),F.y=phi2z(this.e,Math.pow(F.y,1/this.B)),F.y===1/0)throw new Error;F.x=-this.rB*Math.atan2(m*this.cosgam-x*this.singam,Math.cos(this.BrA*r))}return F.x+=this.lam0,F}var names$o=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const omerc={init:init$o,forward:forward$n,inverse:inverse$n,names:names$o};function init$n(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<EPSLN)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var r=Math.sin(this.lat1),s=Math.cos(this.lat1),u=msfnz(this.e,r,s),m=tsfnz(this.e,this.lat1,r),H=Math.sin(this.lat2),x=Math.cos(this.lat2),o=msfnz(this.e,H,x),F=tsfnz(this.e,this.lat2,H),Re=Math.abs(Math.abs(this.lat0)-HALF_PI)<EPSLN?0:tsfnz(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>EPSLN?this.ns=Math.log(u/o)/Math.log(m/F):this.ns=r,isNaN(this.ns)&&(this.ns=r),this.f0=u/(this.ns*Math.pow(m,this.ns)),this.rh=this.a*this.f0*Math.pow(Re,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function forward$m(e){var r=e.x,s=e.y;Math.abs(2*Math.abs(s)-Math.PI)<=EPSLN&&(s=sign$1(s)*(HALF_PI-2*EPSLN));var u=Math.abs(Math.abs(s)-HALF_PI),m,H;if(u>EPSLN)m=tsfnz(this.e,s,Math.sin(s)),H=this.a*this.f0*Math.pow(m,this.ns);else{if(u=s*this.ns,u<=0)return null;H=0}var x=this.ns*adjust_lon(r-this.long0);return e.x=this.k0*(H*Math.sin(x))+this.x0,e.y=this.k0*(this.rh-H*Math.cos(x))+this.y0,e}function inverse$m(e){var r,s,u,m,H,x=(e.x-this.x0)/this.k0,o=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(r=Math.sqrt(x*x+o*o),s=1):(r=-Math.sqrt(x*x+o*o),s=-1);var F=0;if(r!==0&&(F=Math.atan2(s*x,s*o)),r!==0||this.ns>0){if(s=1/this.ns,u=Math.pow(r/(this.a*this.f0),s),m=phi2z(this.e,u),m===-9999)return null}else m=-HALF_PI;return H=adjust_lon(F/this.ns+this.long0),e.x=H,e.y=m,e}var names$n=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const lcc={init:init$n,forward:forward$m,inverse:inverse$m,names:names$n};function init$m(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function forward$l(e){var r,s,u,m,H,x,o,F=e.x,Re=e.y,He=adjust_lon(F-this.long0);return r=Math.pow((1+this.e*Math.sin(Re))/(1-this.e*Math.sin(Re)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(Re/2+this.s45),this.alfa)/r)-this.s45),u=-He*this.alfa,m=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(u)),H=Math.asin(Math.cos(s)*Math.sin(u)/Math.cos(m)),x=this.n*H,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(m/2+this.s45),this.n),e.y=o*Math.cos(x)/1,e.x=o*Math.sin(x)/1,this.czech||(e.y*=-1,e.x*=-1),e}function inverse$l(e){var r,s,u,m,H,x,o,F,Re=e.x;e.x=e.y,e.y=Re,this.czech||(e.y*=-1,e.x*=-1),x=Math.sqrt(e.x*e.x+e.y*e.y),H=Math.atan2(e.y,e.x),m=H/Math.sin(this.s0),u=2*(Math.atan(Math.pow(this.ro0/x,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),r=Math.asin(Math.cos(this.ad)*Math.sin(u)-Math.sin(this.ad)*Math.cos(u)*Math.cos(m)),s=Math.asin(Math.cos(u)*Math.sin(m)/Math.cos(r)),e.x=this.long0-s/this.alfa,o=r,F=0;var He=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(r/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(F=1),o=e.y,He+=1;while(F===0&&He<15);return He>=15?null:e}var names$m=["Krovak","krovak"];const krovak={init:init$m,forward:forward$l,inverse:inverse$l,names:names$m};function mlfn(e,r,s,u,m){return e*m-r*Math.sin(2*m)+s*Math.sin(4*m)-u*Math.sin(6*m)}function e0fn(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function e1fn(e){return .375*e*(1+.25*e*(1+.46875*e))}function e2fn(e){return .05859375*e*e*(1+.75*e)}function e3fn(e){return e*e*e*(35/3072)}function gN(e,r,s){var u=r*s;return e/Math.sqrt(1-u*u)}function adjust_lat(e){return Math.abs(e)<HALF_PI?e:e-sign$1(e)*Math.PI}function imlfn(e,r,s,u,m){var H,x;H=e/r;for(var o=0;o<15;o++)if(x=(e-(r*H-s*Math.sin(2*H)+u*Math.sin(4*H)-m*Math.sin(6*H)))/(r-2*s*Math.cos(2*H)+4*u*Math.cos(4*H)-6*m*Math.cos(6*H)),H+=x,Math.abs(x)<=1e-10)return H;return NaN}function init$l(){this.sphere||(this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0))}function forward$k(e){var r,s,u=e.x,m=e.y;if(u=adjust_lon(u-this.long0),this.sphere)r=this.a*Math.asin(Math.cos(m)*Math.sin(u)),s=this.a*(Math.atan2(Math.tan(m),Math.cos(u))-this.lat0);else{var H=Math.sin(m),x=Math.cos(m),o=gN(this.a,this.e,H),F=Math.tan(m)*Math.tan(m),Re=u*Math.cos(m),He=Re*Re,Ue=this.es*x*x/(1-this.es),Fe=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,m);r=o*Re*(1-He*F*(1/6-(8-F+8*Ue)*He/120)),s=Fe-this.ml0+o*H/x*He*(.5+(5-F+6*Ue)*He/24)}return e.x=r+this.x0,e.y=s+this.y0,e}function inverse$k(e){e.x-=this.x0,e.y-=this.y0;var r=e.x/this.a,s=e.y/this.a,u,m;if(this.sphere){var H=s+this.lat0;u=Math.asin(Math.sin(H)*Math.cos(r)),m=Math.atan2(Math.tan(r),Math.cos(H))}else{var x=this.ml0/this.a+s,o=imlfn(x,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-HALF_PI)<=EPSLN)return e.x=this.long0,e.y=HALF_PI,s<0&&(e.y*=-1),e;var F=gN(this.a,this.e,Math.sin(o)),Re=F*F*F/this.a/this.a*(1-this.es),He=Math.pow(Math.tan(o),2),Ue=r*this.a/F,Fe=Ue*Ue;u=o-F*Math.tan(o)/Re*Ue*Ue*(.5-(1+3*He)*Ue*Ue/24),m=Ue*(1-Fe*(He/3+(1+3*He)*He*Fe/15))/Math.cos(o)}return e.x=adjust_lon(m+this.long0),e.y=adjust_lat(u),e}var names$l=["Cassini","Cassini_Soldner","cass"];const cass={init:init$l,forward:forward$k,inverse:inverse$k,names:names$l};function qsfnz(e,r){var s;return e>1e-7?(s=e*r,(1-e*e)*(r/(1-s*s)-.5/e*Math.log((1-s)/(1+s)))):2*r}var S_POLE=1,N_POLE=2,EQUIT=3,OBLIQ=4;function init$k(){var e=Math.abs(this.lat0);if(Math.abs(e-HALF_PI)<EPSLN?this.mode=this.lat0<0?S_POLE:N_POLE:Math.abs(e)<EPSLN?this.mode=EQUIT:this.mode=OBLIQ,this.es>0){var r;switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=authset(this.es),this.mode){case N_POLE:this.dd=1;break;case S_POLE:this.dd=1;break;case EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case OBLIQ:this.rq=Math.sqrt(.5*this.qp),r=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,r)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*r*r)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function forward$j(e){var r,s,u,m,H,x,o,F,Re,He,Ue=e.x,Fe=e.y;if(Ue=adjust_lon(Ue-this.long0),this.sphere){if(H=Math.sin(Fe),He=Math.cos(Fe),u=Math.cos(Ue),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s=this.mode===this.EQUIT?1+He*u:1+this.sinph0*H+this.cosph0*He*u,s<=EPSLN)return null;s=Math.sqrt(2/s),r=s*He*Math.sin(Ue),s*=this.mode===this.EQUIT?H:this.cosph0*H-this.sinph0*He*u}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),Math.abs(Fe+this.lat0)<EPSLN)return null;s=FORTPI-Fe*.5,s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)),r=s*Math.sin(Ue),s*=u}}else{switch(o=0,F=0,Re=0,u=Math.cos(Ue),m=Math.sin(Ue),H=Math.sin(Fe),x=qsfnz(this.e,H),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=x/this.qp,F=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:Re=1+this.sinb1*o+this.cosb1*F*u;break;case this.EQUIT:Re=1+F*u;break;case this.N_POLE:Re=HALF_PI+Fe,x=this.qp-x;break;case this.S_POLE:Re=Fe-HALF_PI,x=this.qp+x;break}if(Math.abs(Re)<EPSLN)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:Re=Math.sqrt(2/Re),this.mode===this.OBLIQ?s=this.ymf*Re*(this.cosb1*o-this.sinb1*F*u):s=(Re=Math.sqrt(2/(1+F*u)))*o*this.ymf,r=this.xmf*Re*F*m;break;case this.N_POLE:case this.S_POLE:x>=0?(r=(Re=Math.sqrt(x))*m,s=u*(this.mode===this.S_POLE?Re:-Re)):r=s=0;break}}return e.x=this.a*r+this.x0,e.y=this.a*s+this.y0,e}function inverse$j(e){e.x-=this.x0,e.y-=this.y0;var r=e.x/this.a,s=e.y/this.a,u,m,H,x,o,F,Re;if(this.sphere){var He=0,Ue,Fe=0;if(Ue=Math.sqrt(r*r+s*s),m=Ue*.5,m>1)return null;switch(m=2*Math.asin(m),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(Fe=Math.sin(m),He=Math.cos(m)),this.mode){case this.EQUIT:m=Math.abs(Ue)<=EPSLN?0:Math.asin(s*Fe/Ue),r*=Fe,s=He*Ue;break;case this.OBLIQ:m=Math.abs(Ue)<=EPSLN?this.lat0:Math.asin(He*this.sinph0+s*Fe*this.cosph0/Ue),r*=Fe*this.cosph0,s=(He-Math.sin(m)*this.sinph0)*Ue;break;case this.N_POLE:s=-s,m=HALF_PI-m;break;case this.S_POLE:m-=HALF_PI;break}u=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(r,s)}else{if(Re=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r/=this.dd,s*=this.dd,F=Math.sqrt(r*r+s*s),F<EPSLN)return e.x=this.long0,e.y=this.lat0,e;x=2*Math.asin(.5*F/this.rq),H=Math.cos(x),r*=x=Math.sin(x),this.mode===this.OBLIQ?(Re=H*this.sinb1+s*x*this.cosb1/F,o=this.qp*Re,s=F*this.cosb1*H-s*this.sinb1*x):(Re=s*x/F,o=this.qp*Re,s=F*H)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),o=r*r+s*s,!o)return e.x=this.long0,e.y=this.lat0,e;Re=1-o/this.qp,this.mode===this.S_POLE&&(Re=-Re)}u=Math.atan2(r,s),m=authlat(Math.asin(Re),this.apa)}return e.x=adjust_lon(this.long0+u),e.y=m,e}var P00=.3333333333333333,P01=.17222222222222222,P02=.10257936507936508,P10=.06388888888888888,P11=.0664021164021164,P20=.016415012942191543;function authset(e){var r,s=[];return s[0]=e*P00,r=e*e,s[0]+=r*P01,s[1]=r*P10,r*=e,s[0]+=r*P02,s[1]+=r*P11,s[2]=r*P20,s}function authlat(e,r){var s=e+e;return e+r[0]*Math.sin(s)+r[1]*Math.sin(s+s)+r[2]*Math.sin(s+s+s)}var names$k=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const laea={init:init$k,forward:forward$j,inverse:inverse$j,names:names$k,S_POLE,N_POLE,EQUIT,OBLIQ};function asinz(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function init$j(){Math.abs(this.lat1+this.lat2)<EPSLN||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=msfnz(this.e3,this.sin_po,this.cos_po),this.qs1=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=msfnz(this.e3,this.sin_po,this.cos_po),this.qs2=qsfnz(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qsfnz(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>EPSLN?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function forward$i(e){var r=e.x,s=e.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var u=qsfnz(this.e3,this.sin_phi),m=this.a*Math.sqrt(this.c-this.ns0*u)/this.ns0,H=this.ns0*adjust_lon(r-this.long0),x=m*Math.sin(H)+this.x0,o=this.rh-m*Math.cos(H)+this.y0;return e.x=x,e.y=o,e}function inverse$i(e){var r,s,u,m,H,x;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),u=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),u=-1),m=0,r!==0&&(m=Math.atan2(u*e.x,u*e.y)),u=r*this.ns0/this.a,this.sphere?x=Math.asin((this.c-u*u)/(2*this.ns0)):(s=(this.c-u*u)/this.ns0,x=this.phi1z(this.e3,s)),H=adjust_lon(m/this.ns0+this.long0),e.x=H,e.y=x,e}function phi1z(e,r){var s,u,m,H,x,o=asinz(.5*r);if(e<EPSLN)return o;for(var F=e*e,Re=1;Re<=25;Re++)if(s=Math.sin(o),u=Math.cos(o),m=e*s,H=1-m*m,x=.5*H*H/u*(r/(1-F)-s/H+.5/e*Math.log((1-m)/(1+m))),o=o+x,Math.abs(x)<=1e-7)return o;return null}var names$j=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const aea={init:init$j,forward:forward$i,inverse:inverse$i,names:names$j,phi1z};function init$i(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function forward$h(e){var r,s,u,m,H,x,o,F,Re=e.x,He=e.y;return u=adjust_lon(Re-this.long0),r=Math.sin(He),s=Math.cos(He),m=Math.cos(u),x=this.sin_p14*r+this.cos_p14*s*m,H=1,x>0||Math.abs(x)<=EPSLN?(o=this.x0+this.a*H*s*Math.sin(u)/x,F=this.y0+this.a*H*(this.cos_p14*r-this.sin_p14*s*m)/x):(o=this.x0+this.infinity_dist*s*Math.sin(u),F=this.y0+this.infinity_dist*(this.cos_p14*r-this.sin_p14*s*m)),e.x=o,e.y=F,e}function inverse$h(e){var r,s,u,m,H,x;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(r=Math.sqrt(e.x*e.x+e.y*e.y))?(m=Math.atan2(r,this.rc),s=Math.sin(m),u=Math.cos(m),x=asinz(u*this.sin_p14+e.y*s*this.cos_p14/r),H=Math.atan2(e.x*s,r*this.cos_p14*u-e.y*this.sin_p14*s),H=adjust_lon(this.long0+H)):(x=this.phic0,H=0),e.x=H,e.y=x,e}var names$i=["gnom"];const gnom={init:init$i,forward:forward$h,inverse:inverse$h,names:names$i};function iqsfnz(e,r){var s=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(r)-s)<1e-6)return r<0?-1*HALF_PI:HALF_PI;for(var u=Math.asin(.5*r),m,H,x,o,F=0;F<30;F++)if(H=Math.sin(u),x=Math.cos(u),o=e*H,m=Math.pow(1-o*o,2)/(2*x)*(r/(1-e*e)-H/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),u+=m,Math.abs(m)<=1e-10)return u;return NaN}function init$h(){this.sphere||(this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function forward$g(e){var r=e.x,s=e.y,u,m,H=adjust_lon(r-this.long0);if(this.sphere)u=this.x0+this.a*H*Math.cos(this.lat_ts),m=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var x=qsfnz(this.e,Math.sin(s));u=this.x0+this.a*this.k0*H,m=this.y0+this.a*x*.5/this.k0}return e.x=u,e.y=m,e}function inverse$g(e){e.x-=this.x0,e.y-=this.y0;var r,s;return this.sphere?(r=adjust_lon(this.long0+e.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(s=iqsfnz(this.e,2*e.y*this.k0/this.a),r=adjust_lon(this.long0+e.x/(this.a*this.k0))),e.x=r,e.y=s,e}var names$h=["cea"];const cea={init:init$h,forward:forward$g,inverse:inverse$g,names:names$h};function init$g(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function forward$f(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=adjust_lat(s-this.lat0);return e.x=this.x0+this.a*u*this.rc,e.y=this.y0+this.a*m,e}function inverse$f(e){var r=e.x,s=e.y;return e.x=adjust_lon(this.long0+(r-this.x0)/(this.a*this.rc)),e.y=adjust_lat(this.lat0+(s-this.y0)/this.a),e}var names$g=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const eqc={init:init$g,forward:forward$f,inverse:inverse$f,names:names$g};var MAX_ITER$1=20;function init$f(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)}function forward$e(e){var r=e.x,s=e.y,u,m,H,x=adjust_lon(r-this.long0);if(H=x*Math.sin(s),this.sphere)Math.abs(s)<=EPSLN?(u=this.a*x,m=-1*this.a*this.lat0):(u=this.a*Math.sin(H)/Math.tan(s),m=this.a*(adjust_lat(s-this.lat0)+(1-Math.cos(H))/Math.tan(s)));else if(Math.abs(s)<=EPSLN)u=this.a*x,m=-1*this.ml0;else{var o=gN(this.a,this.e,Math.sin(s))/Math.tan(s);u=o*Math.sin(H),m=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*(1-Math.cos(H))}return e.x=u+this.x0,e.y=m+this.y0,e}function inverse$e(e){var r,s,u,m,H,x,o,F,Re;if(u=e.x-this.x0,m=e.y-this.y0,this.sphere)if(Math.abs(m+this.a*this.lat0)<=EPSLN)r=adjust_lon(u/this.a+this.long0),s=0;else{x=this.lat0+m/this.a,o=u*u/this.a/this.a+x*x,F=x;var He;for(H=MAX_ITER$1;H;--H)if(He=Math.tan(F),Re=-1*(x*(F*He+1)-F-.5*(F*F+o)*He)/((F-x)/He-1),F+=Re,Math.abs(Re)<=EPSLN){s=F;break}r=adjust_lon(this.long0+Math.asin(u*Math.tan(F)/this.a)/Math.sin(s))}else if(Math.abs(m+this.ml0)<=EPSLN)s=0,r=adjust_lon(this.long0+u/this.a);else{x=(this.ml0+m)/this.a,o=u*u/this.a/this.a+x*x,F=x;var Ue,Fe,nt,Ze,Ve;for(H=MAX_ITER$1;H;--H)if(Ve=this.e*Math.sin(F),Ue=Math.sqrt(1-Ve*Ve)*Math.tan(F),Fe=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,F),nt=this.e0-2*this.e1*Math.cos(2*F)+4*this.e2*Math.cos(4*F)-6*this.e3*Math.cos(6*F),Ze=Fe/this.a,Re=(x*(Ue*Ze+1)-Ze-.5*Ue*(Ze*Ze+o))/(this.es*Math.sin(2*F)*(Ze*Ze+o-2*x*Ze)/(4*Ue)+(x-Ze)*(Ue*nt-2/Math.sin(2*F))-nt),F-=Re,Math.abs(Re)<=EPSLN){s=F;break}Ue=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),r=adjust_lon(this.long0+Math.asin(u*Ue/this.a)/Math.sin(s))}return e.x=r,e.y=s,e}var names$f=["Polyconic","American_Polyconic","poly"];const poly={init:init$f,forward:forward$e,inverse:inverse$e,names:names$f};function init$e(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function forward$d(e){var r,s=e.x,u=e.y,m=u-this.lat0,H=s-this.long0,x=m/SEC_TO_RAD*1e-5,o=H,F=1,Re=0;for(r=1;r<=10;r++)F=F*x,Re=Re+this.A[r]*F;var He=Re,Ue=o,Fe=1,nt=0,Ze,Ve,er=0,st=0;for(r=1;r<=6;r++)Ze=Fe*He-nt*Ue,Ve=nt*He+Fe*Ue,Fe=Ze,nt=Ve,er=er+this.B_re[r]*Fe-this.B_im[r]*nt,st=st+this.B_im[r]*Fe+this.B_re[r]*nt;return e.x=st*this.a+this.x0,e.y=er*this.a+this.y0,e}function inverse$d(e){var r,s=e.x,u=e.y,m=s-this.x0,H=u-this.y0,x=H/this.a,o=m/this.a,F=1,Re=0,He,Ue,Fe=0,nt=0;for(r=1;r<=6;r++)He=F*x-Re*o,Ue=Re*x+F*o,F=He,Re=Ue,Fe=Fe+this.C_re[r]*F-this.C_im[r]*Re,nt=nt+this.C_im[r]*F+this.C_re[r]*Re;for(var Ze=0;Ze<this.iterations;Ze++){var Ve=Fe,er=nt,st,Ke,Ye=x,tt=o;for(r=2;r<=6;r++)st=Ve*Fe-er*nt,Ke=er*Fe+Ve*nt,Ve=st,er=Ke,Ye=Ye+(r-1)*(this.B_re[r]*Ve-this.B_im[r]*er),tt=tt+(r-1)*(this.B_im[r]*Ve+this.B_re[r]*er);Ve=1,er=0;var Je=this.B_re[1],rr=this.B_im[1];for(r=2;r<=6;r++)st=Ve*Fe-er*nt,Ke=er*Fe+Ve*nt,Ve=st,er=Ke,Je=Je+r*(this.B_re[r]*Ve-this.B_im[r]*er),rr=rr+r*(this.B_im[r]*Ve+this.B_re[r]*er);var Rr=Je*Je+rr*rr;Fe=(Ye*Je+tt*rr)/Rr,nt=(tt*Je-Ye*rr)/Rr}var ar=Fe,Ar=nt,mr=1,Pr=0;for(r=1;r<=9;r++)mr=mr*ar,Pr=Pr+this.D[r]*mr;var Nr=this.lat0+Pr*SEC_TO_RAD*1e5,Ra=this.long0+Ar;return e.x=Ra,e.y=Nr,e}var names$e=["New_Zealand_Map_Grid","nzmg"];const nzmg={init:init$e,forward:forward$d,inverse:inverse$d,names:names$e};function init$d(){}function forward$c(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=this.x0+this.a*u,H=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;return e.x=m,e.y=H,e}function inverse$c(e){e.x-=this.x0,e.y-=this.y0;var r=adjust_lon(this.long0+e.x/this.a),s=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=r,e.y=s,e}var names$d=["Miller_Cylindrical","mill"];const mill={init:init$d,forward:forward$c,inverse:inverse$c,names:names$d};var MAX_ITER=20;function init$c(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pj_enfn(this.es)}function forward$b(e){var r,s,u=e.x,m=e.y;if(u=adjust_lon(u-this.long0),this.sphere){if(!this.m)m=this.n!==1?Math.asin(this.n*Math.sin(m)):m;else for(var H=this.n*Math.sin(m),x=MAX_ITER;x;--x){var o=(this.m*m+Math.sin(m)-H)/(this.m+Math.cos(m));if(m-=o,Math.abs(o)<EPSLN)break}r=this.a*this.C_x*u*(this.m+Math.cos(m)),s=this.a*this.C_y*m}else{var F=Math.sin(m),Re=Math.cos(m);s=this.a*pj_mlfn(m,F,Re,this.en),r=this.a*u*Re/Math.sqrt(1-this.es*F*F)}return e.x=r,e.y=s,e}function inverse$b(e){var r,s,u,m;return e.x-=this.x0,u=e.x/this.a,e.y-=this.y0,r=e.y/this.a,this.sphere?(r/=this.C_y,u=u/(this.C_x*(this.m+Math.cos(r))),this.m?r=asinz((this.m*r+Math.sin(r))/this.n):this.n!==1&&(r=asinz(Math.sin(r)/this.n)),u=adjust_lon(u+this.long0),r=adjust_lat(r)):(r=pj_inv_mlfn(e.y/this.a,this.es,this.en),m=Math.abs(r),m<HALF_PI?(m=Math.sin(r),s=this.long0+e.x*Math.sqrt(1-this.es*m*m)/(this.a*Math.cos(r)),u=adjust_lon(s)):m-EPSLN<HALF_PI&&(u=this.long0)),e.x=u,e.y=r,e}var names$c=["Sinusoidal","sinu"];const sinu={init:init$c,forward:forward$b,inverse:inverse$b,names:names$c};function init$b(){}function forward$a(e){for(var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m=s,H=Math.PI*Math.sin(s);;){var x=-(m+Math.sin(m)-H)/(1+Math.cos(m));if(m+=x,Math.abs(x)<EPSLN)break}m/=2,Math.PI/2-Math.abs(s)<EPSLN&&(u=0);var o=.900316316158*this.a*u*Math.cos(m)+this.x0,F=1.4142135623731*this.a*Math.sin(m)+this.y0;return e.x=o,e.y=F,e}function inverse$a(e){var r,s;e.x-=this.x0,e.y-=this.y0,s=e.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),r=Math.asin(s);var u=adjust_lon(this.long0+e.x/(.900316316158*this.a*Math.cos(r)));u<-Math.PI&&(u=-Math.PI),u>Math.PI&&(u=Math.PI),s=(2*r+Math.sin(2*r))/Math.PI,Math.abs(s)>1&&(s=1);var m=Math.asin(s);return e.x=u,e.y=m,e}var names$b=["Mollweide","moll"];const moll={init:init$b,forward:forward$a,inverse:inverse$a,names:names$b};function init$a(){Math.abs(this.lat1+this.lat2)<EPSLN||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml1=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<EPSLN?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=msfnz(this.e,this.sin_phi,this.cos_phi),this.ml2=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function forward$9(e){var r=e.x,s=e.y,u;if(this.sphere)u=this.a*(this.g-s);else{var m=mlfn(this.e0,this.e1,this.e2,this.e3,s);u=this.a*(this.g-m)}var H=this.ns*adjust_lon(r-this.long0),x=this.x0+u*Math.sin(H),o=this.y0+this.rh-u*Math.cos(H);return e.x=x,e.y=o,e}function inverse$9(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var r,s,u,m;this.ns>=0?(s=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(s=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1);var H=0;if(s!==0&&(H=Math.atan2(r*e.x,r*e.y)),this.sphere)return m=adjust_lon(this.long0+H/this.ns),u=adjust_lat(this.g-s/this.a),e.x=m,e.y=u,e;var x=this.g-s/this.a;return u=imlfn(x,this.e0,this.e1,this.e2,this.e3),m=adjust_lon(this.long0+H/this.ns),e.x=m,e.y=u,e}var names$a=["Equidistant_Conic","eqdc"];const eqdc={init:init$a,forward:forward$9,inverse:inverse$9,names:names$a};function init$9(){this.R=this.a}function forward$8(e){var r=e.x,s=e.y,u=adjust_lon(r-this.long0),m,H;Math.abs(s)<=EPSLN&&(m=this.x0+this.R*u,H=this.y0);var x=asinz(2*Math.abs(s/Math.PI));(Math.abs(u)<=EPSLN||Math.abs(Math.abs(s)-HALF_PI)<=EPSLN)&&(m=this.x0,s>=0?H=this.y0+Math.PI*this.R*Math.tan(.5*x):H=this.y0+Math.PI*this.R*-Math.tan(.5*x));var o=.5*Math.abs(Math.PI/u-u/Math.PI),F=o*o,Re=Math.sin(x),He=Math.cos(x),Ue=He/(Re+He-1),Fe=Ue*Ue,nt=Ue*(2/Re-1),Ze=nt*nt,Ve=Math.PI*this.R*(o*(Ue-Ze)+Math.sqrt(F*(Ue-Ze)*(Ue-Ze)-(Ze+F)*(Fe-Ze)))/(Ze+F);u<0&&(Ve=-Ve),m=this.x0+Ve;var er=F+Ue;return Ve=Math.PI*this.R*(nt*er-o*Math.sqrt((Ze+F)*(F+1)-er*er))/(Ze+F),s>=0?H=this.y0+Ve:H=this.y0-Ve,e.x=m,e.y=H,e}function inverse$8(e){var r,s,u,m,H,x,o,F,Re,He,Ue,Fe,nt;return e.x-=this.x0,e.y-=this.y0,Ue=Math.PI*this.R,u=e.x/Ue,m=e.y/Ue,H=u*u+m*m,x=-Math.abs(m)*(1+H),o=x-2*m*m+u*u,F=-2*x+1+2*m*m+H*H,nt=m*m/F+(2*o*o*o/F/F/F-9*x*o/F/F)/27,Re=(x-o*o/3/F)/F,He=2*Math.sqrt(-Re/3),Ue=3*nt/Re/He,Math.abs(Ue)>1&&(Ue>=0?Ue=1:Ue=-1),Fe=Math.acos(Ue)/3,e.y>=0?s=(-He*Math.cos(Fe+Math.PI/3)-o/3/F)*Math.PI:s=-(-He*Math.cos(Fe+Math.PI/3)-o/3/F)*Math.PI,Math.abs(u)<EPSLN?r=this.long0:r=adjust_lon(this.long0+Math.PI*(H-1+Math.sqrt(1+2*(u*u-m*m)+H*H))/2/u),e.x=r,e.y=s,e}var names$9=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const vandg={init:init$9,forward:forward$8,inverse:inverse$8,names:names$9};function vincentyInverse(e,r,s,u,m,H){const x=u-r,o=Math.atan((1-H)*Math.tan(e)),F=Math.atan((1-H)*Math.tan(s)),Re=Math.sin(o),He=Math.cos(o),Ue=Math.sin(F),Fe=Math.cos(F);let nt=x,Ze,Ve=100,er,st,Ke,Ye,tt,Je,rr,Rr,ar,Ar,mr,Pr,Nr,Ra;do{if(er=Math.sin(nt),st=Math.cos(nt),Ke=Math.sqrt(Fe*er*(Fe*er)+(He*Ue-Re*Fe*st)*(He*Ue-Re*Fe*st)),Ke===0)return{azi1:0,s12:0};Ye=Re*Ue+He*Fe*st,tt=Math.atan2(Ke,Ye),Je=He*Fe*er/Ke,rr=1-Je*Je,Rr=rr!==0?Ye-2*Re*Ue/rr:0,ar=H/16*rr*(4+H*(4-3*rr)),Ze=nt,nt=x+(1-ar)*H*Je*(tt+ar*Ke*(Rr+ar*Ye*(-1+2*Rr*Rr)))}while(Math.abs(nt-Ze)>1e-12&&--Ve>0);return Ve===0?{azi1:NaN,s12:NaN}:(Ar=rr*(m*m-m*(1-H)*(m*(1-H)))/(m*(1-H)*(m*(1-H))),mr=1+Ar/16384*(4096+Ar*(-768+Ar*(320-175*Ar))),Pr=Ar/1024*(256+Ar*(-128+Ar*(74-47*Ar))),Nr=Pr*Ke*(Rr+Pr/4*(Ye*(-1+2*Rr*Rr)-Pr/6*Rr*(-3+4*Ke*Ke)*(-3+4*Rr*Rr))),Ra=m*(1-H)*mr*(tt-Nr),{azi1:Math.atan2(Fe*er,He*Ue-Re*Fe*st),s12:Ra})}function vincentyDirect(e,r,s,u,m,H){const x=Math.atan((1-H)*Math.tan(e)),o=Math.sin(x),F=Math.cos(x),Re=Math.sin(s),He=Math.cos(s),Ue=Math.atan2(o,F*He),Fe=F*Re,nt=1-Fe*Fe,Ze=nt*(m*m-m*(1-H)*(m*(1-H)))/(m*(1-H)*(m*(1-H))),Ve=1+Ze/16384*(4096+Ze*(-768+Ze*(320-175*Ze))),er=Ze/1024*(256+Ze*(-128+Ze*(74-47*Ze)));let st=u/(m*(1-H)*Ve),Ke,Ye=100,tt,Je,rr,Rr;do tt=Math.cos(2*Ue+st),Je=Math.sin(st),rr=Math.cos(st),Rr=er*Je*(tt+er/4*(rr*(-1+2*tt*tt)-er/6*tt*(-3+4*Je*Je)*(-3+4*tt*tt))),Ke=st,st=u/(m*(1-H)*Ve)+Rr;while(Math.abs(st-Ke)>1e-12&&--Ye>0);if(Ye===0)return{lat2:NaN,lon2:NaN};const ar=o*Je-F*rr*He,Ar=Math.atan2(o*rr+F*Je*He,(1-H)*Math.sqrt(Fe*Fe+ar*ar)),mr=Math.atan2(Je*Re,F*rr-o*Je*He),Pr=H/16*nt*(4+H*(4-3*nt)),Nr=mr-(1-Pr)*H*Fe*(st+Pr*Je*(tt+Pr*rr*(-1+2*tt*tt))),Ra=r+Nr;return{lat2:Ar,lon2:Ra}}function init$8(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function forward$7(e){var r=e.x,s=e.y,u=Math.sin(e.y),m=Math.cos(e.y),H=adjust_lon(r-this.long0),x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er;return this.sphere?Math.abs(this.sin_p12-1)<=EPSLN?(e.x=this.x0+this.a*(HALF_PI-s)*Math.sin(H),e.y=this.y0-this.a*(HALF_PI-s)*Math.cos(H),e):Math.abs(this.sin_p12+1)<=EPSLN?(e.x=this.x0+this.a*(HALF_PI+s)*Math.sin(H),e.y=this.y0+this.a*(HALF_PI+s)*Math.cos(H),e):(Ze=this.sin_p12*u+this.cos_p12*m*Math.cos(H),Fe=Math.acos(Ze),nt=Fe?Fe/Math.sin(Fe):1,e.x=this.x0+this.a*nt*m*Math.sin(H),e.y=this.y0+this.a*nt*(this.cos_p12*u-this.sin_p12*m*Math.cos(H)),e):(x=e0fn(this.es),o=e1fn(this.es),F=e2fn(this.es),Re=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(He=this.a*mlfn(x,o,F,Re,HALF_PI),Ue=this.a*mlfn(x,o,F,Re,s),e.x=this.x0+(He-Ue)*Math.sin(H),e.y=this.y0-(He-Ue)*Math.cos(H),e):Math.abs(this.sin_p12+1)<=EPSLN?(He=this.a*mlfn(x,o,F,Re,HALF_PI),Ue=this.a*mlfn(x,o,F,Re,s),e.x=this.x0+(He+Ue)*Math.sin(H),e.y=this.y0+(He+Ue)*Math.cos(H),e):Math.abs(r)<EPSLN&&Math.abs(s-this.lat0)<EPSLN?(e.x=e.y=0,e):(Ve=vincentyInverse(this.lat0,this.long0,s,r,this.a,this.f),er=Ve.azi1,e.x=Ve.s12*Math.sin(er),e.y=Ve.s12*Math.cos(er),e))}function inverse$7(e){e.x-=this.x0,e.y-=this.y0;var r,s,u,m,H,x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er;return this.sphere?(r=Math.sqrt(e.x*e.x+e.y*e.y),r>2*HALF_PI*this.a?void 0:(s=r/this.a,u=Math.sin(s),m=Math.cos(s),H=this.long0,Math.abs(r)<=EPSLN?x=this.lat0:(x=asinz(m*this.sin_p12+e.y*u*this.cos_p12/r),o=Math.abs(this.lat0)-HALF_PI,Math.abs(o)<=EPSLN?this.lat0>=0?H=adjust_lon(this.long0+Math.atan2(e.x,-e.y)):H=adjust_lon(this.long0-Math.atan2(-e.x,e.y)):H=adjust_lon(this.long0+Math.atan2(e.x*u,r*this.cos_p12*m-e.y*this.sin_p12*u))),e.x=H,e.y=x,e)):(F=e0fn(this.es),Re=e1fn(this.es),He=e2fn(this.es),Ue=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(Fe=this.a*mlfn(F,Re,He,Ue,HALF_PI),r=Math.sqrt(e.x*e.x+e.y*e.y),nt=Fe-r,x=imlfn(nt/this.a,F,Re,He,Ue),H=adjust_lon(this.long0+Math.atan2(e.x,-1*e.y)),e.x=H,e.y=x,e):Math.abs(this.sin_p12+1)<=EPSLN?(Fe=this.a*mlfn(F,Re,He,Ue,HALF_PI),r=Math.sqrt(e.x*e.x+e.y*e.y),nt=r-Fe,x=imlfn(nt/this.a,F,Re,He,Ue),H=adjust_lon(this.long0+Math.atan2(e.x,e.y)),e.x=H,e.y=x,e):(Ze=Math.atan2(e.x,e.y),Ve=Math.sqrt(e.x*e.x+e.y*e.y),er=vincentyDirect(this.lat0,this.long0,Ze,Ve,this.a,this.f),e.x=er.lon2,e.y=er.lat2,e))}var names$8=["Azimuthal_Equidistant","aeqd"];const aeqd={init:init$8,forward:forward$7,inverse:inverse$7,names:names$8};function init$7(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function forward$6(e){var r,s,u,m,H,x,o,F,Re=e.x,He=e.y;return u=adjust_lon(Re-this.long0),r=Math.sin(He),s=Math.cos(He),m=Math.cos(u),x=this.sin_p14*r+this.cos_p14*s*m,H=1,(x>0||Math.abs(x)<=EPSLN)&&(o=this.a*H*s*Math.sin(u),F=this.y0+this.a*H*(this.cos_p14*r-this.sin_p14*s*m)),e.x=o,e.y=F,e}function inverse$6(e){var r,s,u,m,H,x,o;return e.x-=this.x0,e.y-=this.y0,r=Math.sqrt(e.x*e.x+e.y*e.y),s=asinz(r/this.a),u=Math.sin(s),m=Math.cos(s),x=this.long0,Math.abs(r)<=EPSLN?(o=this.lat0,e.x=x,e.y=o,e):(o=asinz(m*this.sin_p14+e.y*u*this.cos_p14/r),H=Math.abs(this.lat0)-HALF_PI,Math.abs(H)<=EPSLN?(this.lat0>=0?x=adjust_lon(this.long0+Math.atan2(e.x,-e.y)):x=adjust_lon(this.long0-Math.atan2(-e.x,e.y)),e.x=x,e.y=o,e):(x=adjust_lon(this.long0+Math.atan2(e.x*u,r*this.cos_p14*m-e.y*this.sin_p14*u)),e.x=x,e.y=o,e))}var names$7=["ortho"];const ortho={init:init$7,forward:forward$6,inverse:inverse$6,names:names$7};var FACE_ENUM={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},AREA_ENUM={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function init$6(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=HALF_PI-FORTPI/2?this.face=FACE_ENUM.TOP:this.lat0<=-(HALF_PI-FORTPI/2)?this.face=FACE_ENUM.BOTTOM:Math.abs(this.long0)<=FORTPI?this.face=FACE_ENUM.FRONT:Math.abs(this.long0)<=HALF_PI+FORTPI?this.face=this.long0>0?FACE_ENUM.RIGHT:FACE_ENUM.LEFT:this.face=FACE_ENUM.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function forward$5(e){var r={x:0,y:0},s,u,m,H,x,o,F={value:0};if(e.x-=this.long0,this.es!==0?s=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):s=e.y,u=e.x,this.face===FACE_ENUM.TOP)H=HALF_PI-s,u>=FORTPI&&u<=HALF_PI+FORTPI?(F.value=AREA_ENUM.AREA_0,m=u-HALF_PI):u>HALF_PI+FORTPI||u<=-(HALF_PI+FORTPI)?(F.value=AREA_ENUM.AREA_1,m=u>0?u-SPI:u+SPI):u>-(HALF_PI+FORTPI)&&u<=-FORTPI?(F.value=AREA_ENUM.AREA_2,m=u+HALF_PI):(F.value=AREA_ENUM.AREA_3,m=u);else if(this.face===FACE_ENUM.BOTTOM)H=HALF_PI+s,u>=FORTPI&&u<=HALF_PI+FORTPI?(F.value=AREA_ENUM.AREA_0,m=-u+HALF_PI):u<FORTPI&&u>=-FORTPI?(F.value=AREA_ENUM.AREA_1,m=-u):u<-FORTPI&&u>=-(HALF_PI+FORTPI)?(F.value=AREA_ENUM.AREA_2,m=-u-HALF_PI):(F.value=AREA_ENUM.AREA_3,m=u>0?-u+SPI:-u-SPI);else{var Re,He,Ue,Fe,nt,Ze,Ve;this.face===FACE_ENUM.RIGHT?u=qsc_shift_lon_origin(u,+HALF_PI):this.face===FACE_ENUM.BACK?u=qsc_shift_lon_origin(u,+SPI):this.face===FACE_ENUM.LEFT&&(u=qsc_shift_lon_origin(u,-HALF_PI)),Fe=Math.sin(s),nt=Math.cos(s),Ze=Math.sin(u),Ve=Math.cos(u),Re=nt*Ve,He=nt*Ze,Ue=Fe,this.face===FACE_ENUM.FRONT?(H=Math.acos(Re),m=qsc_fwd_equat_face_theta(H,Ue,He,F)):this.face===FACE_ENUM.RIGHT?(H=Math.acos(He),m=qsc_fwd_equat_face_theta(H,Ue,-Re,F)):this.face===FACE_ENUM.BACK?(H=Math.acos(-Re),m=qsc_fwd_equat_face_theta(H,Ue,-He,F)):this.face===FACE_ENUM.LEFT?(H=Math.acos(-He),m=qsc_fwd_equat_face_theta(H,Ue,Re,F)):(H=m=0,F.value=AREA_ENUM.AREA_0)}return o=Math.atan(12/SPI*(m+Math.acos(Math.sin(m)*Math.cos(FORTPI))-HALF_PI)),x=Math.sqrt((1-Math.cos(H))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(m))))),F.value===AREA_ENUM.AREA_1?o+=HALF_PI:F.value===AREA_ENUM.AREA_2?o+=SPI:F.value===AREA_ENUM.AREA_3&&(o+=1.5*SPI),r.x=x*Math.cos(o),r.y=x*Math.sin(o),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,e.x=r.x,e.y=r.y,e}function inverse$5(e){var r={lam:0,phi:0},s,u,m,H,x,o,F,Re,He,Ue={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,u=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),s=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?Ue.value=AREA_ENUM.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(Ue.value=AREA_ENUM.AREA_1,s-=HALF_PI):e.x<0&&-e.x>=Math.abs(e.y)?(Ue.value=AREA_ENUM.AREA_2,s=s<0?s+SPI:s-SPI):(Ue.value=AREA_ENUM.AREA_3,s+=HALF_PI),He=SPI/12*Math.tan(s),x=Math.sin(He)/(Math.cos(He)-1/Math.sqrt(2)),o=Math.atan(x),m=Math.cos(s),H=Math.tan(u),F=1-m*m*H*H*(1-Math.cos(Math.atan(1/Math.cos(o)))),F<-1?F=-1:F>1&&(F=1),this.face===FACE_ENUM.TOP)Re=Math.acos(F),r.phi=HALF_PI-Re,Ue.value===AREA_ENUM.AREA_0?r.lam=o+HALF_PI:Ue.value===AREA_ENUM.AREA_1?r.lam=o<0?o+SPI:o-SPI:Ue.value===AREA_ENUM.AREA_2?r.lam=o-HALF_PI:r.lam=o;else if(this.face===FACE_ENUM.BOTTOM)Re=Math.acos(F),r.phi=Re-HALF_PI,Ue.value===AREA_ENUM.AREA_0?r.lam=-o+HALF_PI:Ue.value===AREA_ENUM.AREA_1?r.lam=-o:Ue.value===AREA_ENUM.AREA_2?r.lam=-o-HALF_PI:r.lam=o<0?-o-SPI:-o+SPI;else{var Fe,nt,Ze;Fe=F,He=Fe*Fe,He>=1?Ze=0:Ze=Math.sqrt(1-He)*Math.sin(o),He+=Ze*Ze,He>=1?nt=0:nt=Math.sqrt(1-He),Ue.value===AREA_ENUM.AREA_1?(He=nt,nt=-Ze,Ze=He):Ue.value===AREA_ENUM.AREA_2?(nt=-nt,Ze=-Ze):Ue.value===AREA_ENUM.AREA_3&&(He=nt,nt=Ze,Ze=-He),this.face===FACE_ENUM.RIGHT?(He=Fe,Fe=-nt,nt=He):this.face===FACE_ENUM.BACK?(Fe=-Fe,nt=-nt):this.face===FACE_ENUM.LEFT&&(He=Fe,Fe=nt,nt=-He),r.phi=Math.acos(-Ze)-HALF_PI,r.lam=Math.atan2(nt,Fe),this.face===FACE_ENUM.RIGHT?r.lam=qsc_shift_lon_origin(r.lam,-HALF_PI):this.face===FACE_ENUM.BACK?r.lam=qsc_shift_lon_origin(r.lam,-SPI):this.face===FACE_ENUM.LEFT&&(r.lam=qsc_shift_lon_origin(r.lam,+HALF_PI))}if(this.es!==0){var Ve,er,st;Ve=r.phi<0?1:0,er=Math.tan(r.phi),st=this.b/Math.sqrt(er*er+this.one_minus_f_squared),r.phi=Math.atan(Math.sqrt(this.a*this.a-st*st)/(this.one_minus_f*st)),Ve&&(r.phi=-r.phi)}return r.lam+=this.long0,e.x=r.lam,e.y=r.phi,e}function qsc_fwd_equat_face_theta(e,r,s,u){var m;return e<EPSLN?(u.value=AREA_ENUM.AREA_0,m=0):(m=Math.atan2(r,s),Math.abs(m)<=FORTPI?u.value=AREA_ENUM.AREA_0:m>FORTPI&&m<=HALF_PI+FORTPI?(u.value=AREA_ENUM.AREA_1,m-=HALF_PI):m>HALF_PI+FORTPI||m<=-(HALF_PI+FORTPI)?(u.value=AREA_ENUM.AREA_2,m=m>=0?m-SPI:m+SPI):(u.value=AREA_ENUM.AREA_3,m+=HALF_PI)),m}function qsc_shift_lon_origin(e,r){var s=e+r;return s<-SPI?s+=TWO_PI:s>+SPI&&(s-=TWO_PI),s}var names$6=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const qsc={init:init$6,forward:forward$5,inverse:inverse$5,names:names$6};var COEFS_X=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],COEFS_Y=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],FXC=.8487,FYC=1.3523,C1=R2D/5,RC1=1/C1,NODES=18,poly3_val=function(e,r){return e[0]+r*(e[1]+r*(e[2]+r*e[3]))},poly3_der=function(e,r){return e[1]+r*(2*e[2]+r*3*e[3])};function newton_rapshon(e,r,s,u){for(var m=r;u;--u){var H=e(m);if(m-=H,Math.abs(H)<s)break}return m}function init$5(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function forward$4(e){var r=adjust_lon(e.x-this.long0),s=Math.abs(e.y),u=Math.floor(s*C1);u<0?u=0:u>=NODES&&(u=NODES-1),s=R2D*(s-RC1*u);var m={x:poly3_val(COEFS_X[u],s)*r,y:poly3_val(COEFS_Y[u],s)};return e.y<0&&(m.y=-m.y),m.x=m.x*this.a*FXC+this.x0,m.y=m.y*this.a*FYC+this.y0,m}function inverse$4(e){var r={x:(e.x-this.x0)/(this.a*FXC),y:Math.abs(e.y-this.y0)/(this.a*FYC)};if(r.y>=1)r.x/=COEFS_X[NODES][0],r.y=e.y<0?-HALF_PI:HALF_PI;else{var s=Math.floor(r.y*NODES);for(s<0?s=0:s>=NODES&&(s=NODES-1);;)if(COEFS_Y[s][0]>r.y)--s;else if(COEFS_Y[s+1][0]<=r.y)++s;else break;var u=COEFS_Y[s],m=5*(r.y-u[0])/(COEFS_Y[s+1][0]-u[0]);m=newton_rapshon(function(H){return(poly3_val(u,H)-r.y)/poly3_der(u,H)},m,EPSLN,100),r.x/=poly3_val(COEFS_X[s],m),r.y=(5*s+m)*D2R$1,e.y<0&&(r.y=-r.y)}return r.x=adjust_lon(r.x+this.long0),r}var names$5=["Robinson","robin"];const robin={init:init$5,forward:forward$4,inverse:inverse$4,names:names$5};function init$4(){this.name="geocent"}function forward$3(e){var r=geodeticToGeocentric(e,this.es,this.a);return r}function inverse$3(e){var r=geocentricToGeodetic(e,this.es,this.a,this.b);return r}var names$4=["Geocentric","geocentric","geocent","Geocent"];const geocent={init:init$4,forward:forward$3,inverse:inverse$3,names:names$4};var mode={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},params={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function init$3(){if(Object.keys(params).forEach(function(s){if(typeof this[s]>"u")this[s]=params[s].def;else{if(params[s].num&&isNaN(this[s]))throw new Error("Invalid parameter value, must be numeric "+s+" = "+this[s]);params[s].num&&(this[s]=parseFloat(this[s]))}params[s].degrees&&(this[s]=this[s]*D2R$1)}.bind(this)),Math.abs(Math.abs(this.lat0)-HALF_PI)<EPSLN?this.mode=this.lat0<0?mode.S_POLE:mode.N_POLE:Math.abs(this.lat0)<EPSLN?this.mode=mode.EQUIT:(this.mode=mode.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,r=this.azi;this.cg=Math.cos(r),this.sg=Math.sin(r),this.cw=Math.cos(e),this.sw=Math.sin(e)}function forward$2(e){e.x-=this.long0;var r=Math.sin(e.y),s=Math.cos(e.y),u=Math.cos(e.x),m,H;switch(this.mode){case mode.OBLIQ:H=this.sinph0*r+this.cosph0*s*u;break;case mode.EQUIT:H=s*u;break;case mode.S_POLE:H=-r;break;case mode.N_POLE:H=r;break}switch(H=this.pn1/(this.p-H),m=H*s*Math.sin(e.x),this.mode){case mode.OBLIQ:H*=this.cosph0*r-this.sinph0*s*u;break;case mode.EQUIT:H*=r;break;case mode.N_POLE:H*=-(s*u);break;case mode.S_POLE:H*=s*u;break}var x,o;return x=H*this.cg+m*this.sg,o=1/(x*this.sw*this.h1+this.cw),m=(m*this.cg-H*this.sg)*this.cw*o,H=x*o,e.x=m*this.a,e.y=H*this.a,e}function inverse$2(e){e.x/=this.a,e.y/=this.a;var r={x:e.x,y:e.y},s,u,m;m=1/(this.pn1-e.y*this.sw),s=this.pn1*e.x*m,u=this.pn1*e.y*this.cw*m,e.x=s*this.cg+u*this.sg,e.y=u*this.cg-s*this.sg;var H=hypot$2(e.x,e.y);if(Math.abs(H)<EPSLN)r.x=0,r.y=e.y;else{var x,o;switch(o=1-H*H*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/H+H/this.pn1),x=Math.sqrt(1-o*o),this.mode){case mode.OBLIQ:r.y=Math.asin(x*this.sinph0+e.y*o*this.cosph0/H),e.y=(x-this.sinph0*Math.sin(r.y))*H,e.x*=o*this.cosph0;break;case mode.EQUIT:r.y=Math.asin(e.y*o/H),e.y=x*H,e.x*=o;break;case mode.N_POLE:r.y=Math.asin(x),e.y=-e.y;break;case mode.S_POLE:r.y=-Math.asin(x);break}r.x=Math.atan2(e.x,e.y)}return e.x=r.x+this.long0,e.y=r.y,e}var names$3=["Tilted_Perspective","tpers"];const tpers={init:init$3,forward:forward$2,inverse:inverse$2,names:names$3};function init$2(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,r=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=r,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function forward$1(e){var r=e.x,s=e.y,u,m,H,x;if(r=r-this.long0,this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var o=this.radius_p/hypot$2(this.radius_p*Math.cos(s),Math.sin(s));if(m=o*Math.cos(r)*Math.cos(s),H=o*Math.sin(r)*Math.cos(s),x=o*Math.sin(s),(this.radius_g-m)*m-H*H-x*x*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;u=this.radius_g-m,this.flip_axis?(e.x=this.radius_g_1*Math.atan(H/hypot$2(x,u)),e.y=this.radius_g_1*Math.atan(x/u)):(e.x=this.radius_g_1*Math.atan(H/u),e.y=this.radius_g_1*Math.atan(x/hypot$2(H,u)))}else this.shape==="sphere"&&(u=Math.cos(s),m=Math.cos(r)*u,H=Math.sin(r)*u,x=Math.sin(s),u=this.radius_g-m,this.flip_axis?(e.x=this.radius_g_1*Math.atan(H/hypot$2(x,u)),e.y=this.radius_g_1*Math.atan(x/u)):(e.x=this.radius_g_1*Math.atan(H/u),e.y=this.radius_g_1*Math.atan(x/hypot$2(H,u))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function inverse$1(e){var r=-1,s=0,u=0,m,H,x,o;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(u=Math.tan(e.y/this.radius_g_1),s=Math.tan(e.x/this.radius_g_1)*hypot$2(1,u)):(s=Math.tan(e.x/this.radius_g_1),u=Math.tan(e.y/this.radius_g_1)*hypot$2(1,s));var F=u/this.radius_p;if(m=s*s+F*F+r*r,H=2*this.radius_g*r,x=H*H-4*m*this.C,x<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-H-Math.sqrt(x))/(2*m),r=this.radius_g+o*r,s*=o,u*=o,e.x=Math.atan2(s,r),e.y=Math.atan(u*Math.cos(e.x)/r),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(u=Math.tan(e.y/this.radius_g_1),s=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+u*u)):(s=Math.tan(e.x/this.radius_g_1),u=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+s*s)),m=s*s+u*u+r*r,H=2*this.radius_g*r,x=H*H-4*m*this.C,x<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-H-Math.sqrt(x))/(2*m),r=this.radius_g+o*r,s*=o,u*=o,e.x=Math.atan2(s,r),e.y=Math.atan(u*Math.cos(e.x)/r)}return e.x=e.x+this.long0,e}var names$2=["Geostationary Satellite View","Geostationary_Satellite","geos"];const geos={init:init$2,forward:forward$1,inverse:inverse$1,names:names$2};var A1=1.340264,A2=-.081106,A3=893e-6,A4=.003796,M=Math.sqrt(3)/2;function init$1(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function forward(e){var r=adjust_lon(e.x-this.long0),s=e.y,u=Math.asin(M*Math.sin(s)),m=u*u,H=m*m*m;return e.x=r*Math.cos(u)/(M*(A1+3*A2*m+H*(7*A3+9*A4*m))),e.y=u*(A1+A2*m+H*(A3+A4*m)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function inverse(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var r=1e-9,s=12,u=e.y,m,H,x,o,F,Re;for(Re=0;Re<s&&(m=u*u,H=m*m*m,x=u*(A1+A2*m+H*(A3+A4*m))-e.y,o=A1+3*A2*m+H*(7*A3+9*A4*m),u-=F=x/o,!(Math.abs(F)<r));++Re);return m=u*u,H=m*m*m,e.x=M*e.x*(A1+3*A2*m+H*(7*A3+9*A4*m))/Math.cos(u),e.y=Math.asin(Math.sin(u)/M),e.x=adjust_lon(e.x+this.long0),e}var names$1=["eqearth","Equal Earth","Equal_Earth"];const eqearth={init:init$1,forward,inverse,names:names$1};var EPS10=1e-10;function init(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<EPS10)throw new Error;this.es?(this.en=pj_enfn(this.es),this.m1=pj_mlfn(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=e_inv,this.forward=e_fwd):(Math.abs(this.phi1)+EPS10>=HALF_PI?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=s_inv,this.forward=s_fwd)}function e_fwd(e){var r=adjust_lon(e.x-(this.long0||0)),s=e.y,u,m,H;return u=this.am1+this.m1-pj_mlfn(s,m=Math.sin(s),H=Math.cos(s),this.en),m=H*r/(u*Math.sqrt(1-this.es*m*m)),e.x=u*Math.sin(m),e.y=this.am1-u*Math.cos(m),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function e_inv(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var r,s,u,m;if(s=hypot$2(e.x,e.y=this.am1-e.y),m=pj_inv_mlfn(this.am1+this.m1-s,this.es,this.en),(r=Math.abs(m))<HALF_PI)r=Math.sin(m),u=s*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*r*r)/Math.cos(m);else if(Math.abs(r-HALF_PI)<=EPS10)u=0;else throw new Error;return e.x=adjust_lon(u+(this.long0||0)),e.y=adjust_lat(m),e}function s_fwd(e){var r=adjust_lon(e.x-(this.long0||0)),s=e.y,u,m;return m=this.cphi1+this.phi1-s,Math.abs(m)>EPS10?(e.x=m*Math.sin(u=r*Math.cos(s)/m),e.y=this.cphi1-m*Math.cos(u)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function s_inv(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var r,s,u=hypot$2(e.x,e.y=this.cphi1-e.y);if(s=this.cphi1+this.phi1-u,Math.abs(s)>HALF_PI)throw new Error;return Math.abs(Math.abs(s)-HALF_PI)<=EPS10?r=0:r=u*Math.atan2(e.x,e.y)/Math.cos(s),e.x=adjust_lon(r+(this.long0||0)),e.y=adjust_lat(s),e}var names=["bonne","Bonne (Werner lat_1=90)"];const bonne={init,names};function includedProjections(e){e.Proj.projections.add(tmerc),e.Proj.projections.add(etmerc),e.Proj.projections.add(utm),e.Proj.projections.add(sterea),e.Proj.projections.add(stere),e.Proj.projections.add(somerc),e.Proj.projections.add(omerc),e.Proj.projections.add(lcc),e.Proj.projections.add(krovak),e.Proj.projections.add(cass),e.Proj.projections.add(laea),e.Proj.projections.add(aea),e.Proj.projections.add(gnom),e.Proj.projections.add(cea),e.Proj.projections.add(eqc),e.Proj.projections.add(poly),e.Proj.projections.add(nzmg),e.Proj.projections.add(mill),e.Proj.projections.add(sinu),e.Proj.projections.add(moll),e.Proj.projections.add(eqdc),e.Proj.projections.add(vandg),e.Proj.projections.add(aeqd),e.Proj.projections.add(ortho),e.Proj.projections.add(qsc),e.Proj.projections.add(robin),e.Proj.projections.add(geocent),e.Proj.projections.add(tpers),e.Proj.projections.add(geos),e.Proj.projections.add(eqearth),e.Proj.projections.add(bonne)}const proj4=Object.assign(proj4$1,{defaultDatum:"WGS84",Proj:Projection,WGS84:new Projection("WGS84"),Point,toPoint:common$1,defs,nadgrid,transform:transform$1,mgrs,version:"__VERSION__"});includedProjections(proj4);function getWKTString(e){let{type:r,epsg_code:s}=e;for(let u=0;u<crsList.length;u++){if(!crsTypes[crsList[u].type]||crsTypes[crsList[u].type].code!==r)continue;let{authCode:H,wkt:x,children:o}=crsList[u];if(H==s)return x;if(o?.length){for(let F=0;F<o.length;F++)if(o[F].children){for(let Re=0;Re<o[F].children.length;Re++)if(o[F].children[Re].authCode==s)return o[F].children[Re].wkt}else if(o[F].authCode==s)return o[F].wkt}}return null}function project(e,r=12){let[s,u]=e,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:m*Math.pow(2,r)*512,y:H*Math.pow(2,r)*512}}function getTileCoord(e,r){let[s,u]=r,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:Math.floor(m*Math.pow(2,e)),y:Math.floor(H*Math.pow(2,e)),z:e}}function getTilePixelCoord(e,r){let[s,u]=r,m=(180+s)/360,H=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360;return{x:Math.round(m*Math.pow(2,e)*512)%512,y:Math.round(H*Math.pow(2,e)*512)%512}}function getUTMProjection(e){let r=32600,s=Math.ceil((e+180)/6);return{type:3,type_name:"Projected",label:`WGS 84 / UTM zone ${s}N`,epsg_code:r+s}}function transformCoordinate(e,r,s){if(!e)return null;if(e=[...e],e[2]||(e[2]=0),r.offset&&(e=e.map((m,H)=>m+r.offset[H])),!s)return e;let u=null;if(s.type===1&&r.type===1)u=e;else{if(s.type===1||r.type===1)return e;if(r.type===0&&s.type===0){let m=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:r.origin_point[0],lat:r.origin_point[1],alt:r.origin_point[2]},{lon:s.origin_point[0],lat:s.origin_point[1],alt:s.origin_point[2]});u=[m.x+e[0],m.y+e[1],m.z+e[2]]}else if(r.type===0){let m=satellite_geo_calc.coordinateTransfer.enu_to_lla({x:e[0],y:e[1],z:e[2]},{lon:r.origin_point[0],lat:r.origin_point[1],alt:r.origin_point[2]}),H=[m.lon,m.lat,m.alt],{wkt:x,epsg_code:o}=s;if(!x&&o&&(x=getWKTString(s)),!x)return null;u=proj4("EPSG:4326",x,H)}else if(s.type===0){let{wkt:m,epsg_code:H}=r;if(!m&&H&&(m=getWKTString(r)),!m)return null;let x=proj4(m,"EPSG:4326",e),o=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:x[0],lat:x[1],alt:x[2]},{lon:s.origin_point[0],lat:s.origin_point[1],alt:s.origin_point[2]});u=[o.x,o.y,o.z]}else{let m=r.wkt,H=s.wkt;if(r.type===4&&(m="+proj=geocent +datum=WGS84"),s.type===4&&(H="+proj=geocent +datum=WGS84"),!m&&r.epsg_code&&(m=getWKTString(r)),!H&&s.epsg_code&&(H=getWKTString(s)),!m||!H)return null;u=proj4(m,H,e)}}return s.offset?u.map((m,H)=>m-s.offset[H]):u}function transformCoordinateToLngLat(e,r){return transformCoordinate(e,r,{type:2,type_name:"Geographic",epsg_code:4326,wkt:"+proj=longlat +datum=WGS84"})}function transformLnglat(e,r){return transformCoordinate(e,{type:2,type_name:"Geographic",epsg_code:4326,wkt:"+proj=longlat +datum=WGS84"},r)}function geographicToCartesian(e){return proj4("+proj=longlat +datum=WGS84","+proj=geocent +datum=WGS84",e)}const transform=Object.freeze(Object.defineProperty({__proto__:null,getWKTString,project,getTileCoord,getTilePixelCoord,getUTMProjection,transformCoordinate,transformCoordinateToLngLat,transformLnglat,geographicToCartesian},Symbol.toStringTag,{value:"Module"})),types$1=["point","line","polygon","volume"];function generateId(){return v4()}function formatDate(e){return e?hooks(e).format("YYYY-MM-DD HH:mm:ss"):"-"}function formatLocalDate(){return hooks().format("YYYY/M/D HH:mm:ss")}function formatFileSize(e){e=parseInt(e);let r=Math.floor(Math.log(e)/Math.log(1024)),s=["B","KB","MB","GB","TB","PB"];return _$1.round(e/Math.pow(1024,r),2)+s[r]}function getGeoCoordOperator(e){return e==="N"||e==="E"?1:-1}function toRadian(e){return e[0]+e[1]/60+e[2]/3600}function diffLayers(e,r=[]){e=_formatTree(e),r=_formatTree(r);let s=[];for(let u of e){let{visible:m}=u;for(let H of u.items||[]){let{id:x,type:o,opacity:F,visible:Re}=H;if(m||(Re=!1),types$1.some(nt=>nt===o)&&s.find(nt=>nt[0]==="updateAnnotations"))continue;let He=findNodeInTree(x,r);if(!He&&!Re)continue;if(!He){types$1.some(nt=>nt===o)?s.push(["updateAnnotations",H]):s.push(["addLayer",H]);continue}let{opacity:Ue,visible:Fe}=He;_$1.isEqual(H,He)||(types$1.some(nt=>nt===o)?s.push(["updateAnnotations",H]):F!==Ue||!_$1.isEqual(H.metadata,He.metadata)?s.push(["updateLayer",H]):Re!==Fe&&s.push([Re?"addLayer":"removeLayer",H]))}}for(let u of r)for(let m of u.items||[]){let{id:H,type:x}=m;findNodeInTree(H,e)||(types$1.some(F=>F===x)?s.find(F=>F[0]==="updateAnnotations")||s.push(["updateAnnotations",m]):s.push(["removeLayer",m]))}return s}function findNodeInTree(e,r){for(let s of r){if(s.id===e)return s;if(s.items?.length){let u=findNodeInTree(e,s.items);if(u)return u}}return null}function _formatTree(e){let r=_$1.cloneDeep(e);for(let s of r){let u=[];for(let m of s.items||[])if(s.visible||(m.visible=!1),m.items?.length)for(let H of m.items)(!H.visible||!m.metadata?.visible||!s.visible)&&(H.visible=!1),u.push(H);else m.type!=="catalog"&&u.push(m);s.items=u}return r}function getBeforeId(e,r){let s=e.style._layers,u=e.style.order,{layerType:m}=r.metadata;return u.find(o=>{let F=s[o].metadata;return _$1.isEmpty(F)&&(F={layerType:"dsm"}),x(m,r.id)<x(F.layerType,o)})||"";function x(o,F){const Re=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let He=-1;return F.startsWith("gl-draw")?He=5:He=Re.findIndex(Ue=>Ue.includes(o)),He===-1?100:He}}function isTokenExpired(e){if(!e)return!1;let{message:r="",msg:s=""}=e.data;return e.status==401&&(s.toLowerCase().includes("expired")||r.toLowerCase().includes("expired"))}function getDataType$2(e){for(let r in cameras)if(cameras[r].includes(e))return r;return"normal"}function downloadImage(e){let r=`${i18n.t("util.snapshot")}${hooks().format("YYYYMMDD")}${new Date().getTime()}.png`,s=document.createElement("a");s.href=e,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s)}function getGeometryType(e){let r=e.properties?.type;if(r)return r;let s=getType$1(e);return["Point","MultiPoint"].includes(s)?"point":["LineString","MultiLineString"].includes(s)?"line":"polygon"}function rgbaToFloat(e){let r=e[3]>128?0:1,s=-1*(1-r)+r,u=Math.floor((e[3]+.1)%128)*2+Math.floor((e[2]+.1)/128)-127,m=e[0]+e[1]*256+Math.floor((e[2]+.1)%128)*256*256;return s*(1+m/8388607)*Math.pow(2,u)}function getAnnotationFeature(e){let{geometry:r}=e,s=_$1.cloneDeep(e);return delete s.geometry,{id:s.id,type:"Feature",properties:s,geometry:_$1.cloneDeep(r)}}function getAnnotationName(e,r){let s=[];const u=i18n.t(`annotation.${r}`);e.forEach(m=>{if(m.name===u){s.push(0);return}if(m.name.startsWith(`${u} `)){let H=Number(m.name.split(" ").pop());Number.isNaN(H)||s.push(H)}}),s=s.sort((m,H)=>m-H);for(let m=0;m<s.length;m++)if(s[m]!==m)return m===0?u:`${u} ${m}`;return s.length===0?u:`${u} ${s.length}`}function getLineLabelFeature(e){let r=e.geometry.coordinates,s=[];for(let F=1;F<r.length;F++)distance(r[F-1],r[F],{units:"meters"})>30&&s.push([r[F-1],r[F]]);let u=[];if(s.length){let F=Math.floor(s.length/2);u=s[F]}else{let F=Math.floor(r.length/2-1);u=[r[F],r[F+1]]}let m=project(u[0]),H=project(u[1]),x=360-Math.atan((m.y-H.y)/(H.x-m.x))*180/Math.PI,o=midpoint(u[0],u[1]);return o.properties=e.properties,o.properties.angle=x,o.geometry.coordinates.push(((u[0][2]||0)+(u[1][2]||0))/2),o}function addIcons2Map(e,r){return new Promise((s,u)=>{let m=r.length;r.forEach(({url:H,sdf:x})=>{e.loadImage(H,(o,F)=>{m--;let Re=H.split("/").pop().split(".")[0];if(!e.hasImage(Re)){if(o){u(o);return}e.addImage(Re,F,{sdf:x}),m<=0&&s(!0)}})})})}function getTaskTreeList(e,r,s,u){let m=_$1.cloneDeep(e.metadata?.groups||layerGroups$1);if(m.forEach(x=>x.items=[]),u?.length){let x=new Map,o=new Map;r.forEach(Re=>x.set(Re.id,Re)),u.sort((Re,He)=>Re.metadata.index-He.metadata.index),u.forEach(Re=>{let He=Re.type==="catalog",Ue;if(He?Ue={id:Re.catalog_id,name:Re.name,type:"catalog",metadata:Re.metadata,items:[]}:Ue=x.get(Re.res_id),Ue&&(o.set(Re.catalog_id,Ue),Re.parent_id&&o.has(Re.parent_id))){let Fe=o.get(Re.parent_id);Ue.parent_id=Re.parent_id,Fe.items.push(Ue),o.set(Re.parent_id,Fe),o.delete(Re.catalog_id)}});let F=m.find(Re=>Re.id==="annotation");for(let Re of o.entries())F.items.push(Re[1])}else r.forEach(x=>{let o=_$1.cloneDeep(x);o.group||o.group,m.find(Re=>Re.id===o.group).items.push(o)});return(e.status==="complete"?s:[]).forEach(x=>{let{group:o}=x,F=m.find(Re=>Re.id===o);!F||F.items.push(x)}),m}function hasNaN(e){for(let r=0;r<e.length;r++)if(Number.isNaN(e[r]))return!0;return!1}function flatObject(e){let r={};for(let s in e)s.startsWith("xmlns")||Array.isArray(e[s])||(typeof e[s]=="object"?Object.assign(r,flatObject(e[s])):r[s]=e[s]);return r}function getRotationMatrix(e,r,s){let u=[],m=fromValues$2(0,1,0,0,1,0,0,0,0,0,-1,0,0,0,0,1),H=fromValues$2(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),x=fromZRotation(create$3(),s*Math.PI/180),o=fromYRotation(create$3(),e*Math.PI/180),F=fromXRotation(create$3(),r*Math.PI/180),Re=multiply$1(create$3(),multiply$1(create$3(),x,o),F),He=multiply$1(create$3(),multiply$1(create$3(),H,transpose$1(create$3(),Re)),m);for(let Ue=0;Ue<3;Ue++)for(let Fe=0;Fe<3;Fe++)u[Ue*3+Fe]=He[Ue+Fe*4];return u}function transformRoi(e,r){let{boundary:s,min_z:u,max_z:m}=e,{type:H,origin_point:x}=r;if(H===0){let o=[];return s.forEach(F=>{let Re=transformCoordinateToLngLat([...F,0],r);o.push(Re)}),u+=x[2],m+=x[2],{boundary:o,min_z:u,max_z:m}}return e}function getPosSigma(e){return e==="high"?[.03,.03,.06]:e==="low"?[2,2,5]:[.5,.5,1]}function photoPos2Geojson(e){let r=[],s=e.find(H=>H.meta_data.pos);if(s){let H=_$1.cloneDeep(s.meta_data.coordinate_system);e.forEach(x=>{let{meta_data:o={}}=x,{pos:F}=o,Re=transformCoordinateToLngLat(F,H);if(!Re)return;let He=_$1.cloneDeep(x);He.type="photo",r.push(point(Re,He))})}let u=featureCollection(r),m=null;return r.length&&(m=bbox(u)),{geojson:u,bbox:m}}function getDistance(e,r){return Math.sqrt((e[0]-r[0])*(e[0]-r[0])+(e[1]-r[1])*(e[1]-r[1]))}function getMaxValue(e,r){let s=-1/0;return e.forEach(u=>{s=Math.max(u[r],s)}),s}function getAverageValue(e,r){let s=0;return e.forEach(u=>{s+=u[r]}),s/e.length}function getAppVersion(e){let{appVersion:r,environment:s}=e.metadata;return r||(s?`${s.platform}(${s.appVersion})`:i18n.t("util.none"))}function getResolutionLevelByQuality(e){switch(e){case"low":return 3;case"high":return 1;case"medium":default:return 2}}function getQualityAliasByLevel(e){let r=i18n.t("util.high");return e===1?r=i18n.t("util.ultra_high"):e===3&&(r=i18n.t("util.medium")),r}function getImageTypeByDataType(e){switch(e){case"normal":return 1;case"multispectral":return 2;case"infrared":default:return 3}}function getDataTypeAliasByImageType(e){return e==="infrared"?i18n.t("util.thermal_infrared"):e==="multispectral"?i18n.t("util.multispectral"):i18n.t("util.visible_light")}function getTaskStatusAlias(e){return e==="complete"?i18n.t("util.modeling_completed"):e==="error"?i18n.t("util.modeling_error"):e==="none"?i18n.t("util.not_started"):e==="waiting"?i18n.t("util.in_queue"):e==="aerotriangulation"?i18n.t("util.aerial_triangulation_completed"):e.startsWith("processing")?i18n.t("util.processing"):e==="stop"?i18n.t("util.task_terminated"):i18n.t("util.unknown_status")}function include3d(e=[]){return!!(e.length&&e.includes("mesh3d"))}function extend$1(e,...r){for(const s of r)for(const u in s)e[u]=s[u];return e}function endsWith(e,r){return e.indexOf(r,e.length-r.length)!==-1}function convertLength(e,r){return r==="m"?e:r==="ft"?e*3.28084:e}function convertArea(e,r){return r==="m2"?e:r==="km2"?e/1e6:r==="mu"?e/666.6667:r==="hm2"?e/1e4:e}function convertVolume(e,r){return r==="m3"?e:r==="yd3"?e*1.30795062:r==="ft3"?e*35.3146667:r==="usft3"?e*35.3147248:e}let clickPoint=null;function _addEventListener(e,r,s){s[e]=s[e]||[],s[e].push(r)}function _removeEventListener(e,r,s){if(s&&s[e]){if(!r){delete s[e];return}const u=s[e].indexOf(r);u!==-1&&s[e].splice(u,1)}}class Event$1{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(r,s){return this._listeners=this._listeners||{},_addEventListener(r,s,this._listeners),this}off(r,s){return _removeEventListener(r,s,this._listeners),_removeEventListener(r,s,this._oneTimeListeners),this}once(r,s){return this._oneTimeListeners=this._oneTimeListeners||{},_addEventListener(r,s,this._oneTimeListeners),this}fire(r,s){if(this.listens(r)){if(s=extend$1({},s,{type:r,target:this}),clickPoint){if(s.point&&clickPoint===s.point.x+s.point.y){if(clickPoint===s.point.x+s.point.y)return;clickPoint=s.point.x+s.point.y}else if(s.feature){if(clickPoint===s.x+s.y)return;clickPoint=s.x+s.y}}else s.point?clickPoint=s.point.x+s.point.y:s.feature&&(clickPoint=s.x+s.y);const u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let H=0;H<u.length;H++)u[H].call(this,s);const m=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let H=0;H<m.length;H++)m[H].call(this,s),_removeEventListener(r,m[H],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(r,extend$1({},s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else endsWith(r,"error")&&console.error(s&&s.error||s||"Empty error event");return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,s){return this._eventedParent=r,this._eventedParentData=s,this}}const emitter=new Event$1,defaultOptions={tileFormat:"float32",tileSize:256,colorScale:[],sentinelValues:[],transitions:!1,transitionTimeMs:800,debug:!1,extraPixelLayers:0,colorscaleMaxLength:16,sentinelMaxLength:16,minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,glOperation:"none",multiLayers:0,operationUrlA:"",operationUrlB:"",operationUrlC:"",operationUrlD:"",operationUrlE:"",operationUrlF:"",filterLowA:0,filterHighA:1e5,filterLowB:0,filterHighB:1e5,filterLowC:0,filterHighC:1e5,filterLowD:0,filterHighD:1e5,filterLowE:0,filterHighE:1e5,filterLowF:0,filterHighF:1e5,multiplierA:1,multiplierB:1,multiplierC:1,multiplierD:1,multiplierE:1,multiplierF:1,hillshadeType:"none",hsSimpleZoomdelta:0,hsSimpleSlopescale:3,hsSimpleAzimuth:315,hsSimpleAltitude:70,hsAdvValueScale:1,hsAdvPixelScale:"auto",hsAdvSoftIterations:10,hsAdvAmbientIterations:10,hsAdvSunRadiusMultiplier:100,hsAdvFinalSoftMultiplier:1,hsAdvFinalAmbientMultiplier:.25,hsAdvBaselayerUrl:"",hsAdvSmoothInput:!1,hsAdvSmoothInputKernel:3,hsPregenUrl:"",_hillshadeOptions:{hillshadeType:"none"},contourType:"none",contourSmoothLines:!1,contourSmoothInput:!1,contourSmoothInputKernel:7,contourScaleFactor:1,contourInterval:25,contourIndexInterval:100,contourLineColor:"#000000",contourIlluminatedHighlightColor:"rgba(177,174,164,.5)",contourIlluminatedShadowColor:"#5b5143",contourIlluminatedShadowSize:2,contourLineWeight:.5,contourLineIndexWeight:2,contourIndexLabels:!1,contourLabelFont:"12px Arial",contourLabelDistance:250,contourHypso:!1,contourHypsoDomain:[0,1e3,2e3],contourHypsoColors:["#486341","#e5d9c9","#dddddd"],contourBathy:!1,contourBathyDomain:[-2e3,0],contourBathyColors:["#315d9b","#d5f2ff"],contourBathyShadowColor:"#4e5c66",contourBathyHighlightColor:"rgba(224, 242, 255, .5)"};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var UPNG={exports:{}},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,function(e){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function s(H,x){return Object.prototype.hasOwnProperty.call(H,x)}e.assign=function(H){for(var x=Array.prototype.slice.call(arguments,1);x.length;){var o=x.shift();if(!!o){if(typeof o!="object")throw new TypeError(o+"must be non-object");for(var F in o)s(o,F)&&(H[F]=o[F])}}return H},e.shrinkBuf=function(H,x){return H.length===x?H:H.subarray?H.subarray(0,x):(H.length=x,H)};var u={arraySet:function(H,x,o,F,Re){if(x.subarray&&H.subarray){H.set(x.subarray(o,o+F),Re);return}for(var He=0;He<F;He++)H[Re+He]=x[o+He]},flattenChunks:function(H){var x,o,F,Re,He,Ue;for(F=0,x=0,o=H.length;x<o;x++)F+=H[x].length;for(Ue=new Uint8Array(F),Re=0,x=0,o=H.length;x<o;x++)He=H[x],Ue.set(He,Re),Re+=He.length;return Ue}},m={arraySet:function(H,x,o,F,Re){for(var He=0;He<F;He++)H[Re+He]=x[o+He]},flattenChunks:function(H){return[].concat.apply([],H)}};e.setTyped=function(H){H?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,u)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,m))},e.setTyped(r)}(common)),common}var deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;var e=requireCommon(),r=4,s=0,u=1,m=2;function H(Zr){for(var Wa=Zr.length;--Wa>=0;)Zr[Wa]=0}var x=0,o=1,F=2,Re=3,He=258,Ue=29,Fe=256,nt=Fe+1+Ue,Ze=30,Ve=19,er=2*nt+1,st=15,Ke=16,Ye=7,tt=256,Je=16,rr=17,Rr=18,ar=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ar=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],mr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Pr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Nr=512,Ra=new Array((nt+2)*2);H(Ra);var ta=new Array(Ze*2);H(ta);var ha=new Array(Nr);H(ha);var Ea=new Array(He-Re+1);H(Ea);var fa=new Array(Ue);H(fa);var ga=new Array(Ze);H(ga);function Ja(Zr,Wa,zn,di,wa){this.static_tree=Zr,this.extra_bits=Wa,this.extra_base=zn,this.elems=di,this.max_length=wa,this.has_stree=Zr&&Zr.length}var Ba,Pn,_n;function cn(Zr,Wa){this.dyn_tree=Zr,this.max_code=0,this.stat_desc=Wa}function ui(Zr){return Zr<256?ha[Zr]:ha[256+(Zr>>>7)]}function Vn(Zr,Wa){Zr.pending_buf[Zr.pending++]=Wa&255,Zr.pending_buf[Zr.pending++]=Wa>>>8&255}function fn(Zr,Wa,zn){Zr.bi_valid>Ke-zn?(Zr.bi_buf|=Wa<<Zr.bi_valid&65535,Vn(Zr,Zr.bi_buf),Zr.bi_buf=Wa>>Ke-Zr.bi_valid,Zr.bi_valid+=zn-Ke):(Zr.bi_buf|=Wa<<Zr.bi_valid&65535,Zr.bi_valid+=zn)}function kn(Zr,Wa,zn){fn(Zr,zn[Wa*2],zn[Wa*2+1])}function Ln(Zr,Wa){var zn=0;do zn|=Zr&1,Zr>>>=1,zn<<=1;while(--Wa>0);return zn>>>1}function On(Zr){Zr.bi_valid===16?(Vn(Zr,Zr.bi_buf),Zr.bi_buf=0,Zr.bi_valid=0):Zr.bi_valid>=8&&(Zr.pending_buf[Zr.pending++]=Zr.bi_buf&255,Zr.bi_buf>>=8,Zr.bi_valid-=8)}function Ci(Zr,Wa){var zn=Wa.dyn_tree,di=Wa.max_code,wa=Wa.stat_desc.static_tree,gn=Wa.stat_desc.has_stree,Qr=Wa.stat_desc.extra_bits,Cn=Wa.stat_desc.extra_base,Ao=Wa.stat_desc.max_length,hr,hn,bn,Aa,La,Ma,lo=0;for(Aa=0;Aa<=st;Aa++)Zr.bl_count[Aa]=0;for(zn[Zr.heap[Zr.heap_max]*2+1]=0,hr=Zr.heap_max+1;hr<er;hr++)hn=Zr.heap[hr],Aa=zn[zn[hn*2+1]*2+1]+1,Aa>Ao&&(Aa=Ao,lo++),zn[hn*2+1]=Aa,!(hn>di)&&(Zr.bl_count[Aa]++,La=0,hn>=Cn&&(La=Qr[hn-Cn]),Ma=zn[hn*2],Zr.opt_len+=Ma*(Aa+La),gn&&(Zr.static_len+=Ma*(wa[hn*2+1]+La)));if(lo!==0){do{for(Aa=Ao-1;Zr.bl_count[Aa]===0;)Aa--;Zr.bl_count[Aa]--,Zr.bl_count[Aa+1]+=2,Zr.bl_count[Ao]--,lo-=2}while(lo>0);for(Aa=Ao;Aa!==0;Aa--)for(hn=Zr.bl_count[Aa];hn!==0;)bn=Zr.heap[--hr],!(bn>di)&&(zn[bn*2+1]!==Aa&&(Zr.opt_len+=(Aa-zn[bn*2+1])*zn[bn*2],zn[bn*2+1]=Aa),hn--)}}function So(Zr,Wa,zn){var di=new Array(st+1),wa=0,gn,Qr;for(gn=1;gn<=st;gn++)di[gn]=wa=wa+zn[gn-1]<<1;for(Qr=0;Qr<=Wa;Qr++){var Cn=Zr[Qr*2+1];Cn!==0&&(Zr[Qr*2]=Ln(di[Cn]++,Cn))}}function ii(){var Zr,Wa,zn,di,wa,gn=new Array(st+1);for(zn=0,di=0;di<Ue-1;di++)for(fa[di]=zn,Zr=0;Zr<1<<ar[di];Zr++)Ea[zn++]=di;for(Ea[zn-1]=di,wa=0,di=0;di<16;di++)for(ga[di]=wa,Zr=0;Zr<1<<Ar[di];Zr++)ha[wa++]=di;for(wa>>=7;di<Ze;di++)for(ga[di]=wa<<7,Zr=0;Zr<1<<Ar[di]-7;Zr++)ha[256+wa++]=di;for(Wa=0;Wa<=st;Wa++)gn[Wa]=0;for(Zr=0;Zr<=143;)Ra[Zr*2+1]=8,Zr++,gn[8]++;for(;Zr<=255;)Ra[Zr*2+1]=9,Zr++,gn[9]++;for(;Zr<=279;)Ra[Zr*2+1]=7,Zr++,gn[7]++;for(;Zr<=287;)Ra[Zr*2+1]=8,Zr++,gn[8]++;for(So(Ra,nt+1,gn),Zr=0;Zr<Ze;Zr++)ta[Zr*2+1]=5,ta[Zr*2]=Ln(Zr,5);Ba=new Ja(Ra,ar,Fe+1,nt,st),Pn=new Ja(ta,Ar,0,Ze,st),_n=new Ja(new Array(0),mr,0,Ve,Ye)}function ti(Zr){var Wa;for(Wa=0;Wa<nt;Wa++)Zr.dyn_ltree[Wa*2]=0;for(Wa=0;Wa<Ze;Wa++)Zr.dyn_dtree[Wa*2]=0;for(Wa=0;Wa<Ve;Wa++)Zr.bl_tree[Wa*2]=0;Zr.dyn_ltree[tt*2]=1,Zr.opt_len=Zr.static_len=0,Zr.last_lit=Zr.matches=0}function fi(Zr){Zr.bi_valid>8?Vn(Zr,Zr.bi_buf):Zr.bi_valid>0&&(Zr.pending_buf[Zr.pending++]=Zr.bi_buf),Zr.bi_buf=0,Zr.bi_valid=0}function Zi(Zr,Wa,zn,di){fi(Zr),di&&(Vn(Zr,zn),Vn(Zr,~zn)),e.arraySet(Zr.pending_buf,Zr.window,Wa,zn,Zr.pending),Zr.pending+=zn}function $i(Zr,Wa,zn,di){var wa=Wa*2,gn=zn*2;return Zr[wa]<Zr[gn]||Zr[wa]===Zr[gn]&&di[Wa]<=di[zn]}function _o(Zr,Wa,zn){for(var di=Zr.heap[zn],wa=zn<<1;wa<=Zr.heap_len&&(wa<Zr.heap_len&&$i(Wa,Zr.heap[wa+1],Zr.heap[wa],Zr.depth)&&wa++,!$i(Wa,di,Zr.heap[wa],Zr.depth));)Zr.heap[zn]=Zr.heap[wa],zn=wa,wa<<=1;Zr.heap[zn]=di}function Yi(Zr,Wa,zn){var di,wa,gn=0,Qr,Cn;if(Zr.last_lit!==0)do di=Zr.pending_buf[Zr.d_buf+gn*2]<<8|Zr.pending_buf[Zr.d_buf+gn*2+1],wa=Zr.pending_buf[Zr.l_buf+gn],gn++,di===0?kn(Zr,wa,Wa):(Qr=Ea[wa],kn(Zr,Qr+Fe+1,Wa),Cn=ar[Qr],Cn!==0&&(wa-=fa[Qr],fn(Zr,wa,Cn)),di--,Qr=ui(di),kn(Zr,Qr,zn),Cn=Ar[Qr],Cn!==0&&(di-=ga[Qr],fn(Zr,di,Cn)));while(gn<Zr.last_lit);kn(Zr,tt,Wa)}function ao(Zr,Wa){var zn=Wa.dyn_tree,di=Wa.stat_desc.static_tree,wa=Wa.stat_desc.has_stree,gn=Wa.stat_desc.elems,Qr,Cn,Ao=-1,hr;for(Zr.heap_len=0,Zr.heap_max=er,Qr=0;Qr<gn;Qr++)zn[Qr*2]!==0?(Zr.heap[++Zr.heap_len]=Ao=Qr,Zr.depth[Qr]=0):zn[Qr*2+1]=0;for(;Zr.heap_len<2;)hr=Zr.heap[++Zr.heap_len]=Ao<2?++Ao:0,zn[hr*2]=1,Zr.depth[hr]=0,Zr.opt_len--,wa&&(Zr.static_len-=di[hr*2+1]);for(Wa.max_code=Ao,Qr=Zr.heap_len>>1;Qr>=1;Qr--)_o(Zr,zn,Qr);hr=gn;do Qr=Zr.heap[1],Zr.heap[1]=Zr.heap[Zr.heap_len--],_o(Zr,zn,1),Cn=Zr.heap[1],Zr.heap[--Zr.heap_max]=Qr,Zr.heap[--Zr.heap_max]=Cn,zn[hr*2]=zn[Qr*2]+zn[Cn*2],Zr.depth[hr]=(Zr.depth[Qr]>=Zr.depth[Cn]?Zr.depth[Qr]:Zr.depth[Cn])+1,zn[Qr*2+1]=zn[Cn*2+1]=hr,Zr.heap[1]=hr++,_o(Zr,zn,1);while(Zr.heap_len>=2);Zr.heap[--Zr.heap_max]=Zr.heap[1],Ci(Zr,Wa),So(zn,Ao,Zr.bl_count)}function Co(Zr,Wa,zn){var di,wa=-1,gn,Qr=Wa[0*2+1],Cn=0,Ao=7,hr=4;for(Qr===0&&(Ao=138,hr=3),Wa[(zn+1)*2+1]=65535,di=0;di<=zn;di++)gn=Qr,Qr=Wa[(di+1)*2+1],!(++Cn<Ao&&gn===Qr)&&(Cn<hr?Zr.bl_tree[gn*2]+=Cn:gn!==0?(gn!==wa&&Zr.bl_tree[gn*2]++,Zr.bl_tree[Je*2]++):Cn<=10?Zr.bl_tree[rr*2]++:Zr.bl_tree[Rr*2]++,Cn=0,wa=gn,Qr===0?(Ao=138,hr=3):gn===Qr?(Ao=6,hr=3):(Ao=7,hr=4))}function yo(Zr,Wa,zn){var di,wa=-1,gn,Qr=Wa[0*2+1],Cn=0,Ao=7,hr=4;for(Qr===0&&(Ao=138,hr=3),di=0;di<=zn;di++)if(gn=Qr,Qr=Wa[(di+1)*2+1],!(++Cn<Ao&&gn===Qr)){if(Cn<hr)do kn(Zr,gn,Zr.bl_tree);while(--Cn!==0);else gn!==0?(gn!==wa&&(kn(Zr,gn,Zr.bl_tree),Cn--),kn(Zr,Je,Zr.bl_tree),fn(Zr,Cn-3,2)):Cn<=10?(kn(Zr,rr,Zr.bl_tree),fn(Zr,Cn-3,3)):(kn(Zr,Rr,Zr.bl_tree),fn(Zr,Cn-11,7));Cn=0,wa=gn,Qr===0?(Ao=138,hr=3):gn===Qr?(Ao=6,hr=3):(Ao=7,hr=4)}}function Jo(Zr){var Wa;for(Co(Zr,Zr.dyn_ltree,Zr.l_desc.max_code),Co(Zr,Zr.dyn_dtree,Zr.d_desc.max_code),ao(Zr,Zr.bl_desc),Wa=Ve-1;Wa>=3&&Zr.bl_tree[Pr[Wa]*2+1]===0;Wa--);return Zr.opt_len+=3*(Wa+1)+5+5+4,Wa}function fr(Zr,Wa,zn,di){var wa;for(fn(Zr,Wa-257,5),fn(Zr,zn-1,5),fn(Zr,di-4,4),wa=0;wa<di;wa++)fn(Zr,Zr.bl_tree[Pr[wa]*2+1],3);yo(Zr,Zr.dyn_ltree,Wa-1),yo(Zr,Zr.dyn_dtree,zn-1)}function Xa(Zr){var Wa=4093624447,zn;for(zn=0;zn<=31;zn++,Wa>>>=1)if(Wa&1&&Zr.dyn_ltree[zn*2]!==0)return s;if(Zr.dyn_ltree[9*2]!==0||Zr.dyn_ltree[10*2]!==0||Zr.dyn_ltree[13*2]!==0)return u;for(zn=32;zn<Fe;zn++)if(Zr.dyn_ltree[zn*2]!==0)return u;return s}var tn=!1;function mn(Zr){tn||(ii(),tn=!0),Zr.l_desc=new cn(Zr.dyn_ltree,Ba),Zr.d_desc=new cn(Zr.dyn_dtree,Pn),Zr.bl_desc=new cn(Zr.bl_tree,_n),Zr.bi_buf=0,Zr.bi_valid=0,ti(Zr)}function Mn(Zr,Wa,zn,di){fn(Zr,(x<<1)+(di?1:0),3),Zi(Zr,Wa,zn,!0)}function un(Zr){fn(Zr,o<<1,3),kn(Zr,tt,Ra),On(Zr)}function vi(Zr,Wa,zn,di){var wa,gn,Qr=0;Zr.level>0?(Zr.strm.data_type===m&&(Zr.strm.data_type=Xa(Zr)),ao(Zr,Zr.l_desc),ao(Zr,Zr.d_desc),Qr=Jo(Zr),wa=Zr.opt_len+3+7>>>3,gn=Zr.static_len+3+7>>>3,gn<=wa&&(wa=gn)):wa=gn=zn+5,zn+4<=wa&&Wa!==-1?Mn(Zr,Wa,zn,di):Zr.strategy===r||gn===wa?(fn(Zr,(o<<1)+(di?1:0),3),Yi(Zr,Ra,ta)):(fn(Zr,(F<<1)+(di?1:0),3),fr(Zr,Zr.l_desc.max_code+1,Zr.d_desc.max_code+1,Qr+1),Yi(Zr,Zr.dyn_ltree,Zr.dyn_dtree)),ti(Zr),di&&fi(Zr)}function ci(Zr,Wa,zn){return Zr.pending_buf[Zr.d_buf+Zr.last_lit*2]=Wa>>>8&255,Zr.pending_buf[Zr.d_buf+Zr.last_lit*2+1]=Wa&255,Zr.pending_buf[Zr.l_buf+Zr.last_lit]=zn&255,Zr.last_lit++,Wa===0?Zr.dyn_ltree[zn*2]++:(Zr.matches++,Wa--,Zr.dyn_ltree[(Ea[zn]+Fe+1)*2]++,Zr.dyn_dtree[ui(Wa)*2]++),Zr.last_lit===Zr.lit_bufsize-1}return trees._tr_init=mn,trees._tr_stored_block=Mn,trees._tr_flush_block=vi,trees._tr_tally=ci,trees._tr_align=un,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){if(hasRequiredAdler32)return adler32_1;hasRequiredAdler32=1;function e(r,s,u,m){for(var H=r&65535|0,x=r>>>16&65535|0,o=0;u!==0;){o=u>2e3?2e3:u,u-=o;do H=H+s[m++]|0,x=x+H|0;while(--o);H%=65521,x%=65521}return H|x<<16|0}return adler32_1=e,adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;function e(){for(var u,m=[],H=0;H<256;H++){u=H;for(var x=0;x<8;x++)u=u&1?3988292384^u>>>1:u>>>1;m[H]=u}return m}var r=e();function s(u,m,H,x){var o=r,F=x+H;u^=-1;for(var Re=x;Re<F;Re++)u=u>>>8^o[(u^m[Re])&255];return u^-1}return crc32_1=s,crc32_1}var messages,hasRequiredMessages;function requireMessages(){return hasRequiredMessages||(hasRequiredMessages=1,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),messages}var hasRequiredDeflate$1;function requireDeflate$1(){if(hasRequiredDeflate$1)return deflate;hasRequiredDeflate$1=1;var e=requireCommon(),r=requireTrees(),s=requireAdler32(),u=requireCrc32(),m=requireMessages(),H=0,x=1,o=3,F=4,Re=5,He=0,Ue=1,Fe=-2,nt=-3,Ze=-5,Ve=-1,er=1,st=2,Ke=3,Ye=4,tt=0,Je=2,rr=8,Rr=9,ar=15,Ar=8,mr=29,Pr=256,Nr=Pr+1+mr,Ra=30,ta=19,ha=2*Nr+1,Ea=15,fa=3,ga=258,Ja=ga+fa+1,Ba=32,Pn=42,_n=69,cn=73,ui=91,Vn=103,fn=113,kn=666,Ln=1,On=2,Ci=3,So=4,ii=3;function ti(hr,hn){return hr.msg=m[hn],hn}function fi(hr){return(hr<<1)-(hr>4?9:0)}function Zi(hr){for(var hn=hr.length;--hn>=0;)hr[hn]=0}function $i(hr){var hn=hr.state,bn=hn.pending;bn>hr.avail_out&&(bn=hr.avail_out),bn!==0&&(e.arraySet(hr.output,hn.pending_buf,hn.pending_out,bn,hr.next_out),hr.next_out+=bn,hn.pending_out+=bn,hr.total_out+=bn,hr.avail_out-=bn,hn.pending-=bn,hn.pending===0&&(hn.pending_out=0))}function _o(hr,hn){r._tr_flush_block(hr,hr.block_start>=0?hr.block_start:-1,hr.strstart-hr.block_start,hn),hr.block_start=hr.strstart,$i(hr.strm)}function Yi(hr,hn){hr.pending_buf[hr.pending++]=hn}function ao(hr,hn){hr.pending_buf[hr.pending++]=hn>>>8&255,hr.pending_buf[hr.pending++]=hn&255}function Co(hr,hn,bn,Aa){var La=hr.avail_in;return La>Aa&&(La=Aa),La===0?0:(hr.avail_in-=La,e.arraySet(hn,hr.input,hr.next_in,La,bn),hr.state.wrap===1?hr.adler=s(hr.adler,hn,La,bn):hr.state.wrap===2&&(hr.adler=u(hr.adler,hn,La,bn)),hr.next_in+=La,hr.total_in+=La,La)}function yo(hr,hn){var bn=hr.max_chain_length,Aa=hr.strstart,La,Ma,lo=hr.prev_length,Xi=hr.nice_match,no=hr.strstart>hr.w_size-Ja?hr.strstart-(hr.w_size-Ja):0,ji=hr.window,xa=hr.w_mask,dr=hr.prev,Cr=hr.strstart+ga,Vr=ji[Aa+lo-1],Pa=ji[Aa+lo];hr.prev_length>=hr.good_match&&(bn>>=2),Xi>hr.lookahead&&(Xi=hr.lookahead);do if(La=hn,!(ji[La+lo]!==Pa||ji[La+lo-1]!==Vr||ji[La]!==ji[Aa]||ji[++La]!==ji[Aa+1])){Aa+=2,La++;do;while(ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&ji[++Aa]===ji[++La]&&Aa<Cr);if(Ma=ga-(Cr-Aa),Aa=Cr-ga,Ma>lo){if(hr.match_start=hn,lo=Ma,Ma>=Xi)break;Vr=ji[Aa+lo-1],Pa=ji[Aa+lo]}}while((hn=dr[hn&xa])>no&&--bn!==0);return lo<=hr.lookahead?lo:hr.lookahead}function Jo(hr){var hn=hr.w_size,bn,Aa,La,Ma,lo;do{if(Ma=hr.window_size-hr.lookahead-hr.strstart,hr.strstart>=hn+(hn-Ja)){e.arraySet(hr.window,hr.window,hn,hn,0),hr.match_start-=hn,hr.strstart-=hn,hr.block_start-=hn,Aa=hr.hash_size,bn=Aa;do La=hr.head[--bn],hr.head[bn]=La>=hn?La-hn:0;while(--Aa);Aa=hn,bn=Aa;do La=hr.prev[--bn],hr.prev[bn]=La>=hn?La-hn:0;while(--Aa);Ma+=hn}if(hr.strm.avail_in===0)break;if(Aa=Co(hr.strm,hr.window,hr.strstart+hr.lookahead,Ma),hr.lookahead+=Aa,hr.lookahead+hr.insert>=fa)for(lo=hr.strstart-hr.insert,hr.ins_h=hr.window[lo],hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[lo+1])&hr.hash_mask;hr.insert&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[lo+fa-1])&hr.hash_mask,hr.prev[lo&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=lo,lo++,hr.insert--,!(hr.lookahead+hr.insert<fa)););}while(hr.lookahead<Ja&&hr.strm.avail_in!==0)}function fr(hr,hn){var bn=65535;for(bn>hr.pending_buf_size-5&&(bn=hr.pending_buf_size-5);;){if(hr.lookahead<=1){if(Jo(hr),hr.lookahead===0&&hn===H)return Ln;if(hr.lookahead===0)break}hr.strstart+=hr.lookahead,hr.lookahead=0;var Aa=hr.block_start+bn;if((hr.strstart===0||hr.strstart>=Aa)&&(hr.lookahead=hr.strstart-Aa,hr.strstart=Aa,_o(hr,!1),hr.strm.avail_out===0)||hr.strstart-hr.block_start>=hr.w_size-Ja&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):(hr.strstart>hr.block_start&&(_o(hr,!1),hr.strm.avail_out===0),Ln)}function Xa(hr,hn){for(var bn,Aa;;){if(hr.lookahead<Ja){if(Jo(hr),hr.lookahead<Ja&&hn===H)return Ln;if(hr.lookahead===0)break}if(bn=0,hr.lookahead>=fa&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart),bn!==0&&hr.strstart-bn<=hr.w_size-Ja&&(hr.match_length=yo(hr,bn)),hr.match_length>=fa)if(Aa=r._tr_tally(hr,hr.strstart-hr.match_start,hr.match_length-fa),hr.lookahead-=hr.match_length,hr.match_length<=hr.max_lazy_match&&hr.lookahead>=fa){hr.match_length--;do hr.strstart++,hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart;while(--hr.match_length!==0);hr.strstart++}else hr.strstart+=hr.match_length,hr.match_length=0,hr.ins_h=hr.window[hr.strstart],hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+1])&hr.hash_mask;else Aa=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++;if(Aa&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=hr.strstart<fa-1?hr.strstart:fa-1,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function tn(hr,hn){for(var bn,Aa,La;;){if(hr.lookahead<Ja){if(Jo(hr),hr.lookahead<Ja&&hn===H)return Ln;if(hr.lookahead===0)break}if(bn=0,hr.lookahead>=fa&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart),hr.prev_length=hr.match_length,hr.prev_match=hr.match_start,hr.match_length=fa-1,bn!==0&&hr.prev_length<hr.max_lazy_match&&hr.strstart-bn<=hr.w_size-Ja&&(hr.match_length=yo(hr,bn),hr.match_length<=5&&(hr.strategy===er||hr.match_length===fa&&hr.strstart-hr.match_start>4096)&&(hr.match_length=fa-1)),hr.prev_length>=fa&&hr.match_length<=hr.prev_length){La=hr.strstart+hr.lookahead-fa,Aa=r._tr_tally(hr,hr.strstart-1-hr.prev_match,hr.prev_length-fa),hr.lookahead-=hr.prev_length-1,hr.prev_length-=2;do++hr.strstart<=La&&(hr.ins_h=(hr.ins_h<<hr.hash_shift^hr.window[hr.strstart+fa-1])&hr.hash_mask,bn=hr.prev[hr.strstart&hr.w_mask]=hr.head[hr.ins_h],hr.head[hr.ins_h]=hr.strstart);while(--hr.prev_length!==0);if(hr.match_available=0,hr.match_length=fa-1,hr.strstart++,Aa&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}else if(hr.match_available){if(Aa=r._tr_tally(hr,0,hr.window[hr.strstart-1]),Aa&&_o(hr,!1),hr.strstart++,hr.lookahead--,hr.strm.avail_out===0)return Ln}else hr.match_available=1,hr.strstart++,hr.lookahead--}return hr.match_available&&(Aa=r._tr_tally(hr,0,hr.window[hr.strstart-1]),hr.match_available=0),hr.insert=hr.strstart<fa-1?hr.strstart:fa-1,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function mn(hr,hn){for(var bn,Aa,La,Ma,lo=hr.window;;){if(hr.lookahead<=ga){if(Jo(hr),hr.lookahead<=ga&&hn===H)return Ln;if(hr.lookahead===0)break}if(hr.match_length=0,hr.lookahead>=fa&&hr.strstart>0&&(La=hr.strstart-1,Aa=lo[La],Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La])){Ma=hr.strstart+ga;do;while(Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&Aa===lo[++La]&&La<Ma);hr.match_length=ga-(Ma-La),hr.match_length>hr.lookahead&&(hr.match_length=hr.lookahead)}if(hr.match_length>=fa?(bn=r._tr_tally(hr,1,hr.match_length-fa),hr.lookahead-=hr.match_length,hr.strstart+=hr.match_length,hr.match_length=0):(bn=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++),bn&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function Mn(hr,hn){for(var bn;;){if(hr.lookahead===0&&(Jo(hr),hr.lookahead===0)){if(hn===H)return Ln;break}if(hr.match_length=0,bn=r._tr_tally(hr,0,hr.window[hr.strstart]),hr.lookahead--,hr.strstart++,bn&&(_o(hr,!1),hr.strm.avail_out===0))return Ln}return hr.insert=0,hn===F?(_o(hr,!0),hr.strm.avail_out===0?Ci:So):hr.last_lit&&(_o(hr,!1),hr.strm.avail_out===0)?Ln:On}function un(hr,hn,bn,Aa,La){this.good_length=hr,this.max_lazy=hn,this.nice_length=bn,this.max_chain=Aa,this.func=La}var vi;vi=[new un(0,0,0,0,fr),new un(4,4,8,4,Xa),new un(4,5,16,8,Xa),new un(4,6,32,32,Xa),new un(4,4,16,16,tn),new un(8,16,32,32,tn),new un(8,16,128,128,tn),new un(8,32,128,256,tn),new un(32,128,258,1024,tn),new un(32,258,258,4096,tn)];function ci(hr){hr.window_size=2*hr.w_size,Zi(hr.head),hr.max_lazy_match=vi[hr.level].max_lazy,hr.good_match=vi[hr.level].good_length,hr.nice_match=vi[hr.level].nice_length,hr.max_chain_length=vi[hr.level].max_chain,hr.strstart=0,hr.block_start=0,hr.lookahead=0,hr.insert=0,hr.match_length=hr.prev_length=fa-1,hr.match_available=0,hr.ins_h=0}function Zr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(ha*2),this.dyn_dtree=new e.Buf16((2*Ra+1)*2),this.bl_tree=new e.Buf16((2*ta+1)*2),Zi(this.dyn_ltree),Zi(this.dyn_dtree),Zi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(Ea+1),this.heap=new e.Buf16(2*Nr+1),Zi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*Nr+1),Zi(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Wa(hr){var hn;return!hr||!hr.state?ti(hr,Fe):(hr.total_in=hr.total_out=0,hr.data_type=Je,hn=hr.state,hn.pending=0,hn.pending_out=0,hn.wrap<0&&(hn.wrap=-hn.wrap),hn.status=hn.wrap?Pn:fn,hr.adler=hn.wrap===2?0:1,hn.last_flush=H,r._tr_init(hn),He)}function zn(hr){var hn=Wa(hr);return hn===He&&ci(hr.state),hn}function di(hr,hn){return!hr||!hr.state||hr.state.wrap!==2?Fe:(hr.state.gzhead=hn,He)}function wa(hr,hn,bn,Aa,La,Ma){if(!hr)return Fe;var lo=1;if(hn===Ve&&(hn=6),Aa<0?(lo=0,Aa=-Aa):Aa>15&&(lo=2,Aa-=16),La<1||La>Rr||bn!==rr||Aa<8||Aa>15||hn<0||hn>9||Ma<0||Ma>Ye)return ti(hr,Fe);Aa===8&&(Aa=9);var Xi=new Zr;return hr.state=Xi,Xi.strm=hr,Xi.wrap=lo,Xi.gzhead=null,Xi.w_bits=Aa,Xi.w_size=1<<Xi.w_bits,Xi.w_mask=Xi.w_size-1,Xi.hash_bits=La+7,Xi.hash_size=1<<Xi.hash_bits,Xi.hash_mask=Xi.hash_size-1,Xi.hash_shift=~~((Xi.hash_bits+fa-1)/fa),Xi.window=new e.Buf8(Xi.w_size*2),Xi.head=new e.Buf16(Xi.hash_size),Xi.prev=new e.Buf16(Xi.w_size),Xi.lit_bufsize=1<<La+6,Xi.pending_buf_size=Xi.lit_bufsize*4,Xi.pending_buf=new e.Buf8(Xi.pending_buf_size),Xi.d_buf=1*Xi.lit_bufsize,Xi.l_buf=(1+2)*Xi.lit_bufsize,Xi.level=hn,Xi.strategy=Ma,Xi.method=bn,zn(hr)}function gn(hr,hn){return wa(hr,hn,rr,ar,Ar,tt)}function Qr(hr,hn){var bn,Aa,La,Ma;if(!hr||!hr.state||hn>Re||hn<0)return hr?ti(hr,Fe):Fe;if(Aa=hr.state,!hr.output||!hr.input&&hr.avail_in!==0||Aa.status===kn&&hn!==F)return ti(hr,hr.avail_out===0?Ze:Fe);if(Aa.strm=hr,bn=Aa.last_flush,Aa.last_flush=hn,Aa.status===Pn)if(Aa.wrap===2)hr.adler=0,Yi(Aa,31),Yi(Aa,139),Yi(Aa,8),Aa.gzhead?(Yi(Aa,(Aa.gzhead.text?1:0)+(Aa.gzhead.hcrc?2:0)+(Aa.gzhead.extra?4:0)+(Aa.gzhead.name?8:0)+(Aa.gzhead.comment?16:0)),Yi(Aa,Aa.gzhead.time&255),Yi(Aa,Aa.gzhead.time>>8&255),Yi(Aa,Aa.gzhead.time>>16&255),Yi(Aa,Aa.gzhead.time>>24&255),Yi(Aa,Aa.level===9?2:Aa.strategy>=st||Aa.level<2?4:0),Yi(Aa,Aa.gzhead.os&255),Aa.gzhead.extra&&Aa.gzhead.extra.length&&(Yi(Aa,Aa.gzhead.extra.length&255),Yi(Aa,Aa.gzhead.extra.length>>8&255)),Aa.gzhead.hcrc&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending,0)),Aa.gzindex=0,Aa.status=_n):(Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,0),Yi(Aa,Aa.level===9?2:Aa.strategy>=st||Aa.level<2?4:0),Yi(Aa,ii),Aa.status=fn);else{var lo=rr+(Aa.w_bits-8<<4)<<8,Xi=-1;Aa.strategy>=st||Aa.level<2?Xi=0:Aa.level<6?Xi=1:Aa.level===6?Xi=2:Xi=3,lo|=Xi<<6,Aa.strstart!==0&&(lo|=Ba),lo+=31-lo%31,Aa.status=fn,ao(Aa,lo),Aa.strstart!==0&&(ao(Aa,hr.adler>>>16),ao(Aa,hr.adler&65535)),hr.adler=1}if(Aa.status===_n)if(Aa.gzhead.extra){for(La=Aa.pending;Aa.gzindex<(Aa.gzhead.extra.length&65535)&&!(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size));)Yi(Aa,Aa.gzhead.extra[Aa.gzindex]&255),Aa.gzindex++;Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Aa.gzindex===Aa.gzhead.extra.length&&(Aa.gzindex=0,Aa.status=cn)}else Aa.status=cn;if(Aa.status===cn)if(Aa.gzhead.name){La=Aa.pending;do{if(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size)){Ma=1;break}Aa.gzindex<Aa.gzhead.name.length?Ma=Aa.gzhead.name.charCodeAt(Aa.gzindex++)&255:Ma=0,Yi(Aa,Ma)}while(Ma!==0);Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Ma===0&&(Aa.gzindex=0,Aa.status=ui)}else Aa.status=ui;if(Aa.status===ui)if(Aa.gzhead.comment){La=Aa.pending;do{if(Aa.pending===Aa.pending_buf_size&&(Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),$i(hr),La=Aa.pending,Aa.pending===Aa.pending_buf_size)){Ma=1;break}Aa.gzindex<Aa.gzhead.comment.length?Ma=Aa.gzhead.comment.charCodeAt(Aa.gzindex++)&255:Ma=0,Yi(Aa,Ma)}while(Ma!==0);Aa.gzhead.hcrc&&Aa.pending>La&&(hr.adler=u(hr.adler,Aa.pending_buf,Aa.pending-La,La)),Ma===0&&(Aa.status=Vn)}else Aa.status=Vn;if(Aa.status===Vn&&(Aa.gzhead.hcrc?(Aa.pending+2>Aa.pending_buf_size&&$i(hr),Aa.pending+2<=Aa.pending_buf_size&&(Yi(Aa,hr.adler&255),Yi(Aa,hr.adler>>8&255),hr.adler=0,Aa.status=fn)):Aa.status=fn),Aa.pending!==0){if($i(hr),hr.avail_out===0)return Aa.last_flush=-1,He}else if(hr.avail_in===0&&fi(hn)<=fi(bn)&&hn!==F)return ti(hr,Ze);if(Aa.status===kn&&hr.avail_in!==0)return ti(hr,Ze);if(hr.avail_in!==0||Aa.lookahead!==0||hn!==H&&Aa.status!==kn){var no=Aa.strategy===st?Mn(Aa,hn):Aa.strategy===Ke?mn(Aa,hn):vi[Aa.level].func(Aa,hn);if((no===Ci||no===So)&&(Aa.status=kn),no===Ln||no===Ci)return hr.avail_out===0&&(Aa.last_flush=-1),He;if(no===On&&(hn===x?r._tr_align(Aa):hn!==Re&&(r._tr_stored_block(Aa,0,0,!1),hn===o&&(Zi(Aa.head),Aa.lookahead===0&&(Aa.strstart=0,Aa.block_start=0,Aa.insert=0))),$i(hr),hr.avail_out===0))return Aa.last_flush=-1,He}return hn!==F?He:Aa.wrap<=0?Ue:(Aa.wrap===2?(Yi(Aa,hr.adler&255),Yi(Aa,hr.adler>>8&255),Yi(Aa,hr.adler>>16&255),Yi(Aa,hr.adler>>24&255),Yi(Aa,hr.total_in&255),Yi(Aa,hr.total_in>>8&255),Yi(Aa,hr.total_in>>16&255),Yi(Aa,hr.total_in>>24&255)):(ao(Aa,hr.adler>>>16),ao(Aa,hr.adler&65535)),$i(hr),Aa.wrap>0&&(Aa.wrap=-Aa.wrap),Aa.pending!==0?He:Ue)}function Cn(hr){var hn;return!hr||!hr.state?Fe:(hn=hr.state.status,hn!==Pn&&hn!==_n&&hn!==cn&&hn!==ui&&hn!==Vn&&hn!==fn&&hn!==kn?ti(hr,Fe):(hr.state=null,hn===fn?ti(hr,nt):He))}function Ao(hr,hn){var bn=hn.length,Aa,La,Ma,lo,Xi,no,ji,xa;if(!hr||!hr.state||(Aa=hr.state,lo=Aa.wrap,lo===2||lo===1&&Aa.status!==Pn||Aa.lookahead))return Fe;for(lo===1&&(hr.adler=s(hr.adler,hn,bn,0)),Aa.wrap=0,bn>=Aa.w_size&&(lo===0&&(Zi(Aa.head),Aa.strstart=0,Aa.block_start=0,Aa.insert=0),xa=new e.Buf8(Aa.w_size),e.arraySet(xa,hn,bn-Aa.w_size,Aa.w_size,0),hn=xa,bn=Aa.w_size),Xi=hr.avail_in,no=hr.next_in,ji=hr.input,hr.avail_in=bn,hr.next_in=0,hr.input=hn,Jo(Aa);Aa.lookahead>=fa;){La=Aa.strstart,Ma=Aa.lookahead-(fa-1);do Aa.ins_h=(Aa.ins_h<<Aa.hash_shift^Aa.window[La+fa-1])&Aa.hash_mask,Aa.prev[La&Aa.w_mask]=Aa.head[Aa.ins_h],Aa.head[Aa.ins_h]=La,La++;while(--Ma);Aa.strstart=La,Aa.lookahead=fa-1,Jo(Aa)}return Aa.strstart+=Aa.lookahead,Aa.block_start=Aa.strstart,Aa.insert=Aa.lookahead,Aa.lookahead=0,Aa.match_length=Aa.prev_length=fa-1,Aa.match_available=0,hr.next_in=no,hr.input=ji,hr.avail_in=Xi,Aa.wrap=lo,He}return deflate.deflateInit=gn,deflate.deflateInit2=wa,deflate.deflateReset=zn,deflate.deflateResetKeep=Wa,deflate.deflateSetHeader=di,deflate.deflate=Qr,deflate.deflateEnd=Cn,deflate.deflateSetDictionary=Ao,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var strings={},hasRequiredStrings;function requireStrings(){if(hasRequiredStrings)return strings;hasRequiredStrings=1;var e=requireCommon(),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var u=new e.Buf8(256),m=0;m<256;m++)u[m]=m>=252?6:m>=248?5:m>=240?4:m>=224?3:m>=192?2:1;u[254]=u[254]=1,strings.string2buf=function(x){var o,F,Re,He,Ue,Fe=x.length,nt=0;for(He=0;He<Fe;He++)F=x.charCodeAt(He),(F&64512)===55296&&He+1<Fe&&(Re=x.charCodeAt(He+1),(Re&64512)===56320&&(F=65536+(F-55296<<10)+(Re-56320),He++)),nt+=F<128?1:F<2048?2:F<65536?3:4;for(o=new e.Buf8(nt),Ue=0,He=0;Ue<nt;He++)F=x.charCodeAt(He),(F&64512)===55296&&He+1<Fe&&(Re=x.charCodeAt(He+1),(Re&64512)===56320&&(F=65536+(F-55296<<10)+(Re-56320),He++)),F<128?o[Ue++]=F:F<2048?(o[Ue++]=192|F>>>6,o[Ue++]=128|F&63):F<65536?(o[Ue++]=224|F>>>12,o[Ue++]=128|F>>>6&63,o[Ue++]=128|F&63):(o[Ue++]=240|F>>>18,o[Ue++]=128|F>>>12&63,o[Ue++]=128|F>>>6&63,o[Ue++]=128|F&63);return o};function H(x,o){if(o<65534&&(x.subarray&&s||!x.subarray&&r))return String.fromCharCode.apply(null,e.shrinkBuf(x,o));for(var F="",Re=0;Re<o;Re++)F+=String.fromCharCode(x[Re]);return F}return strings.buf2binstring=function(x){return H(x,x.length)},strings.binstring2buf=function(x){for(var o=new e.Buf8(x.length),F=0,Re=o.length;F<Re;F++)o[F]=x.charCodeAt(F);return o},strings.buf2string=function(x,o){var F,Re,He,Ue,Fe=o||x.length,nt=new Array(Fe*2);for(Re=0,F=0;F<Fe;){if(He=x[F++],He<128){nt[Re++]=He;continue}if(Ue=u[He],Ue>4){nt[Re++]=65533,F+=Ue-1;continue}for(He&=Ue===2?31:Ue===3?15:7;Ue>1&&F<Fe;)He=He<<6|x[F++]&63,Ue--;if(Ue>1){nt[Re++]=65533;continue}He<65536?nt[Re++]=He:(He-=65536,nt[Re++]=55296|He>>10&1023,nt[Re++]=56320|He&1023)}return H(nt,Re)},strings.utf8border=function(x,o){var F;for(o=o||x.length,o>x.length&&(o=x.length),F=o-1;F>=0&&(x[F]&192)===128;)F--;return F<0||F===0?o:F+u[x[F]]>o?F:o},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return zstream=e,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;var e=requireDeflate$1(),r=requireCommon(),s=requireStrings(),u=requireMessages(),m=requireZstream(),H=Object.prototype.toString,x=0,o=4,F=0,Re=1,He=2,Ue=-1,Fe=0,nt=8;function Ze(Ke){if(!(this instanceof Ze))return new Ze(Ke);this.options=r.assign({level:Ue,method:nt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fe,to:""},Ke||{});var Ye=this.options;Ye.raw&&Ye.windowBits>0?Ye.windowBits=-Ye.windowBits:Ye.gzip&&Ye.windowBits>0&&Ye.windowBits<16&&(Ye.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var tt=e.deflateInit2(this.strm,Ye.level,Ye.method,Ye.windowBits,Ye.memLevel,Ye.strategy);if(tt!==F)throw new Error(u[tt]);if(Ye.header&&e.deflateSetHeader(this.strm,Ye.header),Ye.dictionary){var Je;if(typeof Ye.dictionary=="string"?Je=s.string2buf(Ye.dictionary):H.call(Ye.dictionary)==="[object ArrayBuffer]"?Je=new Uint8Array(Ye.dictionary):Je=Ye.dictionary,tt=e.deflateSetDictionary(this.strm,Je),tt!==F)throw new Error(u[tt]);this._dict_set=!0}}Ze.prototype.push=function(Ke,Ye){var tt=this.strm,Je=this.options.chunkSize,rr,Rr;if(this.ended)return!1;Rr=Ye===~~Ye?Ye:Ye===!0?o:x,typeof Ke=="string"?tt.input=s.string2buf(Ke):H.call(Ke)==="[object ArrayBuffer]"?tt.input=new Uint8Array(Ke):tt.input=Ke,tt.next_in=0,tt.avail_in=tt.input.length;do{if(tt.avail_out===0&&(tt.output=new r.Buf8(Je),tt.next_out=0,tt.avail_out=Je),rr=e.deflate(tt,Rr),rr!==Re&&rr!==F)return this.onEnd(rr),this.ended=!0,!1;(tt.avail_out===0||tt.avail_in===0&&(Rr===o||Rr===He))&&(this.options.to==="string"?this.onData(s.buf2binstring(r.shrinkBuf(tt.output,tt.next_out))):this.onData(r.shrinkBuf(tt.output,tt.next_out)))}while((tt.avail_in>0||tt.avail_out===0)&&rr!==Re);return Rr===o?(rr=e.deflateEnd(this.strm),this.onEnd(rr),this.ended=!0,rr===F):(Rr===He&&(this.onEnd(F),tt.avail_out=0),!0)},Ze.prototype.onData=function(Ke){this.chunks.push(Ke)},Ze.prototype.onEnd=function(Ke){Ke===F&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=Ke,this.msg=this.strm.msg};function Ve(Ke,Ye){var tt=new Ze(Ye);if(tt.push(Ke,!0),tt.err)throw tt.msg||u[tt.err];return tt.result}function er(Ke,Ye){return Ye=Ye||{},Ye.raw=!0,Ve(Ke,Ye)}function st(Ke,Ye){return Ye=Ye||{},Ye.gzip=!0,Ve(Ke,Ye)}return deflate$1.Deflate=Ze,deflate$1.deflate=Ve,deflate$1.deflateRaw=er,deflate$1.gzip=st,deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;var e=30,r=12;return inffast=function(u,m){var H,x,o,F,Re,He,Ue,Fe,nt,Ze,Ve,er,st,Ke,Ye,tt,Je,rr,Rr,ar,Ar,mr,Pr,Nr,Ra;H=u.state,x=u.next_in,Nr=u.input,o=x+(u.avail_in-5),F=u.next_out,Ra=u.output,Re=F-(m-u.avail_out),He=F+(u.avail_out-257),Ue=H.dmax,Fe=H.wsize,nt=H.whave,Ze=H.wnext,Ve=H.window,er=H.hold,st=H.bits,Ke=H.lencode,Ye=H.distcode,tt=(1<<H.lenbits)-1,Je=(1<<H.distbits)-1;e:do{st<15&&(er+=Nr[x++]<<st,st+=8,er+=Nr[x++]<<st,st+=8),rr=Ke[er&tt];t:for(;;){if(Rr=rr>>>24,er>>>=Rr,st-=Rr,Rr=rr>>>16&255,Rr===0)Ra[F++]=rr&65535;else if(Rr&16){ar=rr&65535,Rr&=15,Rr&&(st<Rr&&(er+=Nr[x++]<<st,st+=8),ar+=er&(1<<Rr)-1,er>>>=Rr,st-=Rr),st<15&&(er+=Nr[x++]<<st,st+=8,er+=Nr[x++]<<st,st+=8),rr=Ye[er&Je];r:for(;;){if(Rr=rr>>>24,er>>>=Rr,st-=Rr,Rr=rr>>>16&255,Rr&16){if(Ar=rr&65535,Rr&=15,st<Rr&&(er+=Nr[x++]<<st,st+=8,st<Rr&&(er+=Nr[x++]<<st,st+=8)),Ar+=er&(1<<Rr)-1,Ar>Ue){u.msg="invalid distance too far back",H.mode=e;break e}if(er>>>=Rr,st-=Rr,Rr=F-Re,Ar>Rr){if(Rr=Ar-Rr,Rr>nt&&H.sane){u.msg="invalid distance too far back",H.mode=e;break e}if(mr=0,Pr=Ve,Ze===0){if(mr+=Fe-Rr,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}}else if(Ze<Rr){if(mr+=Fe+Ze-Rr,Rr-=Ze,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);if(mr=0,Ze<ar){Rr=Ze,ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}}}else if(mr+=Ze-Rr,Rr<ar){ar-=Rr;do Ra[F++]=Ve[mr++];while(--Rr);mr=F-Ar,Pr=Ra}for(;ar>2;)Ra[F++]=Pr[mr++],Ra[F++]=Pr[mr++],Ra[F++]=Pr[mr++],ar-=3;ar&&(Ra[F++]=Pr[mr++],ar>1&&(Ra[F++]=Pr[mr++]))}else{mr=F-Ar;do Ra[F++]=Ra[mr++],Ra[F++]=Ra[mr++],Ra[F++]=Ra[mr++],ar-=3;while(ar>2);ar&&(Ra[F++]=Ra[mr++],ar>1&&(Ra[F++]=Ra[mr++]))}}else if((Rr&64)===0){rr=Ye[(rr&65535)+(er&(1<<Rr)-1)];continue r}else{u.msg="invalid distance code",H.mode=e;break e}break}}else if((Rr&64)===0){rr=Ke[(rr&65535)+(er&(1<<Rr)-1)];continue t}else if(Rr&32){H.mode=r;break e}else{u.msg="invalid literal/length code",H.mode=e;break e}break}}while(x<o&&F<He);ar=st>>3,x-=ar,st-=ar<<3,er&=(1<<st)-1,u.next_in=x,u.next_out=F,u.avail_in=x<o?5+(o-x):5-(x-o),u.avail_out=F<He?257+(He-F):257-(F-He),H.hold=er,H.bits=st},inffast}var inftrees,hasRequiredInftrees;function requireInftrees(){if(hasRequiredInftrees)return inftrees;hasRequiredInftrees=1;var e=requireCommon(),r=15,s=852,u=592,m=0,H=1,x=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],F=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Re=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],He=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return inftrees=function(Fe,nt,Ze,Ve,er,st,Ke,Ye){var tt=Ye.bits,Je=0,rr=0,Rr=0,ar=0,Ar=0,mr=0,Pr=0,Nr=0,Ra=0,ta=0,ha,Ea,fa,ga,Ja,Ba=null,Pn=0,_n,cn=new e.Buf16(r+1),ui=new e.Buf16(r+1),Vn=null,fn=0,kn,Ln,On;for(Je=0;Je<=r;Je++)cn[Je]=0;for(rr=0;rr<Ve;rr++)cn[nt[Ze+rr]]++;for(Ar=tt,ar=r;ar>=1&&cn[ar]===0;ar--);if(Ar>ar&&(Ar=ar),ar===0)return er[st++]=1<<24|64<<16|0,er[st++]=1<<24|64<<16|0,Ye.bits=1,0;for(Rr=1;Rr<ar&&cn[Rr]===0;Rr++);for(Ar<Rr&&(Ar=Rr),Nr=1,Je=1;Je<=r;Je++)if(Nr<<=1,Nr-=cn[Je],Nr<0)return-1;if(Nr>0&&(Fe===m||ar!==1))return-1;for(ui[1]=0,Je=1;Je<r;Je++)ui[Je+1]=ui[Je]+cn[Je];for(rr=0;rr<Ve;rr++)nt[Ze+rr]!==0&&(Ke[ui[nt[Ze+rr]]++]=rr);if(Fe===m?(Ba=Vn=Ke,_n=19):Fe===H?(Ba=o,Pn-=257,Vn=F,fn-=257,_n=256):(Ba=Re,Vn=He,_n=-1),ta=0,rr=0,Je=Rr,Ja=st,mr=Ar,Pr=0,fa=-1,Ra=1<<Ar,ga=Ra-1,Fe===H&&Ra>s||Fe===x&&Ra>u)return 1;for(;;){kn=Je-Pr,Ke[rr]<_n?(Ln=0,On=Ke[rr]):Ke[rr]>_n?(Ln=Vn[fn+Ke[rr]],On=Ba[Pn+Ke[rr]]):(Ln=32+64,On=0),ha=1<<Je-Pr,Ea=1<<mr,Rr=Ea;do Ea-=ha,er[Ja+(ta>>Pr)+Ea]=kn<<24|Ln<<16|On|0;while(Ea!==0);for(ha=1<<Je-1;ta&ha;)ha>>=1;if(ha!==0?(ta&=ha-1,ta+=ha):ta=0,rr++,--cn[Je]===0){if(Je===ar)break;Je=nt[Ze+Ke[rr]]}if(Je>Ar&&(ta&ga)!==fa){for(Pr===0&&(Pr=Ar),Ja+=Rr,mr=Je-Pr,Nr=1<<mr;mr+Pr<ar&&(Nr-=cn[mr+Pr],!(Nr<=0));)mr++,Nr<<=1;if(Ra+=1<<mr,Fe===H&&Ra>s||Fe===x&&Ra>u)return 1;fa=ta&ga,er[fa]=Ar<<24|mr<<16|Ja-st|0}}return ta!==0&&(er[Ja+ta]=Je-Pr<<24|64<<16|0),Ye.bits=Ar,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;var e=requireCommon(),r=requireAdler32(),s=requireCrc32(),u=requireInffast(),m=requireInftrees(),H=0,x=1,o=2,F=4,Re=5,He=6,Ue=0,Fe=1,nt=2,Ze=-2,Ve=-3,er=-4,st=-5,Ke=8,Ye=1,tt=2,Je=3,rr=4,Rr=5,ar=6,Ar=7,mr=8,Pr=9,Nr=10,Ra=11,ta=12,ha=13,Ea=14,fa=15,ga=16,Ja=17,Ba=18,Pn=19,_n=20,cn=21,ui=22,Vn=23,fn=24,kn=25,Ln=26,On=27,Ci=28,So=29,ii=30,ti=31,fi=32,Zi=852,$i=592,_o=15,Yi=_o;function ao(wa){return(wa>>>24&255)+(wa>>>8&65280)+((wa&65280)<<8)+((wa&255)<<24)}function Co(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function yo(wa){var gn;return!wa||!wa.state?Ze:(gn=wa.state,wa.total_in=wa.total_out=gn.total=0,wa.msg="",gn.wrap&&(wa.adler=gn.wrap&1),gn.mode=Ye,gn.last=0,gn.havedict=0,gn.dmax=32768,gn.head=null,gn.hold=0,gn.bits=0,gn.lencode=gn.lendyn=new e.Buf32(Zi),gn.distcode=gn.distdyn=new e.Buf32($i),gn.sane=1,gn.back=-1,Ue)}function Jo(wa){var gn;return!wa||!wa.state?Ze:(gn=wa.state,gn.wsize=0,gn.whave=0,gn.wnext=0,yo(wa))}function fr(wa,gn){var Qr,Cn;return!wa||!wa.state||(Cn=wa.state,gn<0?(Qr=0,gn=-gn):(Qr=(gn>>4)+1,gn<48&&(gn&=15)),gn&&(gn<8||gn>15))?Ze:(Cn.window!==null&&Cn.wbits!==gn&&(Cn.window=null),Cn.wrap=Qr,Cn.wbits=gn,Jo(wa))}function Xa(wa,gn){var Qr,Cn;return wa?(Cn=new Co,wa.state=Cn,Cn.window=null,Qr=fr(wa,gn),Qr!==Ue&&(wa.state=null),Qr):Ze}function tn(wa){return Xa(wa,Yi)}var mn=!0,Mn,un;function vi(wa){if(mn){var gn;for(Mn=new e.Buf32(512),un=new e.Buf32(32),gn=0;gn<144;)wa.lens[gn++]=8;for(;gn<256;)wa.lens[gn++]=9;for(;gn<280;)wa.lens[gn++]=7;for(;gn<288;)wa.lens[gn++]=8;for(m(x,wa.lens,0,288,Mn,0,wa.work,{bits:9}),gn=0;gn<32;)wa.lens[gn++]=5;m(o,wa.lens,0,32,un,0,wa.work,{bits:5}),mn=!1}wa.lencode=Mn,wa.lenbits=9,wa.distcode=un,wa.distbits=5}function ci(wa,gn,Qr,Cn){var Ao,hr=wa.state;return hr.window===null&&(hr.wsize=1<<hr.wbits,hr.wnext=0,hr.whave=0,hr.window=new e.Buf8(hr.wsize)),Cn>=hr.wsize?(e.arraySet(hr.window,gn,Qr-hr.wsize,hr.wsize,0),hr.wnext=0,hr.whave=hr.wsize):(Ao=hr.wsize-hr.wnext,Ao>Cn&&(Ao=Cn),e.arraySet(hr.window,gn,Qr-Cn,Ao,hr.wnext),Cn-=Ao,Cn?(e.arraySet(hr.window,gn,Qr-Cn,Cn,0),hr.wnext=Cn,hr.whave=hr.wsize):(hr.wnext+=Ao,hr.wnext===hr.wsize&&(hr.wnext=0),hr.whave<hr.wsize&&(hr.whave+=Ao))),0}function Zr(wa,gn){var Qr,Cn,Ao,hr,hn,bn,Aa,La,Ma,lo,Xi,no,ji,xa,dr=0,Cr,Vr,Pa,oa,Ua,ya,ua,Da,$a=new e.Buf8(4),ka,Un,Ai=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!wa||!wa.state||!wa.output||!wa.input&&wa.avail_in!==0)return Ze;Qr=wa.state,Qr.mode===ta&&(Qr.mode=ha),hn=wa.next_out,Ao=wa.output,Aa=wa.avail_out,hr=wa.next_in,Cn=wa.input,bn=wa.avail_in,La=Qr.hold,Ma=Qr.bits,lo=bn,Xi=Aa,Da=Ue;e:for(;;)switch(Qr.mode){case Ye:if(Qr.wrap===0){Qr.mode=ha;break}for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.wrap&2&&La===35615){Qr.check=0,$a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0),La=0,Ma=0,Qr.mode=tt;break}if(Qr.flags=0,Qr.head&&(Qr.head.done=!1),!(Qr.wrap&1)||(((La&255)<<8)+(La>>8))%31){wa.msg="incorrect header check",Qr.mode=ii;break}if((La&15)!==Ke){wa.msg="unknown compression method",Qr.mode=ii;break}if(La>>>=4,Ma-=4,ua=(La&15)+8,Qr.wbits===0)Qr.wbits=ua;else if(ua>Qr.wbits){wa.msg="invalid window size",Qr.mode=ii;break}Qr.dmax=1<<ua,wa.adler=Qr.check=1,Qr.mode=La&512?Nr:ta,La=0,Ma=0;break;case tt:for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.flags=La,(Qr.flags&255)!==Ke){wa.msg="unknown compression method",Qr.mode=ii;break}if(Qr.flags&57344){wa.msg="unknown header flags set",Qr.mode=ii;break}Qr.head&&(Qr.head.text=La>>8&1),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0,Qr.mode=Je;case Je:for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.head&&(Qr.head.time=La),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,$a[2]=La>>>16&255,$a[3]=La>>>24&255,Qr.check=s(Qr.check,$a,4,0)),La=0,Ma=0,Qr.mode=rr;case rr:for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.head&&(Qr.head.xflags=La&255,Qr.head.os=La>>8),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0,Qr.mode=Rr;case Rr:if(Qr.flags&1024){for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.length=La,Qr.head&&(Qr.head.extra_len=La),Qr.flags&512&&($a[0]=La&255,$a[1]=La>>>8&255,Qr.check=s(Qr.check,$a,2,0)),La=0,Ma=0}else Qr.head&&(Qr.head.extra=null);Qr.mode=ar;case ar:if(Qr.flags&1024&&(no=Qr.length,no>bn&&(no=bn),no&&(Qr.head&&(ua=Qr.head.extra_len-Qr.length,Qr.head.extra||(Qr.head.extra=new Array(Qr.head.extra_len)),e.arraySet(Qr.head.extra,Cn,hr,no,ua)),Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,Qr.length-=no),Qr.length))break e;Qr.length=0,Qr.mode=Ar;case Ar:if(Qr.flags&2048){if(bn===0)break e;no=0;do ua=Cn[hr+no++],Qr.head&&ua&&Qr.length<65536&&(Qr.head.name+=String.fromCharCode(ua));while(ua&&no<bn);if(Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,ua)break e}else Qr.head&&(Qr.head.name=null);Qr.length=0,Qr.mode=mr;case mr:if(Qr.flags&4096){if(bn===0)break e;no=0;do ua=Cn[hr+no++],Qr.head&&ua&&Qr.length<65536&&(Qr.head.comment+=String.fromCharCode(ua));while(ua&&no<bn);if(Qr.flags&512&&(Qr.check=s(Qr.check,Cn,no,hr)),bn-=no,hr+=no,ua)break e}else Qr.head&&(Qr.head.comment=null);Qr.mode=Pr;case Pr:if(Qr.flags&512){for(;Ma<16;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La!==(Qr.check&65535)){wa.msg="header crc mismatch",Qr.mode=ii;break}La=0,Ma=0}Qr.head&&(Qr.head.hcrc=Qr.flags>>9&1,Qr.head.done=!0),wa.adler=Qr.check=0,Qr.mode=ta;break;case Nr:for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}wa.adler=Qr.check=ao(La),La=0,Ma=0,Qr.mode=Ra;case Ra:if(Qr.havedict===0)return wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,nt;wa.adler=Qr.check=1,Qr.mode=ta;case ta:if(gn===Re||gn===He)break e;case ha:if(Qr.last){La>>>=Ma&7,Ma-=Ma&7,Qr.mode=On;break}for(;Ma<3;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}switch(Qr.last=La&1,La>>>=1,Ma-=1,La&3){case 0:Qr.mode=Ea;break;case 1:if(vi(Qr),Qr.mode=_n,gn===He){La>>>=2,Ma-=2;break e}break;case 2:Qr.mode=Ja;break;case 3:wa.msg="invalid block type",Qr.mode=ii}La>>>=2,Ma-=2;break;case Ea:for(La>>>=Ma&7,Ma-=Ma&7;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if((La&65535)!==(La>>>16^65535)){wa.msg="invalid stored block lengths",Qr.mode=ii;break}if(Qr.length=La&65535,La=0,Ma=0,Qr.mode=fa,gn===He)break e;case fa:Qr.mode=ga;case ga:if(no=Qr.length,no){if(no>bn&&(no=bn),no>Aa&&(no=Aa),no===0)break e;e.arraySet(Ao,Cn,hr,no,hn),bn-=no,hr+=no,Aa-=no,hn+=no,Qr.length-=no;break}Qr.mode=ta;break;case Ja:for(;Ma<14;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Qr.nlen=(La&31)+257,La>>>=5,Ma-=5,Qr.ndist=(La&31)+1,La>>>=5,Ma-=5,Qr.ncode=(La&15)+4,La>>>=4,Ma-=4,Qr.nlen>286||Qr.ndist>30){wa.msg="too many length or distance symbols",Qr.mode=ii;break}Qr.have=0,Qr.mode=Ba;case Ba:for(;Qr.have<Qr.ncode;){for(;Ma<3;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.lens[Ai[Qr.have++]]=La&7,La>>>=3,Ma-=3}for(;Qr.have<19;)Qr.lens[Ai[Qr.have++]]=0;if(Qr.lencode=Qr.lendyn,Qr.lenbits=7,ka={bits:Qr.lenbits},Da=m(H,Qr.lens,0,19,Qr.lencode,0,Qr.work,ka),Qr.lenbits=ka.bits,Da){wa.msg="invalid code lengths set",Qr.mode=ii;break}Qr.have=0,Qr.mode=Pn;case Pn:for(;Qr.have<Qr.nlen+Qr.ndist;){for(;dr=Qr.lencode[La&(1<<Qr.lenbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Pa<16)La>>>=Cr,Ma-=Cr,Qr.lens[Qr.have++]=Pa;else{if(Pa===16){for(Un=Cr+2;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La>>>=Cr,Ma-=Cr,Qr.have===0){wa.msg="invalid bit length repeat",Qr.mode=ii;break}ua=Qr.lens[Qr.have-1],no=3+(La&3),La>>>=2,Ma-=2}else if(Pa===17){for(Un=Cr+3;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=Cr,Ma-=Cr,ua=0,no=3+(La&7),La>>>=3,Ma-=3}else{for(Un=Cr+7;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=Cr,Ma-=Cr,ua=0,no=11+(La&127),La>>>=7,Ma-=7}if(Qr.have+no>Qr.nlen+Qr.ndist){wa.msg="invalid bit length repeat",Qr.mode=ii;break}for(;no--;)Qr.lens[Qr.have++]=ua}}if(Qr.mode===ii)break;if(Qr.lens[256]===0){wa.msg="invalid code -- missing end-of-block",Qr.mode=ii;break}if(Qr.lenbits=9,ka={bits:Qr.lenbits},Da=m(x,Qr.lens,0,Qr.nlen,Qr.lencode,0,Qr.work,ka),Qr.lenbits=ka.bits,Da){wa.msg="invalid literal/lengths set",Qr.mode=ii;break}if(Qr.distbits=6,Qr.distcode=Qr.distdyn,ka={bits:Qr.distbits},Da=m(o,Qr.lens,Qr.nlen,Qr.ndist,Qr.distcode,0,Qr.work,ka),Qr.distbits=ka.bits,Da){wa.msg="invalid distances set",Qr.mode=ii;break}if(Qr.mode=_n,gn===He)break e;case _n:Qr.mode=cn;case cn:if(bn>=6&&Aa>=258){wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,u(wa,Xi),hn=wa.next_out,Ao=wa.output,Aa=wa.avail_out,hr=wa.next_in,Cn=wa.input,bn=wa.avail_in,La=Qr.hold,Ma=Qr.bits,Qr.mode===ta&&(Qr.back=-1);break}for(Qr.back=0;dr=Qr.lencode[La&(1<<Qr.lenbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(Vr&&(Vr&240)===0){for(oa=Cr,Ua=Vr,ya=Pa;dr=Qr.lencode[ya+((La&(1<<oa+Ua)-1)>>oa)],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(oa+Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=oa,Ma-=oa,Qr.back+=oa}if(La>>>=Cr,Ma-=Cr,Qr.back+=Cr,Qr.length=Pa,Vr===0){Qr.mode=Ln;break}if(Vr&32){Qr.back=-1,Qr.mode=ta;break}if(Vr&64){wa.msg="invalid literal/length code",Qr.mode=ii;break}Qr.extra=Vr&15,Qr.mode=ui;case ui:if(Qr.extra){for(Un=Qr.extra;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.length+=La&(1<<Qr.extra)-1,La>>>=Qr.extra,Ma-=Qr.extra,Qr.back+=Qr.extra}Qr.was=Qr.length,Qr.mode=Vn;case Vn:for(;dr=Qr.distcode[La&(1<<Qr.distbits)-1],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if((Vr&240)===0){for(oa=Cr,Ua=Vr,ya=Pa;dr=Qr.distcode[ya+((La&(1<<oa+Ua)-1)>>oa)],Cr=dr>>>24,Vr=dr>>>16&255,Pa=dr&65535,!(oa+Cr<=Ma);){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}La>>>=oa,Ma-=oa,Qr.back+=oa}if(La>>>=Cr,Ma-=Cr,Qr.back+=Cr,Vr&64){wa.msg="invalid distance code",Qr.mode=ii;break}Qr.offset=Pa,Qr.extra=Vr&15,Qr.mode=fn;case fn:if(Qr.extra){for(Un=Qr.extra;Ma<Un;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}Qr.offset+=La&(1<<Qr.extra)-1,La>>>=Qr.extra,Ma-=Qr.extra,Qr.back+=Qr.extra}if(Qr.offset>Qr.dmax){wa.msg="invalid distance too far back",Qr.mode=ii;break}Qr.mode=kn;case kn:if(Aa===0)break e;if(no=Xi-Aa,Qr.offset>no){if(no=Qr.offset-no,no>Qr.whave&&Qr.sane){wa.msg="invalid distance too far back",Qr.mode=ii;break}no>Qr.wnext?(no-=Qr.wnext,ji=Qr.wsize-no):ji=Qr.wnext-no,no>Qr.length&&(no=Qr.length),xa=Qr.window}else xa=Ao,ji=hn-Qr.offset,no=Qr.length;no>Aa&&(no=Aa),Aa-=no,Qr.length-=no;do Ao[hn++]=xa[ji++];while(--no);Qr.length===0&&(Qr.mode=cn);break;case Ln:if(Aa===0)break e;Ao[hn++]=Qr.length,Aa--,Qr.mode=cn;break;case On:if(Qr.wrap){for(;Ma<32;){if(bn===0)break e;bn--,La|=Cn[hr++]<<Ma,Ma+=8}if(Xi-=Aa,wa.total_out+=Xi,Qr.total+=Xi,Xi&&(wa.adler=Qr.check=Qr.flags?s(Qr.check,Ao,Xi,hn-Xi):r(Qr.check,Ao,Xi,hn-Xi)),Xi=Aa,(Qr.flags?La:ao(La))!==Qr.check){wa.msg="incorrect data check",Qr.mode=ii;break}La=0,Ma=0}Qr.mode=Ci;case Ci:if(Qr.wrap&&Qr.flags){for(;Ma<32;){if(bn===0)break e;bn--,La+=Cn[hr++]<<Ma,Ma+=8}if(La!==(Qr.total&4294967295)){wa.msg="incorrect length check",Qr.mode=ii;break}La=0,Ma=0}Qr.mode=So;case So:Da=Fe;break e;case ii:Da=Ve;break e;case ti:return er;case fi:default:return Ze}return wa.next_out=hn,wa.avail_out=Aa,wa.next_in=hr,wa.avail_in=bn,Qr.hold=La,Qr.bits=Ma,(Qr.wsize||Xi!==wa.avail_out&&Qr.mode<ii&&(Qr.mode<On||gn!==F))&&ci(wa,wa.output,wa.next_out,Xi-wa.avail_out),lo-=wa.avail_in,Xi-=wa.avail_out,wa.total_in+=lo,wa.total_out+=Xi,Qr.total+=Xi,Qr.wrap&&Xi&&(wa.adler=Qr.check=Qr.flags?s(Qr.check,Ao,Xi,wa.next_out-Xi):r(Qr.check,Ao,Xi,wa.next_out-Xi)),wa.data_type=Qr.bits+(Qr.last?64:0)+(Qr.mode===ta?128:0)+(Qr.mode===_n||Qr.mode===fa?256:0),(lo===0&&Xi===0||gn===F)&&Da===Ue&&(Da=st),Da}function Wa(wa){if(!wa||!wa.state)return Ze;var gn=wa.state;return gn.window&&(gn.window=null),wa.state=null,Ue}function zn(wa,gn){var Qr;return!wa||!wa.state||(Qr=wa.state,(Qr.wrap&2)===0)?Ze:(Qr.head=gn,gn.done=!1,Ue)}function di(wa,gn){var Qr=gn.length,Cn,Ao,hr;return!wa||!wa.state||(Cn=wa.state,Cn.wrap!==0&&Cn.mode!==Ra)?Ze:Cn.mode===Ra&&(Ao=1,Ao=r(Ao,gn,Qr,0),Ao!==Cn.check)?Ve:(hr=ci(wa,gn,Qr,Qr),hr?(Cn.mode=ti,er):(Cn.havedict=1,Ue))}return inflate.inflateReset=Jo,inflate.inflateReset2=fr,inflate.inflateResetKeep=yo,inflate.inflateInit=tn,inflate.inflateInit2=Xa,inflate.inflate=Zr,inflate.inflateEnd=Wa,inflate.inflateGetHeader=zn,inflate.inflateSetDictionary=di,inflate.inflateInfo="pako inflate (from Nodeca project)",inflate}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),constants}var gzheader,hasRequiredGzheader;function requireGzheader(){if(hasRequiredGzheader)return gzheader;hasRequiredGzheader=1;function e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return gzheader=e,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;var e=requireInflate$1(),r=requireCommon(),s=requireStrings(),u=requireConstants(),m=requireMessages(),H=requireZstream(),x=requireGzheader(),o=Object.prototype.toString;function F(Ue){if(!(this instanceof F))return new F(Ue);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},Ue||{});var Fe=this.options;Fe.raw&&Fe.windowBits>=0&&Fe.windowBits<16&&(Fe.windowBits=-Fe.windowBits,Fe.windowBits===0&&(Fe.windowBits=-15)),Fe.windowBits>=0&&Fe.windowBits<16&&!(Ue&&Ue.windowBits)&&(Fe.windowBits+=32),Fe.windowBits>15&&Fe.windowBits<48&&(Fe.windowBits&15)===0&&(Fe.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new H,this.strm.avail_out=0;var nt=e.inflateInit2(this.strm,Fe.windowBits);if(nt!==u.Z_OK)throw new Error(m[nt]);if(this.header=new x,e.inflateGetHeader(this.strm,this.header),Fe.dictionary&&(typeof Fe.dictionary=="string"?Fe.dictionary=s.string2buf(Fe.dictionary):o.call(Fe.dictionary)==="[object ArrayBuffer]"&&(Fe.dictionary=new Uint8Array(Fe.dictionary)),Fe.raw&&(nt=e.inflateSetDictionary(this.strm,Fe.dictionary),nt!==u.Z_OK)))throw new Error(m[nt])}F.prototype.push=function(Ue,Fe){var nt=this.strm,Ze=this.options.chunkSize,Ve=this.options.dictionary,er,st,Ke,Ye,tt,Je=!1;if(this.ended)return!1;st=Fe===~~Fe?Fe:Fe===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof Ue=="string"?nt.input=s.binstring2buf(Ue):o.call(Ue)==="[object ArrayBuffer]"?nt.input=new Uint8Array(Ue):nt.input=Ue,nt.next_in=0,nt.avail_in=nt.input.length;do{if(nt.avail_out===0&&(nt.output=new r.Buf8(Ze),nt.next_out=0,nt.avail_out=Ze),er=e.inflate(nt,u.Z_NO_FLUSH),er===u.Z_NEED_DICT&&Ve&&(er=e.inflateSetDictionary(this.strm,Ve)),er===u.Z_BUF_ERROR&&Je===!0&&(er=u.Z_OK,Je=!1),er!==u.Z_STREAM_END&&er!==u.Z_OK)return this.onEnd(er),this.ended=!0,!1;nt.next_out&&(nt.avail_out===0||er===u.Z_STREAM_END||nt.avail_in===0&&(st===u.Z_FINISH||st===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(Ke=s.utf8border(nt.output,nt.next_out),Ye=nt.next_out-Ke,tt=s.buf2string(nt.output,Ke),nt.next_out=Ye,nt.avail_out=Ze-Ye,Ye&&r.arraySet(nt.output,nt.output,Ke,Ye,0),this.onData(tt)):this.onData(r.shrinkBuf(nt.output,nt.next_out))),nt.avail_in===0&&nt.avail_out===0&&(Je=!0)}while((nt.avail_in>0||nt.avail_out===0)&&er!==u.Z_STREAM_END);return er===u.Z_STREAM_END&&(st=u.Z_FINISH),st===u.Z_FINISH?(er=e.inflateEnd(this.strm),this.onEnd(er),this.ended=!0,er===u.Z_OK):(st===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),nt.avail_out=0),!0)},F.prototype.onData=function(Ue){this.chunks.push(Ue)},F.prototype.onEnd=function(Ue){Ue===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=Ue,this.msg=this.strm.msg};function Re(Ue,Fe){var nt=new F(Fe);if(nt.push(Ue,!0),nt.err)throw nt.msg||m[nt.err];return nt.result}function He(Ue,Fe){return Fe=Fe||{},Fe.raw=!0,Re(Ue,Fe)}return inflate$1.Inflate=F,inflate$1.inflate=Re,inflate$1.inflateRaw=He,inflate$1.ungzip=Re,inflate$1}var pako_1,hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako_1;hasRequiredPako=1;var e=requireCommon().assign,r=requireDeflate(),s=requireInflate(),u=requireConstants(),m={};return e(m,r,s,u),pako_1=m,pako_1}(function(e){(function(){var r={},s;e.exports=r,typeof commonjsRequire=="function"?s=requirePako():s=window.pako,function(u,m){u.toRGBA8=function(H){var x=H.width,o=H.height;if(H.tabs.acTL==null)return[u.toRGBA8.decodeImage(H.data,x,o,H).buffer];var F=[];H.frames[0].data==null&&(H.frames[0].data=H.data);for(var Re,He=new Uint8Array(x*o*4),Ue=0;Ue<H.frames.length;Ue++){var Fe=H.frames[Ue],nt=Fe.rect.x,Ze=Fe.rect.y,Ve=Fe.rect.width,er=Fe.rect.height,st=u.toRGBA8.decodeImage(Fe.data,Ve,er,H);if(Ue==0?Re=st:Fe.blend==0?u._copyTile(st,Ve,er,Re,x,o,nt,Ze,0):Fe.blend==1&&u._copyTile(st,Ve,er,Re,x,o,nt,Ze,1),F.push(Re.buffer),Re=Re.slice(0),Fe.dispose!=0){if(Fe.dispose==1)u._copyTile(He,Ve,er,Re,x,o,nt,Ze,0);else if(Fe.dispose==2){for(var Ke=Ue-1;H.frames[Ke].dispose==2;)Ke--;Re=new Uint8Array(F[Ke]).slice(0)}}}return F},u.toRGBA8.decodeImage=function(H,x,o,F){var Re=x*o,He=u.decode._getBPP(F),Ue=Math.ceil(x*He/8),Fe=new Uint8Array(Re*4),nt=new Uint32Array(Fe.buffer),Ze=F.ctype,Ve=F.depth,er=u._bin.readUshort;if(Ze==6){var st=Re<<2;if(Ve==8)for(var Ke=0;Ke<st;Ke++)Fe[Ke]=H[Ke];if(Ve==16)for(var Ke=0;Ke<st;Ke++)Fe[Ke]=H[Ke<<1]}else if(Ze==2){var Ye=F.tabs.tRNS,tt=-1,Je=-1,rr=-1;if(Ye&&(tt=Ye[0],Je=Ye[1],rr=Ye[2]),Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ar=Ke*3;Fe[Rr]=H[ar],Fe[Rr+1]=H[ar+1],Fe[Rr+2]=H[ar+2],Fe[Rr+3]=255,tt!=-1&&H[ar]==tt&&H[ar+1]==Je&&H[ar+2]==rr&&(Fe[Rr+3]=0)}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ar=Ke*6;Fe[Rr]=H[ar],Fe[Rr+1]=H[ar+2],Fe[Rr+2]=H[ar+4],Fe[Rr+3]=255,tt!=-1&&er(H,ar)==tt&&er(H,ar+2)==Je&&er(H,ar+4)==rr&&(Fe[Rr+3]=0)}}else if(Ze==3){var Ar=F.tabs.PLTE,mr=F.tabs.tRNS,Pr=mr?mr.length:0;if(Ve==1)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>3)]>>7-((Ke&7)<<0)&1,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==2)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>2)]>>6-((Ke&3)<<1)&3,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==4)for(var Nr=0;Nr<o;Nr++)for(var Ra=Nr*Ue,ta=Nr*x,Ke=0;Ke<x;Ke++){var Rr=ta+Ke<<2,ha=H[Ra+(Ke>>1)]>>4-((Ke&1)<<2)&15,Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,ha=H[Ke],Ea=3*ha;Fe[Rr]=Ar[Ea],Fe[Rr+1]=Ar[Ea+1],Fe[Rr+2]=Ar[Ea+2],Fe[Rr+3]=ha<Pr?mr[ha]:255}}else if(Ze==4){if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,fa=Ke<<1,ga=H[fa];Fe[Rr]=ga,Fe[Rr+1]=ga,Fe[Rr+2]=ga,Fe[Rr+3]=H[fa+1]}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var Rr=Ke<<2,fa=Ke<<2,ga=H[fa];Fe[Rr]=ga,Fe[Rr+1]=ga,Fe[Rr+2]=ga,Fe[Rr+3]=H[fa+2]}}else if(Ze==0){var tt=F.tabs.tRNS?F.tabs.tRNS:-1;if(Ve==1)for(var Ke=0;Ke<Re;Ke++){var ga=255*(H[Ke>>3]>>7-(Ke&7)&1),Ja=ga==tt*255?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==2)for(var Ke=0;Ke<Re;Ke++){var ga=85*(H[Ke>>2]>>6-((Ke&3)<<1)&3),Ja=ga==tt*85?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==4)for(var Ke=0;Ke<Re;Ke++){var ga=17*(H[Ke>>1]>>4-((Ke&1)<<2)&15),Ja=ga==tt*17?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==8)for(var Ke=0;Ke<Re;Ke++){var ga=H[Ke],Ja=ga==tt?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}if(Ve==16)for(var Ke=0;Ke<Re;Ke++){var ga=H[Ke<<1],Ja=er(H,Ke<<1)==tt?0:255;nt[Ke]=Ja<<24|ga<<16|ga<<8|ga}}return Fe},u.decode=function(H){for(var x=new Uint8Array(H),o=8,F=u._bin,Re=F.readUshort,He=F.readUint,Ue={tabs:{},frames:[]},Fe=new Uint8Array(x.length),nt=0,Ze,Ve=0,er=[137,80,78,71,13,10,26,10],st=0;st<8;st++)if(x[st]!=er[st])throw"The input is not a PNG file!";for(;o<x.length;){var Ke=F.readUint(x,o);o+=4;var Ye=F.readASCII(x,o,4);if(o+=4,Ye=="IHDR")u.decode._IHDR(x,o,Ue);else if(Ye=="IDAT"){for(var st=0;st<Ke;st++)Fe[nt+st]=x[o+st];nt+=Ke}else if(Ye=="acTL")Ue.tabs[Ye]={num_frames:He(x,o),num_plays:He(x,o+4)},Ze=new Uint8Array(x.length);else if(Ye=="fcTL"){if(Ve!=0){var tt=Ue.frames[Ue.frames.length-1];tt.data=u.decode._decompress(Ue,Ze.slice(0,Ve),tt.rect.width,tt.rect.height),Ve=0}var Je={x:He(x,o+12),y:He(x,o+16),width:He(x,o+4),height:He(x,o+8)},rr=Re(x,o+22);rr=Re(x,o+20)/(rr==0?100:rr);var Rr={rect:Je,delay:Math.round(rr*1e3),dispose:x[o+24],blend:x[o+25]};Ue.frames.push(Rr)}else if(Ye=="fdAT"){for(var st=0;st<Ke-4;st++)Ze[Ve+st]=x[o+st+4];Ve+=Ke-4}else if(Ye=="pHYs")Ue.tabs[Ye]=[F.readUint(x,o),F.readUint(x,o+4),x[o+8]];else if(Ye=="cHRM"){Ue.tabs[Ye]=[];for(var st=0;st<8;st++)Ue.tabs[Ye].push(F.readUint(x,o+st*4))}else if(Ye=="tEXt"){Ue.tabs[Ye]==null&&(Ue.tabs[Ye]={});var ar=F.nextZero(x,o),Ar=F.readASCII(x,o,ar-o),mr=F.readASCII(x,ar+1,o+Ke-ar-1);Ue.tabs[Ye][Ar]=mr}else if(Ye=="iTXt"){Ue.tabs[Ye]==null&&(Ue.tabs[Ye]={});var ar=0,Pr=o;ar=F.nextZero(x,Pr);var Ar=F.readASCII(x,Pr,ar-Pr);Pr=ar+1,x[Pr],x[Pr+1],Pr+=2,ar=F.nextZero(x,Pr),F.readASCII(x,Pr,ar-Pr),Pr=ar+1,ar=F.nextZero(x,Pr),F.readUTF8(x,Pr,ar-Pr),Pr=ar+1;var mr=F.readUTF8(x,Pr,Ke-(Pr-o));Ue.tabs[Ye][Ar]=mr}else if(Ye=="PLTE")Ue.tabs[Ye]=F.readBytes(x,o,Ke);else if(Ye=="hIST"){var Nr=Ue.tabs.PLTE.length/3;Ue.tabs[Ye]=[];for(var st=0;st<Nr;st++)Ue.tabs[Ye].push(Re(x,o+st*2))}else if(Ye=="tRNS")Ue.ctype==3?Ue.tabs[Ye]=F.readBytes(x,o,Ke):Ue.ctype==0?Ue.tabs[Ye]=Re(x,o):Ue.ctype==2&&(Ue.tabs[Ye]=[Re(x,o),Re(x,o+2),Re(x,o+4)]);else if(Ye=="gAMA")Ue.tabs[Ye]=F.readUint(x,o)/1e5;else if(Ye=="sRGB")Ue.tabs[Ye]=x[o];else if(Ye=="bKGD")Ue.ctype==0||Ue.ctype==4?Ue.tabs[Ye]=[Re(x,o)]:Ue.ctype==2||Ue.ctype==6?Ue.tabs[Ye]=[Re(x,o),Re(x,o+2),Re(x,o+4)]:Ue.ctype==3&&(Ue.tabs[Ye]=x[o]);else if(Ye=="IEND"){if(Ve!=0){var tt=Ue.frames[Ue.frames.length-1];tt.data=u.decode._decompress(Ue,Ze.slice(0,Ve),tt.rect.width,tt.rect.height),Ve=0}Ue.data=u.decode._decompress(Ue,Fe,Ue.width,Ue.height);break}o+=Ke,F.readUint(x,o),o+=4}return delete Ue.compress,delete Ue.interlace,delete Ue.filter,Ue},u.decode._decompress=function(H,x,o,F){return H.compress==0&&(x=u.decode._inflate(x)),H.interlace==0?x=u.decode._filterZero(x,H,0,o,F):H.interlace==1&&(x=u.decode._readInterlace(x,H)),x},u.decode._inflate=function(H){return m.inflate(H)},u.decode._readInterlace=function(H,x){for(var o=x.width,F=x.height,Re=u.decode._getBPP(x),He=Re>>3,Ue=Math.ceil(o*Re/8),Fe=new Uint8Array(F*Ue),nt=0,Ze=[0,0,4,0,2,0,1],Ve=[0,4,0,2,0,1,0],er=[8,8,8,4,4,2,2],st=[8,8,4,4,2,2,1],Ke=0;Ke<7;){for(var Ye=er[Ke],tt=st[Ke],Je=0,rr=0,Rr=Ze[Ke];Rr<F;)Rr+=Ye,rr++;for(var ar=Ve[Ke];ar<o;)ar+=tt,Je++;var Ar=Math.ceil(Je*Re/8);u.decode._filterZero(H,x,nt,Je,rr);for(var mr=0,Pr=Ze[Ke];Pr<F;){for(var Nr=Ve[Ke],Ra=nt+mr*Ar<<3;Nr<o;){if(Re==1){var ta=H[Ra>>3];ta=ta>>7-(Ra&7)&1,Fe[Pr*Ue+(Nr>>3)]|=ta<<7-((Nr&3)<<0)}if(Re==2){var ta=H[Ra>>3];ta=ta>>6-(Ra&7)&3,Fe[Pr*Ue+(Nr>>2)]|=ta<<6-((Nr&3)<<1)}if(Re==4){var ta=H[Ra>>3];ta=ta>>4-(Ra&7)&15,Fe[Pr*Ue+(Nr>>1)]|=ta<<4-((Nr&1)<<2)}if(Re>=8)for(var ha=Pr*Ue+Nr*He,Ea=0;Ea<He;Ea++)Fe[ha+Ea]=H[(Ra>>3)+Ea];Ra+=Re,Nr+=tt}mr++,Pr+=Ye}Je*rr!=0&&(nt+=rr*(1+Ar)),Ke=Ke+1}return Fe},u.decode._getBPP=function(H){var x=[1,null,3,1,2,null,4][H.ctype];return x*H.depth},u.decode._filterZero=function(H,x,o,F,Re){var He=u.decode._getBPP(x),Ue=Math.ceil(F*He/8),Fe=u.decode._paeth;He=Math.ceil(He/8);for(var nt=0;nt<Re;nt++){var Ze=o+nt*Ue,Ve=Ze+nt+1,er=H[Ve-1];if(er==0)for(var st=0;st<Ue;st++)H[Ze+st]=H[Ve+st];else if(er==1){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st];for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+H[Ze+st-He]&255}else if(nt==0){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st];if(er==2)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]&255;if(er==3)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-He]>>1)&255;if(er==4)for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+Fe(H[Ze+st-He],0,0)&255}else{if(er==2)for(var st=0;st<Ue;st++)H[Ze+st]=H[Ve+st]+H[Ze+st-Ue]&255;if(er==3){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-Ue]>>1)&255;for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+(H[Ze+st-Ue]+H[Ze+st-He]>>1)&255}if(er==4){for(var st=0;st<He;st++)H[Ze+st]=H[Ve+st]+Fe(0,H[Ze+st-Ue],0)&255;for(var st=He;st<Ue;st++)H[Ze+st]=H[Ve+st]+Fe(H[Ze+st-He],H[Ze+st-Ue],H[Ze+st-He-Ue])&255}}}return H},u.decode._paeth=function(H,x,o){var F=H+x-o,Re=Math.abs(F-H),He=Math.abs(F-x),Ue=Math.abs(F-o);return Re<=He&&Re<=Ue?H:He<=Ue?x:o},u.decode._IHDR=function(H,x,o){var F=u._bin;o.width=F.readUint(H,x),x+=4,o.height=F.readUint(H,x),x+=4,o.depth=H[x],x++,o.ctype=H[x],x++,o.compress=H[x],x++,o.filter=H[x],x++,o.interlace=H[x],x++},u._bin={nextZero:function(H,x){for(;H[x]!=0;)x++;return x},readUshort:function(H,x){return H[x]<<8|H[x+1]},writeUshort:function(H,x,o){H[x]=o>>8&255,H[x+1]=o&255},readUint:function(H,x){return H[x]*(256*256*256)+(H[x+1]<<16|H[x+2]<<8|H[x+3])},writeUint:function(H,x,o){H[x]=o>>24&255,H[x+1]=o>>16&255,H[x+2]=o>>8&255,H[x+3]=o&255},readASCII:function(H,x,o){for(var F="",Re=0;Re<o;Re++)F+=String.fromCharCode(H[x+Re]);return F},writeASCII:function(H,x,o){for(var F=0;F<o.length;F++)H[x+F]=o.charCodeAt(F)},readBytes:function(H,x,o){for(var F=[],Re=0;Re<o;Re++)F.push(H[x+Re]);return F},pad:function(H){return H.length<2?"0"+H:H},readUTF8:function(H,x,o){for(var F="",Re,He=0;He<o;He++)F+="%"+u._bin.pad(H[x+He].toString(16));try{Re=decodeURIComponent(F)}catch{return u._bin.readASCII(H,x,o)}return Re}},u._copyTile=function(H,x,o,F,Re,He,Ue,Fe,nt){for(var Ze=Math.min(x,Re),Ve=Math.min(o,He),er=0,st=0,Ke=0;Ke<Ve;Ke++)for(var Ye=0;Ye<Ze;Ye++)if(Ue>=0&&Fe>=0?(er=Ke*x+Ye<<2,st=(Fe+Ke)*Re+Ue+Ye<<2):(er=(-Fe+Ke)*x-Ue+Ye<<2,st=Ke*Re+Ye<<2),nt==0)F[st]=H[er],F[st+1]=H[er+1],F[st+2]=H[er+2],F[st+3]=H[er+3];else if(nt==1){var tt=H[er+3]*.00392156862745098,Je=H[er]*tt,rr=H[er+1]*tt,Rr=H[er+2]*tt,ar=F[st+3]*(1/255),Ar=F[st]*ar,mr=F[st+1]*ar,Pr=F[st+2]*ar,Nr=1-tt,Ra=tt+ar*Nr,ta=Ra==0?0:1/Ra;F[st+3]=255*Ra,F[st+0]=(Je+Ar*Nr)*ta,F[st+1]=(rr+mr*Nr)*ta,F[st+2]=(Rr+Pr*Nr)*ta}else if(nt==2){var tt=H[er+3],Je=H[er],rr=H[er+1],Rr=H[er+2],ar=F[st+3],Ar=F[st],mr=F[st+1],Pr=F[st+2];tt==ar&&Je==Ar&&rr==mr&&Rr==Pr?(F[st]=0,F[st+1]=0,F[st+2]=0,F[st+3]=0):(F[st]=Je,F[st+1]=rr,F[st+2]=Rr,F[st+3]=tt)}else if(nt==3){var tt=H[er+3],Je=H[er],rr=H[er+1],Rr=H[er+2],ar=F[st+3],Ar=F[st],mr=F[st+1],Pr=F[st+2];if(tt==ar&&Je==Ar&&rr==mr&&Rr==Pr)continue;if(tt<220&&ar>20)return!1}return!0},u.encode=function(H,x,o,F,Re,He){F==null&&(F=0),He==null&&(He=!1);for(var Ue=new Uint8Array(H[0].byteLength*H.length+100),Fe=[137,80,78,71,13,10,26,10],nt=0;nt<8;nt++)Ue[nt]=Fe[nt];var Ze=8,Ve=u._bin,er=u.crc.crc,st=Ve.writeUint,Ke=Ve.writeUshort,Ye=Ve.writeASCII,tt=u.encode.compressPNG(H,x,o,F,He);st(Ue,Ze,13),Ze+=4,Ye(Ue,Ze,"IHDR"),Ze+=4,st(Ue,Ze,x),Ze+=4,st(Ue,Ze,o),Ze+=4,Ue[Ze]=tt.depth,Ze++,Ue[Ze]=tt.ctype,Ze++,Ue[Ze]=0,Ze++,Ue[Ze]=0,Ze++,Ue[Ze]=0,Ze++,st(Ue,Ze,er(Ue,Ze-17,17)),Ze+=4,st(Ue,Ze,1),Ze+=4,Ye(Ue,Ze,"sRGB"),Ze+=4,Ue[Ze]=1,Ze++,st(Ue,Ze,er(Ue,Ze-5,5)),Ze+=4;var Je=H.length>1;if(Je&&(st(Ue,Ze,8),Ze+=4,Ye(Ue,Ze,"acTL"),Ze+=4,st(Ue,Ze,H.length),Ze+=4,st(Ue,Ze,0),Ze+=4,st(Ue,Ze,er(Ue,Ze-12,12)),Ze+=4),tt.ctype==3){var rr=tt.plte.length;st(Ue,Ze,rr*3),Ze+=4,Ye(Ue,Ze,"PLTE"),Ze+=4;for(var nt=0;nt<rr;nt++){var Rr=nt*3,ar=tt.plte[nt],Ar=ar&255,mr=ar>>8&255,Pr=ar>>16&255;Ue[Ze+Rr+0]=Ar,Ue[Ze+Rr+1]=mr,Ue[Ze+Rr+2]=Pr}if(Ze+=rr*3,st(Ue,Ze,er(Ue,Ze-rr*3-4,rr*3+4)),Ze+=4,tt.gotAlpha){st(Ue,Ze,rr),Ze+=4,Ye(Ue,Ze,"tRNS"),Ze+=4;for(var nt=0;nt<rr;nt++)Ue[Ze+nt]=tt.plte[nt]>>24&255;Ze+=rr,st(Ue,Ze,er(Ue,Ze-rr-4,rr+4)),Ze+=4}}for(var Nr=0,Ra=0;Ra<tt.frames.length;Ra++){var ta=tt.frames[Ra];Je&&(st(Ue,Ze,26),Ze+=4,Ye(Ue,Ze,"fcTL"),Ze+=4,st(Ue,Ze,Nr++),Ze+=4,st(Ue,Ze,ta.rect.width),Ze+=4,st(Ue,Ze,ta.rect.height),Ze+=4,st(Ue,Ze,ta.rect.x),Ze+=4,st(Ue,Ze,ta.rect.y),Ze+=4,Ke(Ue,Ze,Re[Ra]),Ze+=2,Ke(Ue,Ze,1e3),Ze+=2,Ue[Ze]=ta.dispose,Ze++,Ue[Ze]=ta.blend,Ze++,st(Ue,Ze,er(Ue,Ze-30,30)),Ze+=4);var ha=ta.cimg,rr=ha.length;st(Ue,Ze,rr+(Ra==0?0:4)),Ze+=4;var Ea=Ze;Ye(Ue,Ze,Ra==0?"IDAT":"fdAT"),Ze+=4,Ra!=0&&(st(Ue,Ze,Nr++),Ze+=4);for(var nt=0;nt<rr;nt++)Ue[Ze+nt]=ha[nt];Ze+=rr,st(Ue,Ze,er(Ue,Ea,Ze-Ea)),Ze+=4}return st(Ue,Ze,0),Ze+=4,Ye(Ue,Ze,"IEND"),Ze+=4,st(Ue,Ze,er(Ue,Ze-4,4)),Ze+=4,Ue.buffer.slice(0,Ze)},u.encode.compressPNG=function(H,x,o,F,Re){for(var He=u.encode.compress(H,x,o,F,!1,Re),Ue=0;Ue<H.length;Ue++){var Fe=He.frames[Ue];Fe.rect.width;var nt=Fe.rect.height,Ze=Fe.bpl,Ve=Fe.bpp,er=new Uint8Array(nt*Ze+nt);Fe.cimg=u.encode._filterZero(Fe.img,nt,Ve,Ze,er)}return He},u.encode.compress=function(H,x,o,F,Re,He){He==null&&(He=!1);for(var Ue=6,Fe=8,nt=4,Ze=255,Ve=0;Ve<H.length;Ve++)for(var er=new Uint8Array(H[Ve]),st=er.length,Ke=0;Ke<st;Ke+=4)Ze&=er[Ke+3];var Ye=Ze!=255,tt={},Je=[];if(H.length!=0&&(tt[0]=0,Je.push(0),F!=0&&F--),F!=0){var rr=u.quantize(H,F,Re);H=rr.bufs;for(var Ke=0;Ke<rr.plte.length;Ke++){var Rr=rr.plte[Ke].est.rgba;tt[Rr]==null&&(tt[Rr]=Je.length,Je.push(Rr))}}else for(var Ve=0;Ve<H.length;Ve++)for(var ar=new Uint32Array(H[Ve]),st=ar.length,Ke=0;Ke<st;Ke++){var Rr=ar[Ke];if((Ke<x||Rr!=ar[Ke-1]&&Rr!=ar[Ke-x])&&tt[Rr]==null&&(tt[Rr]=Je.length,Je.push(Rr),Je.length>=300))break}var Ar=Ye?Re:!1,mr=Je.length;mr<=256&&He==!1&&(mr<=2?Fe=1:mr<=4?Fe=2:mr<=16?Fe=4:Fe=8,Re&&(Fe=8),Ye=!0);for(var Pr=[],Ve=0;Ve<H.length;Ve++){var Nr=new Uint8Array(H[Ve]),Ra=new Uint32Array(Nr.buffer),ta=0,ha=0,Ea=x,fa=o,ga=0;if(Ve!=0&&!Ar){for(var Ja=Re||Ve==1||Pr[Pr.length-2].dispose==2?1:2,Ba=0,Pn=1e9,_n=0;_n<Ja;_n++){for(var So=new Uint8Array(H[Ve-1-_n]),cn=new Uint32Array(H[Ve-1-_n]),ui=x,Vn=o,fn=-1,kn=-1,Ln=0;Ln<o;Ln++)for(var On=0;On<x;On++){var Ke=Ln*x+On;Ra[Ke]!=cn[Ke]&&(On<ui&&(ui=On),On>fn&&(fn=On),Ln<Vn&&(Vn=Ln),Ln>kn&&(kn=Ln))}var Ci=fn==-1?1:(fn-ui+1)*(kn-Vn+1);Ci<Pn&&(Pn=Ci,Ba=_n,fn==-1?(ta=ha=0,Ea=fa=1):(ta=ui,ha=Vn,Ea=fn-ui+1,fa=kn-Vn+1))}var So=new Uint8Array(H[Ve-1-Ba]);Ba==1&&(Pr[Pr.length-1].dispose=2);var ii=new Uint8Array(Ea*fa*4);new Uint32Array(ii.buffer),u._copyTile(So,x,o,ii,Ea,fa,-ta,-ha,0),u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,3)?(u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,2),ga=1):(u._copyTile(Nr,x,o,ii,Ea,fa,-ta,-ha,0),ga=0),Nr=ii,Ra=new Uint32Array(Nr.buffer)}var ti=4*Ea;if(mr<=256&&He==!1){ti=Math.ceil(Fe*Ea/8);for(var ii=new Uint8Array(ti*fa),Ln=0;Ln<fa;Ln++){var Ke=Ln*ti,fi=Ln*Ea;if(Fe==8)for(var On=0;On<Ea;On++)ii[Ke+On]=tt[Ra[fi+On]];else if(Fe==4)for(var On=0;On<Ea;On++)ii[Ke+(On>>1)]|=tt[Ra[fi+On]]<<4-(On&1)*4;else if(Fe==2)for(var On=0;On<Ea;On++)ii[Ke+(On>>2)]|=tt[Ra[fi+On]]<<6-(On&3)*2;else if(Fe==1)for(var On=0;On<Ea;On++)ii[Ke+(On>>3)]|=tt[Ra[fi+On]]<<7-(On&7)*1}Nr=ii,Ue=3,nt=1}else if(Ye==!1&&H.length==1){for(var ii=new Uint8Array(Ea*fa*3),Zi=Ea*fa,Ke=0;Ke<Zi;Ke++){var $i=Ke*3,_o=Ke*4;ii[$i]=Nr[_o],ii[$i+1]=Nr[_o+1],ii[$i+2]=Nr[_o+2]}Nr=ii,Ue=2,nt=3,ti=3*Ea}Pr.push({rect:{x:ta,y:ha,width:Ea,height:fa},img:Nr,bpl:ti,bpp:nt,blend:ga,dispose:Ar?1:0})}return{ctype:Ue,depth:Fe,plte:Je,gotAlpha:Ye,frames:Pr}},u.encode._filterZero=function(H,x,o,F,Re){for(var He=[],Ue=0;Ue<5;Ue++)if(!(x*F>5e5&&(Ue==2||Ue==3||Ue==4))){for(var Fe=0;Fe<x;Fe++)u.encode._filterLine(Re,H,Fe,F,o,Ue);if(He.push(m.deflate(Re)),o==1)break}for(var nt,Ze=1e9,Ve=0;Ve<He.length;Ve++)He[Ve].length<Ze&&(nt=Ve,Ze=He[Ve].length);return He[nt]},u.encode._filterLine=function(H,x,o,F,Re,He){var Ue=o*F,Fe=Ue+o,nt=u.decode._paeth;if(H[Fe]=He,Fe++,He==0)for(var Ze=0;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze];else if(He==1){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze];for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-x[Ue+Ze-Re]+256&255}else if(o==0){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze];if(He==2)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze];if(He==3)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-(x[Ue+Ze-Re]>>1)+256&255;if(He==4)for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]-nt(x[Ue+Ze-Re],0,0)+256&255}else{if(He==2)for(var Ze=0;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-x[Ue+Ze-F]&255;if(He==3){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-(x[Ue+Ze-F]>>1)&255;for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-(x[Ue+Ze-F]+x[Ue+Ze-Re]>>1)&255}if(He==4){for(var Ze=0;Ze<Re;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-nt(0,x[Ue+Ze-F],0)&255;for(var Ze=Re;Ze<F;Ze++)H[Fe+Ze]=x[Ue+Ze]+256-nt(x[Ue+Ze-Re],x[Ue+Ze-F],x[Ue+Ze-Re-F])&255}}},u.crc={table:function(){for(var H=new Uint32Array(256),x=0;x<256;x++){for(var o=x,F=0;F<8;F++)o&1?o=3988292384^o>>>1:o=o>>>1;H[x]=o}return H}(),update:function(H,x,o,F){for(var Re=0;Re<F;Re++)H=u.crc.table[(H^x[o+Re])&255]^H>>>8;return H},crc:function(H,x,o){return u.crc.update(4294967295,H,x,o)^4294967295}},u.quantize=function(H,x,o){for(var F=[],Re=0,He=0;He<H.length;He++)F.push(u.encode.alphaMul(new Uint8Array(H[He]),o)),Re+=H[He].byteLength;for(var Ue=new Uint8Array(Re),Fe=new Uint32Array(Ue.buffer),nt=0,He=0;He<F.length;He++){for(var Ze=F[He],Ve=Ze.length,er=0;er<Ve;er++)Ue[nt+er]=Ze[er];nt+=Ve}var st={i0:0,i1:Ue.length,bst:null,est:null,tdst:0,left:null,right:null};st.bst=u.quantize.stats(Ue,st.i0,st.i1),st.est=u.quantize.estats(st.bst);for(var Ke=[st];Ke.length<x;){for(var Ye=0,tt=0,He=0;He<Ke.length;He++)Ke[He].est.L>Ye&&(Ye=Ke[He].est.L,tt=He);if(Ye<.001)break;var Je=Ke[tt],rr=u.quantize.splitPixels(Ue,Fe,Je.i0,Je.i1,Je.est.e,Je.est.eMq255),Rr={i0:Je.i0,i1:rr,bst:null,est:null,tdst:0,left:null,right:null};Rr.bst=u.quantize.stats(Ue,Rr.i0,Rr.i1),Rr.est=u.quantize.estats(Rr.bst);var ar={i0:rr,i1:Je.i1,bst:null,est:null,tdst:0,left:null,right:null};ar.bst={R:[],m:[],N:Je.bst.N-Rr.bst.N};for(var He=0;He<16;He++)ar.bst.R[He]=Je.bst.R[He]-Rr.bst.R[He];for(var He=0;He<4;He++)ar.bst.m[He]=Je.bst.m[He]-Rr.bst.m[He];ar.est=u.quantize.estats(ar.bst),Je.left=Rr,Je.right=ar,Ke[tt]=Rr,Ke.push(ar)}Ke.sort(function(Ja,Ba){return Ba.bst.N-Ja.bst.N});for(var Ar=0;Ar<F.length;Ar++){for(var mr=u.quantize.planeDst,Pr=new Uint8Array(F[Ar].buffer),Nr=new Uint32Array(F[Ar].buffer),Ra=Pr.length,He=0;He<Ra;He+=4){for(var ta=Pr[He]*.00392156862745098,ha=Pr[He+1]*(1/255),Ea=Pr[He+2]*(1/255),fa=Pr[He+3]*(1/255),ga=st;ga.left;)ga=mr(ga.est,ta,ha,Ea,fa)<=0?ga.left:ga.right;Nr[He>>2]=ga.est.rgba}F[Ar]=Nr.buffer}return{bufs:F,plte:Ke}},u.quantize.getNearest=function(H,x,o,F,Re){if(H.left==null)return H.tdst=u.quantize.dist(H.est.q,x,o,F,Re),H;var He=u.quantize.planeDst(H.est,x,o,F,Re),Ue=H.left,Fe=H.right;He>0&&(Ue=H.right,Fe=H.left);var nt=u.quantize.getNearest(Ue,x,o,F,Re);if(nt.tdst<=He*He)return nt;var Ze=u.quantize.getNearest(Fe,x,o,F,Re);return Ze.tdst<nt.tdst?Ze:nt},u.quantize.planeDst=function(H,x,o,F,Re){var He=H.e;return He[0]*x+He[1]*o+He[2]*F+He[3]*Re-H.eMq},u.quantize.dist=function(H,x,o,F,Re){var He=x-H[0],Ue=o-H[1],Fe=F-H[2],nt=Re-H[3];return He*He+Ue*Ue+Fe*Fe+nt*nt},u.quantize.splitPixels=function(H,x,o,F,Re,He){var Ue=u.quantize.vecDot;for(F-=4;o<F;){for(;Ue(H,o,Re)<=He;)o+=4;for(;Ue(H,F,Re)>He;)F-=4;if(o>=F)break;var Fe=x[o>>2];x[o>>2]=x[F>>2],x[F>>2]=Fe,o+=4,F-=4}for(;Ue(H,o,Re)>He;)o-=4;return o+4},u.quantize.vecDot=function(H,x,o){return H[x]*o[0]+H[x+1]*o[1]+H[x+2]*o[2]+H[x+3]*o[3]},u.quantize.stats=function(H,x,o){for(var F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Re=[0,0,0,0],He=o-x>>2,Ue=x;Ue<o;Ue+=4){var Fe=H[Ue]*.00392156862745098,nt=H[Ue+1]*(1/255),Ze=H[Ue+2]*(1/255),Ve=H[Ue+3]*(1/255);Re[0]+=Fe,Re[1]+=nt,Re[2]+=Ze,Re[3]+=Ve,F[0]+=Fe*Fe,F[1]+=Fe*nt,F[2]+=Fe*Ze,F[3]+=Fe*Ve,F[5]+=nt*nt,F[6]+=nt*Ze,F[7]+=nt*Ve,F[10]+=Ze*Ze,F[11]+=Ze*Ve,F[15]+=Ve*Ve}return F[4]=F[1],F[8]=F[2],F[12]=F[3],F[9]=F[6],F[13]=F[7],F[14]=F[11],{R:F,m:Re,N:He}},u.quantize.estats=function(H){var x=H.R,o=H.m,F=H.N,Re=o[0],He=o[1],Ue=o[2],Fe=o[3],nt=F==0?0:1/F,Ze=[x[0]-Re*Re*nt,x[1]-Re*He*nt,x[2]-Re*Ue*nt,x[3]-Re*Fe*nt,x[4]-He*Re*nt,x[5]-He*He*nt,x[6]-He*Ue*nt,x[7]-He*Fe*nt,x[8]-Ue*Re*nt,x[9]-Ue*He*nt,x[10]-Ue*Ue*nt,x[11]-Ue*Fe*nt,x[12]-Fe*Re*nt,x[13]-Fe*He*nt,x[14]-Fe*Ue*nt,x[15]-Fe*Fe*nt],Ve=Ze,er=u.M4,st=[.5,.5,.5,.5],Ke=0,Ye=0;if(F!=0)for(var tt=0;tt<10&&(st=er.multVec(Ve,st),Ye=Math.sqrt(er.dot(st,st)),st=er.sml(1/Ye,st),!(Math.abs(Ye-Ke)<1e-9));tt++)Ke=Ye;var Je=[Re*nt,He*nt,Ue*nt,Fe*nt],rr=er.dot(er.sml(255,Je),st),Rr=Je[3]<.001?0:1/Je[3];return{Cov:Ze,q:Je,e:st,L:Ke,eMq255:rr,eMq:er.dot(st,Je),rgba:(Math.round(255*Je[3])<<24|Math.round(255*Je[2]*Rr)<<16|Math.round(255*Je[1]*Rr)<<8|Math.round(255*Je[0]*Rr)<<0)>>>0}},u.M4={multVec:function(H,x){return[H[0]*x[0]+H[1]*x[1]+H[2]*x[2]+H[3]*x[3],H[4]*x[0]+H[5]*x[1]+H[6]*x[2]+H[7]*x[3],H[8]*x[0]+H[9]*x[1]+H[10]*x[2]+H[11]*x[3],H[12]*x[0]+H[13]*x[1]+H[14]*x[2]+H[15]*x[3]]},dot:function(H,x){return H[0]*x[0]+H[1]*x[1]+H[2]*x[2]+H[3]*x[3]},sml:function(H,x){return[H*x[0],H*x[1],H*x[2],H*x[3]]}},u.encode.alphaMul=function(H,x){for(var o=new Uint8Array(H.length),F=H.length>>2,Re=0;Re<F;Re++){var He=Re<<2,Ue=H[He+3];x&&(Ue=Ue<128?0:255);var Fe=Ue*(1/255);o[He+0]=H[He+0]*Fe,o[He+1]=H[He+1]*Fe,o[He+2]=H[He+2]*Fe,o[He+3]=Ue}return o}}(r,s)})()})(UPNG);const CLEAR_COLOR=[0,0,0,0],MAX_TEXTURE_DIMENSION=1024,EARTH_SUN_DISTANCE=1496e8,EARTH_CIRCUMFERENCE=40075016686e-3,SUN_RADIUS=695508e3,DEG2RAD=.017453292519943295,SLOPEFACTOR=.0333334,RGB_REGEX=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,HEX_REGEX=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig;function machineIsLittleEndian(){const e=new Uint8Array([170,187]);return new Uint16Array(e.buffer)[0]===48042}function range(...e){if(e.length===1){const[r]=e;return new Array(r).fill(void 0).map((s,u)=>u)}else{const[r,s,u=1]=e;if(u===0)throw new Error("Argument step must be nonzero.");const m=[];for(let H=r;u>0?H<s:H>s;H+=u)m.push(H);return m}}async function fetchPNGData(e,r,s){return new Promise((u,m)=>{const H=new XMLHttpRequest;H.open("GET",e,!0),H.responseType="arraybuffer",H.addEventListener("load",()=>{u(H.response)}),H.addEventListener("error",m),H.send(null)}).then(u=>{const m=UPNG.exports.decode(u),H=UPNG.exports.toRGBA8(m)[0];return new Uint8Array(H)}).catch(()=>createNoDataTile(r,s))}function typedArraysAreEqual(e,r){return e.byteLength!==r.byteLength?!1:e.every((s,u)=>s===r[u])}function getTransformMatrix(e,r){const s=2/e,u=-2/r;return[s,0,0,0,0,u,0,0,0,0,1,0,-1,1,0,1]}function getTexCoordVerticesTriangleStripQuad(e){const[{x:r,y:s},{x:u,y:m}]=e;return[[r,s],[u,s],[r,m],[u,m]]}const createNoDataTile=lodash.exports.memoize((e,r=256)=>{const s=new Float32Array(r*r);return s.fill(e),new Uint8Array(s.buffer)});function defineMacros(e,r){return`${Object.keys(r).map(u=>`#define ${u} ${r[u]}
|
|
209
209
|
`).join("")}
|
|
210
210
|
${e}`}const hexToRGB=e=>{const r=e.length===9,s=r?24:16,u=parseInt(e.slice(1),16),m=u>>s&255,H=u>>s-8&255,x=u>>s-16&255,o=r?u>>s-24&255:255;return[m,H,x,o]};function colorStringToInts(e){if(e==="transparent")return[0,0,0,0];const r=e.match(RGB_REGEX),s=e.match(HEX_REGEX);if(r!==null){const[,u,m,H]=r;return[+u,+m,+H,255]}else{if(s!==null)return hexToRGB(e);throw new Error(`'${e}' is not a valid RGB or hex color expression.`)}}const colormapToFlatArray=e=>{const r=[];let s=[];for(let o=0;o<e.length;o++){r.push(e[o].offset);const F=colorStringToInts(e[o].color);s=s.concat(F)}const u=new Float32Array(r),m=new Uint8Array(u.buffer),H=Array.from(m);return s.concat(H)};function createColormapTexture(e,r){const s=colormapToFlatArray(e);let u;return e.length===0?u=r.texture({shape:[2,2]}):u=r.texture({width:e.length,height:2,data:s}),u}var regl={exports:{}};(function(e,r){(function(s,u){e.exports=u()})(commonjsGlobal,function(){var s=function(gr){return gr instanceof Uint8Array||gr instanceof Uint16Array||gr instanceof Uint32Array||gr instanceof Int8Array||gr instanceof Int16Array||gr instanceof Int32Array||gr instanceof Float32Array||gr instanceof Float64Array||gr instanceof Uint8ClampedArray},u=function(gr,Sa){for(var pa=Object.keys(Sa),En=0;En<pa.length;++En)gr[pa[En]]=Sa[pa[En]];return gr},m=`
|
|
211
211
|
`;function H(gr){return typeof atob<"u"?atob(gr):"base64:"+gr}function x(gr){var Sa=new Error("(regl) "+gr);throw console.error(Sa),Sa}function o(gr,Sa){gr||x(Sa)}function F(gr){return gr?": "+gr:""}function Re(gr,Sa,pa){gr in Sa||x("unknown parameter ("+gr+")"+F(pa)+". possible values: "+Object.keys(Sa).join())}function He(gr,Sa){s(gr)||x("invalid parameter type"+F(Sa)+". must be a typed array")}function Ue(gr,Sa){switch(Sa){case"number":return typeof gr=="number";case"object":return typeof gr=="object";case"string":return typeof gr=="string";case"boolean":return typeof gr=="boolean";case"function":return typeof gr=="function";case"undefined":return typeof gr>"u";case"symbol":return typeof gr=="symbol"}}function Fe(gr,Sa,pa){Ue(gr,Sa)||x("invalid parameter type"+F(pa)+". expected "+Sa+", got "+typeof gr)}function nt(gr,Sa){gr>=0&&(gr|0)===gr||x("invalid parameter type, ("+gr+")"+F(Sa)+". must be a nonnegative integer")}function Ze(gr,Sa,pa){Sa.indexOf(gr)<0&&x("invalid value"+F(pa)+". must be one of: "+Sa)}var Ve=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function er(gr){Object.keys(gr).forEach(function(Sa){Ve.indexOf(Sa)<0&&x('invalid regl constructor argument "'+Sa+'". must be one of '+Ve)})}function st(gr,Sa){for(gr=gr+"";gr.length<Sa;)gr=" "+gr;return gr}function Ke(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function Ye(gr,Sa){this.number=gr,this.line=Sa,this.errors=[]}function tt(gr,Sa,pa){this.file=gr,this.line=Sa,this.message=pa}function Je(){var gr=new Error,Sa=(gr.stack||gr).toString(),pa=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(Sa);if(pa)return pa[1];var En=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(Sa);return En?En[1]:"unknown"}function rr(){var gr=new Error,Sa=(gr.stack||gr).toString(),pa=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(Sa);if(pa)return pa[1];var En=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(Sa);return En?En[1]:"unknown"}function Rr(gr,Sa){var pa=gr.split(`
|
|
@@ -486,7 +486,7 @@ Example:
|
|
|
486
486
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
487
487
|
**/(function(e,r){(function(s){var u=2e3,m={s:1,n:0,d:1};function H(st,Ke){if(isNaN(st=parseInt(st,10)))throw Ve();return st*Ke}function x(st,Ke){if(Ke===0)throw Ze();var Ye=Object.create(nt.prototype);Ye.s=st<0?-1:1,st=st<0?-st:st;var tt=Fe(st,Ke);return Ye.n=st/tt,Ye.d=Ke/tt,Ye}function o(st){for(var Ke={},Ye=st,tt=2,Je=4;Je<=Ye;){for(;Ye%tt===0;)Ye/=tt,Ke[tt]=(Ke[tt]||0)+1;Je+=1+2*tt++}return Ye!==st?Ye>1&&(Ke[Ye]=(Ke[Ye]||0)+1):Ke[st]=(Ke[st]||0)+1,Ke}var F=function(st,Ke){var Ye=0,tt=1,Je=1,rr=0,Rr=0,ar=0,Ar=1,mr=1,Pr=0,Nr=1,Ra=1,ta=1,ha=1e7,Ea;if(st!=null)if(Ke!==void 0){if(Ye=st,tt=Ke,Je=Ye*tt,Ye%1!==0||tt%1!==0)throw er()}else switch(typeof st){case"object":{if("d"in st&&"n"in st)Ye=st.n,tt=st.d,"s"in st&&(Ye*=st.s);else if(0 in st)Ye=st[0],1 in st&&(tt=st[1]);else throw Ve();Je=Ye*tt;break}case"number":{if(st<0&&(Je=st,st=-st),st%1===0)Ye=st;else if(st>0){for(st>=1&&(mr=Math.pow(10,Math.floor(1+Math.log(st)/Math.LN10)),st/=mr);Nr<=ha&&ta<=ha;)if(Ea=(Pr+Ra)/(Nr+ta),st===Ea){Nr+ta<=ha?(Ye=Pr+Ra,tt=Nr+ta):ta>Nr?(Ye=Ra,tt=ta):(Ye=Pr,tt=Nr);break}else st>Ea?(Pr+=Ra,Nr+=ta):(Ra+=Pr,ta+=Nr),Nr>ha?(Ye=Ra,tt=ta):(Ye=Pr,tt=Nr);Ye*=mr}else(isNaN(st)||isNaN(Ke))&&(tt=Ye=NaN);break}case"string":{if(Nr=st.match(/\d+|./g),Nr===null)throw Ve();if(Nr[Pr]==="-"?(Je=-1,Pr++):Nr[Pr]==="+"&&Pr++,Nr.length===Pr+1?Rr=H(Nr[Pr++],Je):Nr[Pr+1]==="."||Nr[Pr]==="."?(Nr[Pr]!=="."&&(rr=H(Nr[Pr++],Je)),Pr++,(Pr+1===Nr.length||Nr[Pr+1]==="("&&Nr[Pr+3]===")"||Nr[Pr+1]==="'"&&Nr[Pr+3]==="'")&&(Rr=H(Nr[Pr],Je),Ar=Math.pow(10,Nr[Pr].length),Pr++),(Nr[Pr]==="("&&Nr[Pr+2]===")"||Nr[Pr]==="'"&&Nr[Pr+2]==="'")&&(ar=H(Nr[Pr+1],Je),mr=Math.pow(10,Nr[Pr+1].length)-1,Pr+=3)):Nr[Pr+1]==="/"||Nr[Pr+1]===":"?(Rr=H(Nr[Pr],Je),Ar=H(Nr[Pr+2],1),Pr+=3):Nr[Pr+3]==="/"&&Nr[Pr+1]===" "&&(rr=H(Nr[Pr],Je),Rr=H(Nr[Pr+2],Je),Ar=H(Nr[Pr+4],1),Pr+=5),Nr.length<=Pr){tt=Ar*mr,Je=Ye=ar+tt*rr+mr*Rr;break}}default:throw Ve()}if(tt===0)throw Ze();m.s=Je<0?-1:1,m.n=Math.abs(Ye),m.d=Math.abs(tt)};function Re(st,Ke,Ye){for(var tt=1;Ke>0;st=st*st%Ye,Ke>>=1)Ke&1&&(tt=tt*st%Ye);return tt}function He(st,Ke){for(;Ke%2===0;Ke/=2);for(;Ke%5===0;Ke/=5);if(Ke===1)return 0;for(var Ye=10%Ke,tt=1;Ye!==1;tt++)if(Ye=Ye*10%Ke,tt>u)return 0;return tt}function Ue(st,Ke,Ye){for(var tt=1,Je=Re(10,Ye,Ke),rr=0;rr<300;rr++){if(tt===Je)return rr;tt=tt*10%Ke,Je=Je*10%Ke}return 0}function Fe(st,Ke){if(!st)return Ke;if(!Ke)return st;for(;;){if(st%=Ke,!st)return Ke;if(Ke%=st,!Ke)return st}}function nt(st,Ke){if(F(st,Ke),this instanceof nt)st=Fe(m.d,m.n),this.s=m.s,this.n=m.n/st,this.d=m.d/st;else return x(m.s*m.n,m.d)}var Ze=function(){return new Error("Division by Zero")},Ve=function(){return new Error("Invalid argument")},er=function(){return new Error("Parameters must be integer")};nt.prototype={s:1,n:0,d:1,abs:function(){return x(this.n,this.d)},neg:function(){return x(-this.s*this.n,this.d)},add:function(st,Ke){return F(st,Ke),x(this.s*this.n*m.d+m.s*this.d*m.n,this.d*m.d)},sub:function(st,Ke){return F(st,Ke),x(this.s*this.n*m.d-m.s*this.d*m.n,this.d*m.d)},mul:function(st,Ke){return F(st,Ke),x(this.s*m.s*this.n*m.n,this.d*m.d)},div:function(st,Ke){return F(st,Ke),x(this.s*m.s*this.n*m.d,this.d*m.n)},clone:function(){return x(this.s*this.n,this.d)},mod:function(st,Ke){if(isNaN(this.n)||isNaN(this.d))return new nt(NaN);if(st===void 0)return x(this.s*this.n%this.d,1);if(F(st,Ke),m.n===0&&this.d===0)throw Ze();return x(this.s*(m.d*this.n)%(m.n*this.d),m.d*this.d)},gcd:function(st,Ke){return F(st,Ke),x(Fe(m.n,this.n)*Fe(m.d,this.d),m.d*this.d)},lcm:function(st,Ke){return F(st,Ke),m.n===0&&this.n===0?x(0,1):x(m.n*this.n,Fe(m.n,this.n)*Fe(m.d,this.d))},ceil:function(st){return st=Math.pow(10,st||0),isNaN(this.n)||isNaN(this.d)?new nt(NaN):x(Math.ceil(st*this.s*this.n/this.d),st)},floor:function(st){return st=Math.pow(10,st||0),isNaN(this.n)||isNaN(this.d)?new nt(NaN):x(Math.floor(st*this.s*this.n/this.d),st)},round:function(st){return st=Math.pow(10,st||0),isNaN(this.n)||isNaN(this.d)?new nt(NaN):x(Math.round(st*this.s*this.n/this.d),st)},inverse:function(){return x(this.s*this.d,this.n)},pow:function(st,Ke){if(F(st,Ke),m.d===1)return m.s<0?x(Math.pow(this.s*this.d,m.n),Math.pow(this.n,m.n)):x(Math.pow(this.s*this.n,m.n),Math.pow(this.d,m.n));if(this.s<0)return null;var Ye=o(this.n),tt=o(this.d),Je=1,rr=1;for(var Rr in Ye)if(Rr!=="1"){if(Rr==="0"){Je=0;break}if(Ye[Rr]*=m.n,Ye[Rr]%m.d===0)Ye[Rr]/=m.d;else return null;Je*=Math.pow(Rr,Ye[Rr])}for(var Rr in tt)if(Rr!=="1"){if(tt[Rr]*=m.n,tt[Rr]%m.d===0)tt[Rr]/=m.d;else return null;rr*=Math.pow(Rr,tt[Rr])}return m.s<0?x(rr,Je):x(Je,rr)},equals:function(st,Ke){return F(st,Ke),this.s*this.n*m.d===m.s*m.n*this.d},compare:function(st,Ke){F(st,Ke);var Ye=this.s*this.n*m.d-m.s*m.n*this.d;return(0<Ye)-(Ye<0)},simplify:function(st){if(isNaN(this.n)||isNaN(this.d))return this;st=st||.001;for(var Ke=this.abs(),Ye=Ke.toContinued(),tt=1;tt<Ye.length;tt++){for(var Je=x(Ye[tt-1],1),rr=tt-2;rr>=0;rr--)Je=Je.inverse().add(Ye[rr]);if(Math.abs(Je.sub(Ke).valueOf())<st)return Je.mul(this.s)}return this},divisible:function(st,Ke){return F(st,Ke),!(!(m.n*this.d)||this.n*m.d%(m.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(st){var Ke,Ye="",tt=this.n,Je=this.d;return this.s<0&&(Ye+="-"),Je===1?Ye+=tt:(st&&(Ke=Math.floor(tt/Je))>0&&(Ye+=Ke,Ye+=" ",tt%=Je),Ye+=tt,Ye+="/",Ye+=Je),Ye},toLatex:function(st){var Ke,Ye="",tt=this.n,Je=this.d;return this.s<0&&(Ye+="-"),Je===1?Ye+=tt:(st&&(Ke=Math.floor(tt/Je))>0&&(Ye+=Ke,tt%=Je),Ye+="\\frac{",Ye+=tt,Ye+="}{",Ye+=Je,Ye+="}"),Ye},toContinued:function(){var st,Ke=this.n,Ye=this.d,tt=[];if(isNaN(Ke)||isNaN(Ye))return tt;do tt.push(Math.floor(Ke/Ye)),st=Ke%Ye,Ke=Ye,Ye=st;while(Ke!==1);return tt},toString:function(st){var Ke=this.n,Ye=this.d;if(isNaN(Ke)||isNaN(Ye))return"NaN";st=st||15;var tt=He(Ke,Ye),Je=Ue(Ke,Ye,tt),rr=this.s<0?"-":"";if(rr+=Ke/Ye|0,Ke%=Ye,Ke*=10,Ke&&(rr+="."),tt){for(var Rr=Je;Rr--;)rr+=Ke/Ye|0,Ke%=Ye,Ke*=10;rr+="(";for(var Rr=tt;Rr--;)rr+=Ke/Ye|0,Ke%=Ye,Ke*=10;rr+=")"}else for(var Rr=st;Ke&&Rr--;)rr+=Ke/Ye|0,Ke%=Ye,Ke*=10;return rr}},Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=nt,nt.Fraction=nt,e.exports=nt})()})(fraction$1);const Fraction$1=getDefaultExportFromCjs(fraction$1.exports);var name$B="Fraction",dependencies$A=[],createFractionClass=factory(name$B,dependencies$A,()=>(Object.defineProperty(Fraction$1,"name",{value:"Fraction"}),Fraction$1.prototype.constructor=Fraction$1,Fraction$1.prototype.type="Fraction",Fraction$1.prototype.isFraction=!0,Fraction$1.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Fraction$1.fromJSON=function(e){return new Fraction$1(e)},Fraction$1),{isClass:!0}),name$A="Matrix",dependencies$z=[],createMatrixClass=factory(name$A,dependencies$z,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,s){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,s,u){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,s,u){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,s){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,s){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,s){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function maxArgumentCount(e){return Object.keys(e.signatures||{}).reduce(function(r,s){var u=(s.match(/,/g)||[]).length+1;return Math.max(r,u)},-1)}var name$z="DenseMatrix",dependencies$y=["Matrix"],createDenseMatrixClass=factory(name$z,dependencies$y,e=>{var{Matrix:r}=e;function s(He,Ue){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(Ue&&!isString(Ue))throw new Error("Invalid datatype: "+Ue);if(isMatrix(He))He.type==="DenseMatrix"?(this._data=clone$2(He._data),this._size=clone$2(He._size),this._datatype=Ue||He._datatype):(this._data=He.toArray(),this._size=He.size(),this._datatype=Ue||He._datatype);else if(He&&isArray(He.data)&&isArray(He.size))this._data=He.data,this._size=He.size,validate(this._data,this._size),this._datatype=Ue||He.datatype;else if(isArray(He))this._data=Re(He),this._size=arraySize(this._data),validate(this._data,this._size),this._datatype=Ue;else{if(He)throw new TypeError("Unsupported type of data ("+typeOf(He)+")");this._data=[],this._size=[0],this._datatype=Ue}}s.prototype=new r,s.prototype.createDenseMatrix=function(He,Ue){return new s(He,Ue)},Object.defineProperty(s,"name",{value:"DenseMatrix"}),s.prototype.constructor=s,s.prototype.type="DenseMatrix",s.prototype.isDenseMatrix=!0,s.prototype.getDataType=function(){return getArrayDataType(this._data,typeOf)},s.prototype.storage=function(){return"dense"},s.prototype.datatype=function(){return this._datatype},s.prototype.create=function(He,Ue){return new s(He,Ue)},s.prototype.subset=function(He,Ue,Fe){switch(arguments.length){case 1:return u(this,He);case 2:case 3:return H(this,He,Ue,Fe);default:throw new SyntaxError("Wrong number of arguments")}},s.prototype.get=function(He){if(!isArray(He))throw new TypeError("Array expected");if(He.length!==this._size.length)throw new DimensionError(He.length,this._size.length);for(var Ue=0;Ue<He.length;Ue++)validateIndex(He[Ue],this._size[Ue]);for(var Fe=this._data,nt=0,Ze=He.length;nt<Ze;nt++){var Ve=He[nt];validateIndex(Ve,Fe.length),Fe=Fe[Ve]}return Fe},s.prototype.set=function(He,Ue,Fe){if(!isArray(He))throw new TypeError("Array expected");if(He.length<this._size.length)throw new DimensionError(He.length,this._size.length,"<");var nt,Ze,Ve,er=He.map(function(Ke){return Ke+1});F(this,er,Fe);var st=this._data;for(nt=0,Ze=He.length-1;nt<Ze;nt++)Ve=He[nt],validateIndex(Ve,st.length),st=st[Ve];return Ve=He[He.length-1],validateIndex(Ve,st.length),st[Ve]=Ue,this};function u(He,Ue){if(!isIndex(Ue))throw new TypeError("Invalid index");var Fe=Ue.isScalar();if(Fe)return He.get(Ue.min());var nt=Ue.size();if(nt.length!==He._size.length)throw new DimensionError(nt.length,He._size.length);for(var Ze=Ue.min(),Ve=Ue.max(),er=0,st=He._size.length;er<st;er++)validateIndex(Ze[er],He._size[er]),validateIndex(Ve[er],He._size[er]);return new s(m(He._data,Ue,nt.length,0),He._datatype)}function m(He,Ue,Fe,nt){var Ze=nt===Fe-1,Ve=Ue.dimension(nt);return Ze?Ve.map(function(er){return validateIndex(er,He.length),He[er]}).valueOf():Ve.map(function(er){validateIndex(er,He.length);var st=He[er];return m(st,Ue,Fe,nt+1)}).valueOf()}function H(He,Ue,Fe,nt){if(!Ue||Ue.isIndex!==!0)throw new TypeError("Invalid index");var Ze=Ue.size(),Ve=Ue.isScalar(),er;if(isMatrix(Fe)?(er=Fe.size(),Fe=Fe.valueOf()):er=arraySize(Fe),Ve){if(er.length!==0)throw new TypeError("Scalar expected");He.set(Ue.min(),Fe,nt)}else{if(!deepStrictEqual(er,Ze))try{er.length===0?Fe=broadcastTo([Fe],Ze):Fe=broadcastTo(Fe,Ze),er=arraySize(Fe)}catch{}if(Ze.length<He._size.length)throw new DimensionError(Ze.length,He._size.length,"<");if(er.length<Ze.length){for(var st=0,Ke=0;Ze[st]===1&&er[st]===1;)st++;for(;Ze[st]===1;)Ke++,st++;Fe=unsqueeze(Fe,Ze.length,Ke,er)}if(!deepStrictEqual(Ze,er))throw new DimensionError(Ze,er,">");var Ye=Ue.max().map(function(rr){return rr+1});F(He,Ye,nt);var tt=Ze.length,Je=0;x(He._data,Ue,Fe,tt,Je)}return He}function x(He,Ue,Fe,nt,Ze){var Ve=Ze===nt-1,er=Ue.dimension(Ze);Ve?er.forEach(function(st,Ke){validateIndex(st),He[st]=Fe[Ke[0]]}):er.forEach(function(st,Ke){validateIndex(st),x(He[st],Ue,Fe[Ke[0]],nt,Ze+1)})}s.prototype.resize=function(He,Ue,Fe){if(!isCollection(He))throw new TypeError("Array or Matrix expected");var nt=He.valueOf().map(Ve=>Array.isArray(Ve)&&Ve.length===1?Ve[0]:Ve),Ze=Fe?this.clone():this;return o(Ze,nt,Ue)};function o(He,Ue,Fe){if(Ue.length===0){for(var nt=He._data;isArray(nt);)nt=nt[0];return nt}return He._size=Ue.slice(0),He._data=resize(He._data,He._size,Fe),He}s.prototype.reshape=function(He,Ue){var Fe=Ue?this.clone():this;Fe._data=reshape(Fe._data,He);var nt=Fe._size.reduce((Ze,Ve)=>Ze*Ve);return Fe._size=processSizesWildcard(He,nt),Fe};function F(He,Ue,Fe){for(var nt=He._size.slice(0),Ze=!1;nt.length<Ue.length;)nt.push(0),Ze=!0;for(var Ve=0,er=Ue.length;Ve<er;Ve++)Ue[Ve]>nt[Ve]&&(nt[Ve]=Ue[Ve],Ze=!0);Ze&&o(He,nt,Fe)}s.prototype.clone=function(){var He=new s({data:clone$2(this._data),size:clone$2(this._size),datatype:this._datatype});return He},s.prototype.size=function(){return this._size.slice(0)},s.prototype.map=function(He){var Ue=this,Fe=maxArgumentCount(He),nt=function er(st,Ke){return isArray(st)?st.map(function(Ye,tt){return er(Ye,Ke.concat(tt))}):Fe===1?He(st):Fe===2?He(st,Ke):He(st,Ke,Ue)},Ze=nt(this._data,[]),Ve=this._datatype!==void 0?getArrayDataType(Ze,typeOf):void 0;return new s(Ze,Ve)},s.prototype.forEach=function(He){var Ue=this,Fe=function nt(Ze,Ve){isArray(Ze)?Ze.forEach(function(er,st){nt(er,Ve.concat(st))}):He(Ze,Ve,Ue)};Fe(this._data,[])},s.prototype[Symbol.iterator]=function*(){var He=function*Ue(Fe,nt){if(isArray(Fe))for(var Ze=0;Ze<Fe.length;Ze++)yield*Ue(Fe[Ze],nt.concat(Ze));else yield{value:Fe,index:nt}};yield*He(this._data,[])},s.prototype.rows=function(){var He=[],Ue=this.size();if(Ue.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var Fe=this._data;for(var nt of Fe)He.push(new s([nt],this._datatype));return He},s.prototype.columns=function(){var He=this,Ue=[],Fe=this.size();if(Fe.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var nt=this._data,Ze=function(st){var Ke=nt.map(Ye=>[Ye[st]]);Ue.push(new s(Ke,He._datatype))},Ve=0;Ve<Fe[1];Ve++)Ze(Ve);return Ue},s.prototype.toArray=function(){return clone$2(this._data)},s.prototype.valueOf=function(){return this._data},s.prototype.format=function(He){return format(this._data,He)},s.prototype.toString=function(){return format(this._data)},s.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},s.prototype.diagonal=function(He){if(He){if(isBigNumber(He)&&(He=He.toNumber()),!isNumber(He)||!isInteger$1(He))throw new TypeError("The parameter k must be an integer number")}else He=0;for(var Ue=He>0?He:0,Fe=He<0?-He:0,nt=this._size[0],Ze=this._size[1],Ve=Math.min(nt-Fe,Ze-Ue),er=[],st=0;st<Ve;st++)er[st]=this._data[st+Fe][st+Ue];return new s({data:er,size:[Ve],datatype:this._datatype})},s.diagonal=function(He,Ue,Fe,nt){if(!isArray(He))throw new TypeError("Array expected, size parameter");if(He.length!==2)throw new Error("Only two dimensions matrix are supported");if(He=He.map(function(Rr){if(isBigNumber(Rr)&&(Rr=Rr.toNumber()),!isNumber(Rr)||!isInteger$1(Rr)||Rr<1)throw new Error("Size values must be positive integers");return Rr}),Fe){if(isBigNumber(Fe)&&(Fe=Fe.toNumber()),!isNumber(Fe)||!isInteger$1(Fe))throw new TypeError("The parameter k must be an integer number")}else Fe=0;var Ze=Fe>0?Fe:0,Ve=Fe<0?-Fe:0,er=He[0],st=He[1],Ke=Math.min(er-Ve,st-Ze),Ye;if(isArray(Ue)){if(Ue.length!==Ke)throw new Error("Invalid value array length");Ye=function(ar){return Ue[ar]}}else if(isMatrix(Ue)){var tt=Ue.size();if(tt.length!==1||tt[0]!==Ke)throw new Error("Invalid matrix length");Ye=function(ar){return Ue.get([ar])}}else Ye=function(){return Ue};nt||(nt=isBigNumber(Ye(0))?Ye(0).mul(0):0);var Je=[];if(He.length>0){Je=resize(Je,He,nt);for(var rr=0;rr<Ke;rr++)Je[rr+Ve][rr+Ze]=Ye(rr)}return new s({data:Je,size:[er,st]})},s.fromJSON=function(He){return new s(He)},s.prototype.swapRows=function(He,Ue){if(!isNumber(He)||!isInteger$1(He)||!isNumber(Ue)||!isInteger$1(Ue))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return validateIndex(He,this._size[0]),validateIndex(Ue,this._size[0]),s._swapRows(He,Ue,this._data),this},s._swapRows=function(He,Ue,Fe){var nt=Fe[He];Fe[He]=Fe[Ue],Fe[Ue]=nt};function Re(He){return isMatrix(He)?Re(He.valueOf()):isArray(He)?He.map(Re):He}return s},{isClass:!0});function _switch(e){var r=e.length,s=e[0].length,u,m,H=[];for(m=0;m<s;m++){var x=[];for(u=0;u<r;u++)x.push(e[u][m]);H.push(x)}return H}function containsCollections(e){for(var r=0;r<e.length;r++)if(isCollection(e[r]))return!0;return!1}function deepForEach(e,r){isMatrix(e)&&(e=e.valueOf());for(var s=0,u=e.length;s<u;s++){var m=e[s];Array.isArray(m)?deepForEach(m,r):r(m)}}function deepMap(e,r,s){return e&&typeof e.map=="function"?e.map(function(u){return deepMap(u,r)}):r(e)}function reduce(e,r,s){var u=Array.isArray(e)?arraySize(e):e.size();if(r<0||r>=u.length)throw new IndexError(r,u.length);return isMatrix(e)?e.create(_reduce(e.valueOf(),r,s)):_reduce(e,r,s)}function _reduce(e,r,s){var u,m,H,x;if(r<=0)if(Array.isArray(e[0])){for(x=_switch(e),m=[],u=0;u<x.length;u++)m[u]=_reduce(x[u],r-1,s);return m}else{for(H=e[0],u=1;u<e.length;u++)H=s(H,e[u]);return H}else{for(m=[],u=0;u<e.length;u++)m[u]=_reduce(e[u],r-1,s);return m}}var name$y="isInteger",dependencies$x=["typed"],createIsInteger=factory(name$y,dependencies$x,e=>{var{typed:r}=e;return r(name$y,{number:isInteger$1,BigNumber:function(u){return u.isInt()},Fraction:function(u){return u.d===1&&isFinite(u.n)},"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),n1$1="number",n2="number, number";function absNumber(e){return Math.abs(e)}absNumber.signature=n1$1;function addNumber(e,r){return e+r}addNumber.signature=n2;function subtractNumber(e,r){return e-r}subtractNumber.signature=n2;function multiplyNumber(e,r){return e*r}multiplyNumber.signature=n2;function unaryMinusNumber(e){return-e}unaryMinusNumber.signature=n1$1;var n1="number";function isZeroNumber(e){return e===0}isZeroNumber.signature=n1;var name$x="isZero",dependencies$w=["typed"],createIsZero=factory(name$x,dependencies$w,e=>{var{typed:r}=e;return r(name$x,{number:isZeroNumber,BigNumber:function(u){return u.isZero()},Complex:function(u){return u.re===0&&u.im===0},Fraction:function(u){return u.d===1&&u.n===0},Unit:r.referToSelf(s=>u=>r.find(s,u.valueType())(u.value)),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})});function nearlyEqual(e,r,s){if(s==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var u=e.minus(r).abs();if(u.isZero())return!0;var m=e.constructor.max(e.abs(),r.abs());return u.lte(m.times(s))}return!1}function complexEquals(e,r,s){return nearlyEqual$1(e.re,r.re,s)&&nearlyEqual$1(e.im,r.im,s)}var createCompareUnits=factory("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(s=>(u,m)=>{if(!u.equalBase(m))throw new Error("Cannot compare units with different base");return r.find(s,[u.valueType(),m.valueType()])(u.value,m.value)})}}),name$w="equalScalar",dependencies$v=["typed","config"],createEqualScalar=factory(name$w,dependencies$v,e=>{var{typed:r,config:s}=e,u=createCompareUnits({typed:r});return r(name$w,{"boolean, boolean":function(H,x){return H===x},"number, number":function(H,x){return nearlyEqual$1(H,x,s.epsilon)},"BigNumber, BigNumber":function(H,x){return H.eq(x)||nearlyEqual(H,x,s.epsilon)},"Fraction, Fraction":function(H,x){return H.equals(x)},"Complex, Complex":function(H,x){return complexEquals(H,x,s.epsilon)}},u)});factory(name$w,["typed","config"],e=>{var{typed:r,config:s}=e;return r(name$w,{"number, number":function(m,H){return nearlyEqual$1(m,H,s.epsilon)}})});var name$v="SparseMatrix",dependencies$u=["typed","equalScalar","Matrix"],createSparseMatrixClass=factory(name$v,dependencies$u,e=>{var{typed:r,equalScalar:s,Matrix:u}=e;function m(Ve,er){if(!(this instanceof m))throw new SyntaxError("Constructor must be called with the new operator");if(er&&!isString(er))throw new Error("Invalid datatype: "+er);if(isMatrix(Ve))H(this,Ve,er);else if(Ve&&isArray(Ve.index)&&isArray(Ve.ptr)&&isArray(Ve.size))this._values=Ve.values,this._index=Ve.index,this._ptr=Ve.ptr,this._size=Ve.size,this._datatype=er||Ve.datatype;else if(isArray(Ve))x(this,Ve,er);else{if(Ve)throw new TypeError("Unsupported type of data ("+typeOf(Ve)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=er}}function H(Ve,er,st){er.type==="SparseMatrix"?(Ve._values=er._values?clone$2(er._values):void 0,Ve._index=clone$2(er._index),Ve._ptr=clone$2(er._ptr),Ve._size=clone$2(er._size),Ve._datatype=st||er._datatype):x(Ve,er.valueOf(),st||er._datatype)}function x(Ve,er,st){Ve._values=[],Ve._index=[],Ve._ptr=[],Ve._datatype=st;var Ke=er.length,Ye=0,tt=s,Je=0;if(isString(st)&&(tt=r.find(s,[st,st])||s,Je=r.convert(0,st)),Ke>0){var rr=0;do{Ve._ptr.push(Ve._index.length);for(var Rr=0;Rr<Ke;Rr++){var ar=er[Rr];if(isArray(ar)){if(rr===0&&Ye<ar.length&&(Ye=ar.length),rr<ar.length){var Ar=ar[rr];tt(Ar,Je)||(Ve._values.push(Ar),Ve._index.push(Rr))}}else rr===0&&Ye<1&&(Ye=1),tt(ar,Je)||(Ve._values.push(ar),Ve._index.push(Rr))}rr++}while(rr<Ye)}Ve._ptr.push(Ve._index.length),Ve._size=[Ke,Ye]}m.prototype=new u,m.prototype.createSparseMatrix=function(Ve,er){return new m(Ve,er)},Object.defineProperty(m,"name",{value:"SparseMatrix"}),m.prototype.constructor=m,m.prototype.type="SparseMatrix",m.prototype.isSparseMatrix=!0,m.prototype.getDataType=function(){return getArrayDataType(this._values,typeOf)},m.prototype.storage=function(){return"sparse"},m.prototype.datatype=function(){return this._datatype},m.prototype.create=function(Ve,er){return new m(Ve,er)},m.prototype.density=function(){var Ve=this._size[0],er=this._size[1];return Ve!==0&&er!==0?this._index.length/(Ve*er):0},m.prototype.subset=function(Ve,er,st){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return o(this,Ve);case 2:case 3:return F(this,Ve,er,st);default:throw new SyntaxError("Wrong number of arguments")}};function o(Ve,er){if(!isIndex(er))throw new TypeError("Invalid index");var st=er.isScalar();if(st)return Ve.get(er.min());var Ke=er.size();if(Ke.length!==Ve._size.length)throw new DimensionError(Ke.length,Ve._size.length);var Ye,tt,Je,rr,Rr=er.min(),ar=er.max();for(Ye=0,tt=Ve._size.length;Ye<tt;Ye++)validateIndex(Rr[Ye],Ve._size[Ye]),validateIndex(ar[Ye],Ve._size[Ye]);var Ar=Ve._values,mr=Ve._index,Pr=Ve._ptr,Nr=er.dimension(0),Ra=er.dimension(1),ta=[],ha=[];Nr.forEach(function(Ja,Ba){ha[Ja]=Ba[0],ta[Ja]=!0});var Ea=Ar?[]:void 0,fa=[],ga=[];return Ra.forEach(function(Ja){for(ga.push(fa.length),Je=Pr[Ja],rr=Pr[Ja+1];Je<rr;Je++)Ye=mr[Je],ta[Ye]===!0&&(fa.push(ha[Ye]),Ea&&Ea.push(Ar[Je]))}),ga.push(fa.length),new m({values:Ea,index:fa,ptr:ga,size:Ke,datatype:Ve._datatype})}function F(Ve,er,st,Ke){if(!er||er.isIndex!==!0)throw new TypeError("Invalid index");var Ye=er.size(),tt=er.isScalar(),Je;if(isMatrix(st)?(Je=st.size(),st=st.toArray()):Je=arraySize(st),tt){if(Je.length!==0)throw new TypeError("Scalar expected");Ve.set(er.min(),st,Ke)}else{if(Ye.length!==1&&Ye.length!==2)throw new DimensionError(Ye.length,Ve._size.length,"<");if(Je.length<Ye.length){for(var rr=0,Rr=0;Ye[rr]===1&&Je[rr]===1;)rr++;for(;Ye[rr]===1;)Rr++,rr++;st=unsqueeze(st,Ye.length,Rr,Je)}if(!deepStrictEqual(Ye,Je))throw new DimensionError(Ye,Je,">");if(Ye.length===1){var ar=er.dimension(0);ar.forEach(function(Pr,Nr){validateIndex(Pr),Ve.set([Pr,0],st[Nr[0]],Ke)})}else{var Ar=er.dimension(0),mr=er.dimension(1);Ar.forEach(function(Pr,Nr){validateIndex(Pr),mr.forEach(function(Ra,ta){validateIndex(Ra),Ve.set([Pr,Ra],st[Nr[0]][ta[0]],Ke)})})}}return Ve}m.prototype.get=function(Ve){if(!isArray(Ve))throw new TypeError("Array expected");if(Ve.length!==this._size.length)throw new DimensionError(Ve.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var er=Ve[0],st=Ve[1];validateIndex(er,this._size[0]),validateIndex(st,this._size[1]);var Ke=Re(er,this._ptr[st],this._ptr[st+1],this._index);return Ke<this._ptr[st+1]&&this._index[Ke]===er?this._values[Ke]:0},m.prototype.set=function(Ve,er,st){if(!isArray(Ve))throw new TypeError("Array expected");if(Ve.length!==this._size.length)throw new DimensionError(Ve.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var Ke=Ve[0],Ye=Ve[1],tt=this._size[0],Je=this._size[1],rr=s,Rr=0;isString(this._datatype)&&(rr=r.find(s,[this._datatype,this._datatype])||s,Rr=r.convert(0,this._datatype)),(Ke>tt-1||Ye>Je-1)&&(Fe(this,Math.max(Ke+1,tt),Math.max(Ye+1,Je),st),tt=this._size[0],Je=this._size[1]),validateIndex(Ke,tt),validateIndex(Ye,Je);var ar=Re(Ke,this._ptr[Ye],this._ptr[Ye+1],this._index);return ar<this._ptr[Ye+1]&&this._index[ar]===Ke?rr(er,Rr)?He(ar,Ye,this._values,this._index,this._ptr):this._values[ar]=er:rr(er,Rr)||Ue(ar,Ke,Ye,er,this._values,this._index,this._ptr),this};function Re(Ve,er,st,Ke){if(st-er===0)return st;for(var Ye=er;Ye<st;Ye++)if(Ke[Ye]===Ve)return Ye;return er}function He(Ve,er,st,Ke,Ye){st.splice(Ve,1),Ke.splice(Ve,1);for(var tt=er+1;tt<Ye.length;tt++)Ye[tt]--}function Ue(Ve,er,st,Ke,Ye,tt,Je){Ye.splice(Ve,0,Ke),tt.splice(Ve,0,er);for(var rr=st+1;rr<Je.length;rr++)Je[rr]++}m.prototype.resize=function(Ve,er,st){if(!isCollection(Ve))throw new TypeError("Array or Matrix expected");var Ke=Ve.valueOf().map(tt=>Array.isArray(tt)&&tt.length===1?tt[0]:tt);if(Ke.length!==2)throw new Error("Only two dimensions matrix are supported");Ke.forEach(function(tt){if(!isNumber(tt)||!isInteger$1(tt)||tt<0)throw new TypeError("Invalid size, must contain positive integers (size: "+format(Ke)+")")});var Ye=st?this.clone():this;return Fe(Ye,Ke[0],Ke[1],er)};function Fe(Ve,er,st,Ke){var Ye=Ke||0,tt=s,Je=0;isString(Ve._datatype)&&(tt=r.find(s,[Ve._datatype,Ve._datatype])||s,Je=r.convert(0,Ve._datatype),Ye=r.convert(Ye,Ve._datatype));var rr=!tt(Ye,Je),Rr=Ve._size[0],ar=Ve._size[1],Ar,mr,Pr;if(st>ar){for(mr=ar;mr<st;mr++)if(Ve._ptr[mr]=Ve._values.length,rr)for(Ar=0;Ar<Rr;Ar++)Ve._values.push(Ye),Ve._index.push(Ar);Ve._ptr[st]=Ve._values.length}else st<ar&&(Ve._ptr.splice(st+1,ar-st),Ve._values.splice(Ve._ptr[st],Ve._values.length),Ve._index.splice(Ve._ptr[st],Ve._index.length));if(ar=st,er>Rr){if(rr){var Nr=0;for(mr=0;mr<ar;mr++){Ve._ptr[mr]=Ve._ptr[mr]+Nr,Pr=Ve._ptr[mr+1]+Nr;var Ra=0;for(Ar=Rr;Ar<er;Ar++,Ra++)Ve._values.splice(Pr+Ra,0,Ye),Ve._index.splice(Pr+Ra,0,Ar),Nr++}Ve._ptr[ar]=Ve._values.length}}else if(er<Rr){var ta=0;for(mr=0;mr<ar;mr++){Ve._ptr[mr]=Ve._ptr[mr]-ta;var ha=Ve._ptr[mr],Ea=Ve._ptr[mr+1]-ta;for(Pr=ha;Pr<Ea;Pr++)Ar=Ve._index[Pr],Ar>er-1&&(Ve._values.splice(Pr,1),Ve._index.splice(Pr,1),ta++)}Ve._ptr[mr]=Ve._values.length}return Ve._size[0]=er,Ve._size[1]=st,Ve}m.prototype.reshape=function(Ve,er){if(!isArray(Ve))throw new TypeError("Array expected");if(Ve.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");Ve.forEach(function(Ja){if(!isNumber(Ja)||!isInteger$1(Ja)||Ja<=-2||Ja===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+format(Ve)+")")});var st=this._size[0]*this._size[1];Ve=processSizesWildcard(Ve,st);var Ke=Ve[0]*Ve[1];if(st!==Ke)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var Ye=er?this.clone():this;if(this._size[0]===Ve[0]&&this._size[1]===Ve[1])return Ye;for(var tt=[],Je=0;Je<Ye._ptr.length;Je++)for(var rr=0;rr<Ye._ptr[Je+1]-Ye._ptr[Je];rr++)tt.push(Je);for(var Rr=Ye._values.slice(),ar=Ye._index.slice(),Ar=0;Ar<Ye._index.length;Ar++){var mr=ar[Ar],Pr=tt[Ar],Nr=mr*Ye._size[1]+Pr;tt[Ar]=Nr%Ve[1],ar[Ar]=Math.floor(Nr/Ve[1])}Ye._values.length=0,Ye._index.length=0,Ye._ptr.length=Ve[1]+1,Ye._size=Ve.slice();for(var Ra=0;Ra<Ye._ptr.length;Ra++)Ye._ptr[Ra]=0;for(var ta=0;ta<Rr.length;ta++){var ha=ar[ta],Ea=tt[ta],fa=Rr[ta],ga=Re(ha,Ye._ptr[Ea],Ye._ptr[Ea+1],Ye._index);Ue(ga,ha,Ea,fa,Ye._values,Ye._index,Ye._ptr)}return Ye},m.prototype.clone=function(){var Ve=new m({values:this._values?clone$2(this._values):void 0,index:clone$2(this._index),ptr:clone$2(this._ptr),size:clone$2(this._size),datatype:this._datatype});return Ve},m.prototype.size=function(){return this._size.slice(0)},m.prototype.map=function(Ve,er){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var st=this,Ke=this._size[0],Ye=this._size[1],tt=maxArgumentCount(Ve),Je=function(Rr,ar,Ar){return tt===1?Ve(Rr):tt===2?Ve(Rr,[ar,Ar]):Ve(Rr,[ar,Ar],st)};return nt(this,0,Ke-1,0,Ye-1,Je,er)};function nt(Ve,er,st,Ke,Ye,tt,Je){var rr=[],Rr=[],ar=[],Ar=s,mr=0;isString(Ve._datatype)&&(Ar=r.find(s,[Ve._datatype,Ve._datatype])||s,mr=r.convert(0,Ve._datatype));for(var Pr=function(cn,ui,Vn){cn=tt(cn,ui,Vn),Ar(cn,mr)||(rr.push(cn),Rr.push(ui))},Nr=Ke;Nr<=Ye;Nr++){ar.push(rr.length);var Ra=Ve._ptr[Nr],ta=Ve._ptr[Nr+1];if(Je)for(var ha=Ra;ha<ta;ha++){var Ea=Ve._index[ha];Ea>=er&&Ea<=st&&Pr(Ve._values[ha],Ea-er,Nr-Ke)}else{for(var fa={},ga=Ra;ga<ta;ga++){var Ja=Ve._index[ga];fa[Ja]=Ve._values[ga]}for(var Ba=er;Ba<=st;Ba++){var Pn=Ba in fa?fa[Ba]:0;Pr(Pn,Ba-er,Nr-Ke)}}}return ar.push(rr.length),new m({values:rr,index:Rr,ptr:ar,size:[st-er+1,Ye-Ke+1]})}m.prototype.forEach=function(Ve,er){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var st=this,Ke=this._size[0],Ye=this._size[1],tt=0;tt<Ye;tt++){var Je=this._ptr[tt],rr=this._ptr[tt+1];if(er)for(var Rr=Je;Rr<rr;Rr++){var ar=this._index[Rr];Ve(this._values[Rr],[ar,tt],st)}else{for(var Ar={},mr=Je;mr<rr;mr++){var Pr=this._index[mr];Ar[Pr]=this._values[mr]}for(var Nr=0;Nr<Ke;Nr++){var Ra=Nr in Ar?Ar[Nr]:0;Ve(Ra,[Nr,tt],st)}}}},m.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var Ve=this._size[1],er=0;er<Ve;er++)for(var st=this._ptr[er],Ke=this._ptr[er+1],Ye=st;Ye<Ke;Ye++){var tt=this._index[Ye];yield{value:this._values[Ye],index:[tt,er]}}},m.prototype.toArray=function(){return Ze(this._values,this._index,this._ptr,this._size,!0)},m.prototype.valueOf=function(){return Ze(this._values,this._index,this._ptr,this._size,!1)};function Ze(Ve,er,st,Ke,Ye){var tt=Ke[0],Je=Ke[1],rr=[],Rr,ar;for(Rr=0;Rr<tt;Rr++)for(rr[Rr]=[],ar=0;ar<Je;ar++)rr[Rr][ar]=0;for(ar=0;ar<Je;ar++)for(var Ar=st[ar],mr=st[ar+1],Pr=Ar;Pr<mr;Pr++)Rr=er[Pr],rr[Rr][ar]=Ve?Ye?clone$2(Ve[Pr]):Ve[Pr]:1;return rr}return m.prototype.format=function(Ve){for(var er=this._size[0],st=this._size[1],Ke=this.density(),Ye="Sparse Matrix ["+format(er,Ve)+" x "+format(st,Ve)+"] density: "+format(Ke,Ve)+`
|
|
488
488
|
`,tt=0;tt<st;tt++)for(var Je=this._ptr[tt],rr=this._ptr[tt+1],Rr=Je;Rr<rr;Rr++){var ar=this._index[Rr];Ye+=`
|
|
489
|
-
(`+format(ar,Ve)+", "+format(tt,Ve)+") ==> "+(this._values?format(this._values[Rr],Ve):"X")}return Ye},m.prototype.toString=function(){return format(this.toArray())},m.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},m.prototype.diagonal=function(Ve){if(Ve){if(isBigNumber(Ve)&&(Ve=Ve.toNumber()),!isNumber(Ve)||!isInteger$1(Ve))throw new TypeError("The parameter k must be an integer number")}else Ve=0;var er=Ve>0?Ve:0,st=Ve<0?-Ve:0,Ke=this._size[0],Ye=this._size[1],tt=Math.min(Ke-st,Ye-er),Je=[],rr=[],Rr=[];Rr[0]=0;for(var ar=er;ar<Ye&&Je.length<tt;ar++)for(var Ar=this._ptr[ar],mr=this._ptr[ar+1],Pr=Ar;Pr<mr;Pr++){var Nr=this._index[Pr];if(Nr===ar-er+st){Je.push(this._values[Pr]),rr[Je.length-1]=Nr-st;break}}return Rr.push(Je.length),new m({values:Je,index:rr,ptr:Rr,size:[tt,1]})},m.fromJSON=function(Ve){return new m(Ve)},m.diagonal=function(Ve,er,st,Ke,Ye){if(!isArray(Ve))throw new TypeError("Array expected, size parameter");if(Ve.length!==2)throw new Error("Only two dimensions matrix are supported");if(Ve=Ve.map(function(Ja){if(isBigNumber(Ja)&&(Ja=Ja.toNumber()),!isNumber(Ja)||!isInteger$1(Ja)||Ja<1)throw new Error("Size values must be positive integers");return Ja}),st){if(isBigNumber(st)&&(st=st.toNumber()),!isNumber(st)||!isInteger$1(st))throw new TypeError("The parameter k must be an integer number")}else st=0;var tt=s,Je=0;isString(Ye)&&(tt=r.find(s,[Ye,Ye])||s,Je=r.convert(0,Ye));var rr=st>0?st:0,Rr=st<0?-st:0,ar=Ve[0],Ar=Ve[1],mr=Math.min(ar-Rr,Ar-rr),Pr;if(isArray(er)){if(er.length!==mr)throw new Error("Invalid value array length");Pr=function(Ba){return er[Ba]}}else if(isMatrix(er)){var Nr=er.size();if(Nr.length!==1||Nr[0]!==mr)throw new Error("Invalid matrix length");Pr=function(Ba){return er.get([Ba])}}else Pr=function(){return er};for(var Ra=[],ta=[],ha=[],Ea=0;Ea<Ar;Ea++){ha.push(Ra.length);var fa=Ea-rr;if(fa>=0&&fa<mr){var ga=Pr(fa);tt(ga,Je)||(ta.push(fa+Rr),Ra.push(ga))}}return ha.push(Ra.length),new m({values:Ra,index:ta,ptr:ha,size:[ar,Ar]})},m.prototype.swapRows=function(Ve,er){if(!isNumber(Ve)||!isInteger$1(Ve)||!isNumber(er)||!isInteger$1(er))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return validateIndex(Ve,this._size[0]),validateIndex(er,this._size[0]),m._swapRows(Ve,er,this._size[1],this._values,this._index,this._ptr),this},m._forEachRow=function(Ve,er,st,Ke,Ye){for(var tt=Ke[Ve],Je=Ke[Ve+1],rr=tt;rr<Je;rr++)Ye(st[rr],er[rr])},m._swapRows=function(Ve,er,st,Ke,Ye,tt){for(var Je=0;Je<st;Je++){var rr=tt[Je],Rr=tt[Je+1],ar=Re(Ve,rr,Rr,Ye),Ar=Re(er,rr,Rr,Ye);if(ar<Rr&&Ar<Rr&&Ye[ar]===Ve&&Ye[Ar]===er){if(Ke){var mr=Ke[ar];Ke[ar]=Ke[Ar],Ke[Ar]=mr}continue}if(ar<Rr&&Ye[ar]===Ve&&(Ar>=Rr||Ye[Ar]!==er)){var Pr=Ke?Ke[ar]:void 0;Ye.splice(Ar,0,er),Ke&&Ke.splice(Ar,0,Pr),Ye.splice(Ar<=ar?ar+1:ar,1),Ke&&Ke.splice(Ar<=ar?ar+1:ar,1);continue}if(Ar<Rr&&Ye[Ar]===er&&(ar>=Rr||Ye[ar]!==Ve)){var Nr=Ke?Ke[Ar]:void 0;Ye.splice(ar,0,Ve),Ke&&Ke.splice(ar,0,Nr),Ye.splice(ar<=Ar?Ar+1:Ar,1),Ke&&Ke.splice(ar<=Ar?Ar+1:Ar,1)}}},m},{isClass:!0}),name$u="number",dependencies$t=["typed"];function getNonDecimalNumberParts(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(r){var s={"0b":2,"0o":8,"0x":16}[r[1]],u=r[2],m=r[3];return{input:e,radix:s,integerPart:u,fractionalPart:m}}else return null}function makeNumberFromNonDecimalParts(e){for(var r=parseInt(e.integerPart,e.radix),s=0,u=0;u<e.fractionalPart.length;u++){var m=parseInt(e.fractionalPart[u],e.radix);s+=m/Math.pow(e.radix,u+1)}var H=r+s;if(isNaN(H))throw new SyntaxError('String "'+e.input+'" is not a valid number');return H}var createNumber=factory(name$u,dependencies$t,e=>{var{typed:r}=e,s=r("number",{"":function(){return 0},number:function(m){return m},string:function(m){if(m==="NaN")return NaN;var H=getNonDecimalNumberParts(m);if(H)return makeNumberFromNonDecimalParts(H);var x=0,o=m.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(x=Number(o[2]),m=o[1]);var F=Number(m);if(isNaN(F))throw new SyntaxError('String "'+m+'" is not a valid number');if(o){if(F>2**x-1)throw new SyntaxError('String "'.concat(m,'" is out of range'));F>=2**(x-1)&&(F=F-2**x)}return F},BigNumber:function(m){return m.toNumber()},Fraction:function(m){return m.valueOf()},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),null:function(m){return 0},"Unit, string | Unit":function(m,H){return m.toNumber(H)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))});return s.fromJSON=function(u){return parseFloat(u.value)},s}),name$t="bignumber",dependencies$s=["typed","BigNumber"],createBignumber=factory(name$t,dependencies$s,e=>{var{typed:r,BigNumber:s}=e;return r("bignumber",{"":function(){return new s(0)},number:function(m){return new s(m+"")},string:function(m){var H=m.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(H){var x=H[2],o=s(H[1]),F=new s(2).pow(Number(x));if(o.gt(F.sub(1)))throw new SyntaxError('String "'.concat(m,'" is out of range'));var Re=new s(2).pow(Number(x)-1);return o.gte(Re)?o.sub(F):o}return new s(m)},BigNumber:function(m){return m},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),Fraction:function(m){return new s(m.n).div(m.d).times(m.s)},null:function(m){return new s(0)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))})}),name$s="fraction",dependencies$r=["typed","Fraction"],createFraction=factory(name$s,dependencies$r,e=>{var{typed:r,Fraction:s}=e;return r("fraction",{number:function(m){if(!isFinite(m)||isNaN(m))throw new Error(m+" cannot be represented as a fraction");return new s(m)},string:function(m){return new s(m)},"number, number":function(m,H){return new s(m,H)},null:function(m){return new s(0)},BigNumber:function(m){return new s(m.toString())},Fraction:function(m){return m},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),Object:function(m){return new s(m)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))})}),name$r="matrix",dependencies$q=["typed","Matrix","DenseMatrix","SparseMatrix"],createMatrix=factory(name$r,dependencies$q,e=>{var{typed:r,Matrix:s,DenseMatrix:u,SparseMatrix:m}=e;return r(name$r,{"":function(){return H([])},string:function(o){return H([],o)},"string, string":function(o,F){return H([],o,F)},Array:function(o){return H(o)},Matrix:function(o){return H(o,o.storage())},"Array | Matrix, string":H,"Array | Matrix, string, string":H});function H(x,o,F){if(o==="dense"||o==="default"||o===void 0)return new u(x,F);if(o==="sparse")return new m(x,F);throw new TypeError("Unknown matrix type "+JSON.stringify(o)+".")}}),name$q="unaryMinus",dependencies$p=["typed"],createUnaryMinus=factory(name$q,dependencies$p,e=>{var{typed:r}=e;return r(name$q,{number:unaryMinusNumber,"Complex | BigNumber | Fraction":s=>s.neg(),Unit:r.referToSelf(s=>u=>{var m=u.clone();return m.value=r.find(s,m.valueType())(u.value),m}),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$p="abs",dependencies$o=["typed"],createAbs=factory(name$p,dependencies$o,e=>{var{typed:r}=e;return r(name$p,{number:absNumber,"Complex | BigNumber | Fraction | Unit":s=>s.abs(),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$o="addScalar",dependencies$n=["typed"],createAddScalar=factory(name$o,dependencies$n,e=>{var{typed:r}=e;return r(name$o,{"number, number":addNumber,"Complex, Complex":function(u,m){return u.add(m)},"BigNumber, BigNumber":function(u,m){return u.plus(m)},"Fraction, Fraction":function(u,m){return u.add(m)},"Unit, Unit":r.referToSelf(s=>(u,m)=>{if(u.value===null||u.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(m.value===null||m.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!u.equalBase(m))throw new Error("Units do not match");var H=u.clone();return H.value=r.find(s,[H.valueType(),m.valueType()])(H.value,m.value),H.fixPrefix=!1,H})})}),name$n="subtractScalar",dependencies$m=["typed"],createSubtractScalar=factory(name$n,dependencies$m,e=>{var{typed:r}=e;return r(name$n,{"number, number":subtractNumber,"Complex, Complex":function(u,m){return u.sub(m)},"BigNumber, BigNumber":function(u,m){return u.minus(m)},"Fraction, Fraction":function(u,m){return u.sub(m)},"Unit, Unit":r.referToSelf(s=>(u,m)=>{if(u.value===null||u.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(m.value===null||m.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!u.equalBase(m))throw new Error("Units do not match");var H=u.clone();return H.value=r.find(s,[H.valueType(),m.valueType()])(H.value,m.value),H.fixPrefix=!1,H})})}),name$m="matAlgo11xS0s",dependencies$l=["typed","equalScalar"],createMatAlgo11xS0s=factory(name$m,dependencies$l,e=>{var{typed:r,equalScalar:s}=e;return function(m,H,x,o){var F=m._values,Re=m._index,He=m._ptr,Ue=m._size,Fe=m._datatype;if(!F)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var nt=Ue[0],Ze=Ue[1],Ve,er=s,st=0,Ke=x;typeof Fe=="string"&&(Ve=Fe,er=r.find(s,[Ve,Ve]),st=r.convert(0,Ve),H=r.convert(H,Ve),Ke=r.find(x,[Ve,Ve]));for(var Ye=[],tt=[],Je=[],rr=0;rr<Ze;rr++){Je[rr]=tt.length;for(var Rr=He[rr],ar=He[rr+1],Ar=Rr;Ar<ar;Ar++){var mr=Re[Ar],Pr=o?Ke(H,F[Ar]):Ke(F[Ar],H);er(Pr,st)||(tt.push(mr),Ye.push(Pr))}}return Je[Ze]=tt.length,m.createSparseMatrix({values:Ye,index:tt,ptr:Je,size:[nt,Ze],datatype:Ve})}}),name$l="matAlgo14xDs",dependencies$k=["typed"],createMatAlgo14xDs=factory(name$l,dependencies$k,e=>{var{typed:r}=e;return function(m,H,x,o){var F=m._data,Re=m._size,He=m._datatype,Ue,Fe=x;typeof He=="string"&&(Ue=He,H=r.convert(H,Ue),Fe=r.find(x,[Ue,Ue]));var nt=Re.length>0?s(Fe,0,Re,Re[0],F,H,o):[];return m.createDenseMatrix({data:nt,size:clone$2(Re),datatype:Ue})};function s(u,m,H,x,o,F,Re){var He=[];if(m===H.length-1)for(var Ue=0;Ue<x;Ue++)He[Ue]=Re?u(F,o[Ue]):u(o[Ue],F);else for(var Fe=0;Fe<x;Fe++)He[Fe]=s(u,m+1,H,H[m+1],o[Fe],F,Re);return He}}),name$k="matAlgo13xDD",dependencies$j=["typed"],createMatAlgo13xDD=factory(name$k,dependencies$j,e=>{var{typed:r}=e;return function(m,H,x){var o=m._data,F=m._size,Re=m._datatype,He=H._data,Ue=H._size,Fe=H._datatype,nt=[];if(F.length!==Ue.length)throw new DimensionError(F.length,Ue.length);for(var Ze=0;Ze<F.length;Ze++){if(F[Ze]!==Ue[Ze])throw new RangeError("Dimension mismatch. Matrix A ("+F+") must match Matrix B ("+Ue+")");nt[Ze]=F[Ze]}var Ve,er=x;typeof Re=="string"&&Re===Fe&&(Ve=Re,er=r.find(x,[Ve,Ve]));var st=nt.length>0?s(er,0,nt,nt[0],o,He):[];return m.createDenseMatrix({data:st,size:nt,datatype:Ve})};function s(u,m,H,x,o,F){var Re=[];if(m===H.length-1)for(var He=0;He<x;He++)Re[He]=u(o[He],F[He]);else for(var Ue=0;Ue<x;Ue++)Re[Ue]=s(u,m+1,H,H[m+1],o[Ue],F[Ue]);return Re}}),name$j="broadcast",dependancies=["concat"],createBroadcast=factory(name$j,dependancies,e=>{var{concat:r}=e;return function(m,H){var x=Math.max(m._size.length,H._size.length);if(m._size.length===H._size.length&&m._size.every((Ze,Ve)=>Ze===H._size[Ve]))return[m,H];for(var o=s(m._size,x,0),F=s(H._size,x,0),Re=[],He=0;He<x;He++)Re[He]=Math.max(o[He],F[He]);checkBroadcastingRules(o,Re),checkBroadcastingRules(F,Re);var Ue=m.clone(),Fe=H.clone();Ue._size.length<x?Ue.reshape(s(Ue._size,x,1)):Fe._size.length<x&&Fe.reshape(s(Fe._size,x,1));for(var nt=0;nt<x;nt++)Ue._size[nt]<Re[nt]&&(Ue=u(Ue,Re[nt],nt)),Fe._size[nt]<Re[nt]&&(Fe=u(Fe,Re[nt],nt));return[Ue,Fe]};function s(m,H,x){return[...Array(H-m.length).fill(x),...m]}function u(m,H,x){return r(...Array(H).fill(m),x)}}),name$i="matrixAlgorithmSuite",dependencies$i=["typed","matrix","concat"],createMatrixAlgorithmSuite=factory(name$i,dependencies$i,e=>{var{typed:r,matrix:s,concat:u}=e,m=createMatAlgo13xDD({typed:r}),H=createMatAlgo14xDs({typed:r}),x=createBroadcast({concat:u});return function(F){var Re=F.elop,He=F.SD||F.DS,Ue;Re?(Ue={"DenseMatrix, DenseMatrix":(Ve,er)=>m(...x(Ve,er),Re),"Array, Array":(Ve,er)=>m(...x(s(Ve),s(er)),Re).valueOf(),"Array, DenseMatrix":(Ve,er)=>m(...x(s(Ve),er),Re),"DenseMatrix, Array":(Ve,er)=>m(...x(Ve,s(er)),Re)},F.SS&&(Ue["SparseMatrix, SparseMatrix"]=(Ve,er)=>F.SS(...x(Ve,er),Re,!1)),F.DS&&(Ue["DenseMatrix, SparseMatrix"]=(Ve,er)=>F.DS(...x(Ve,er),Re,!1),Ue["Array, SparseMatrix"]=(Ve,er)=>F.DS(...x(s(Ve),er),Re,!1)),He&&(Ue["SparseMatrix, DenseMatrix"]=(Ve,er)=>He(...x(er,Ve),Re,!0),Ue["SparseMatrix, Array"]=(Ve,er)=>He(...x(s(er),Ve),Re,!0))):(Ue={"DenseMatrix, DenseMatrix":r.referToSelf(Ve=>(er,st)=>m(...x(er,st),Ve)),"Array, Array":r.referToSelf(Ve=>(er,st)=>m(...x(s(er),s(st)),Ve).valueOf()),"Array, DenseMatrix":r.referToSelf(Ve=>(er,st)=>m(...x(s(er),st),Ve)),"DenseMatrix, Array":r.referToSelf(Ve=>(er,st)=>m(...x(er,s(st)),Ve))},F.SS&&(Ue["SparseMatrix, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.SS(...x(er,st),Ve,!1))),F.DS&&(Ue["DenseMatrix, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.DS(...x(er,st),Ve,!1)),Ue["Array, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.DS(...x(s(er),st),Ve,!1))),He&&(Ue["SparseMatrix, DenseMatrix"]=r.referToSelf(Ve=>(er,st)=>He(...x(st,er),Ve,!0)),Ue["SparseMatrix, Array"]=r.referToSelf(Ve=>(er,st)=>He(...x(s(st),er),Ve,!0))));var Fe=F.scalar||"any",nt=F.Ds||F.Ss;nt&&(Re?(Ue["DenseMatrix,"+Fe]=(Ve,er)=>H(Ve,er,Re,!1),Ue[Fe+", DenseMatrix"]=(Ve,er)=>H(er,Ve,Re,!0),Ue["Array,"+Fe]=(Ve,er)=>H(s(Ve),er,Re,!1).valueOf(),Ue[Fe+", Array"]=(Ve,er)=>H(s(er),Ve,Re,!0).valueOf()):(Ue["DenseMatrix,"+Fe]=r.referToSelf(Ve=>(er,st)=>H(er,st,Ve,!1)),Ue[Fe+", DenseMatrix"]=r.referToSelf(Ve=>(er,st)=>H(st,er,Ve,!0)),Ue["Array,"+Fe]=r.referToSelf(Ve=>(er,st)=>H(s(er),st,Ve,!1).valueOf()),Ue[Fe+", Array"]=r.referToSelf(Ve=>(er,st)=>H(s(st),er,Ve,!0).valueOf())));var Ze=F.sS!==void 0?F.sS:F.Ss;return Re?(F.Ss&&(Ue["SparseMatrix,"+Fe]=(Ve,er)=>F.Ss(Ve,er,Re,!1)),Ze&&(Ue[Fe+", SparseMatrix"]=(Ve,er)=>Ze(er,Ve,Re,!0))):(F.Ss&&(Ue["SparseMatrix,"+Fe]=r.referToSelf(Ve=>(er,st)=>F.Ss(er,st,Ve,!1))),Ze&&(Ue[Fe+", SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>Ze(st,er,Ve,!0)))),Re&&Re.signatures&&extend(Ue,Re.signatures),Ue}}),name$h="matAlgo01xDSid",dependencies$h=["typed"],createMatAlgo01xDSid=factory(name$h,dependencies$h,e=>{var{typed:r}=e;return function(u,m,H,x){var o=u._data,F=u._size,Re=u._datatype,He=m._values,Ue=m._index,Fe=m._ptr,nt=m._size,Ze=m._datatype;if(F.length!==nt.length)throw new DimensionError(F.length,nt.length);if(F[0]!==nt[0]||F[1]!==nt[1])throw new RangeError("Dimension mismatch. Matrix A ("+F+") must match Matrix B ("+nt+")");if(!He)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var Ve=F[0],er=F[1],st=typeof Re=="string"&&Re===Ze?Re:void 0,Ke=st?r.find(H,[st,st]):H,Ye,tt,Je=[];for(Ye=0;Ye<Ve;Ye++)Je[Ye]=[];var rr=[],Rr=[];for(tt=0;tt<er;tt++){for(var ar=tt+1,Ar=Fe[tt],mr=Fe[tt+1],Pr=Ar;Pr<mr;Pr++)Ye=Ue[Pr],rr[Ye]=x?Ke(He[Pr],o[Ye][tt]):Ke(o[Ye][tt],He[Pr]),Rr[Ye]=ar;for(Ye=0;Ye<Ve;Ye++)Rr[Ye]===ar?Je[Ye][tt]=rr[Ye]:Je[Ye][tt]=o[Ye][tt]}return u.createDenseMatrix({data:Je,size:[Ve,er],datatype:st})}}),name$g="matAlgo04xSidSid",dependencies$g=["typed","equalScalar"],createMatAlgo04xSidSid=factory(name$g,dependencies$g,e=>{var{typed:r,equalScalar:s}=e;return function(m,H,x){var o=m._values,F=m._index,Re=m._ptr,He=m._size,Ue=m._datatype,Fe=H._values,nt=H._index,Ze=H._ptr,Ve=H._size,er=H._datatype;if(He.length!==Ve.length)throw new DimensionError(He.length,Ve.length);if(He[0]!==Ve[0]||He[1]!==Ve[1])throw new RangeError("Dimension mismatch. Matrix A ("+He+") must match Matrix B ("+Ve+")");var st=He[0],Ke=He[1],Ye,tt=s,Je=0,rr=x;typeof Ue=="string"&&Ue===er&&(Ye=Ue,tt=r.find(s,[Ye,Ye]),Je=r.convert(0,Ye),rr=r.find(x,[Ye,Ye]));var Rr=o&&Fe?[]:void 0,ar=[],Ar=[],mr=o&&Fe?[]:void 0,Pr=o&&Fe?[]:void 0,Nr=[],Ra=[],ta,ha,Ea,fa,ga;for(ha=0;ha<Ke;ha++){Ar[ha]=ar.length;var Ja=ha+1;for(fa=Re[ha],ga=Re[ha+1],Ea=fa;Ea<ga;Ea++)ta=F[Ea],ar.push(ta),Nr[ta]=Ja,mr&&(mr[ta]=o[Ea]);for(fa=Ze[ha],ga=Ze[ha+1],Ea=fa;Ea<ga;Ea++)if(ta=nt[Ea],Nr[ta]===Ja){if(mr){var Ba=rr(mr[ta],Fe[Ea]);tt(Ba,Je)?Nr[ta]=null:mr[ta]=Ba}}else ar.push(ta),Ra[ta]=Ja,Pr&&(Pr[ta]=Fe[Ea]);if(mr&&Pr)for(Ea=Ar[ha];Ea<ar.length;)ta=ar[Ea],Nr[ta]===Ja?(Rr[Ea]=mr[ta],Ea++):Ra[ta]===Ja?(Rr[Ea]=Pr[ta],Ea++):ar.splice(Ea,1)}return Ar[Ke]=ar.length,m.createSparseMatrix({values:Rr,index:ar,ptr:Ar,size:[st,Ke],datatype:Ye})}}),name$f="matAlgo10xSids",dependencies$f=["typed","DenseMatrix"],createMatAlgo10xSids=factory(name$f,dependencies$f,e=>{var{typed:r,DenseMatrix:s}=e;return function(m,H,x,o){var F=m._values,Re=m._index,He=m._ptr,Ue=m._size,Fe=m._datatype;if(!F)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var nt=Ue[0],Ze=Ue[1],Ve,er=x;typeof Fe=="string"&&(Ve=Fe,H=r.convert(H,Ve),er=r.find(x,[Ve,Ve]));for(var st=[],Ke=[],Ye=[],tt=0;tt<Ze;tt++){for(var Je=tt+1,rr=He[tt],Rr=He[tt+1],ar=rr;ar<Rr;ar++){var Ar=Re[ar];Ke[Ar]=F[ar],Ye[Ar]=Je}for(var mr=0;mr<nt;mr++)tt===0&&(st[mr]=[]),Ye[mr]===Je?st[mr][tt]=o?er(H,Ke[mr]):er(Ke[mr],H):st[mr][tt]=H}return new s({data:st,size:[nt,Ze],datatype:Ve})}}),name$e="multiplyScalar",dependencies$e=["typed"],createMultiplyScalar=factory(name$e,dependencies$e,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":multiplyNumber,"Complex, Complex":function(u,m){return u.mul(m)},"BigNumber, BigNumber":function(u,m){return u.times(m)},"Fraction, Fraction":function(u,m){return u.mul(m)},"number | Fraction | BigNumber | Complex, Unit":(s,u)=>u.multiply(s),"Unit, number | Fraction | BigNumber | Complex | Unit":(s,u)=>s.multiply(u)})}),name$d="multiply",dependencies$d=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],createMultiply=factory(name$d,dependencies$d,e=>{var{typed:r,matrix:s,addScalar:u,multiplyScalar:m,equalScalar:H,dot:x}=e,o=createMatAlgo11xS0s({typed:r,equalScalar:H}),F=createMatAlgo14xDs({typed:r});function Re(Je,rr){switch(Je.length){case 1:switch(rr.length){case 1:if(Je[0]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(Je[0]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+Je[0]+") must match Matrix rows ("+rr[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+rr.length+" dimensions)")}break;case 2:switch(rr.length){case 1:if(Je[1]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+Je[1]+") must match Vector length ("+rr[0]+")");break;case 2:if(Je[1]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+Je[1]+") must match Matrix B rows ("+rr[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+rr.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+Je.length+" dimensions)")}}function He(Je,rr,Rr){if(Rr===0)throw new Error("Cannot multiply two empty vectors");return x(Je,rr)}function Ue(Je,rr){if(rr.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return Fe(Je,rr)}function Fe(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._size,Nr=rr._datatype,Ra=ar[0],ta=Pr[1],ha,Ea=u,fa=m;Ar&&Nr&&Ar===Nr&&typeof Ar=="string"&&(ha=Ar,Ea=r.find(u,[ha,ha]),fa=r.find(m,[ha,ha]));for(var ga=[],Ja=0;Ja<ta;Ja++){for(var Ba=fa(Rr[0],mr[0][Ja]),Pn=1;Pn<Ra;Pn++)Ba=Ea(Ba,fa(Rr[Pn],mr[Pn][Ja]));ga[Ja]=Ba}return Je.createDenseMatrix({data:ga,size:[ta],datatype:ha})}var nt=r("_multiplyMatrixVector",{"DenseMatrix, any":Ve,"SparseMatrix, any":Ke}),Ze=r("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":er,"DenseMatrix, SparseMatrix":st,"SparseMatrix, DenseMatrix":Ye,"SparseMatrix, SparseMatrix":tt});function Ve(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._datatype,Nr=ar[0],Ra=ar[1],ta,ha=u,Ea=m;Ar&&Pr&&Ar===Pr&&typeof Ar=="string"&&(ta=Ar,ha=r.find(u,[ta,ta]),Ea=r.find(m,[ta,ta]));for(var fa=[],ga=0;ga<Nr;ga++){for(var Ja=Rr[ga],Ba=Ea(Ja[0],mr[0]),Pn=1;Pn<Ra;Pn++)Ba=ha(Ba,Ea(Ja[Pn],mr[Pn]));fa[ga]=Ba}return Je.createDenseMatrix({data:fa,size:[Nr],datatype:ta})}function er(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._size,Nr=rr._datatype,Ra=ar[0],ta=ar[1],ha=Pr[1],Ea,fa=u,ga=m;Ar&&Nr&&Ar===Nr&&typeof Ar=="string"&&(Ea=Ar,fa=r.find(u,[Ea,Ea]),ga=r.find(m,[Ea,Ea]));for(var Ja=[],Ba=0;Ba<Ra;Ba++){var Pn=Rr[Ba];Ja[Ba]=[];for(var _n=0;_n<ha;_n++){for(var cn=ga(Pn[0],mr[0][_n]),ui=1;ui<ta;ui++)cn=fa(cn,ga(Pn[ui],mr[ui][_n]));Ja[Ba][_n]=cn}}return Je.createDenseMatrix({data:Ja,size:[Ra,ha],datatype:Ea})}function st(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._values,Pr=rr._index,Nr=rr._ptr,Ra=rr._size,ta=rr._datatype;if(!mr)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var ha=ar[0],Ea=Ra[1],fa,ga=u,Ja=m,Ba=H,Pn=0;Ar&&ta&&Ar===ta&&typeof Ar=="string"&&(fa=Ar,ga=r.find(u,[fa,fa]),Ja=r.find(m,[fa,fa]),Ba=r.find(H,[fa,fa]),Pn=r.convert(0,fa));for(var _n=[],cn=[],ui=[],Vn=rr.createSparseMatrix({values:_n,index:cn,ptr:ui,size:[ha,Ea],datatype:fa}),fn=0;fn<Ea;fn++){ui[fn]=cn.length;var kn=Nr[fn],Ln=Nr[fn+1];if(Ln>kn)for(var On=0,Ci=0;Ci<ha;Ci++){for(var So=Ci+1,ii=void 0,ti=kn;ti<Ln;ti++){var fi=Pr[ti];On!==So?(ii=Ja(Rr[Ci][fi],mr[ti]),On=So):ii=ga(ii,Ja(Rr[Ci][fi],mr[ti]))}On===So&&!Ba(ii,Pn)&&(cn.push(Ci),_n.push(ii))}}return ui[Ea]=cn.length,Vn}function Ke(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype;if(!Rr)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var Pr=rr._data,Nr=rr._datatype,Ra=Je._size[0],ta=rr._size[0],ha=[],Ea=[],fa=[],ga,Ja=u,Ba=m,Pn=H,_n=0;mr&&Nr&&mr===Nr&&typeof mr=="string"&&(ga=mr,Ja=r.find(u,[ga,ga]),Ba=r.find(m,[ga,ga]),Pn=r.find(H,[ga,ga]),_n=r.convert(0,ga));var cn=[],ui=[];fa[0]=0;for(var Vn=0;Vn<ta;Vn++){var fn=Pr[Vn];if(!Pn(fn,_n))for(var kn=Ar[Vn],Ln=Ar[Vn+1],On=kn;On<Ln;On++){var Ci=ar[On];ui[Ci]?cn[Ci]=Ja(cn[Ci],Ba(fn,Rr[On])):(ui[Ci]=!0,Ea.push(Ci),cn[Ci]=Ba(fn,Rr[On]))}}for(var So=Ea.length,ii=0;ii<So;ii++){var ti=Ea[ii];ha[ii]=cn[ti]}return fa[1]=Ea.length,Je.createSparseMatrix({values:ha,index:Ea,ptr:fa,size:[Ra,1],datatype:ga})}function Ye(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype;if(!Rr)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var Pr=rr._data,Nr=rr._datatype,Ra=Je._size[0],ta=rr._size[0],ha=rr._size[1],Ea,fa=u,ga=m,Ja=H,Ba=0;mr&&Nr&&mr===Nr&&typeof mr=="string"&&(Ea=mr,fa=r.find(u,[Ea,Ea]),ga=r.find(m,[Ea,Ea]),Ja=r.find(H,[Ea,Ea]),Ba=r.convert(0,Ea));for(var Pn=[],_n=[],cn=[],ui=Je.createSparseMatrix({values:Pn,index:_n,ptr:cn,size:[Ra,ha],datatype:Ea}),Vn=[],fn=[],kn=0;kn<ha;kn++){cn[kn]=_n.length;for(var Ln=kn+1,On=0;On<ta;On++){var Ci=Pr[On][kn];if(!Ja(Ci,Ba))for(var So=Ar[On],ii=Ar[On+1],ti=So;ti<ii;ti++){var fi=ar[ti];fn[fi]!==Ln?(fn[fi]=Ln,_n.push(fi),Vn[fi]=ga(Ci,Rr[ti])):Vn[fi]=fa(Vn[fi],ga(Ci,Rr[ti]))}}for(var Zi=cn[kn],$i=_n.length,_o=Zi;_o<$i;_o++){var Yi=_n[_o];Pn[_o]=Vn[Yi]}}return cn[ha]=_n.length,ui}function tt(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype,Pr=rr._values,Nr=rr._index,Ra=rr._ptr,ta=rr._datatype,ha=Je._size[0],Ea=rr._size[1],fa=Rr&&Pr,ga,Ja=u,Ba=m;mr&&ta&&mr===ta&&typeof mr=="string"&&(ga=mr,Ja=r.find(u,[ga,ga]),Ba=r.find(m,[ga,ga]));for(var Pn=fa?[]:void 0,_n=[],cn=[],ui=Je.createSparseMatrix({values:Pn,index:_n,ptr:cn,size:[ha,Ea],datatype:ga}),Vn=fa?[]:void 0,fn=[],kn,Ln,On,Ci,So,ii,ti,fi,Zi=0;Zi<Ea;Zi++){cn[Zi]=_n.length;var $i=Zi+1;for(So=Ra[Zi],ii=Ra[Zi+1],Ci=So;Ci<ii;Ci++)if(fi=Nr[Ci],fa)for(Ln=Ar[fi],On=Ar[fi+1],kn=Ln;kn<On;kn++)ti=ar[kn],fn[ti]!==$i?(fn[ti]=$i,_n.push(ti),Vn[ti]=Ba(Pr[Ci],Rr[kn])):Vn[ti]=Ja(Vn[ti],Ba(Pr[Ci],Rr[kn]));else for(Ln=Ar[fi],On=Ar[fi+1],kn=Ln;kn<On;kn++)ti=ar[kn],fn[ti]!==$i&&(fn[ti]=$i,_n.push(ti));if(fa)for(var _o=cn[Zi],Yi=_n.length,ao=_o;ao<Yi;ao++){var Co=_n[ao];Pn[ao]=Vn[Co]}}return cn[Ea]=_n.length,ui}return r(name$d,m,{"Array, Array":r.referTo("Matrix, Matrix",Je=>(rr,Rr)=>{Re(arraySize(rr),arraySize(Rr));var ar=Je(s(rr),s(Rr));return isMatrix(ar)?ar.valueOf():ar}),"Matrix, Matrix":function(rr,Rr){var ar=rr.size(),Ar=Rr.size();return Re(ar,Ar),ar.length===1?Ar.length===1?He(rr,Rr,ar[0]):Ue(rr,Rr):Ar.length===1?nt(rr,Rr):Ze(rr,Rr)},"Matrix, Array":r.referTo("Matrix,Matrix",Je=>(rr,Rr)=>Je(rr,s(Rr))),"Array, Matrix":r.referToSelf(Je=>(rr,Rr)=>Je(s(rr,Rr.storage()),Rr)),"SparseMatrix, any":function(rr,Rr){return o(rr,Rr,m,!1)},"DenseMatrix, any":function(rr,Rr){return F(rr,Rr,m,!1)},"any, SparseMatrix":function(rr,Rr){return o(Rr,rr,m,!0)},"any, DenseMatrix":function(rr,Rr){return F(Rr,rr,m,!0)},"Array, any":function(rr,Rr){return F(s(rr),Rr,m,!1).valueOf()},"any, Array":function(rr,Rr){return F(s(Rr),rr,m,!0).valueOf()},"any, any":m,"any, any, ...any":r.referToSelf(Je=>(rr,Rr,ar)=>{for(var Ar=Je(rr,Rr),mr=0;mr<ar.length;mr++)Ar=Je(Ar,ar[mr]);return Ar})})}),name$c="conj",dependencies$c=["typed"],createConj=factory(name$c,dependencies$c,e=>{var{typed:r}=e;return r(name$c,{"number | BigNumber | Fraction":s=>s,Complex:s=>s.conjugate(),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$b="concat",dependencies$b=["typed","matrix","isInteger"],createConcat=factory(name$b,dependencies$b,e=>{var{typed:r,matrix:s,isInteger:u}=e;return r(name$b,{"...Array | Matrix | number | BigNumber":function(H){var x,o=H.length,F=-1,Re,He=!1,Ue=[];for(x=0;x<o;x++){var Fe=H[x];if(isMatrix(Fe)&&(He=!0),isNumber(Fe)||isBigNumber(Fe)){if(x!==o-1)throw new Error("Dimension must be specified as last argument");if(Re=F,F=Fe.valueOf(),!u(F))throw new TypeError("Integer number expected for dimension");if(F<0||x>0&&F>Re)throw new IndexError(F,Re+1)}else{var nt=clone$2(Fe).valueOf(),Ze=arraySize(nt);if(Ue[x]=nt,Re=F,F=Ze.length-1,x>0&&F!==Re)throw new DimensionError(Re+1,F+1)}}if(Ue.length===0)throw new SyntaxError("At least one matrix expected");for(var Ve=Ue.shift();Ue.length;)Ve=concat$1(Ve,Ue.shift(),F);return He?s(Ve):Ve},"...string":function(H){return H.join("")}})}),name$a="identity",dependencies$a=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],createIdentity=factory(name$a,dependencies$a,e=>{var{typed:r,config:s,matrix:u,BigNumber:m,DenseMatrix:H,SparseMatrix:x}=e;return r(name$a,{"":function(){return s.matrix==="Matrix"?u([]):[]},string:function(He){return u(He)},"number | BigNumber":function(He){return F(He,He,s.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(He,Ue){return F(He,He,Ue)},"number | BigNumber, number | BigNumber":function(He,Ue){return F(He,Ue,s.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(He,Ue,Fe){return F(He,Ue,Fe)},Array:function(He){return o(He)},"Array, string":function(He,Ue){return o(He,Ue)},Matrix:function(He){return o(He.valueOf(),He.storage())},"Matrix, string":function(He,Ue){return o(He.valueOf(),Ue)}});function o(Re,He){switch(Re.length){case 0:return He?u(He):[];case 1:return F(Re[0],Re[0],He);case 2:return F(Re[0],Re[1],He);default:throw new Error("Vector containing two values expected")}}function F(Re,He,Ue){var Fe=isBigNumber(Re)||isBigNumber(He)?m:null;if(isBigNumber(Re)&&(Re=Re.toNumber()),isBigNumber(He)&&(He=He.toNumber()),!isInteger$1(Re)||Re<1)throw new Error("Parameters in function identity must be positive integers");if(!isInteger$1(He)||He<1)throw new Error("Parameters in function identity must be positive integers");var nt=Fe?new m(1):1,Ze=Fe?new Fe(0):0,Ve=[Re,He];if(Ue){if(Ue==="sparse")return x.diagonal(Ve,nt,0,Ze);if(Ue==="dense")return H.diagonal(Ve,nt,0,Ze);throw new TypeError('Unknown matrix type "'.concat(Ue,'"'))}for(var er=resize([],Ve,Ze),st=Re<He?Re:He,Ke=0;Ke<st;Ke++)er[Ke][Ke]=nt;return er}});function noBignumber(){throw new Error('No "bignumber" implementation available')}function noFraction(){throw new Error('No "fraction" implementation available')}function noMatrix(){throw new Error('No "matrix" implementation available')}var name$9="size",dependencies$9=["typed","config","?matrix"],createSize=factory(name$9,dependencies$9,e=>{var{typed:r,config:s,matrix:u}=e;return r(name$9,{Matrix:function(H){return H.create(H.size())},Array:arraySize,string:function(H){return s.matrix==="Array"?[H.length]:u([H.length])},"number | Complex | BigNumber | Unit | boolean | null":function(H){return s.matrix==="Array"?[]:u?u([]):noMatrix()}})}),name$8="transpose",dependencies$8=["typed","matrix"],createTranspose=factory(name$8,dependencies$8,e=>{var{typed:r,matrix:s}=e;return r(name$8,{Array:x=>u(s(x)).valueOf(),Matrix:u,any:clone$2});function u(x){var o=x.size(),F;switch(o.length){case 1:F=x.clone();break;case 2:{var Re=o[0],He=o[1];if(He===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+format(o)+")");switch(x.storage()){case"dense":F=m(x,Re,He);break;case"sparse":F=H(x,Re,He);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+format(o)+")")}return F}function m(x,o,F){for(var Re=x._data,He=[],Ue,Fe=0;Fe<F;Fe++){Ue=He[Fe]=[];for(var nt=0;nt<o;nt++)Ue[nt]=clone$2(Re[nt][Fe])}return x.createDenseMatrix({data:He,size:[F,o],datatype:x._datatype})}function H(x,o,F){for(var Re=x._values,He=x._index,Ue=x._ptr,Fe=Re?[]:void 0,nt=[],Ze=[],Ve=[],er=0;er<o;er++)Ve[er]=0;var st,Ke,Ye;for(st=0,Ke=He.length;st<Ke;st++)Ve[He[st]]++;for(var tt=0,Je=0;Je<o;Je++)Ze.push(tt),tt+=Ve[Je],Ve[Je]=Ze[Je];for(Ze.push(tt),Ye=0;Ye<F;Ye++)for(var rr=Ue[Ye],Rr=Ue[Ye+1],ar=rr;ar<Rr;ar++){var Ar=Ve[He[ar]]++;nt[Ar]=Ye,Re&&(Fe[Ar]=clone$2(Re[ar]))}return x.createSparseMatrix({values:Fe,index:nt,ptr:Ze,size:[F,o],datatype:x._datatype})}});function improveErrorMessage(e,r,s){var u;return String(e).indexOf("Unexpected type")!==-1?(u=arguments.length>2?" (type: "+typeOf(s)+", value: "+JSON.stringify(s)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+u)):String(e).indexOf("complex numbers")!==-1?(u=arguments.length>2?" (type: "+typeOf(s)+", value: "+JSON.stringify(s)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+u)):e}var name$7="numeric",dependencies$7=["number","?bignumber","?fraction"],createNumeric=factory(name$7,dependencies$7,e=>{var{number:r,bignumber:s,fraction:u}=e,m={string:!0,number:!0,BigNumber:!0,Fraction:!0},H={number:x=>r(x),BigNumber:s?x=>s(x):noBignumber,Fraction:u?x=>u(x):noFraction};return function(o){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",Re=arguments.length>2?arguments[2]:void 0;if(Re!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var He=typeOf(o);if(!(He in m))throw new TypeError("Cannot convert "+o+' of type "'+He+'"; valid input types are '+Object.keys(m).join(", "));if(!(F in H))throw new TypeError("Cannot convert "+o+' to type "'+F+'"; valid output types are '+Object.keys(H).join(", "));return F===He?o:H[F](o)}}),name$6="divideScalar",dependencies$6=["typed","numeric"],createDivideScalar=factory(name$6,dependencies$6,e=>{var{typed:r,numeric:s}=e;return r(name$6,{"number, number":function(m,H){return m/H},"Complex, Complex":function(m,H){return m.div(H)},"BigNumber, BigNumber":function(m,H){return m.div(H)},"Fraction, Fraction":function(m,H){return m.div(H)},"Unit, number | Complex | Fraction | BigNumber | Unit":(u,m)=>u.divide(m),"number | Fraction | Complex | BigNumber, Unit":(u,m)=>m.divideInto(u)})}),name$5="add",dependencies$5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],createAdd=factory(name$5,dependencies$5,e=>{var{typed:r,matrix:s,addScalar:u,equalScalar:m,DenseMatrix:H,SparseMatrix:x,concat:o}=e,F=createMatAlgo01xDSid({typed:r}),Re=createMatAlgo04xSidSid({typed:r,equalScalar:m}),He=createMatAlgo10xSids({typed:r,DenseMatrix:H}),Ue=createMatrixAlgorithmSuite({typed:r,matrix:s,concat:o});return r(name$5,{"any, any":u,"any, any, ...any":r.referToSelf(Fe=>(nt,Ze,Ve)=>{for(var er=Fe(nt,Ze),st=0;st<Ve.length;st++)er=Fe(er,Ve[st]);return er})},Ue({elop:u,DS:F,SS:Re,Ss:He}))}),name$4="dot",dependencies$4=["typed","addScalar","multiplyScalar","conj","size"],createDot=factory(name$4,dependencies$4,e=>{var{typed:r,addScalar:s,multiplyScalar:u,conj:m,size:H}=e;return r(name$4,{"Array | DenseMatrix, Array | DenseMatrix":o,"SparseMatrix, SparseMatrix":F});function x(He,Ue){var Fe=Re(He),nt=Re(Ue),Ze,Ve;if(Fe.length===1)Ze=Fe[0];else if(Fe.length===2&&Fe[1]===1)Ze=Fe[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+Fe.join(", ")+")");if(nt.length===1)Ve=nt[0];else if(nt.length===2&&nt[1]===1)Ve=nt[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+nt.join(", ")+")");if(Ze!==Ve)throw new RangeError("Vectors must have equal length ("+Ze+" != "+Ve+")");if(Ze===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return Ze}function o(He,Ue){var Fe=x(He,Ue),nt=isMatrix(He)?He._data:He,Ze=isMatrix(He)?He._datatype:void 0,Ve=isMatrix(Ue)?Ue._data:Ue,er=isMatrix(Ue)?Ue._datatype:void 0,st=Re(He).length===2,Ke=Re(Ue).length===2,Ye=s,tt=u;if(Ze&&er&&Ze===er&&typeof Ze=="string"){var Je=Ze;Ye=r.find(s,[Je,Je]),tt=r.find(u,[Je,Je])}if(!st&&!Ke){for(var rr=tt(m(nt[0]),Ve[0]),Rr=1;Rr<Fe;Rr++)rr=Ye(rr,tt(m(nt[Rr]),Ve[Rr]));return rr}if(!st&&Ke){for(var ar=tt(m(nt[0]),Ve[0][0]),Ar=1;Ar<Fe;Ar++)ar=Ye(ar,tt(m(nt[Ar]),Ve[Ar][0]));return ar}if(st&&!Ke){for(var mr=tt(m(nt[0][0]),Ve[0]),Pr=1;Pr<Fe;Pr++)mr=Ye(mr,tt(m(nt[Pr][0]),Ve[Pr]));return mr}if(st&&Ke){for(var Nr=tt(m(nt[0][0]),Ve[0][0]),Ra=1;Ra<Fe;Ra++)Nr=Ye(Nr,tt(m(nt[Ra][0]),Ve[Ra][0]));return Nr}}function F(He,Ue){x(He,Ue);for(var Fe=He._index,nt=He._values,Ze=Ue._index,Ve=Ue._values,er=0,st=s,Ke=u,Ye=0,tt=0;Ye<Fe.length&&tt<Ze.length;){var Je=Fe[Ye],rr=Ze[tt];if(Je<rr){Ye++;continue}if(Je>rr){tt++;continue}Je===rr&&(er=st(er,Ke(nt[Ye],Ve[tt])),Ye++,tt++)}return er}function Re(He){return isMatrix(He)?He.size():H(He)}}),name$3="det",dependencies$3=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],createDet=factory(name$3,dependencies$3,e=>{var{typed:r,matrix:s,subtractScalar:u,multiply:m,divideScalar:H,isZero:x,unaryMinus:o}=e;return r(name$3,{any:function(He){return clone$2(He)},"Array | Matrix":function(He){var Ue;switch(isMatrix(He)?Ue=He.size():Array.isArray(He)?(He=s(He),Ue=He.size()):Ue=[],Ue.length){case 0:return clone$2(He);case 1:if(Ue[0]===1)return clone$2(He.valueOf()[0]);if(Ue[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+format(Ue)+")");case 2:{var Fe=Ue[0],nt=Ue[1];if(Fe===nt)return F(He.clone().valueOf(),Fe);if(nt===0)return 1;throw new RangeError("Matrix must be square (size: "+format(Ue)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+format(Ue)+")")}}});function F(Re,He,Ue){if(He===1)return clone$2(Re[0][0]);if(He===2)return u(m(Re[0][0],Re[1][1]),m(Re[1][0],Re[0][1]));for(var Fe=!1,nt=new Array(He).fill(0).map((Rr,ar)=>ar),Ze=0;Ze<He;Ze++){var Ve=nt[Ze];if(x(Re[Ve][Ze])){var er=void 0;for(er=Ze+1;er<He;er++)if(!x(Re[nt[er]][Ze])){Ve=nt[er],nt[er]=nt[Ze],nt[Ze]=Ve,Fe=!Fe;break}if(er===He)return Re[Ve][Ze]}for(var st=Re[Ve][Ze],Ke=Ze===0?1:Re[nt[Ze-1]][Ze-1],Ye=Ze+1;Ye<He;Ye++)for(var tt=nt[Ye],Je=Ze+1;Je<He;Je++)Re[tt][Je]=H(u(m(Re[tt][Je],st),m(Re[tt][Ze],Re[Ve][Je])),Ke)}var rr=Re[nt[He-1]][He-1];return Fe?o(rr):rr}}),name$2="inv",dependencies$2=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],createInv=factory(name$2,dependencies$2,e=>{var{typed:r,matrix:s,divideScalar:u,addScalar:m,multiply:H,unaryMinus:x,det:o,identity:F,abs:Re}=e;return r(name$2,{"Array | Matrix":function(Fe){var nt=isMatrix(Fe)?Fe.size():arraySize(Fe);switch(nt.length){case 1:if(nt[0]===1)return isMatrix(Fe)?s([u(1,Fe.valueOf()[0])]):[u(1,Fe[0])];throw new RangeError("Matrix must be square (size: "+format(nt)+")");case 2:{var Ze=nt[0],Ve=nt[1];if(Ze===Ve)return isMatrix(Fe)?s(He(Fe.valueOf(),Ze,Ve),Fe.storage()):He(Fe,Ze,Ve);throw new RangeError("Matrix must be square (size: "+format(nt)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+format(nt)+")")}},any:function(Fe){return u(1,Fe)}});function He(Ue,Fe,nt){var Ze,Ve,er,st,Ke;if(Fe===1){if(st=Ue[0][0],st===0)throw Error("Cannot calculate inverse, determinant is zero");return[[u(1,st)]]}else if(Fe===2){var Ye=o(Ue);if(Ye===0)throw Error("Cannot calculate inverse, determinant is zero");return[[u(Ue[1][1],Ye),u(x(Ue[0][1]),Ye)],[u(x(Ue[1][0]),Ye),u(Ue[0][0],Ye)]]}else{var tt=Ue.concat();for(Ze=0;Ze<Fe;Ze++)tt[Ze]=tt[Ze].concat();for(var Je=F(Fe).valueOf(),rr=0;rr<nt;rr++){var Rr=Re(tt[rr][rr]),ar=rr;for(Ze=rr+1;Ze<Fe;)Re(tt[Ze][rr])>Rr&&(Rr=Re(tt[Ze][rr]),ar=Ze),Ze++;if(Rr===0)throw Error("Cannot calculate inverse, determinant is zero");Ze=ar,Ze!==rr&&(Ke=tt[rr],tt[rr]=tt[Ze],tt[Ze]=Ke,Ke=Je[rr],Je[rr]=Je[Ze],Je[Ze]=Ke);var Ar=tt[rr],mr=Je[rr];for(Ze=0;Ze<Fe;Ze++){var Pr=tt[Ze],Nr=Je[Ze];if(Ze!==rr){if(Pr[rr]!==0){for(er=u(x(Pr[rr]),Ar[rr]),Ve=rr;Ve<nt;Ve++)Pr[Ve]=m(Pr[Ve],H(er,Ar[Ve]));for(Ve=0;Ve<nt;Ve++)Nr[Ve]=m(Nr[Ve],H(er,mr[Ve]))}}else{for(er=Ar[rr],Ve=rr;Ve<nt;Ve++)Pr[Ve]=u(Pr[Ve],er);for(Ve=0;Ve<nt;Ve++)Nr[Ve]=u(Nr[Ve],er)}}}return Je}}}),name$1="sum",dependencies$1=["typed","config","add","numeric"],createSum=factory(name$1,dependencies$1,e=>{var{typed:r,config:s,add:u,numeric:m}=e;return r(name$1,{"Array | Matrix":H,"Array | Matrix, number | BigNumber":x,"...":function(F){if(containsCollections(F))throw new TypeError("Scalar values expected in function sum");return H(F)}});function H(o){var F;return deepForEach(o,function(Re){try{F=F===void 0?Re:u(F,Re)}catch(He){throw improveErrorMessage(He,"sum",Re)}}),F===void 0&&(F=m(0,s.number)),typeof F=="string"&&(F=m(F,s.number)),F}function x(o,F){try{var Re=reduce(o,F,u);return Re}catch(He){throw improveErrorMessage(He,"sum")}}}),BigNumber=createBigNumberClass({config:config$1}),Complex=createComplexClass({}),Fraction=createFractionClass({}),Matrix=createMatrixClass({}),DenseMatrix=createDenseMatrixClass({Matrix}),typed=createTyped({BigNumber,Complex,DenseMatrix,Fraction}),abs=createAbs({typed}),addScalar=createAddScalar({typed}),bignumber=createBignumber({BigNumber,typed}),conj=createConj({typed}),equalScalar=createEqualScalar({config:config$1,typed}),isInteger=createIsInteger({typed}),isZero=createIsZero({typed}),multiplyScalar=createMultiplyScalar({typed}),number=createNumber({typed}),SparseMatrix=createSparseMatrixClass({Matrix,equalScalar,typed}),subtractScalar=createSubtractScalar({typed}),unaryMinus=createUnaryMinus({typed}),fraction=createFraction({Fraction,typed}),matrix=createMatrix({DenseMatrix,Matrix,SparseMatrix,typed}),numeric=createNumeric({bignumber,fraction,number}),size=createSize({matrix,config:config$1,typed}),transpose=createTranspose({matrix,typed}),concat=createConcat({isInteger,matrix,typed}),divideScalar=createDivideScalar({numeric,typed}),identity=createIdentity({BigNumber,DenseMatrix,SparseMatrix,config:config$1,matrix,typed}),add=createAdd({DenseMatrix,SparseMatrix,addScalar,concat,equalScalar,matrix,typed}),dot=createDot({addScalar,conj,multiplyScalar,size,typed}),multiply=createMultiply({addScalar,dot,equalScalar,matrix,multiplyScalar,typed}),sum=createSum({add,config:config$1,numeric,typed}),det=createDet({divideScalar,isZero,matrix,multiply,subtractScalar,typed,unaryMinus}),inv=createInv({abs,addScalar,det,divideScalar,identity,matrix,multiply,typed,unaryMinus});function predictObservations(e,r,s,u){let{observations:m}=r;return m.length>1?predictOptimize(e,r,u):predictBeforeAT(e,r,s,u)}function predictBeforeAT(e,r,s,u){let{images:m,cameras:H,coordinateSystem:x}=e;if(x.type===1)return u&&m.forEach(Ue=>{Ue.predict=void 0}),{predicts:{}};let o={};H.forEach(Ue=>o[Ue.camera_id]=Ue);let{coordinate:F}=r,Re=fromValues$1(0,0,0);if(s.type===1)Re=fromValues$1(F[1],F[1],F[2]);else{let Ue=transformCoordinateToLngLat(F,s),Fe=x.origin_point,nt=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:Ue[0],lat:Ue[1],alt:Ue[2]||0},{lon:Fe[0],lat:Fe[1],alt:Fe[2]});Re=fromValues$1(nt.x,nt.y,nt.z)}let He={};return m.forEach(Ue=>{let{img_id:Fe,camera_id:nt,projection_matrix:Ze,image_rect:Ve}=Ue,er=o[nt].camera_params,{width:st,height:Ke}=Ve,Ye=Ze,tt=fromValues$3(Ye[0],Ye[4],Ye[8],Ye[1],Ye[5],Ye[9],Ye[2],Ye[6],Ye[10]),Je=fromValues$1(Ye[3],Ye[7],Ye[11]),rr=fromValues$3(er[0],0,0,0,er[1],0,er[2],er[3],1),Rr=transformMat3(create$2(),add$4(create$2(),transformMat3(create$2(),Re,tt),Je),rr),ar=scale(create$2,Rr,1/Rr[2]);if(ar[0]>0&&ar[0]<st&&ar[1]>0&&ar[1]<Ke){let Ar=fromValues$1(ar[0],ar[1],1),mr=transformMat3(create$2(),Ar,invert(create$4(),rr)),Pr=distortPoint(mr,er);ar=transformMat3(create$2(),fromValues$1(...Pr,1),rr),He[Fe]=[ar[0],ar[1]],u&&(Ue.predict={uv:[ar[0],ar[1]],position:{left:ar[0]*100/st,top:ar[1]*100/Ke},distance:Math.hypot(ar[0]-st/2,ar[1]-Ke/2)})}else u&&(Ue.predict=void 0)}),{predicts:He}}function predictOptimize(e,r,s){let{images:u,cameras:m}=e,{observations:H}=r,x={};m.forEach(Ye=>x[Ye.camera_id]=Ye);let o={},F=[],Re=new Map;H.forEach(Ye=>Re.set(Ye.id,Ye.uv)),u.forEach(Ye=>{if(!Re.has(Ye.img_id)){Ye.observation=void 0;return}Ye.observation={id:Ye.img_id,uv:Re.get(Ye.img_id)},F.push(Ye)});let He=[],Ue=[];F.forEach(Ye=>{let tt=Ye.projection_matrix,Je=x[Ye.camera_id].camera_params,rr=undistortPoint(Ye.observation.uv,Je),Rr=fromValues$3(tt[0],tt[4],tt[8],tt[1],tt[5],tt[9],tt[2],tt[6],tt[10]),ar=fromValues$1(tt[3],tt[7],tt[11]),Ar=fromValues$3(Je[0],0,0,0,Je[1],0,Je[2],Je[3],1),mr=invert(create$4(),Ar),Pr=transformMat3(create$2(),rr,mr);He.push([Rr[0]-Rr[2]*Pr[0],Rr[3]-Rr[5]*Pr[0],Rr[6]-Rr[8]*Pr[0]]),He.push([Rr[1]-Rr[2]*Pr[1],Rr[4]-Rr[5]*Pr[1],Rr[7]-Rr[8]*Pr[1]]),Ue.push(ar[2]*Pr[0]-ar[0],ar[2]*Pr[1]-ar[1])});let Fe=matrix(He),nt=matrix(Ue),Ze=transpose(Fe),Ve=multiply(multiply(inv(multiply(Ze,Fe)),Ze),nt),er=fromValues$1(Ve.get([0]),Ve.get([1]),Ve.get([2])),st=0,Ke=[];return u.forEach(Ye=>{let{img_id:tt,camera_id:Je,projection_matrix:rr,image_rect:Rr}=Ye,ar=x[Je].camera_params,{width:Ar,height:mr}=Rr,Pr=rr,Nr=fromValues$3(Pr[0],Pr[4],Pr[8],Pr[1],Pr[5],Pr[9],Pr[2],Pr[6],Pr[10]),Ra=fromValues$1(Pr[3],Pr[7],Pr[11]),ta=fromValues$3(ar[0],0,0,0,ar[1],0,ar[2],ar[3],1),ha=add$4(create$2(),transformMat3(create$2(),er,Nr),Ra),Ea=transformMat3(create$2(),fromValues$1(ha[0]/ha[2],ha[1]/ha[2],1),ta);if(Ea[0]>0&&Ea[0]<Ar&&Ea[1]>0&&Ea[1]<mr){let fa=fromValues$1(...Ea,1),ga=transformMat3(create$2(),fa,invert(create$4(),ta)),Ja=distortPoint(ga,ar);if(Ea=transformMat3(create$2(),fromValues$1(...Ja,1),ta),Ye.observation){s&&(Ye.predict={uv:Ye.observation.uv,position:{left:Ye.observation.uv[0]*100/Ar,top:Ye.observation.uv[1]*100/mr},distance:Math.hypot(Ye.observation.uv[0]-Ar/2,Ye.observation.uv[1]-mr/2)});let Ba=Ye.observation.uv;Ke.push(Math.sqrt((Ea[0]-Ba[0])*(Ea[0]-Ba[0])+(Ea[1]-Ba[1])*(Ea[1]-Ba[1])))}else o[tt]=[Ea[0],Ea[1]],s&&(Ye.predict={uv:[Ea[0],Ea[1]],position:{left:Ea[0]*100/Ar,top:Ea[1]*100/mr},distance:Math.hypot(Ea[0]-Ar/2,Ea[1]-mr/2)})}else s&&(Ye.predict=void 0)}),st=sum(Ke)/Ke.length,{predicts:o,residual_rmse:st}}function undistortPoint(e,r){let s=fromValues$3(r[0],0,0,0,r[1],0,r[2],r[3],1),u=transformMat3(create$2(),fromValues$1(...e,1),invert(create$4(),s)),m=100,H=1e-10,x=fromValues(u[0],u[1]),o=subtract(create$1(),distortPoint(x,r),x),F=subtract(create$1(),add$3(create$1(),x,o),u);for(;Math.abs(F[0])+Math.abs(F[1])>H&&m-- >0;)x=subtract(create$1(),u,o),o=subtract(create$1(),distortPoint(x,r),x),F=subtract(create$1(),add$3(create$1(),x,o),u);return transformMat3(create$2(),fromValues$1(...x,1),s)}function distortPoint(e,r){let s=[e[0],e[1]],u=s[0]*s[0]+s[1]*s[1],m=Math.pow(u,2),H=Math.pow(u,3),x=[s[0]*(1+r[4]*u+r[5]*m+r[6]*H)+2*r[7]*s[0]*s[1]+r[8]*(u+2*s[0]*s[0]),s[1]*(1+r[4]*u+r[5]*m+r[6]*H)+2*r[8]*s[0]*s[1]+r[7]*(u+2*s[1]*s[1])];return fromValues(...x)}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754$1.read=function(e,r,s,u,m){var H,x,o=m*8-u-1,F=(1<<o)-1,Re=F>>1,He=-7,Ue=s?m-1:0,Fe=s?-1:1,nt=e[r+Ue];for(Ue+=Fe,H=nt&(1<<-He)-1,nt>>=-He,He+=o;He>0;H=H*256+e[r+Ue],Ue+=Fe,He-=8);for(x=H&(1<<-He)-1,H>>=-He,He+=u;He>0;x=x*256+e[r+Ue],Ue+=Fe,He-=8);if(H===0)H=1-Re;else{if(H===F)return x?NaN:(nt?-1:1)*(1/0);x=x+Math.pow(2,u),H=H-Re}return(nt?-1:1)*x*Math.pow(2,H-u)},ieee754$1.write=function(e,r,s,u,m,H){var x,o,F,Re=H*8-m-1,He=(1<<Re)-1,Ue=He>>1,Fe=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,nt=u?0:H-1,Ze=u?1:-1,Ve=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(o=isNaN(r)?1:0,x=He):(x=Math.floor(Math.log(r)/Math.LN2),r*(F=Math.pow(2,-x))<1&&(x--,F*=2),x+Ue>=1?r+=Fe/F:r+=Fe*Math.pow(2,1-Ue),r*F>=2&&(x++,F/=2),x+Ue>=He?(o=0,x=He):x+Ue>=1?(o=(r*F-1)*Math.pow(2,m),x=x+Ue):(o=r*Math.pow(2,Ue-1)*Math.pow(2,m),x=0));m>=8;e[s+nt]=o&255,nt+=Ze,o/=256,m-=8);for(x=x<<m|o,Re+=m;Re>0;e[s+nt]=x&255,nt+=Ze,x/=256,Re-=8);e[s+nt-Ze]|=Ve*128};var pbf=Pbf,ieee754=ieee754$1;function Pbf(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var SHIFT_LEFT_32=(1<<16)*(1<<16),SHIFT_RIGHT_32=1/SHIFT_LEFT_32,TEXT_DECODER_MIN_LENGTH=12,utf8TextDecoder=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Pbf.prototype={destroy:function(){this.buf=null},readFields:function(e,r,s){for(s=s||this.length;this.pos<s;){var u=this.readVarint(),m=u>>3,H=this.pos;this.type=u&7,e(m,r,this),this.pos===H&&this.skip(u)}return r},readMessage:function(e,r){return this.readFields(e,r,this.readVarint()+this.pos)},readFixed32:function(){var e=readUInt32(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=readInt32(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,e},readSFixed64:function(){var e=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,e},readFloat:function(){var e=ieee754.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ieee754.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var r=this.buf,s,u;return u=r[this.pos++],s=u&127,u<128||(u=r[this.pos++],s|=(u&127)<<7,u<128)||(u=r[this.pos++],s|=(u&127)<<14,u<128)||(u=r[this.pos++],s|=(u&127)<<21,u<128)?s:(u=r[this.pos],s|=(u&15)<<28,readVarintRemainder(s,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=TEXT_DECODER_MIN_LENGTH&&utf8TextDecoder?readUtf8TextDecoder(this.buf,r,e):readUtf8(this.buf,r,e)},readBytes:function(){var e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r},readPackedVarint:function(e,r){if(this.type!==Pbf.Bytes)return e.push(this.readVarint(r));var s=readPackedEnd(this);for(e=e||[];this.pos<s;)e.push(this.readVarint(r));return e},readPackedSVarint:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSVarint());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readBoolean());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFloat());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readDouble());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFixed32());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSFixed32());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFixed64());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSFixed64());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed64());return e},skip:function(e){var r=e&7;if(r===Pbf.Varint)for(;this.buf[this.pos++]>127;);else if(r===Pbf.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Pbf.Fixed32)this.pos+=4;else if(r===Pbf.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+r)},writeTag:function(e,r){this.writeVarint(e<<3|r)},realloc:function(e){for(var r=this.length||16;r<this.pos+e;)r*=2;if(r!==this.length){var s=new Uint8Array(r);s.set(this.buf),this.buf=s,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),writeInt32(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),writeInt32(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),writeInt32(this.buf,e&-1,this.pos),writeInt32(this.buf,Math.floor(e*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),writeInt32(this.buf,e&-1,this.pos),writeInt32(this.buf,Math.floor(e*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){writeBigVarint(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var r=this.pos;this.pos=writeUtf8(this.buf,e,this.pos);var s=this.pos-r;s>=128&&makeRoomForExtraLength(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeFloat:function(e){this.realloc(4),ieee754.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ieee754.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var r=e.length;this.writeVarint(r),this.realloc(r);for(var s=0;s<r;s++)this.buf[this.pos++]=e[s]},writeRawMessage:function(e,r){this.pos++;var s=this.pos;e(r,this);var u=this.pos-s;u>=128&&makeRoomForExtraLength(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u},writeMessage:function(e,r,s){this.writeTag(e,Pbf.Bytes),this.writeRawMessage(r,s)},writePackedVarint:function(e,r){r.length&&this.writeMessage(e,writePackedVarint,r)},writePackedSVarint:function(e,r){r.length&&this.writeMessage(e,writePackedSVarint,r)},writePackedBoolean:function(e,r){r.length&&this.writeMessage(e,writePackedBoolean,r)},writePackedFloat:function(e,r){r.length&&this.writeMessage(e,writePackedFloat,r)},writePackedDouble:function(e,r){r.length&&this.writeMessage(e,writePackedDouble,r)},writePackedFixed32:function(e,r){r.length&&this.writeMessage(e,writePackedFixed32,r)},writePackedSFixed32:function(e,r){r.length&&this.writeMessage(e,writePackedSFixed32,r)},writePackedFixed64:function(e,r){r.length&&this.writeMessage(e,writePackedFixed64,r)},writePackedSFixed64:function(e,r){r.length&&this.writeMessage(e,writePackedSFixed64,r)},writeBytesField:function(e,r){this.writeTag(e,Pbf.Bytes),this.writeBytes(r)},writeFixed32Field:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeSFixed64(r)},writeVarintField:function(e,r){this.writeTag(e,Pbf.Varint),this.writeVarint(r)},writeSVarintField:function(e,r){this.writeTag(e,Pbf.Varint),this.writeSVarint(r)},writeStringField:function(e,r){this.writeTag(e,Pbf.Bytes),this.writeString(r)},writeFloatField:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeFloat(r)},writeDoubleField:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeDouble(r)},writeBooleanField:function(e,r){this.writeVarintField(e,Boolean(r))}};function readVarintRemainder(e,r,s){var u=s.buf,m,H;if(H=u[s.pos++],m=(H&112)>>4,H<128||(H=u[s.pos++],m|=(H&127)<<3,H<128)||(H=u[s.pos++],m|=(H&127)<<10,H<128)||(H=u[s.pos++],m|=(H&127)<<17,H<128)||(H=u[s.pos++],m|=(H&127)<<24,H<128)||(H=u[s.pos++],m|=(H&1)<<31,H<128))return toNum(e,m,r);throw new Error("Expected varint not more than 10 bytes")}function readPackedEnd(e){return e.type===Pbf.Bytes?e.readVarint()+e.pos:e.pos+1}function toNum(e,r,s){return s?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function writeBigVarint(e,r){var s,u;if(e>=0?(s=e%4294967296|0,u=e/4294967296|0):(s=~(-e%4294967296),u=~(-e/4294967296),s^4294967295?s=s+1|0:(s=0,u=u+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),writeBigVarintLow(s,u,r),writeBigVarintHigh(u,r)}function writeBigVarintLow(e,r,s){s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos]=e&127}function writeBigVarintHigh(e,r){var s=(e&7)<<4;r.buf[r.pos++]|=s|((e>>>=3)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127)))))}function makeRoomForExtraLength(e,r,s){var u=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(Math.LN2*7));s.realloc(u);for(var m=s.pos-1;m>=e;m--)s.buf[m+u]=s.buf[m]}function writePackedVarint(e,r){for(var s=0;s<e.length;s++)r.writeVarint(e[s])}function writePackedSVarint(e,r){for(var s=0;s<e.length;s++)r.writeSVarint(e[s])}function writePackedFloat(e,r){for(var s=0;s<e.length;s++)r.writeFloat(e[s])}function writePackedDouble(e,r){for(var s=0;s<e.length;s++)r.writeDouble(e[s])}function writePackedBoolean(e,r){for(var s=0;s<e.length;s++)r.writeBoolean(e[s])}function writePackedFixed32(e,r){for(var s=0;s<e.length;s++)r.writeFixed32(e[s])}function writePackedSFixed32(e,r){for(var s=0;s<e.length;s++)r.writeSFixed32(e[s])}function writePackedFixed64(e,r){for(var s=0;s<e.length;s++)r.writeFixed64(e[s])}function writePackedSFixed64(e,r){for(var s=0;s<e.length;s++)r.writeSFixed64(e[s])}function readUInt32(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+e[r+3]*16777216}function writeInt32(e,r,s){e[s]=r,e[s+1]=r>>>8,e[s+2]=r>>>16,e[s+3]=r>>>24}function readInt32(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+(e[r+3]<<24)}function readUtf8(e,r,s){for(var u="",m=r;m<s;){var H=e[m],x=null,o=H>239?4:H>223?3:H>191?2:1;if(m+o>s)break;var F,Re,He;o===1?H<128&&(x=H):o===2?(F=e[m+1],(F&192)===128&&(x=(H&31)<<6|F&63,x<=127&&(x=null))):o===3?(F=e[m+1],Re=e[m+2],(F&192)===128&&(Re&192)===128&&(x=(H&15)<<12|(F&63)<<6|Re&63,(x<=2047||x>=55296&&x<=57343)&&(x=null))):o===4&&(F=e[m+1],Re=e[m+2],He=e[m+3],(F&192)===128&&(Re&192)===128&&(He&192)===128&&(x=(H&15)<<18|(F&63)<<12|(Re&63)<<6|He&63,(x<=65535||x>=1114112)&&(x=null))),x===null?(x=65533,o=1):x>65535&&(x-=65536,u+=String.fromCharCode(x>>>10&1023|55296),x=56320|x&1023),u+=String.fromCharCode(x),m+=o}return u}function readUtf8TextDecoder(e,r,s){return utf8TextDecoder.decode(e.subarray(r,s))}function writeUtf8(e,r,s){for(var u=0,m,H;u<r.length;u++){if(m=r.charCodeAt(u),m>55295&&m<57344)if(H)if(m<56320){e[s++]=239,e[s++]=191,e[s++]=189,H=m;continue}else m=H-55296<<10|m-56320|65536,H=null;else{m>56319||u+1===r.length?(e[s++]=239,e[s++]=191,e[s++]=189):H=m;continue}else H&&(e[s++]=239,e[s++]=191,e[s++]=189,H=null);m<128?e[s++]=m:(m<2048?e[s++]=m>>6|192:(m<65536?e[s++]=m>>12|224:(e[s++]=m>>18|240,e[s++]=m>>12&63|128),e[s++]=m>>6&63|128),e[s++]=m&63|128)}return s}const proto_10=`
|
|
489
|
+
(`+format(ar,Ve)+", "+format(tt,Ve)+") ==> "+(this._values?format(this._values[Rr],Ve):"X")}return Ye},m.prototype.toString=function(){return format(this.toArray())},m.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},m.prototype.diagonal=function(Ve){if(Ve){if(isBigNumber(Ve)&&(Ve=Ve.toNumber()),!isNumber(Ve)||!isInteger$1(Ve))throw new TypeError("The parameter k must be an integer number")}else Ve=0;var er=Ve>0?Ve:0,st=Ve<0?-Ve:0,Ke=this._size[0],Ye=this._size[1],tt=Math.min(Ke-st,Ye-er),Je=[],rr=[],Rr=[];Rr[0]=0;for(var ar=er;ar<Ye&&Je.length<tt;ar++)for(var Ar=this._ptr[ar],mr=this._ptr[ar+1],Pr=Ar;Pr<mr;Pr++){var Nr=this._index[Pr];if(Nr===ar-er+st){Je.push(this._values[Pr]),rr[Je.length-1]=Nr-st;break}}return Rr.push(Je.length),new m({values:Je,index:rr,ptr:Rr,size:[tt,1]})},m.fromJSON=function(Ve){return new m(Ve)},m.diagonal=function(Ve,er,st,Ke,Ye){if(!isArray(Ve))throw new TypeError("Array expected, size parameter");if(Ve.length!==2)throw new Error("Only two dimensions matrix are supported");if(Ve=Ve.map(function(Ja){if(isBigNumber(Ja)&&(Ja=Ja.toNumber()),!isNumber(Ja)||!isInteger$1(Ja)||Ja<1)throw new Error("Size values must be positive integers");return Ja}),st){if(isBigNumber(st)&&(st=st.toNumber()),!isNumber(st)||!isInteger$1(st))throw new TypeError("The parameter k must be an integer number")}else st=0;var tt=s,Je=0;isString(Ye)&&(tt=r.find(s,[Ye,Ye])||s,Je=r.convert(0,Ye));var rr=st>0?st:0,Rr=st<0?-st:0,ar=Ve[0],Ar=Ve[1],mr=Math.min(ar-Rr,Ar-rr),Pr;if(isArray(er)){if(er.length!==mr)throw new Error("Invalid value array length");Pr=function(Ba){return er[Ba]}}else if(isMatrix(er)){var Nr=er.size();if(Nr.length!==1||Nr[0]!==mr)throw new Error("Invalid matrix length");Pr=function(Ba){return er.get([Ba])}}else Pr=function(){return er};for(var Ra=[],ta=[],ha=[],Ea=0;Ea<Ar;Ea++){ha.push(Ra.length);var fa=Ea-rr;if(fa>=0&&fa<mr){var ga=Pr(fa);tt(ga,Je)||(ta.push(fa+Rr),Ra.push(ga))}}return ha.push(Ra.length),new m({values:Ra,index:ta,ptr:ha,size:[ar,Ar]})},m.prototype.swapRows=function(Ve,er){if(!isNumber(Ve)||!isInteger$1(Ve)||!isNumber(er)||!isInteger$1(er))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return validateIndex(Ve,this._size[0]),validateIndex(er,this._size[0]),m._swapRows(Ve,er,this._size[1],this._values,this._index,this._ptr),this},m._forEachRow=function(Ve,er,st,Ke,Ye){for(var tt=Ke[Ve],Je=Ke[Ve+1],rr=tt;rr<Je;rr++)Ye(st[rr],er[rr])},m._swapRows=function(Ve,er,st,Ke,Ye,tt){for(var Je=0;Je<st;Je++){var rr=tt[Je],Rr=tt[Je+1],ar=Re(Ve,rr,Rr,Ye),Ar=Re(er,rr,Rr,Ye);if(ar<Rr&&Ar<Rr&&Ye[ar]===Ve&&Ye[Ar]===er){if(Ke){var mr=Ke[ar];Ke[ar]=Ke[Ar],Ke[Ar]=mr}continue}if(ar<Rr&&Ye[ar]===Ve&&(Ar>=Rr||Ye[Ar]!==er)){var Pr=Ke?Ke[ar]:void 0;Ye.splice(Ar,0,er),Ke&&Ke.splice(Ar,0,Pr),Ye.splice(Ar<=ar?ar+1:ar,1),Ke&&Ke.splice(Ar<=ar?ar+1:ar,1);continue}if(Ar<Rr&&Ye[Ar]===er&&(ar>=Rr||Ye[ar]!==Ve)){var Nr=Ke?Ke[Ar]:void 0;Ye.splice(ar,0,Ve),Ke&&Ke.splice(ar,0,Nr),Ye.splice(ar<=Ar?Ar+1:Ar,1),Ke&&Ke.splice(ar<=Ar?Ar+1:Ar,1)}}},m},{isClass:!0}),name$u="number",dependencies$t=["typed"];function getNonDecimalNumberParts(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(r){var s={"0b":2,"0o":8,"0x":16}[r[1]],u=r[2],m=r[3];return{input:e,radix:s,integerPart:u,fractionalPart:m}}else return null}function makeNumberFromNonDecimalParts(e){for(var r=parseInt(e.integerPart,e.radix),s=0,u=0;u<e.fractionalPart.length;u++){var m=parseInt(e.fractionalPart[u],e.radix);s+=m/Math.pow(e.radix,u+1)}var H=r+s;if(isNaN(H))throw new SyntaxError('String "'+e.input+'" is not a valid number');return H}var createNumber=factory(name$u,dependencies$t,e=>{var{typed:r}=e,s=r("number",{"":function(){return 0},number:function(m){return m},string:function(m){if(m==="NaN")return NaN;var H=getNonDecimalNumberParts(m);if(H)return makeNumberFromNonDecimalParts(H);var x=0,o=m.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(x=Number(o[2]),m=o[1]);var F=Number(m);if(isNaN(F))throw new SyntaxError('String "'+m+'" is not a valid number');if(o){if(F>2**x-1)throw new SyntaxError('String "'.concat(m,'" is out of range'));F>=2**(x-1)&&(F=F-2**x)}return F},BigNumber:function(m){return m.toNumber()},Fraction:function(m){return m.valueOf()},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),null:function(m){return 0},"Unit, string | Unit":function(m,H){return m.toNumber(H)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))});return s.fromJSON=function(u){return parseFloat(u.value)},s}),name$t="bignumber",dependencies$s=["typed","BigNumber"],createBignumber=factory(name$t,dependencies$s,e=>{var{typed:r,BigNumber:s}=e;return r("bignumber",{"":function(){return new s(0)},number:function(m){return new s(m+"")},string:function(m){var H=m.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(H){var x=H[2],o=s(H[1]),F=new s(2).pow(Number(x));if(o.gt(F.sub(1)))throw new SyntaxError('String "'.concat(m,'" is out of range'));var Re=new s(2).pow(Number(x)-1);return o.gte(Re)?o.sub(F):o}return new s(m)},BigNumber:function(m){return m},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),Fraction:function(m){return new s(m.n).div(m.d).times(m.s)},null:function(m){return new s(0)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))})}),name$s="fraction",dependencies$r=["typed","Fraction"],createFraction=factory(name$s,dependencies$r,e=>{var{typed:r,Fraction:s}=e;return r("fraction",{number:function(m){if(!isFinite(m)||isNaN(m))throw new Error(m+" cannot be represented as a fraction");return new s(m)},string:function(m){return new s(m)},"number, number":function(m,H){return new s(m,H)},null:function(m){return new s(0)},BigNumber:function(m){return new s(m.toString())},Fraction:function(m){return m},Unit:r.referToSelf(u=>m=>{var H=m.clone();return H.value=u(m.value),H}),Object:function(m){return new s(m)},"Array | Matrix":r.referToSelf(u=>m=>deepMap(m,u))})}),name$r="matrix",dependencies$q=["typed","Matrix","DenseMatrix","SparseMatrix"],createMatrix=factory(name$r,dependencies$q,e=>{var{typed:r,Matrix:s,DenseMatrix:u,SparseMatrix:m}=e;return r(name$r,{"":function(){return H([])},string:function(o){return H([],o)},"string, string":function(o,F){return H([],o,F)},Array:function(o){return H(o)},Matrix:function(o){return H(o,o.storage())},"Array | Matrix, string":H,"Array | Matrix, string, string":H});function H(x,o,F){if(o==="dense"||o==="default"||o===void 0)return new u(x,F);if(o==="sparse")return new m(x,F);throw new TypeError("Unknown matrix type "+JSON.stringify(o)+".")}}),name$q="unaryMinus",dependencies$p=["typed"],createUnaryMinus=factory(name$q,dependencies$p,e=>{var{typed:r}=e;return r(name$q,{number:unaryMinusNumber,"Complex | BigNumber | Fraction":s=>s.neg(),Unit:r.referToSelf(s=>u=>{var m=u.clone();return m.value=r.find(s,m.valueType())(u.value),m}),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$p="abs",dependencies$o=["typed"],createAbs=factory(name$p,dependencies$o,e=>{var{typed:r}=e;return r(name$p,{number:absNumber,"Complex | BigNumber | Fraction | Unit":s=>s.abs(),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$o="addScalar",dependencies$n=["typed"],createAddScalar=factory(name$o,dependencies$n,e=>{var{typed:r}=e;return r(name$o,{"number, number":addNumber,"Complex, Complex":function(u,m){return u.add(m)},"BigNumber, BigNumber":function(u,m){return u.plus(m)},"Fraction, Fraction":function(u,m){return u.add(m)},"Unit, Unit":r.referToSelf(s=>(u,m)=>{if(u.value===null||u.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(m.value===null||m.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!u.equalBase(m))throw new Error("Units do not match");var H=u.clone();return H.value=r.find(s,[H.valueType(),m.valueType()])(H.value,m.value),H.fixPrefix=!1,H})})}),name$n="subtractScalar",dependencies$m=["typed"],createSubtractScalar=factory(name$n,dependencies$m,e=>{var{typed:r}=e;return r(name$n,{"number, number":subtractNumber,"Complex, Complex":function(u,m){return u.sub(m)},"BigNumber, BigNumber":function(u,m){return u.minus(m)},"Fraction, Fraction":function(u,m){return u.sub(m)},"Unit, Unit":r.referToSelf(s=>(u,m)=>{if(u.value===null||u.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(m.value===null||m.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!u.equalBase(m))throw new Error("Units do not match");var H=u.clone();return H.value=r.find(s,[H.valueType(),m.valueType()])(H.value,m.value),H.fixPrefix=!1,H})})}),name$m="matAlgo11xS0s",dependencies$l=["typed","equalScalar"],createMatAlgo11xS0s=factory(name$m,dependencies$l,e=>{var{typed:r,equalScalar:s}=e;return function(m,H,x,o){var F=m._values,Re=m._index,He=m._ptr,Ue=m._size,Fe=m._datatype;if(!F)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var nt=Ue[0],Ze=Ue[1],Ve,er=s,st=0,Ke=x;typeof Fe=="string"&&(Ve=Fe,er=r.find(s,[Ve,Ve]),st=r.convert(0,Ve),H=r.convert(H,Ve),Ke=r.find(x,[Ve,Ve]));for(var Ye=[],tt=[],Je=[],rr=0;rr<Ze;rr++){Je[rr]=tt.length;for(var Rr=He[rr],ar=He[rr+1],Ar=Rr;Ar<ar;Ar++){var mr=Re[Ar],Pr=o?Ke(H,F[Ar]):Ke(F[Ar],H);er(Pr,st)||(tt.push(mr),Ye.push(Pr))}}return Je[Ze]=tt.length,m.createSparseMatrix({values:Ye,index:tt,ptr:Je,size:[nt,Ze],datatype:Ve})}}),name$l="matAlgo14xDs",dependencies$k=["typed"],createMatAlgo14xDs=factory(name$l,dependencies$k,e=>{var{typed:r}=e;return function(m,H,x,o){var F=m._data,Re=m._size,He=m._datatype,Ue,Fe=x;typeof He=="string"&&(Ue=He,H=r.convert(H,Ue),Fe=r.find(x,[Ue,Ue]));var nt=Re.length>0?s(Fe,0,Re,Re[0],F,H,o):[];return m.createDenseMatrix({data:nt,size:clone$2(Re),datatype:Ue})};function s(u,m,H,x,o,F,Re){var He=[];if(m===H.length-1)for(var Ue=0;Ue<x;Ue++)He[Ue]=Re?u(F,o[Ue]):u(o[Ue],F);else for(var Fe=0;Fe<x;Fe++)He[Fe]=s(u,m+1,H,H[m+1],o[Fe],F,Re);return He}}),name$k="matAlgo13xDD",dependencies$j=["typed"],createMatAlgo13xDD=factory(name$k,dependencies$j,e=>{var{typed:r}=e;return function(m,H,x){var o=m._data,F=m._size,Re=m._datatype,He=H._data,Ue=H._size,Fe=H._datatype,nt=[];if(F.length!==Ue.length)throw new DimensionError(F.length,Ue.length);for(var Ze=0;Ze<F.length;Ze++){if(F[Ze]!==Ue[Ze])throw new RangeError("Dimension mismatch. Matrix A ("+F+") must match Matrix B ("+Ue+")");nt[Ze]=F[Ze]}var Ve,er=x;typeof Re=="string"&&Re===Fe&&(Ve=Re,er=r.find(x,[Ve,Ve]));var st=nt.length>0?s(er,0,nt,nt[0],o,He):[];return m.createDenseMatrix({data:st,size:nt,datatype:Ve})};function s(u,m,H,x,o,F){var Re=[];if(m===H.length-1)for(var He=0;He<x;He++)Re[He]=u(o[He],F[He]);else for(var Ue=0;Ue<x;Ue++)Re[Ue]=s(u,m+1,H,H[m+1],o[Ue],F[Ue]);return Re}}),name$j="broadcast",dependancies=["concat"],createBroadcast=factory(name$j,dependancies,e=>{var{concat:r}=e;return function(m,H){var x=Math.max(m._size.length,H._size.length);if(m._size.length===H._size.length&&m._size.every((Ze,Ve)=>Ze===H._size[Ve]))return[m,H];for(var o=s(m._size,x,0),F=s(H._size,x,0),Re=[],He=0;He<x;He++)Re[He]=Math.max(o[He],F[He]);checkBroadcastingRules(o,Re),checkBroadcastingRules(F,Re);var Ue=m.clone(),Fe=H.clone();Ue._size.length<x?Ue.reshape(s(Ue._size,x,1)):Fe._size.length<x&&Fe.reshape(s(Fe._size,x,1));for(var nt=0;nt<x;nt++)Ue._size[nt]<Re[nt]&&(Ue=u(Ue,Re[nt],nt)),Fe._size[nt]<Re[nt]&&(Fe=u(Fe,Re[nt],nt));return[Ue,Fe]};function s(m,H,x){return[...Array(H-m.length).fill(x),...m]}function u(m,H,x){return r(...Array(H).fill(m),x)}}),name$i="matrixAlgorithmSuite",dependencies$i=["typed","matrix","concat"],createMatrixAlgorithmSuite=factory(name$i,dependencies$i,e=>{var{typed:r,matrix:s,concat:u}=e,m=createMatAlgo13xDD({typed:r}),H=createMatAlgo14xDs({typed:r}),x=createBroadcast({concat:u});return function(F){var Re=F.elop,He=F.SD||F.DS,Ue;Re?(Ue={"DenseMatrix, DenseMatrix":(Ve,er)=>m(...x(Ve,er),Re),"Array, Array":(Ve,er)=>m(...x(s(Ve),s(er)),Re).valueOf(),"Array, DenseMatrix":(Ve,er)=>m(...x(s(Ve),er),Re),"DenseMatrix, Array":(Ve,er)=>m(...x(Ve,s(er)),Re)},F.SS&&(Ue["SparseMatrix, SparseMatrix"]=(Ve,er)=>F.SS(...x(Ve,er),Re,!1)),F.DS&&(Ue["DenseMatrix, SparseMatrix"]=(Ve,er)=>F.DS(...x(Ve,er),Re,!1),Ue["Array, SparseMatrix"]=(Ve,er)=>F.DS(...x(s(Ve),er),Re,!1)),He&&(Ue["SparseMatrix, DenseMatrix"]=(Ve,er)=>He(...x(er,Ve),Re,!0),Ue["SparseMatrix, Array"]=(Ve,er)=>He(...x(s(er),Ve),Re,!0))):(Ue={"DenseMatrix, DenseMatrix":r.referToSelf(Ve=>(er,st)=>m(...x(er,st),Ve)),"Array, Array":r.referToSelf(Ve=>(er,st)=>m(...x(s(er),s(st)),Ve).valueOf()),"Array, DenseMatrix":r.referToSelf(Ve=>(er,st)=>m(...x(s(er),st),Ve)),"DenseMatrix, Array":r.referToSelf(Ve=>(er,st)=>m(...x(er,s(st)),Ve))},F.SS&&(Ue["SparseMatrix, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.SS(...x(er,st),Ve,!1))),F.DS&&(Ue["DenseMatrix, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.DS(...x(er,st),Ve,!1)),Ue["Array, SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>F.DS(...x(s(er),st),Ve,!1))),He&&(Ue["SparseMatrix, DenseMatrix"]=r.referToSelf(Ve=>(er,st)=>He(...x(st,er),Ve,!0)),Ue["SparseMatrix, Array"]=r.referToSelf(Ve=>(er,st)=>He(...x(s(st),er),Ve,!0))));var Fe=F.scalar||"any",nt=F.Ds||F.Ss;nt&&(Re?(Ue["DenseMatrix,"+Fe]=(Ve,er)=>H(Ve,er,Re,!1),Ue[Fe+", DenseMatrix"]=(Ve,er)=>H(er,Ve,Re,!0),Ue["Array,"+Fe]=(Ve,er)=>H(s(Ve),er,Re,!1).valueOf(),Ue[Fe+", Array"]=(Ve,er)=>H(s(er),Ve,Re,!0).valueOf()):(Ue["DenseMatrix,"+Fe]=r.referToSelf(Ve=>(er,st)=>H(er,st,Ve,!1)),Ue[Fe+", DenseMatrix"]=r.referToSelf(Ve=>(er,st)=>H(st,er,Ve,!0)),Ue["Array,"+Fe]=r.referToSelf(Ve=>(er,st)=>H(s(er),st,Ve,!1).valueOf()),Ue[Fe+", Array"]=r.referToSelf(Ve=>(er,st)=>H(s(st),er,Ve,!0).valueOf())));var Ze=F.sS!==void 0?F.sS:F.Ss;return Re?(F.Ss&&(Ue["SparseMatrix,"+Fe]=(Ve,er)=>F.Ss(Ve,er,Re,!1)),Ze&&(Ue[Fe+", SparseMatrix"]=(Ve,er)=>Ze(er,Ve,Re,!0))):(F.Ss&&(Ue["SparseMatrix,"+Fe]=r.referToSelf(Ve=>(er,st)=>F.Ss(er,st,Ve,!1))),Ze&&(Ue[Fe+", SparseMatrix"]=r.referToSelf(Ve=>(er,st)=>Ze(st,er,Ve,!0)))),Re&&Re.signatures&&extend(Ue,Re.signatures),Ue}}),name$h="matAlgo01xDSid",dependencies$h=["typed"],createMatAlgo01xDSid=factory(name$h,dependencies$h,e=>{var{typed:r}=e;return function(u,m,H,x){var o=u._data,F=u._size,Re=u._datatype,He=m._values,Ue=m._index,Fe=m._ptr,nt=m._size,Ze=m._datatype;if(F.length!==nt.length)throw new DimensionError(F.length,nt.length);if(F[0]!==nt[0]||F[1]!==nt[1])throw new RangeError("Dimension mismatch. Matrix A ("+F+") must match Matrix B ("+nt+")");if(!He)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var Ve=F[0],er=F[1],st=typeof Re=="string"&&Re===Ze?Re:void 0,Ke=st?r.find(H,[st,st]):H,Ye,tt,Je=[];for(Ye=0;Ye<Ve;Ye++)Je[Ye]=[];var rr=[],Rr=[];for(tt=0;tt<er;tt++){for(var ar=tt+1,Ar=Fe[tt],mr=Fe[tt+1],Pr=Ar;Pr<mr;Pr++)Ye=Ue[Pr],rr[Ye]=x?Ke(He[Pr],o[Ye][tt]):Ke(o[Ye][tt],He[Pr]),Rr[Ye]=ar;for(Ye=0;Ye<Ve;Ye++)Rr[Ye]===ar?Je[Ye][tt]=rr[Ye]:Je[Ye][tt]=o[Ye][tt]}return u.createDenseMatrix({data:Je,size:[Ve,er],datatype:st})}}),name$g="matAlgo04xSidSid",dependencies$g=["typed","equalScalar"],createMatAlgo04xSidSid=factory(name$g,dependencies$g,e=>{var{typed:r,equalScalar:s}=e;return function(m,H,x){var o=m._values,F=m._index,Re=m._ptr,He=m._size,Ue=m._datatype,Fe=H._values,nt=H._index,Ze=H._ptr,Ve=H._size,er=H._datatype;if(He.length!==Ve.length)throw new DimensionError(He.length,Ve.length);if(He[0]!==Ve[0]||He[1]!==Ve[1])throw new RangeError("Dimension mismatch. Matrix A ("+He+") must match Matrix B ("+Ve+")");var st=He[0],Ke=He[1],Ye,tt=s,Je=0,rr=x;typeof Ue=="string"&&Ue===er&&(Ye=Ue,tt=r.find(s,[Ye,Ye]),Je=r.convert(0,Ye),rr=r.find(x,[Ye,Ye]));var Rr=o&&Fe?[]:void 0,ar=[],Ar=[],mr=o&&Fe?[]:void 0,Pr=o&&Fe?[]:void 0,Nr=[],Ra=[],ta,ha,Ea,fa,ga;for(ha=0;ha<Ke;ha++){Ar[ha]=ar.length;var Ja=ha+1;for(fa=Re[ha],ga=Re[ha+1],Ea=fa;Ea<ga;Ea++)ta=F[Ea],ar.push(ta),Nr[ta]=Ja,mr&&(mr[ta]=o[Ea]);for(fa=Ze[ha],ga=Ze[ha+1],Ea=fa;Ea<ga;Ea++)if(ta=nt[Ea],Nr[ta]===Ja){if(mr){var Ba=rr(mr[ta],Fe[Ea]);tt(Ba,Je)?Nr[ta]=null:mr[ta]=Ba}}else ar.push(ta),Ra[ta]=Ja,Pr&&(Pr[ta]=Fe[Ea]);if(mr&&Pr)for(Ea=Ar[ha];Ea<ar.length;)ta=ar[Ea],Nr[ta]===Ja?(Rr[Ea]=mr[ta],Ea++):Ra[ta]===Ja?(Rr[Ea]=Pr[ta],Ea++):ar.splice(Ea,1)}return Ar[Ke]=ar.length,m.createSparseMatrix({values:Rr,index:ar,ptr:Ar,size:[st,Ke],datatype:Ye})}}),name$f="matAlgo10xSids",dependencies$f=["typed","DenseMatrix"],createMatAlgo10xSids=factory(name$f,dependencies$f,e=>{var{typed:r,DenseMatrix:s}=e;return function(m,H,x,o){var F=m._values,Re=m._index,He=m._ptr,Ue=m._size,Fe=m._datatype;if(!F)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var nt=Ue[0],Ze=Ue[1],Ve,er=x;typeof Fe=="string"&&(Ve=Fe,H=r.convert(H,Ve),er=r.find(x,[Ve,Ve]));for(var st=[],Ke=[],Ye=[],tt=0;tt<Ze;tt++){for(var Je=tt+1,rr=He[tt],Rr=He[tt+1],ar=rr;ar<Rr;ar++){var Ar=Re[ar];Ke[Ar]=F[ar],Ye[Ar]=Je}for(var mr=0;mr<nt;mr++)tt===0&&(st[mr]=[]),Ye[mr]===Je?st[mr][tt]=o?er(H,Ke[mr]):er(Ke[mr],H):st[mr][tt]=H}return new s({data:st,size:[nt,Ze],datatype:Ve})}}),name$e="multiplyScalar",dependencies$e=["typed"],createMultiplyScalar=factory(name$e,dependencies$e,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":multiplyNumber,"Complex, Complex":function(u,m){return u.mul(m)},"BigNumber, BigNumber":function(u,m){return u.times(m)},"Fraction, Fraction":function(u,m){return u.mul(m)},"number | Fraction | BigNumber | Complex, Unit":(s,u)=>u.multiply(s),"Unit, number | Fraction | BigNumber | Complex | Unit":(s,u)=>s.multiply(u)})}),name$d="multiply",dependencies$d=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],createMultiply=factory(name$d,dependencies$d,e=>{var{typed:r,matrix:s,addScalar:u,multiplyScalar:m,equalScalar:H,dot:x}=e,o=createMatAlgo11xS0s({typed:r,equalScalar:H}),F=createMatAlgo14xDs({typed:r});function Re(Je,rr){switch(Je.length){case 1:switch(rr.length){case 1:if(Je[0]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(Je[0]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+Je[0]+") must match Matrix rows ("+rr[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+rr.length+" dimensions)")}break;case 2:switch(rr.length){case 1:if(Je[1]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+Je[1]+") must match Vector length ("+rr[0]+")");break;case 2:if(Je[1]!==rr[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+Je[1]+") must match Matrix B rows ("+rr[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+rr.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+Je.length+" dimensions)")}}function He(Je,rr,Rr){if(Rr===0)throw new Error("Cannot multiply two empty vectors");return x(Je,rr)}function Ue(Je,rr){if(rr.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return Fe(Je,rr)}function Fe(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._size,Nr=rr._datatype,Ra=ar[0],ta=Pr[1],ha,Ea=u,fa=m;Ar&&Nr&&Ar===Nr&&typeof Ar=="string"&&(ha=Ar,Ea=r.find(u,[ha,ha]),fa=r.find(m,[ha,ha]));for(var ga=[],Ja=0;Ja<ta;Ja++){for(var Ba=fa(Rr[0],mr[0][Ja]),Pn=1;Pn<Ra;Pn++)Ba=Ea(Ba,fa(Rr[Pn],mr[Pn][Ja]));ga[Ja]=Ba}return Je.createDenseMatrix({data:ga,size:[ta],datatype:ha})}var nt=r("_multiplyMatrixVector",{"DenseMatrix, any":Ve,"SparseMatrix, any":Ke}),Ze=r("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":er,"DenseMatrix, SparseMatrix":st,"SparseMatrix, DenseMatrix":Ye,"SparseMatrix, SparseMatrix":tt});function Ve(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._datatype,Nr=ar[0],Ra=ar[1],ta,ha=u,Ea=m;Ar&&Pr&&Ar===Pr&&typeof Ar=="string"&&(ta=Ar,ha=r.find(u,[ta,ta]),Ea=r.find(m,[ta,ta]));for(var fa=[],ga=0;ga<Nr;ga++){for(var Ja=Rr[ga],Ba=Ea(Ja[0],mr[0]),Pn=1;Pn<Ra;Pn++)Ba=ha(Ba,Ea(Ja[Pn],mr[Pn]));fa[ga]=Ba}return Je.createDenseMatrix({data:fa,size:[Nr],datatype:ta})}function er(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._data,Pr=rr._size,Nr=rr._datatype,Ra=ar[0],ta=ar[1],ha=Pr[1],Ea,fa=u,ga=m;Ar&&Nr&&Ar===Nr&&typeof Ar=="string"&&(Ea=Ar,fa=r.find(u,[Ea,Ea]),ga=r.find(m,[Ea,Ea]));for(var Ja=[],Ba=0;Ba<Ra;Ba++){var Pn=Rr[Ba];Ja[Ba]=[];for(var _n=0;_n<ha;_n++){for(var cn=ga(Pn[0],mr[0][_n]),ui=1;ui<ta;ui++)cn=fa(cn,ga(Pn[ui],mr[ui][_n]));Ja[Ba][_n]=cn}}return Je.createDenseMatrix({data:Ja,size:[Ra,ha],datatype:Ea})}function st(Je,rr){var Rr=Je._data,ar=Je._size,Ar=Je._datatype,mr=rr._values,Pr=rr._index,Nr=rr._ptr,Ra=rr._size,ta=rr._datatype;if(!mr)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var ha=ar[0],Ea=Ra[1],fa,ga=u,Ja=m,Ba=H,Pn=0;Ar&&ta&&Ar===ta&&typeof Ar=="string"&&(fa=Ar,ga=r.find(u,[fa,fa]),Ja=r.find(m,[fa,fa]),Ba=r.find(H,[fa,fa]),Pn=r.convert(0,fa));for(var _n=[],cn=[],ui=[],Vn=rr.createSparseMatrix({values:_n,index:cn,ptr:ui,size:[ha,Ea],datatype:fa}),fn=0;fn<Ea;fn++){ui[fn]=cn.length;var kn=Nr[fn],Ln=Nr[fn+1];if(Ln>kn)for(var On=0,Ci=0;Ci<ha;Ci++){for(var So=Ci+1,ii=void 0,ti=kn;ti<Ln;ti++){var fi=Pr[ti];On!==So?(ii=Ja(Rr[Ci][fi],mr[ti]),On=So):ii=ga(ii,Ja(Rr[Ci][fi],mr[ti]))}On===So&&!Ba(ii,Pn)&&(cn.push(Ci),_n.push(ii))}}return ui[Ea]=cn.length,Vn}function Ke(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype;if(!Rr)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var Pr=rr._data,Nr=rr._datatype,Ra=Je._size[0],ta=rr._size[0],ha=[],Ea=[],fa=[],ga,Ja=u,Ba=m,Pn=H,_n=0;mr&&Nr&&mr===Nr&&typeof mr=="string"&&(ga=mr,Ja=r.find(u,[ga,ga]),Ba=r.find(m,[ga,ga]),Pn=r.find(H,[ga,ga]),_n=r.convert(0,ga));var cn=[],ui=[];fa[0]=0;for(var Vn=0;Vn<ta;Vn++){var fn=Pr[Vn];if(!Pn(fn,_n))for(var kn=Ar[Vn],Ln=Ar[Vn+1],On=kn;On<Ln;On++){var Ci=ar[On];ui[Ci]?cn[Ci]=Ja(cn[Ci],Ba(fn,Rr[On])):(ui[Ci]=!0,Ea.push(Ci),cn[Ci]=Ba(fn,Rr[On]))}}for(var So=Ea.length,ii=0;ii<So;ii++){var ti=Ea[ii];ha[ii]=cn[ti]}return fa[1]=Ea.length,Je.createSparseMatrix({values:ha,index:Ea,ptr:fa,size:[Ra,1],datatype:ga})}function Ye(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype;if(!Rr)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var Pr=rr._data,Nr=rr._datatype,Ra=Je._size[0],ta=rr._size[0],ha=rr._size[1],Ea,fa=u,ga=m,Ja=H,Ba=0;mr&&Nr&&mr===Nr&&typeof mr=="string"&&(Ea=mr,fa=r.find(u,[Ea,Ea]),ga=r.find(m,[Ea,Ea]),Ja=r.find(H,[Ea,Ea]),Ba=r.convert(0,Ea));for(var Pn=[],_n=[],cn=[],ui=Je.createSparseMatrix({values:Pn,index:_n,ptr:cn,size:[Ra,ha],datatype:Ea}),Vn=[],fn=[],kn=0;kn<ha;kn++){cn[kn]=_n.length;for(var Ln=kn+1,On=0;On<ta;On++){var Ci=Pr[On][kn];if(!Ja(Ci,Ba))for(var So=Ar[On],ii=Ar[On+1],ti=So;ti<ii;ti++){var fi=ar[ti];fn[fi]!==Ln?(fn[fi]=Ln,_n.push(fi),Vn[fi]=ga(Ci,Rr[ti])):Vn[fi]=fa(Vn[fi],ga(Ci,Rr[ti]))}}for(var Zi=cn[kn],$i=_n.length,_o=Zi;_o<$i;_o++){var Yi=_n[_o];Pn[_o]=Vn[Yi]}}return cn[ha]=_n.length,ui}function tt(Je,rr){var Rr=Je._values,ar=Je._index,Ar=Je._ptr,mr=Je._datatype,Pr=rr._values,Nr=rr._index,Ra=rr._ptr,ta=rr._datatype,ha=Je._size[0],Ea=rr._size[1],fa=Rr&&Pr,ga,Ja=u,Ba=m;mr&&ta&&mr===ta&&typeof mr=="string"&&(ga=mr,Ja=r.find(u,[ga,ga]),Ba=r.find(m,[ga,ga]));for(var Pn=fa?[]:void 0,_n=[],cn=[],ui=Je.createSparseMatrix({values:Pn,index:_n,ptr:cn,size:[ha,Ea],datatype:ga}),Vn=fa?[]:void 0,fn=[],kn,Ln,On,Ci,So,ii,ti,fi,Zi=0;Zi<Ea;Zi++){cn[Zi]=_n.length;var $i=Zi+1;for(So=Ra[Zi],ii=Ra[Zi+1],Ci=So;Ci<ii;Ci++)if(fi=Nr[Ci],fa)for(Ln=Ar[fi],On=Ar[fi+1],kn=Ln;kn<On;kn++)ti=ar[kn],fn[ti]!==$i?(fn[ti]=$i,_n.push(ti),Vn[ti]=Ba(Pr[Ci],Rr[kn])):Vn[ti]=Ja(Vn[ti],Ba(Pr[Ci],Rr[kn]));else for(Ln=Ar[fi],On=Ar[fi+1],kn=Ln;kn<On;kn++)ti=ar[kn],fn[ti]!==$i&&(fn[ti]=$i,_n.push(ti));if(fa)for(var _o=cn[Zi],Yi=_n.length,ao=_o;ao<Yi;ao++){var Co=_n[ao];Pn[ao]=Vn[Co]}}return cn[Ea]=_n.length,ui}return r(name$d,m,{"Array, Array":r.referTo("Matrix, Matrix",Je=>(rr,Rr)=>{Re(arraySize(rr),arraySize(Rr));var ar=Je(s(rr),s(Rr));return isMatrix(ar)?ar.valueOf():ar}),"Matrix, Matrix":function(rr,Rr){var ar=rr.size(),Ar=Rr.size();return Re(ar,Ar),ar.length===1?Ar.length===1?He(rr,Rr,ar[0]):Ue(rr,Rr):Ar.length===1?nt(rr,Rr):Ze(rr,Rr)},"Matrix, Array":r.referTo("Matrix,Matrix",Je=>(rr,Rr)=>Je(rr,s(Rr))),"Array, Matrix":r.referToSelf(Je=>(rr,Rr)=>Je(s(rr,Rr.storage()),Rr)),"SparseMatrix, any":function(rr,Rr){return o(rr,Rr,m,!1)},"DenseMatrix, any":function(rr,Rr){return F(rr,Rr,m,!1)},"any, SparseMatrix":function(rr,Rr){return o(Rr,rr,m,!0)},"any, DenseMatrix":function(rr,Rr){return F(Rr,rr,m,!0)},"Array, any":function(rr,Rr){return F(s(rr),Rr,m,!1).valueOf()},"any, Array":function(rr,Rr){return F(s(Rr),rr,m,!0).valueOf()},"any, any":m,"any, any, ...any":r.referToSelf(Je=>(rr,Rr,ar)=>{for(var Ar=Je(rr,Rr),mr=0;mr<ar.length;mr++)Ar=Je(Ar,ar[mr]);return Ar})})}),name$c="conj",dependencies$c=["typed"],createConj=factory(name$c,dependencies$c,e=>{var{typed:r}=e;return r(name$c,{"number | BigNumber | Fraction":s=>s,Complex:s=>s.conjugate(),"Array | Matrix":r.referToSelf(s=>u=>deepMap(u,s))})}),name$b="concat",dependencies$b=["typed","matrix","isInteger"],createConcat=factory(name$b,dependencies$b,e=>{var{typed:r,matrix:s,isInteger:u}=e;return r(name$b,{"...Array | Matrix | number | BigNumber":function(H){var x,o=H.length,F=-1,Re,He=!1,Ue=[];for(x=0;x<o;x++){var Fe=H[x];if(isMatrix(Fe)&&(He=!0),isNumber(Fe)||isBigNumber(Fe)){if(x!==o-1)throw new Error("Dimension must be specified as last argument");if(Re=F,F=Fe.valueOf(),!u(F))throw new TypeError("Integer number expected for dimension");if(F<0||x>0&&F>Re)throw new IndexError(F,Re+1)}else{var nt=clone$2(Fe).valueOf(),Ze=arraySize(nt);if(Ue[x]=nt,Re=F,F=Ze.length-1,x>0&&F!==Re)throw new DimensionError(Re+1,F+1)}}if(Ue.length===0)throw new SyntaxError("At least one matrix expected");for(var Ve=Ue.shift();Ue.length;)Ve=concat$1(Ve,Ue.shift(),F);return He?s(Ve):Ve},"...string":function(H){return H.join("")}})}),name$a="identity",dependencies$a=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],createIdentity=factory(name$a,dependencies$a,e=>{var{typed:r,config:s,matrix:u,BigNumber:m,DenseMatrix:H,SparseMatrix:x}=e;return r(name$a,{"":function(){return s.matrix==="Matrix"?u([]):[]},string:function(He){return u(He)},"number | BigNumber":function(He){return F(He,He,s.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(He,Ue){return F(He,He,Ue)},"number | BigNumber, number | BigNumber":function(He,Ue){return F(He,Ue,s.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(He,Ue,Fe){return F(He,Ue,Fe)},Array:function(He){return o(He)},"Array, string":function(He,Ue){return o(He,Ue)},Matrix:function(He){return o(He.valueOf(),He.storage())},"Matrix, string":function(He,Ue){return o(He.valueOf(),Ue)}});function o(Re,He){switch(Re.length){case 0:return He?u(He):[];case 1:return F(Re[0],Re[0],He);case 2:return F(Re[0],Re[1],He);default:throw new Error("Vector containing two values expected")}}function F(Re,He,Ue){var Fe=isBigNumber(Re)||isBigNumber(He)?m:null;if(isBigNumber(Re)&&(Re=Re.toNumber()),isBigNumber(He)&&(He=He.toNumber()),!isInteger$1(Re)||Re<1)throw new Error("Parameters in function identity must be positive integers");if(!isInteger$1(He)||He<1)throw new Error("Parameters in function identity must be positive integers");var nt=Fe?new m(1):1,Ze=Fe?new Fe(0):0,Ve=[Re,He];if(Ue){if(Ue==="sparse")return x.diagonal(Ve,nt,0,Ze);if(Ue==="dense")return H.diagonal(Ve,nt,0,Ze);throw new TypeError('Unknown matrix type "'.concat(Ue,'"'))}for(var er=resize([],Ve,Ze),st=Re<He?Re:He,Ke=0;Ke<st;Ke++)er[Ke][Ke]=nt;return er}});function noBignumber(){throw new Error('No "bignumber" implementation available')}function noFraction(){throw new Error('No "fraction" implementation available')}function noMatrix(){throw new Error('No "matrix" implementation available')}var name$9="size",dependencies$9=["typed","config","?matrix"],createSize=factory(name$9,dependencies$9,e=>{var{typed:r,config:s,matrix:u}=e;return r(name$9,{Matrix:function(H){return H.create(H.size())},Array:arraySize,string:function(H){return s.matrix==="Array"?[H.length]:u([H.length])},"number | Complex | BigNumber | Unit | boolean | null":function(H){return s.matrix==="Array"?[]:u?u([]):noMatrix()}})}),name$8="transpose",dependencies$8=["typed","matrix"],createTranspose=factory(name$8,dependencies$8,e=>{var{typed:r,matrix:s}=e;return r(name$8,{Array:x=>u(s(x)).valueOf(),Matrix:u,any:clone$2});function u(x){var o=x.size(),F;switch(o.length){case 1:F=x.clone();break;case 2:{var Re=o[0],He=o[1];if(He===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+format(o)+")");switch(x.storage()){case"dense":F=m(x,Re,He);break;case"sparse":F=H(x,Re,He);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+format(o)+")")}return F}function m(x,o,F){for(var Re=x._data,He=[],Ue,Fe=0;Fe<F;Fe++){Ue=He[Fe]=[];for(var nt=0;nt<o;nt++)Ue[nt]=clone$2(Re[nt][Fe])}return x.createDenseMatrix({data:He,size:[F,o],datatype:x._datatype})}function H(x,o,F){for(var Re=x._values,He=x._index,Ue=x._ptr,Fe=Re?[]:void 0,nt=[],Ze=[],Ve=[],er=0;er<o;er++)Ve[er]=0;var st,Ke,Ye;for(st=0,Ke=He.length;st<Ke;st++)Ve[He[st]]++;for(var tt=0,Je=0;Je<o;Je++)Ze.push(tt),tt+=Ve[Je],Ve[Je]=Ze[Je];for(Ze.push(tt),Ye=0;Ye<F;Ye++)for(var rr=Ue[Ye],Rr=Ue[Ye+1],ar=rr;ar<Rr;ar++){var Ar=Ve[He[ar]]++;nt[Ar]=Ye,Re&&(Fe[Ar]=clone$2(Re[ar]))}return x.createSparseMatrix({values:Fe,index:nt,ptr:Ze,size:[F,o],datatype:x._datatype})}});function improveErrorMessage(e,r,s){var u;return String(e).indexOf("Unexpected type")!==-1?(u=arguments.length>2?" (type: "+typeOf(s)+", value: "+JSON.stringify(s)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+u)):String(e).indexOf("complex numbers")!==-1?(u=arguments.length>2?" (type: "+typeOf(s)+", value: "+JSON.stringify(s)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+u)):e}var name$7="numeric",dependencies$7=["number","?bignumber","?fraction"],createNumeric=factory(name$7,dependencies$7,e=>{var{number:r,bignumber:s,fraction:u}=e,m={string:!0,number:!0,BigNumber:!0,Fraction:!0},H={number:x=>r(x),BigNumber:s?x=>s(x):noBignumber,Fraction:u?x=>u(x):noFraction};return function(o){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",Re=arguments.length>2?arguments[2]:void 0;if(Re!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var He=typeOf(o);if(!(He in m))throw new TypeError("Cannot convert "+o+' of type "'+He+'"; valid input types are '+Object.keys(m).join(", "));if(!(F in H))throw new TypeError("Cannot convert "+o+' to type "'+F+'"; valid output types are '+Object.keys(H).join(", "));return F===He?o:H[F](o)}}),name$6="divideScalar",dependencies$6=["typed","numeric"],createDivideScalar=factory(name$6,dependencies$6,e=>{var{typed:r,numeric:s}=e;return r(name$6,{"number, number":function(m,H){return m/H},"Complex, Complex":function(m,H){return m.div(H)},"BigNumber, BigNumber":function(m,H){return m.div(H)},"Fraction, Fraction":function(m,H){return m.div(H)},"Unit, number | Complex | Fraction | BigNumber | Unit":(u,m)=>u.divide(m),"number | Fraction | Complex | BigNumber, Unit":(u,m)=>m.divideInto(u)})}),name$5="add",dependencies$5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],createAdd=factory(name$5,dependencies$5,e=>{var{typed:r,matrix:s,addScalar:u,equalScalar:m,DenseMatrix:H,SparseMatrix:x,concat:o}=e,F=createMatAlgo01xDSid({typed:r}),Re=createMatAlgo04xSidSid({typed:r,equalScalar:m}),He=createMatAlgo10xSids({typed:r,DenseMatrix:H}),Ue=createMatrixAlgorithmSuite({typed:r,matrix:s,concat:o});return r(name$5,{"any, any":u,"any, any, ...any":r.referToSelf(Fe=>(nt,Ze,Ve)=>{for(var er=Fe(nt,Ze),st=0;st<Ve.length;st++)er=Fe(er,Ve[st]);return er})},Ue({elop:u,DS:F,SS:Re,Ss:He}))}),name$4="dot",dependencies$4=["typed","addScalar","multiplyScalar","conj","size"],createDot=factory(name$4,dependencies$4,e=>{var{typed:r,addScalar:s,multiplyScalar:u,conj:m,size:H}=e;return r(name$4,{"Array | DenseMatrix, Array | DenseMatrix":o,"SparseMatrix, SparseMatrix":F});function x(He,Ue){var Fe=Re(He),nt=Re(Ue),Ze,Ve;if(Fe.length===1)Ze=Fe[0];else if(Fe.length===2&&Fe[1]===1)Ze=Fe[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+Fe.join(", ")+")");if(nt.length===1)Ve=nt[0];else if(nt.length===2&&nt[1]===1)Ve=nt[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+nt.join(", ")+")");if(Ze!==Ve)throw new RangeError("Vectors must have equal length ("+Ze+" != "+Ve+")");if(Ze===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return Ze}function o(He,Ue){var Fe=x(He,Ue),nt=isMatrix(He)?He._data:He,Ze=isMatrix(He)?He._datatype:void 0,Ve=isMatrix(Ue)?Ue._data:Ue,er=isMatrix(Ue)?Ue._datatype:void 0,st=Re(He).length===2,Ke=Re(Ue).length===2,Ye=s,tt=u;if(Ze&&er&&Ze===er&&typeof Ze=="string"){var Je=Ze;Ye=r.find(s,[Je,Je]),tt=r.find(u,[Je,Je])}if(!st&&!Ke){for(var rr=tt(m(nt[0]),Ve[0]),Rr=1;Rr<Fe;Rr++)rr=Ye(rr,tt(m(nt[Rr]),Ve[Rr]));return rr}if(!st&&Ke){for(var ar=tt(m(nt[0]),Ve[0][0]),Ar=1;Ar<Fe;Ar++)ar=Ye(ar,tt(m(nt[Ar]),Ve[Ar][0]));return ar}if(st&&!Ke){for(var mr=tt(m(nt[0][0]),Ve[0]),Pr=1;Pr<Fe;Pr++)mr=Ye(mr,tt(m(nt[Pr][0]),Ve[Pr]));return mr}if(st&&Ke){for(var Nr=tt(m(nt[0][0]),Ve[0][0]),Ra=1;Ra<Fe;Ra++)Nr=Ye(Nr,tt(m(nt[Ra][0]),Ve[Ra][0]));return Nr}}function F(He,Ue){x(He,Ue);for(var Fe=He._index,nt=He._values,Ze=Ue._index,Ve=Ue._values,er=0,st=s,Ke=u,Ye=0,tt=0;Ye<Fe.length&&tt<Ze.length;){var Je=Fe[Ye],rr=Ze[tt];if(Je<rr){Ye++;continue}if(Je>rr){tt++;continue}Je===rr&&(er=st(er,Ke(nt[Ye],Ve[tt])),Ye++,tt++)}return er}function Re(He){return isMatrix(He)?He.size():H(He)}}),name$3="det",dependencies$3=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],createDet=factory(name$3,dependencies$3,e=>{var{typed:r,matrix:s,subtractScalar:u,multiply:m,divideScalar:H,isZero:x,unaryMinus:o}=e;return r(name$3,{any:function(He){return clone$2(He)},"Array | Matrix":function(He){var Ue;switch(isMatrix(He)?Ue=He.size():Array.isArray(He)?(He=s(He),Ue=He.size()):Ue=[],Ue.length){case 0:return clone$2(He);case 1:if(Ue[0]===1)return clone$2(He.valueOf()[0]);if(Ue[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+format(Ue)+")");case 2:{var Fe=Ue[0],nt=Ue[1];if(Fe===nt)return F(He.clone().valueOf(),Fe);if(nt===0)return 1;throw new RangeError("Matrix must be square (size: "+format(Ue)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+format(Ue)+")")}}});function F(Re,He,Ue){if(He===1)return clone$2(Re[0][0]);if(He===2)return u(m(Re[0][0],Re[1][1]),m(Re[1][0],Re[0][1]));for(var Fe=!1,nt=new Array(He).fill(0).map((Rr,ar)=>ar),Ze=0;Ze<He;Ze++){var Ve=nt[Ze];if(x(Re[Ve][Ze])){var er=void 0;for(er=Ze+1;er<He;er++)if(!x(Re[nt[er]][Ze])){Ve=nt[er],nt[er]=nt[Ze],nt[Ze]=Ve,Fe=!Fe;break}if(er===He)return Re[Ve][Ze]}for(var st=Re[Ve][Ze],Ke=Ze===0?1:Re[nt[Ze-1]][Ze-1],Ye=Ze+1;Ye<He;Ye++)for(var tt=nt[Ye],Je=Ze+1;Je<He;Je++)Re[tt][Je]=H(u(m(Re[tt][Je],st),m(Re[tt][Ze],Re[Ve][Je])),Ke)}var rr=Re[nt[He-1]][He-1];return Fe?o(rr):rr}}),name$2="inv",dependencies$2=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],createInv=factory(name$2,dependencies$2,e=>{var{typed:r,matrix:s,divideScalar:u,addScalar:m,multiply:H,unaryMinus:x,det:o,identity:F,abs:Re}=e;return r(name$2,{"Array | Matrix":function(Fe){var nt=isMatrix(Fe)?Fe.size():arraySize(Fe);switch(nt.length){case 1:if(nt[0]===1)return isMatrix(Fe)?s([u(1,Fe.valueOf()[0])]):[u(1,Fe[0])];throw new RangeError("Matrix must be square (size: "+format(nt)+")");case 2:{var Ze=nt[0],Ve=nt[1];if(Ze===Ve)return isMatrix(Fe)?s(He(Fe.valueOf(),Ze,Ve),Fe.storage()):He(Fe,Ze,Ve);throw new RangeError("Matrix must be square (size: "+format(nt)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+format(nt)+")")}},any:function(Fe){return u(1,Fe)}});function He(Ue,Fe,nt){var Ze,Ve,er,st,Ke;if(Fe===1){if(st=Ue[0][0],st===0)throw Error("Cannot calculate inverse, determinant is zero");return[[u(1,st)]]}else if(Fe===2){var Ye=o(Ue);if(Ye===0)throw Error("Cannot calculate inverse, determinant is zero");return[[u(Ue[1][1],Ye),u(x(Ue[0][1]),Ye)],[u(x(Ue[1][0]),Ye),u(Ue[0][0],Ye)]]}else{var tt=Ue.concat();for(Ze=0;Ze<Fe;Ze++)tt[Ze]=tt[Ze].concat();for(var Je=F(Fe).valueOf(),rr=0;rr<nt;rr++){var Rr=Re(tt[rr][rr]),ar=rr;for(Ze=rr+1;Ze<Fe;)Re(tt[Ze][rr])>Rr&&(Rr=Re(tt[Ze][rr]),ar=Ze),Ze++;if(Rr===0)throw Error("Cannot calculate inverse, determinant is zero");Ze=ar,Ze!==rr&&(Ke=tt[rr],tt[rr]=tt[Ze],tt[Ze]=Ke,Ke=Je[rr],Je[rr]=Je[Ze],Je[Ze]=Ke);var Ar=tt[rr],mr=Je[rr];for(Ze=0;Ze<Fe;Ze++){var Pr=tt[Ze],Nr=Je[Ze];if(Ze!==rr){if(Pr[rr]!==0){for(er=u(x(Pr[rr]),Ar[rr]),Ve=rr;Ve<nt;Ve++)Pr[Ve]=m(Pr[Ve],H(er,Ar[Ve]));for(Ve=0;Ve<nt;Ve++)Nr[Ve]=m(Nr[Ve],H(er,mr[Ve]))}}else{for(er=Ar[rr],Ve=rr;Ve<nt;Ve++)Pr[Ve]=u(Pr[Ve],er);for(Ve=0;Ve<nt;Ve++)Nr[Ve]=u(Nr[Ve],er)}}}return Je}}}),name$1="sum",dependencies$1=["typed","config","add","numeric"],createSum=factory(name$1,dependencies$1,e=>{var{typed:r,config:s,add:u,numeric:m}=e;return r(name$1,{"Array | Matrix":H,"Array | Matrix, number | BigNumber":x,"...":function(F){if(containsCollections(F))throw new TypeError("Scalar values expected in function sum");return H(F)}});function H(o){var F;return deepForEach(o,function(Re){try{F=F===void 0?Re:u(F,Re)}catch(He){throw improveErrorMessage(He,"sum",Re)}}),F===void 0&&(F=m(0,s.number)),typeof F=="string"&&(F=m(F,s.number)),F}function x(o,F){try{var Re=reduce(o,F,u);return Re}catch(He){throw improveErrorMessage(He,"sum")}}}),BigNumber=createBigNumberClass({config:config$1}),Complex=createComplexClass({}),Fraction=createFractionClass({}),Matrix=createMatrixClass({}),DenseMatrix=createDenseMatrixClass({Matrix}),typed=createTyped({BigNumber,Complex,DenseMatrix,Fraction}),abs=createAbs({typed}),addScalar=createAddScalar({typed}),bignumber=createBignumber({BigNumber,typed}),conj=createConj({typed}),equalScalar=createEqualScalar({config:config$1,typed}),isInteger=createIsInteger({typed}),isZero=createIsZero({typed}),multiplyScalar=createMultiplyScalar({typed}),number=createNumber({typed}),SparseMatrix=createSparseMatrixClass({Matrix,equalScalar,typed}),subtractScalar=createSubtractScalar({typed}),unaryMinus=createUnaryMinus({typed}),fraction=createFraction({Fraction,typed}),matrix=createMatrix({DenseMatrix,Matrix,SparseMatrix,typed}),numeric=createNumeric({bignumber,fraction,number}),size=createSize({matrix,config:config$1,typed}),transpose=createTranspose({matrix,typed}),concat=createConcat({isInteger,matrix,typed}),divideScalar=createDivideScalar({numeric,typed}),identity=createIdentity({BigNumber,DenseMatrix,SparseMatrix,config:config$1,matrix,typed}),add=createAdd({DenseMatrix,SparseMatrix,addScalar,concat,equalScalar,matrix,typed}),dot=createDot({addScalar,conj,multiplyScalar,size,typed}),multiply=createMultiply({addScalar,dot,equalScalar,matrix,multiplyScalar,typed}),sum=createSum({add,config:config$1,numeric,typed}),det=createDet({divideScalar,isZero,matrix,multiply,subtractScalar,typed,unaryMinus}),inv=createInv({abs,addScalar,det,divideScalar,identity,matrix,multiply,typed,unaryMinus});function predictObservations(e,r,s,u){let{observations:m}=r;return m.length>1?predictOptimize(e,r,u):predictBeforeAT(e,r,s,u)}function predictBeforeAT(e,r,s,u){let{images:m,cameras:H,coordinateSystem:x}=e;if(x.type===1)return u&&m.forEach(Ue=>{Ue.predict=void 0}),{predicts:{}};let o={};H.forEach(Ue=>o[Ue.camera_id]=Ue);let{coordinate:F}=r,Re=fromValues$1(0,0,0);if(s.type===1)Re=fromValues$1(F[1],F[1],F[2]);else{let Ue=transformCoordinateToLngLat(F,s),Fe=x.origin_point,nt=satellite_geo_calc.coordinateTransfer.lla_to_enu({lon:Ue[0],lat:Ue[1],alt:Ue[2]||0},{lon:Fe[0],lat:Fe[1],alt:Fe[2]});Re=fromValues$1(nt.x,nt.y,nt.z)}let He={};return m.forEach(Ue=>{let{img_id:Fe,camera_id:nt,projection_matrix:Ze,image_rect:Ve}=Ue,er=o[nt].camera_params,{width:st,height:Ke}=Ve,Ye=Ze,tt=fromValues$3(Ye[0],Ye[4],Ye[8],Ye[1],Ye[5],Ye[9],Ye[2],Ye[6],Ye[10]),Je=fromValues$1(Ye[3],Ye[7],Ye[11]),rr=fromValues$3(er[0],0,0,0,er[1],0,er[2],er[3],1),Rr=transformMat3(create$2(),add$4(create$2(),transformMat3(create$2(),Re,tt),Je),rr),ar=scale(create$2(),Rr,1/Rr[2]);if(ar[0]>0&&ar[0]<st&&ar[1]>0&&ar[1]<Ke){let Ar=fromValues$1(ar[0],ar[1],1),mr=transformMat3(create$2(),Ar,invert(create$4(),rr)),Pr=distortPoint(mr,er);ar=transformMat3(create$2(),fromValues$1(...Pr,1),rr),He[Fe]=[ar[0],ar[1]],u&&(Ue.predict={uv:[ar[0],ar[1]],position:{left:ar[0]*100/st,top:ar[1]*100/Ke},distance:Math.hypot(ar[0]-st/2,ar[1]-Ke/2)})}else u&&(Ue.predict=void 0)}),{predicts:He}}function predictOptimize(e,r,s){let{images:u,cameras:m}=e,{observations:H}=r,x={};m.forEach(Ye=>x[Ye.camera_id]=Ye);let o={},F=[],Re=new Map;H.forEach(Ye=>Re.set(Ye.id,Ye.uv)),u.forEach(Ye=>{if(!Re.has(Ye.img_id)){Ye.observation=void 0;return}Ye.observation={id:Ye.img_id,uv:Re.get(Ye.img_id)},F.push(Ye)});let He=[],Ue=[];F.forEach(Ye=>{let tt=Ye.projection_matrix,Je=x[Ye.camera_id].camera_params,rr=undistortPoint(Ye.observation.uv,Je),Rr=fromValues$3(tt[0],tt[4],tt[8],tt[1],tt[5],tt[9],tt[2],tt[6],tt[10]),ar=fromValues$1(tt[3],tt[7],tt[11]),Ar=fromValues$3(Je[0],0,0,0,Je[1],0,Je[2],Je[3],1),mr=invert(create$4(),Ar),Pr=transformMat3(create$2(),rr,mr);He.push([Rr[0]-Rr[2]*Pr[0],Rr[3]-Rr[5]*Pr[0],Rr[6]-Rr[8]*Pr[0]]),He.push([Rr[1]-Rr[2]*Pr[1],Rr[4]-Rr[5]*Pr[1],Rr[7]-Rr[8]*Pr[1]]),Ue.push(ar[2]*Pr[0]-ar[0],ar[2]*Pr[1]-ar[1])});let Fe=matrix(He),nt=matrix(Ue),Ze=transpose(Fe),Ve=multiply(multiply(inv(multiply(Ze,Fe)),Ze),nt),er=fromValues$1(Ve.get([0]),Ve.get([1]),Ve.get([2])),st=0,Ke=[];return u.forEach(Ye=>{let{img_id:tt,camera_id:Je,projection_matrix:rr,image_rect:Rr}=Ye,ar=x[Je].camera_params,{width:Ar,height:mr}=Rr,Pr=rr,Nr=fromValues$3(Pr[0],Pr[4],Pr[8],Pr[1],Pr[5],Pr[9],Pr[2],Pr[6],Pr[10]),Ra=fromValues$1(Pr[3],Pr[7],Pr[11]),ta=fromValues$3(ar[0],0,0,0,ar[1],0,ar[2],ar[3],1),ha=add$4(create$2(),transformMat3(create$2(),er,Nr),Ra),Ea=transformMat3(create$2(),fromValues$1(ha[0]/ha[2],ha[1]/ha[2],1),ta);if(Ea[0]>0&&Ea[0]<Ar&&Ea[1]>0&&Ea[1]<mr){let fa=fromValues$1(...Ea,1),ga=transformMat3(create$2(),fa,invert(create$4(),ta)),Ja=distortPoint(ga,ar);if(Ea=transformMat3(create$2(),fromValues$1(...Ja,1),ta),Ye.observation){s&&(Ye.predict={uv:Ye.observation.uv,position:{left:Ye.observation.uv[0]*100/Ar,top:Ye.observation.uv[1]*100/mr},distance:Math.hypot(Ye.observation.uv[0]-Ar/2,Ye.observation.uv[1]-mr/2)});let Ba=Ye.observation.uv;Ke.push(Math.sqrt((Ea[0]-Ba[0])*(Ea[0]-Ba[0])+(Ea[1]-Ba[1])*(Ea[1]-Ba[1])))}else o[tt]=[Ea[0],Ea[1]],s&&(Ye.predict={uv:[Ea[0],Ea[1]],position:{left:Ea[0]*100/Ar,top:Ea[1]*100/mr},distance:Math.hypot(Ea[0]-Ar/2,Ea[1]-mr/2)})}else s&&(Ye.predict=void 0)}),st=sum(Ke)/Ke.length,{predicts:o,residual_rmse:st}}function undistortPoint(e,r){let s=fromValues$3(r[0],0,0,0,r[1],0,r[2],r[3],1),u=transformMat3(create$2(),fromValues$1(...e,1),invert(create$4(),s)),m=100,H=1e-10,x=fromValues(u[0],u[1]),o=subtract(create$1(),distortPoint(x,r),x),F=subtract(create$1(),add$3(create$1(),x,o),u);for(;Math.abs(F[0])+Math.abs(F[1])>H&&m-- >0;)x=subtract(create$1(),u,o),o=subtract(create$1(),distortPoint(x,r),x),F=subtract(create$1(),add$3(create$1(),x,o),u);return transformMat3(create$2(),fromValues$1(...x,1),s)}function distortPoint(e,r){let s=[e[0],e[1]],u=s[0]*s[0]+s[1]*s[1],m=Math.pow(u,2),H=Math.pow(u,3),x=[s[0]*(1+r[4]*u+r[5]*m+r[6]*H)+2*r[7]*s[0]*s[1]+r[8]*(u+2*s[0]*s[0]),s[1]*(1+r[4]*u+r[5]*m+r[6]*H)+2*r[8]*s[0]*s[1]+r[7]*(u+2*s[1]*s[1])];return fromValues(...x)}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754$1.read=function(e,r,s,u,m){var H,x,o=m*8-u-1,F=(1<<o)-1,Re=F>>1,He=-7,Ue=s?m-1:0,Fe=s?-1:1,nt=e[r+Ue];for(Ue+=Fe,H=nt&(1<<-He)-1,nt>>=-He,He+=o;He>0;H=H*256+e[r+Ue],Ue+=Fe,He-=8);for(x=H&(1<<-He)-1,H>>=-He,He+=u;He>0;x=x*256+e[r+Ue],Ue+=Fe,He-=8);if(H===0)H=1-Re;else{if(H===F)return x?NaN:(nt?-1:1)*(1/0);x=x+Math.pow(2,u),H=H-Re}return(nt?-1:1)*x*Math.pow(2,H-u)},ieee754$1.write=function(e,r,s,u,m,H){var x,o,F,Re=H*8-m-1,He=(1<<Re)-1,Ue=He>>1,Fe=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,nt=u?0:H-1,Ze=u?1:-1,Ve=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(o=isNaN(r)?1:0,x=He):(x=Math.floor(Math.log(r)/Math.LN2),r*(F=Math.pow(2,-x))<1&&(x--,F*=2),x+Ue>=1?r+=Fe/F:r+=Fe*Math.pow(2,1-Ue),r*F>=2&&(x++,F/=2),x+Ue>=He?(o=0,x=He):x+Ue>=1?(o=(r*F-1)*Math.pow(2,m),x=x+Ue):(o=r*Math.pow(2,Ue-1)*Math.pow(2,m),x=0));m>=8;e[s+nt]=o&255,nt+=Ze,o/=256,m-=8);for(x=x<<m|o,Re+=m;Re>0;e[s+nt]=x&255,nt+=Ze,x/=256,Re-=8);e[s+nt-Ze]|=Ve*128};var pbf=Pbf,ieee754=ieee754$1;function Pbf(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var SHIFT_LEFT_32=(1<<16)*(1<<16),SHIFT_RIGHT_32=1/SHIFT_LEFT_32,TEXT_DECODER_MIN_LENGTH=12,utf8TextDecoder=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Pbf.prototype={destroy:function(){this.buf=null},readFields:function(e,r,s){for(s=s||this.length;this.pos<s;){var u=this.readVarint(),m=u>>3,H=this.pos;this.type=u&7,e(m,r,this),this.pos===H&&this.skip(u)}return r},readMessage:function(e,r){return this.readFields(e,r,this.readVarint()+this.pos)},readFixed32:function(){var e=readUInt32(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=readInt32(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,e},readSFixed64:function(){var e=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,e},readFloat:function(){var e=ieee754.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ieee754.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var r=this.buf,s,u;return u=r[this.pos++],s=u&127,u<128||(u=r[this.pos++],s|=(u&127)<<7,u<128)||(u=r[this.pos++],s|=(u&127)<<14,u<128)||(u=r[this.pos++],s|=(u&127)<<21,u<128)?s:(u=r[this.pos],s|=(u&15)<<28,readVarintRemainder(s,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=TEXT_DECODER_MIN_LENGTH&&utf8TextDecoder?readUtf8TextDecoder(this.buf,r,e):readUtf8(this.buf,r,e)},readBytes:function(){var e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r},readPackedVarint:function(e,r){if(this.type!==Pbf.Bytes)return e.push(this.readVarint(r));var s=readPackedEnd(this);for(e=e||[];this.pos<s;)e.push(this.readVarint(r));return e},readPackedSVarint:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSVarint());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readBoolean());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFloat());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readDouble());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFixed32());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSFixed32());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readFixed64());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Pbf.Bytes)return e.push(this.readSFixed64());var r=readPackedEnd(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed64());return e},skip:function(e){var r=e&7;if(r===Pbf.Varint)for(;this.buf[this.pos++]>127;);else if(r===Pbf.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Pbf.Fixed32)this.pos+=4;else if(r===Pbf.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+r)},writeTag:function(e,r){this.writeVarint(e<<3|r)},realloc:function(e){for(var r=this.length||16;r<this.pos+e;)r*=2;if(r!==this.length){var s=new Uint8Array(r);s.set(this.buf),this.buf=s,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),writeInt32(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),writeInt32(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),writeInt32(this.buf,e&-1,this.pos),writeInt32(this.buf,Math.floor(e*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),writeInt32(this.buf,e&-1,this.pos),writeInt32(this.buf,Math.floor(e*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){writeBigVarint(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var r=this.pos;this.pos=writeUtf8(this.buf,e,this.pos);var s=this.pos-r;s>=128&&makeRoomForExtraLength(r,s,this),this.pos=r-1,this.writeVarint(s),this.pos+=s},writeFloat:function(e){this.realloc(4),ieee754.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ieee754.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var r=e.length;this.writeVarint(r),this.realloc(r);for(var s=0;s<r;s++)this.buf[this.pos++]=e[s]},writeRawMessage:function(e,r){this.pos++;var s=this.pos;e(r,this);var u=this.pos-s;u>=128&&makeRoomForExtraLength(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u},writeMessage:function(e,r,s){this.writeTag(e,Pbf.Bytes),this.writeRawMessage(r,s)},writePackedVarint:function(e,r){r.length&&this.writeMessage(e,writePackedVarint,r)},writePackedSVarint:function(e,r){r.length&&this.writeMessage(e,writePackedSVarint,r)},writePackedBoolean:function(e,r){r.length&&this.writeMessage(e,writePackedBoolean,r)},writePackedFloat:function(e,r){r.length&&this.writeMessage(e,writePackedFloat,r)},writePackedDouble:function(e,r){r.length&&this.writeMessage(e,writePackedDouble,r)},writePackedFixed32:function(e,r){r.length&&this.writeMessage(e,writePackedFixed32,r)},writePackedSFixed32:function(e,r){r.length&&this.writeMessage(e,writePackedSFixed32,r)},writePackedFixed64:function(e,r){r.length&&this.writeMessage(e,writePackedFixed64,r)},writePackedSFixed64:function(e,r){r.length&&this.writeMessage(e,writePackedSFixed64,r)},writeBytesField:function(e,r){this.writeTag(e,Pbf.Bytes),this.writeBytes(r)},writeFixed32Field:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeSFixed64(r)},writeVarintField:function(e,r){this.writeTag(e,Pbf.Varint),this.writeVarint(r)},writeSVarintField:function(e,r){this.writeTag(e,Pbf.Varint),this.writeSVarint(r)},writeStringField:function(e,r){this.writeTag(e,Pbf.Bytes),this.writeString(r)},writeFloatField:function(e,r){this.writeTag(e,Pbf.Fixed32),this.writeFloat(r)},writeDoubleField:function(e,r){this.writeTag(e,Pbf.Fixed64),this.writeDouble(r)},writeBooleanField:function(e,r){this.writeVarintField(e,Boolean(r))}};function readVarintRemainder(e,r,s){var u=s.buf,m,H;if(H=u[s.pos++],m=(H&112)>>4,H<128||(H=u[s.pos++],m|=(H&127)<<3,H<128)||(H=u[s.pos++],m|=(H&127)<<10,H<128)||(H=u[s.pos++],m|=(H&127)<<17,H<128)||(H=u[s.pos++],m|=(H&127)<<24,H<128)||(H=u[s.pos++],m|=(H&1)<<31,H<128))return toNum(e,m,r);throw new Error("Expected varint not more than 10 bytes")}function readPackedEnd(e){return e.type===Pbf.Bytes?e.readVarint()+e.pos:e.pos+1}function toNum(e,r,s){return s?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function writeBigVarint(e,r){var s,u;if(e>=0?(s=e%4294967296|0,u=e/4294967296|0):(s=~(-e%4294967296),u=~(-e/4294967296),s^4294967295?s=s+1|0:(s=0,u=u+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),writeBigVarintLow(s,u,r),writeBigVarintHigh(u,r)}function writeBigVarintLow(e,r,s){s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos++]=e&127|128,e>>>=7,s.buf[s.pos]=e&127}function writeBigVarintHigh(e,r){var s=(e&7)<<4;r.buf[r.pos++]|=s|((e>>>=3)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127)))))}function makeRoomForExtraLength(e,r,s){var u=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(Math.LN2*7));s.realloc(u);for(var m=s.pos-1;m>=e;m--)s.buf[m+u]=s.buf[m]}function writePackedVarint(e,r){for(var s=0;s<e.length;s++)r.writeVarint(e[s])}function writePackedSVarint(e,r){for(var s=0;s<e.length;s++)r.writeSVarint(e[s])}function writePackedFloat(e,r){for(var s=0;s<e.length;s++)r.writeFloat(e[s])}function writePackedDouble(e,r){for(var s=0;s<e.length;s++)r.writeDouble(e[s])}function writePackedBoolean(e,r){for(var s=0;s<e.length;s++)r.writeBoolean(e[s])}function writePackedFixed32(e,r){for(var s=0;s<e.length;s++)r.writeFixed32(e[s])}function writePackedSFixed32(e,r){for(var s=0;s<e.length;s++)r.writeSFixed32(e[s])}function writePackedFixed64(e,r){for(var s=0;s<e.length;s++)r.writeFixed64(e[s])}function writePackedSFixed64(e,r){for(var s=0;s<e.length;s++)r.writeSFixed64(e[s])}function readUInt32(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+e[r+3]*16777216}function writeInt32(e,r,s){e[s]=r,e[s+1]=r>>>8,e[s+2]=r>>>16,e[s+3]=r>>>24}function readInt32(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+(e[r+3]<<24)}function readUtf8(e,r,s){for(var u="",m=r;m<s;){var H=e[m],x=null,o=H>239?4:H>223?3:H>191?2:1;if(m+o>s)break;var F,Re,He;o===1?H<128&&(x=H):o===2?(F=e[m+1],(F&192)===128&&(x=(H&31)<<6|F&63,x<=127&&(x=null))):o===3?(F=e[m+1],Re=e[m+2],(F&192)===128&&(Re&192)===128&&(x=(H&15)<<12|(F&63)<<6|Re&63,(x<=2047||x>=55296&&x<=57343)&&(x=null))):o===4&&(F=e[m+1],Re=e[m+2],He=e[m+3],(F&192)===128&&(Re&192)===128&&(He&192)===128&&(x=(H&15)<<18|(F&63)<<12|(Re&63)<<6|He&63,(x<=65535||x>=1114112)&&(x=null))),x===null?(x=65533,o=1):x>65535&&(x-=65536,u+=String.fromCharCode(x>>>10&1023|55296),x=56320|x&1023),u+=String.fromCharCode(x),m+=o}return u}function readUtf8TextDecoder(e,r,s){return utf8TextDecoder.decode(e.subarray(r,s))}function writeUtf8(e,r,s){for(var u=0,m,H;u<r.length;u++){if(m=r.charCodeAt(u),m>55295&&m<57344)if(H)if(m<56320){e[s++]=239,e[s++]=191,e[s++]=189,H=m;continue}else m=H-55296<<10|m-56320|65536,H=null;else{m>56319||u+1===r.length?(e[s++]=239,e[s++]=191,e[s++]=189):H=m;continue}else H&&(e[s++]=239,e[s++]=191,e[s++]=189,H=null);m<128?e[s++]=m:(m<2048?e[s++]=m>>6|192:(m<65536?e[s++]=m>>12|224:(e[s++]=m>>18|240,e[s++]=m>>12&63|128),e[s++]=m>>6&63|128),e[s++]=m&63|128)}return s}const proto_10=`
|
|
490
490
|
syntax = "proto2";
|
|
491
491
|
package mipmap.engine.message;
|
|
492
492
|
|